Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the QML controls looks default better?

I create default "empty" qml app in the QtCreator. Then I just add the button and run it:

import QtQuick 2.11
import QtQuick.Window 2.11
import QtQuick.Controls 2.4

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Button {
        text: "Button1"
    }
}

But the button looks fantastically ugly:

enter image description here

What I should to do (turn on or add or smth) to bring it look to more attractive?

For example, even the default Win10 view will suit me.

Answer addition: Its sad to me but there are no way to make the QtQuick app looks better than to implement all of the comtrols by self. The answer below explain how to do that.

like image 655
AeroSun Avatar asked Oct 16 '22 12:10

AeroSun


1 Answers

Controls 2 are a new design, from the ground up optimized for performance and they are in a sense departure away from native look and feel, in a direction of a unified look and feel across different platforms.

You can select some of the additional pre-defined styles for Controls 2, or customize a style in several ways, which will easily get you a better look, alas if native look is important for you, there doesn't seem to be a shortcut to that. There was also this effort to create yet another GUI library specifically for native look and feel, but it looks like WIP.

Note that you can still use the old QWidgets styles with the old Controls, but doing so seems to require to bring in the widgets module as a project dependency, which is not ideal.

like image 196
dtech Avatar answered Nov 17 '22 08:11

dtech