Change the color overlay for hover on a QML Button
Unsolved
QML and Qt Quick
-
I just made the change from Qt 5.12.3 to 6.1.2. Having done this I went ahead and compiled a very simple QML App:
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.0 ApplicationWindow { id: mainWindow visible: true //visibility: Window.Maximized width: 1000 height: 800 title: qsTr("Hello World") Button { id: myTestButton width: 100 height: 50 text: "Click Me!" anchors.centerIn: parent //hoverEnabled: false onClicked: { console.log("Button Was clicked") } } }
When I hover over the button now, it slowñy gets covered by a slight blue tranparent overlay while the mouse is over the button. I can disable this by setting hoverEnabled to false, but I much rather change it to something that I can use. How can change the color of this hover overlay?
-
@aarelovich
see this: https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-button
and change the color of thebackground
Rectangle whencontrol.hovered
is true