KDAB / cxx-qt

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

cxx-qt-lib bindings for QAnyStringView #629

Open Be-ing opened 1 year ago

Be-ing commented 1 year ago

QAnyStringView is a new class in Qt6 that is being used in new Qt APIs that take string arguments, for example QQmlApplicationEngine::loadFromModule. It supports UTF-8 strings, so it may be possible to implement cheap conversion from Rust &str to QAnyStringView without needing to copy data or convert to UTF-16 for a QString first.

ahayzen-kdab commented 1 year ago

We only pass in the major Qt version at the moment and the QQmlApplicationEngine method is since a minor version.

I'm going to look at exposing Qt major, minor, micro versions to the app developer as well, so I'll combine that into one change :-)