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

examples: add basic widgets example #622

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ahayzen-kdab
Copy link
Collaborator

Lots of hacks, but we can launch a QPushButton !

I'll likely pick things off from this branch as separate pull requests over time.

@ahayzen-kdab ahayzen-kdab changed the title WIP: extern "C++Qt" block support and widgets example examples: add basic widgets example Jan 15, 2024
@ahayzen-kdab ahayzen-kdab marked this pull request as ready for review January 15, 2024 14:23
type QString = cxx_qt_lib::QString;

#[qsignal]
#[allow(dead_code)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we only connect to the signal and don't emit it causes dead code, wonder if we should always mark as dead ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(as this is an existing signal rather than one being created from Rust, so for inherit / C++Qt types you might not see an emit)

use cxx_qt_lib::QString;
use cxx_qt_lib_extras::{QApplication, QPushButton};

fn main() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have some kind of test as well, even if C++ to see if this works, unsure how so far....

@ahayzen-kdab ahayzen-kdab force-pushed the 577-extern-cpp-qt-block branch 3 times, most recently from bcb4e07 to b9dcbfc Compare April 17, 2024 09:19
#[qobject]
type QPushButton;

// TODO: we should use upcasting methods here and implement QAbstractButton and QWidget
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should figure out how upcasting is going to work, as otherwise we are going to duplicate a load of methods in the widgets world

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.

None yet

2 participants