QML not using style. QApplication: invalid style override passed, ignoring it.
-
Re: [Qt 5.11.0 - QApplication: invalid style override passed](ignoring it.)
Hi,
Using QApplication in QML application, with xfce4 does not use style selected, and outputs the following error:QApplication: invalid style override passed, ignoring it.
However, running application as root with sudo makes it work. I've read other posts of this issue but did not found solution. I'm using Qt 5.11.1 in Ubuntu 18.04 with xfce4 desktop environment.
Thanks -
Well, i found a permanent workarround myself. I went to /etc/X11/Xsession.d/ and searched for the QT_STYLE_OVERRIDE variable inside files with:
grep -rnw './' -e 'QT_STYLE_OVERRIDE'
then i oppened the file that had that variable set and commented with a #.
Now the problem is solved and i get right style in my apps.
-
Hi, i found a workarround myself:
First, i had to change owner the following files:sudo chown <usernaem>:<username> /home/<username>/.config/QtProject/qtcreator/default.qws sudo chown <username>:<username> /path/to/my/project/MyProject.pro.user
Then, i had to unset the environment variable QT_STYLE_OVERRIDE in project configuration.
I don't know it this changes are bad in some way. Also, i keep geting this errors:(MyProject:25557): Gtk-WARNING **: 14:53:18.817: Theme parsing error: gtk.css:4549:12: not a number (MyProject:25557): Gtk-WARNING **: 14:53:18.817: Theme parsing error: gtk.css:4549:12: Expected a string.
-
-
Well, i found a permanent workarround myself. I went to /etc/X11/Xsession.d/ and searched for the QT_STYLE_OVERRIDE variable inside files with:
grep -rnw './' -e 'QT_STYLE_OVERRIDE'
then i oppened the file that had that variable set and commented with a #.
Now the problem is solved and i get right style in my apps.
-
View my post on this very issue. I've upgraded from Linux Mint 18.3 which used GTK2 to Linux Mint 19 which uses GTK3. That warning's gone now when I build and run an app.