KDAB / cxx-qt

Safe interop between Rust and Qt
https://kdab.github.io/cxx-qt/book/
1.02k stars 68 forks source link

For overloads in cxx-qt-lib use impl AsRef #810

Open ahayzen-kdab opened 8 months ago

ahayzen-kdab commented 8 months ago

Where we need to have an overload in cxx-qt-lib, eg QPainter::setPen can take QColor or QPen or an enum. Accept impl AsRef<QPen> then implement Into from QColor and the enum. Then this should allow Rust code to have any of the types.

There are a few places already where we could have had overloads for QPoint, QSize etc consider doing this in those places.

Note however this will mean we need an extra impl block that then calls the direct CXX binding.