Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML not using style. QApplication: invalid style override passed, ignoring it.
Forum Updated to NodeBB v4.3 + New Features

QML not using style. QApplication: invalid style override passed, ignoring it.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dokif
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dokif
      wrote on last edited by
      #4

      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.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dokif
        wrote on last edited by
        #2

        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.
        
        1 Reply Last reply
        0
        • D Offline
          D Offline
          dokif
          wrote on last edited by
          #3

          As nobody seems to answer, I must add that this does not solve the problem. It only uses the selected style in QtCreator, but not if executed outside it.
          Is this going to be fixed? Is there a way to unset the QT_STYLE_OVERRIDE permanently in the system?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dokif
            wrote on last edited by
            #4

            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.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #5

              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.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved