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. [Solved] Are QWindowsStyles gone in Qt 5?

[Solved] Are QWindowsStyles gone in Qt 5?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 13.8k 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.
  • W Offline
    W Offline
    wssddc
    wrote on last edited by
    #1

    QWindowsStyle, QWindowsXPStyle and QWindowsVistaStyle are gone in the help for Qt Creator 2.61 and Qt 5, but I still see them at http://qt-project.org/doc/qt-5.0/qtwidgets/gallery.html. The include files have been moved to a private subdirectory, which isn't a good sign, and I get many unresolved links if I try to use these classes. I also see this posting http://www.mail-archive.com/development@qt-project.org/msg07983.html which says these classes "pollute the public API." I'm using windowsmodernstyle.cpp from http://www.mimec.org/articles/qt/wmstyle which needs these classes. Any easy way to get them back?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      The styles are still there but the headers have moved to private API. But fear not, any code that access them directly just need to be slightly modified in Qt5. Instead of inheriting directly from QWindowsVistaStyle, you need to inherit from QProxyStyle instead. (and if required use QStyleFactory to explicitly create an instance of "vista" style.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ArcNexus
        wrote on last edited by
        #3

        I think Qt5 is more best and easy that Qt4. You can create a qss file with a similar style to Windows vista or other style personalized by you and use it for all platforms if you use new "fusion" style. I think it's much more best than Qt4 styles. You have a Example in qt5 directory in examples/widgets/widgets/stylesheet.

        When we are one, we win

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wssddc
          wrote on last edited by
          #4

          Thanks. I was able to rework things to use QProxyStyle with either Qt4 or Qt5.

          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