0
votes

I am using Creator 4.8.0 and QtQuick 2.9

Is it possible to define in QML a push button that has rounded corners?

2

2 Answers

1
votes

QML has a RoundButton with a radius property https://doc.qt.io/qt-5.11/qml-qtquick-controls2-roundbutton.html

import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.3

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

    RoundButton {
        text: "Press me please"
        radius: 5
    }
}
0
votes

If you want to use Rolf Winter's answer: https://stackoverflow.com/a/53816297/7600801

Qt Quick Controls 2.3 was released in Qt 5.10 according to their blogpost: http://blog.qt.io/blog/2017/11/23/ready-qt-quick-controls-2-3/

Using Qt's Maintenance Tool, you should be able to add a 5.10 kit to your installation. Then in your project, add the kit and select it as the kit you want to compile with and you should be able to then import QtQuick.Control 2.3