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. Qt 5.14.0 QApplication::setStyle(..) broken?
Forum Update on Monday, May 27th 2025

Qt 5.14.0 QApplication::setStyle(..) broken?

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 3.0k 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.
  • M Offline
    M Offline
    mireiner
    wrote on last edited by mireiner
    #1

    Hi there,

    today I installed the new Qt 5.14.0 final release on Windows 10 64 bit desktop.

    But QApplication::setStyle() doesn't respond to "windowsxp" and "windowsvista" styles anymore. Only "windows" (old Windows98 style) and "fusion" styles do work.

    No matter which version of setStyle() is used:

    QApplication a(argc, argv);    
    a.setStyle(QStyleFactory::create("windowsvista"));
    

    or

    QApplication a(argc, argv);   
    a.setStyle("windowsvista");
    

    setStyle() works fine in Qt 5.13.2 and before. Is that a bug in Qt 5.14.0? Or did Qt 5.14.0 changed the way setStyle() has to be used?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      They both were removed afaik.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mireiner
        wrote on last edited by mireiner
        #3

        Where can I find the removal of the Windows styles "windowsxp" and "windowsvista" in the Qt 5.14 documentation?

        Qt 5.14 Online documentation and Qt 5.14 Assistant says:
        "The string must be one of the QStyleFactory::keys(), typically one of "windows", "windowsvista", "fusion", or "macintosh". Style names are case insensitive."

        https://doc-snapshots.qt.io/qt5-5.14/qapplication.html#setStyle

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Ah, it was the xp style which is the same as the Vista style. Take a look into your plugins/style Folder to see if there is a Vista style available.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • M Offline
            M Offline
            mireiner
            wrote on last edited by mireiner
            #5

            I do program Windows desktop applications since Qt v5.3 and never payed attention to the Qt plugins/styles directory. My applications showed up in modern Windows Vista style without coping Vista style DLLs to my applications folder.

            But I tried that also now and copied the Vista style DLL into my build directory like the Qt 5.14 documentation says but with no luck:
            https://doc-snapshots.qt.io/qt5-5.14/windows-deployment.html

            Is there another way to enable the modern Windows 10 style with Qt 5.14?

            Addendum:
            It seams to be a bug:
            https://bugreports.qt.io/browse/QTBUG-80732

            1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @mireiner said in Qt 5.14.0 QApplication::setStyle(..) broken?:

              If I copy the DLL right next to my application exe file

              This is wrong for sure and can't work. If you want to deploy our Application, use windeployqt.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              3
              • M Offline
                M Offline
                mireiner
                wrote on last edited by mireiner
                #7

                After further testing I found the cause for this issue:

                If you place Qt 5.14 dlls (like Qt5Core.dll, Qt5Gui.dll etc.) inside the application build directory (like build/Debug or build/Release) then the application shows up in old Windows 95 style and not in the modern Windows 10 (Vista) style. In this case you even not able to force the application to run in Vista style if you use QApplication::setStyle("windowsvista") in its main.cpp file.

                In all Qt 5.13.2 and prior Qt versions this did not happen: An applications shows up in modern Vista style even if Qt Dlls are placed inside its build directory.

                I suppose this can't be called a bug so this report might be closed. But it's not ideal for application testing during application developement how Qt 5.14 changed its behaviour in this case.

                1 Reply Last reply
                0
                • Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Placing some Qt dlls in the debug/release folder is not needed at all when you set up your Qt paths correctly. When you do this then Qt expects that there are also all plugin folders available in this directy which is not in your case.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  2
                  • M Offline
                    M Offline
                    mireiner
                    wrote on last edited by
                    #9

                    Thank you Christian Ehrlicher for clearing my confusion and helping me to understand this case.

                    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