Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How can I enable the native Windows style?
Forum Updated to NodeBB v4.3 + New Features

How can I enable the native Windows style?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 903 Views 2 Watching
  • 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.
  • E Offline
    E Offline
    edfasefwfawd
    wrote on last edited by
    #1

    Some of the Qt 6 material talks about native desktop styles. I'd like to use the Windows one. How can I enable it?

    For example, I can do QQuickStyle::setStyle("Universal"); but QQuickStyle::setStyle("Windows"); doesn't work. Is there anywhere I can see all the possible string values that I can pass to that function?

    I don't see the style listed here here: https://doc-snapshots.qt.io/qt6-dev/qtquickcontrols2-styles.html#available-styles

    JKSHJ 1 Reply Last reply
    0
    • E edfasefwfawd

      Some of the Qt 6 material talks about native desktop styles. I'd like to use the Windows one. How can I enable it?

      For example, I can do QQuickStyle::setStyle("Universal"); but QQuickStyle::setStyle("Windows"); doesn't work. Is there anywhere I can see all the possible string values that I can pass to that function?

      I don't see the style listed here here: https://doc-snapshots.qt.io/qt6-dev/qtquickcontrols2-styles.html#available-styles

      JKSHJ Online
      JKSHJ Online
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome!

      @edfasefwfawd said in How can I enable the native Windows style?:

      Some of the Qt 6 material talks about native desktop styles. I'd like to use the Windows one. How can I enable it?

      If I'm not mistaken, it's already enabled by default.

      Just create a basic Qt Quick project and build it with both Qt 5 and Qt 6:

      import QtQuick.Window 2.15
      import QtQuick.Controls 2.5
      
      Window {
      	width: 640
      	height: 480
      	visible: true
      
      	Button {
      		text: "Hello"
      	}
      }
      

      On Windows 10, when using Qt 5, the button is large, flat, and always gray. However, when using Qt 6, the button is smaller with a blue-ish hover effect, just like native Windows buttons.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      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