Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Style changes when upgrading from 5.8 to 5.12



  • We recently upgrade our QT version from 5.8 to 5.12 and we’re noticing some unexpected style changes we’re hoping for help with.

    We have a dialog that previously had a white background and its controls used the flat modern Windows style. After the QT upgrade though, the dialog has a light gray background and its controls have a classic Windows styling. Oddly, the classic Windows styling is used even when running on a Mac.

    I’m very new to QT so I don’t have a good grasp of where to look for what could have caused the style change.

    Is this expected with upgrading from 5.8 to 5.12? Any recommendations on what to look into?

    Thank you!


  • Lifetime Qt Champion

    Hi
    Way back
    https://www.qt.io/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion
    The old styles were removed and left us with Fusion Style

    So going from 5.8 to 5.12 should not change the look as far as i know BUT
    if it reverts to sort old win32 style its often sign that the style plugin did not load as it should.

    Is this for a deployed application ? or also when running in Creator?

    Please try
    (in main.cpp)

    QApplication a(argc, argv);
    qDebug() << QStyleFactory::keys();
    a.setStyle(QStyleFactory::create("Fusion"));
    

    and see if that makes any difference.

    also check what
    qDebug() << QStyleFactory::keys();
    outputs.

    Mine says.
    ("windowsvista", "Windows", "Fusion")

    Im wondering if you simply dont have the Fusion plugin in your deployment folder/app



  • It's for a deployed application that we're building with either Visual Studio or XCode. We haven't tried running it with Creator.

    Changing the style does get us a white background, however, we're still not seeing the modern Window style controls.

    When I output the QStyleFactory::keys(), I see "Windows" and "Fusion". I'm missing the "windowsvista" though. Any idea what might be needed to get that?


  • Moderators

    @J-Andre said in Style changes when upgrading from 5.8 to 5.12:

    I'm missing the "windowsvista" though. Any idea what might be needed to get that?

    You must deploy the style plugin styles\qwindowsvistastyle.dll (similar to deploying the platform plugin platform\qwindows.dll)


  • Lifetime Qt Champion

    @JKSH
    Thank you,
    But missing the qwindowsvistastyle on macOS should not make it look classic win32 or
    what do you think?

    • . Oddly, the classic Windows styling is used even when running on a Mac.

  • Moderators

    @mrjj said in Style changes when upgrading from 5.8 to 5.12:

    But missing the qwindowsvistastyle on macOS should not make it look classic win32 or
    what do you think?

    • . Oddly, the classic Windows styling is used even when running on a Mac.

    I missed that bit; thanks for pointing it out!

    I would not have expected any macOS deployment to use a Windows-like style. @J-Andre, what style plugins are available on your macOS system?


  • Lifetime Qt Champion

    @JKSH
    Hi
    That was also my first thought. Also, it sounds like it reverts to
    "Windows"
    like doing
    a.setStyle(QStyleFactory::create("Windows"));

    So i wonder if its due to Fusion not loading and then there is only "Windows"
    left to use.



  • @JKSH said in Style changes when upgrading from 5.8 to 5.12:

    expected any macOS deployment to use a Wind

    Strangely, the Mac seems to have "Windows" and "Fusion" as its options.
    Before we made the upgrade, we had a "Macintosh" option as well.

    I've confirmed that our Windows build was previously using the WindowsVista style, so I'll try bringing that back and hopefully it works.



  • @JKSH Thanks a lot for your help. The missing qwindowsvistastyle.dll (and Mac equivalent for the Mac build) was what we were missing.


  • Lifetime Qt Champion

    @J-Andre

    Hi Could you post what name for "Mac equivalent for the Mac build"
    as its good to know.



  • @mrjj Good call.
    The Mac one was libqmacstyle.dylib


Log in to reply