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

Allow using QGuiApplication and not linking to QtWidgets #211

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

AdrianEddy
Copy link
Contributor

This PR adds a new feature flag that allows to skip linking the QtWidgets module and use QGuiApplication instead of QApplication. I added it as an optional feature that disables the linking to not break any existing code and feature set that users may already have.

@@ -31,6 +31,8 @@ qtmultimediawidgets = []
qtsql = []
# Link against QtTest
qttest = []
# Don't link QtWidgets and use QGuiApplication
nowidgets = []
Copy link
Member

Choose a reason for hiding this comment

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

In Rust, features need to be additive.
So this should be a qtwidget feature and enable it by default.

Copy link
Contributor Author

@AdrianEddy AdrianEddy Nov 15, 2021

Choose a reason for hiding this comment

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

But then what about users who already have no-default-features enabled? It would break the build for them

Copy link
Member

Choose a reason for hiding this comment

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

Right.
I suppose we will have to increase the semver then.

Copy link
Member

Choose a reason for hiding this comment

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

Something like rust-lang/rfcs#3146 would be nice.

Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

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

Thanks, the change starts to look good.

Since this require a semver version change. I'm wondering about merging this now or waiting a bit to see if there are other needed breaking changes. How much do you require this change?

qmetaobject/build.rs Outdated Show resolved Hide resolved
qttypes/build.rs Outdated Show resolved Hide resolved
@AdrianEddy
Copy link
Contributor Author

Since this require a semver version change. I'm wondering about merging this now or waiting a bit to see if there are other needed breaking changes. How much do you require this change?

It's not super important, it'll be just nice to save some space by not having to deploy QtWidgets module when it's not used. It can wait, it's not a blocker for me

chrono_qdatetime = ["qttypes/chrono"]
webengine = ["qttypes/qtwebengine"]
widgets = ["qttypes/qtwidgets"]

[dependencies]
qttypes = { path = "../qttypes", version = "0.2.5", features = ["qtquick"] }

Choose a reason for hiding this comment

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

Suggested change
qttypes = { path = "../qttypes", version = "0.2.5", features = ["qtquick"] }
qttypes = { path = "../qttypes", version = "0.2.5", default-features = false, features = ["required", "qtquick"] }

This PR is extremely helpful for me: I'm creating an app for the reMarkable e-ink tablet, which only supports QtQuick. However, qttypes still tries to link to QtWidgets with its default features, which causes an error for me because it doesn't exist.

… as supported, but it's required on Android so add it explicitly
…detected as supported, but it's required on Android so add it explicitly"

This reverts commit e359084.
@ogoffart
Copy link
Member

Maybe it's soon time to make a breaking change release so we can merge this.

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.

3 participants