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

Spinbox color in dark theme when setting style programmatically #168

Open
michaelrossherron opened this issue Mar 24, 2022 · 0 comments
Open

Comments

@michaelrossherron
Copy link

In our software, we have a setting that allows the user to choose the software's theme. I've added options for both the Adaita and Adwaita-Dark themes. In our mainwindow's constructor (and before any UI elements are created), we read the theme setting, and set the style appropriately using a command like this:

qApp->setStyle(QStyleFactory::create("adwaita-dark"));

This works well for our other themes, and also for the Adwaita (light) theme. For some reason, however, when using this method to set the style for the Adwaita Dark theme, almost everything looks correct, except for the spinboxes, which look like they do in the image below.

image

I have found that if I manually pass a -style adwaita-dark flag to the program when I launch it, then the spinboxes look like they should.

image

The software is being built and run on Ubuntu 20.04.4 LTS. I compiled the plugin against Qt 6.2.2, which is also what my main program is compiled against and linking to at runtime. I'm not including any of adwaita-qt's code, or linking to the libraries, I've just copied the compiled plugin into the plugins/styles directory in my Qt installation.

I'm not sure if this is a bug in the plugin, or if I'm doing something wrong, though I would greatly appreciate any insight into the problem.

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

No branches or pull requests

1 participant