Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add QQuickPaintedItem example using Constructor trait #513

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

ahayzen-kdab
Copy link
Collaborator

This then allows you to create a QQuickItem such as a QQuickPaintedItem.

Closes #474

@ahayzen-kdab
Copy link
Collaborator Author

#546 may help (bumping vcpkg version) with the macOS errors here as @Be-ing found a similar looking error in the Qt bugs https://bugreports.qt.io/browse/QTBUG-95665?focusedCommentId=578483

@Be-ing
Copy link
Contributor

Be-ing commented May 25, 2023

Linking Qt6Quick statically requires linking .cpp.o files. Unfortunately, rustc and cargo do not have a stable interface to pass those to the linker. There is a -l link-arg option but that is unstable. I tested building Qt6 statically on Linux and adding

println!("cargo:rustc-link-lib=link-arg=/home/be/qt6-installed/lib/objects-Release/Quick_resources_2/.rcc/qrc_scenegraph_shaders.cpp.o");

to build.rs for the qml-features crate got cargo test to link with nightly.

@ahayzen-kdab
Copy link
Collaborator Author

Constructor trait will be the API for allowing the developer to declare a different parent type #566. Once that is ready the QQuickPaintedItem can be moved across.

@ahayzen-kdab ahayzen-kdab mentioned this pull request Jun 5, 2023
@Be-ing Be-ing mentioned this pull request Jul 4, 2023
@ahayzen-kdab ahayzen-kdab force-pushed the 474-custom-parent branch 3 times, most recently from aee8a0f to 8be73b5 Compare July 7, 2023 17:09
@ahayzen-kdab
Copy link
Collaborator Author

This is now blocked on the fixes in #600 to get static macOS Qt with QtQuick working...

@Be-ing Be-ing mentioned this pull request Jul 12, 2023
This then allows you to create a QQuickItem such as a QQuickPaintedItem.

Closes KDAB#474
@Be-ing Be-ing marked this pull request as ready for review July 12, 2023 17:53
@Be-ing Be-ing changed the title cxx-qt-gen: add support for choosing a custom parent class add QQuickPaintedItem example with custom base class Jul 12, 2023
@Be-ing Be-ing changed the title add QQuickPaintedItem example with custom base class add QQuickPaintedItem example using Constructor trait Jul 12, 2023
@Be-ing Be-ing enabled auto-merge (rebase) July 12, 2023 18:22
@Be-ing Be-ing merged commit 26cb666 into KDAB:main Jul 12, 2023
@Be-ing
Copy link
Contributor

Be-ing commented Jul 12, 2023

Woohoo! @CarlSchwan we finally have the pieces in place to implement custom QQuickItems in Rust :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to be able to choose the parent when deriving from different bases
2 participants