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. Available styles change between Creator and deployment

Available styles change between Creator and deployment

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 338 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.
  • S Offline
    S Offline
    StevePosh
    wrote on last edited by
    #1

    I'm currently having a problem with windows Qt styles. I'm using QT 6.8.2, QT Creator 15.0.1, on a Windows 10 machine.

    Screenshot 2025-02-01 183030.png
    Launched from Creator, with snippet for listing style options

    Screenshot 2025-02-01 183452.png
    Launched after being deployed

    My application was built with the windowsvista style in mind. When launching the application through QT Creator the styles listed by QStyleFactory::keys() are windows11, windowsvista, Windows, Fusion, defaulting to windowsvista. However, when I try to deploy the application using windeployqt.exe the list is reduced to only Windows and Fusion, defaulting to Windows and making the app look like it's from the 95 era: thick emboss buttons, no transparency, etc.

    Previously I was using Qt 6.7.0 and did not have this issue, except when executing on a windows 11 machine. How can I get the windowsvista style back into the deployment version? As far as I've found it used to be a standalone .dll file under the styles folder, but that's been replaced by a one-size-fits-all qmodernwindowsstyle.dll.

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

      When qmodernwindowsstyle.dll is in there strata with QT_DEBUG_PLUGINS=1 and see why it is not loaded. There are numerous posts about how to debug plug in issues here in the forum.

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

      S 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        When qmodernwindowsstyle.dll is in there strata with QT_DEBUG_PLUGINS=1 and see why it is not loaded. There are numerous posts about how to debug plug in issues here in the forum.

        S Offline
        S Offline
        StevePosh
        wrote on last edited by
        #3

        @Christian-Ehrlicher

        Thanks for your suggestion. I've been able to get QT_DEBUG_PLUGINS=1 while debugging normally via Qt Creator and the plugins are loaded as normal. I was also able to get debug info out of the release build using DebugView from Microsoft and found that it was no longer searching the APPDIR/styles folder created by windeployqt.exe for qmodernsindowsstyle.dll. I attempted to force it to load using QLibrary but that didn't do anything. Finally, I moved qmodernwindowsstyle.dll to a new folder APPDIR/plugins/styles, which seems to be the new default. That made it load qmodernwindowsstyle.dll properly and I was able to set it back to windowsvista.

        In a previous build I have of the project compiled with Qt 6.7.0, the APPDIR/styles folder is searched properly and qmodernwindowsstyle.dll is loaded without any modification to the file structureas set by windeployqt. Wondering if that's been documented somewhere or if it's a change that's been missed. In any case, I'm adding a post build step to do this for me and it's solved for now.

        V 2 Replies Last reply
        1
        • S StevePosh has marked this topic as solved on
        • S StevePosh

          @Christian-Ehrlicher

          Thanks for your suggestion. I've been able to get QT_DEBUG_PLUGINS=1 while debugging normally via Qt Creator and the plugins are loaded as normal. I was also able to get debug info out of the release build using DebugView from Microsoft and found that it was no longer searching the APPDIR/styles folder created by windeployqt.exe for qmodernsindowsstyle.dll. I attempted to force it to load using QLibrary but that didn't do anything. Finally, I moved qmodernwindowsstyle.dll to a new folder APPDIR/plugins/styles, which seems to be the new default. That made it load qmodernwindowsstyle.dll properly and I was able to set it back to windowsvista.

          In a previous build I have of the project compiled with Qt 6.7.0, the APPDIR/styles folder is searched properly and qmodernwindowsstyle.dll is loaded without any modification to the file structureas set by windeployqt. Wondering if that's been documented somewhere or if it's a change that's been missed. In any case, I'm adding a post build step to do this for me and it's solved for now.

          V Offline
          V Offline
          Violet Giraffe
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • S StevePosh

            @Christian-Ehrlicher

            Thanks for your suggestion. I've been able to get QT_DEBUG_PLUGINS=1 while debugging normally via Qt Creator and the plugins are loaded as normal. I was also able to get debug info out of the release build using DebugView from Microsoft and found that it was no longer searching the APPDIR/styles folder created by windeployqt.exe for qmodernsindowsstyle.dll. I attempted to force it to load using QLibrary but that didn't do anything. Finally, I moved qmodernwindowsstyle.dll to a new folder APPDIR/plugins/styles, which seems to be the new default. That made it load qmodernwindowsstyle.dll properly and I was able to set it back to windowsvista.

            In a previous build I have of the project compiled with Qt 6.7.0, the APPDIR/styles folder is searched properly and qmodernwindowsstyle.dll is loaded without any modification to the file structureas set by windeployqt. Wondering if that's been documented somewhere or if it's a change that's been missed. In any case, I'm adding a post build step to do this for me and it's solved for now.

            V Offline
            V Offline
            Violet Giraffe
            wrote on last edited by Violet Giraffe
            #5

            @StevePosh, thank you! I've been going mad trying to figure out why it won't load.

            Did you create a bug report for this?

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

              The style plugin has to be under <appdir>\styles - no code or anything else needed. This was true for every qt5 and qt6 version.

              D:\development\Qt-bin\6.8.2\msvc2022_64\bin\tmp
              λ assistant.exe -style windows11
              ...
              qt.core.plugin.factoryloader: checking directory path "D:/development/Qt-bin/6.8.2/msvc2022_64/bin/tmp/styles" ...
              qt.core.plugin.factoryloader: looking at "qmodernwindowsstyle.dll"
              qt.core.plugin.loader: Found metadata in lib D:/development/Qt-bin/6.8.2/msvc2022_64/bin/tmp/styles/qmodernwindowsstyle.dll, metadata=
              {
                  "IID": "org.qt-project.Qt.QStyleFactoryInterface",
                  "MetaData": {
                      "Keys": [
                          "windowsvista",
                          "windows11"
                      ]
                  },
                  "archlevel": 0,
                  "className": "QModernWindowsStylePlugin",
                  "debug": false,
                  "version": 395264
              }
              
              
              qt.core.plugin.factoryloader: Got keys from plugin meta data QList("windowsvista", "windows11")
              qt.core.library: "D:/development/Qt-bin/6.8.2/msvc2022_64/bin/tmp/styles/qmodernwindowsstyle.dll" loaded library
              

              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
              • V Offline
                V Offline
                Violet Giraffe
                wrote on last edited by Violet Giraffe
                #7

                Then it is also true that windeployqt used to place it correctly, and no longer does. Resulting in broken deployments and literal hours of debugging.

                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