[Interest] How to change button color in QML?

Minzhang He loongsking at gmail.com
Wed Nov 21 02:45:44 CET 2018


I just started using and like QtQuick.Controls 2.

I want change button Material color in QML.
this is my QML code:
*    Button {*
*        id: btnOK*
*        x: 248*
*        y: 208*
*        text: qsTr("确认")*
*        Material.foreground: Material.primary*
*        Material.background: Material.Dark*
*        MouseArea{*
*            anchors.fill: parent*
*            hoverEnabled: true*
*            onEntered: {*
*                //this is want to change Material code:*
*                //btnOK.Material.foreground = ???*
*                //btnOK.Material.background = ???*
*            }*
*        }*
*    }*
Can you help me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20181121/518c11f7/attachment.html>


More information about the Interest mailing list