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 force-pushed the 577-extern-cpp-qt-block branch from 27851e2 to 81a04e6 Compare August 3, 2023 14:10
@ahayzen-kdab ahayzen-kdab force-pushed the 577-extern-cpp-qt-block branch from 81a04e6 to 461bfaf Compare January 15, 2024 14:22
@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
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 4 times, most recently from b9dcbfc to dae15d9 Compare April 17, 2024 09:56
#[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

@ahayzen-kdab ahayzen-kdab force-pushed the 577-extern-cpp-qt-block branch from dae15d9 to 48a9cd3 Compare October 8, 2024 11:31
Comment on lines +14 to +15
// TODO: we should really pass a parent in here
let mut push_button = QPushButton::new();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we use UniquePtr or should we use raw pointer and set a parent like Qt, or should we support both?

@ahayzen-kdab ahayzen-kdab force-pushed the 577-extern-cpp-qt-block branch from 48a9cd3 to db51492 Compare October 8, 2024 11:34
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (7d57542) to head (db51492).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #622   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           71        71           
  Lines        11953     11953           
=========================================
  Hits         11953     11953           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants