How to change a menubars style? (Example ?)
QML and Qt Quick
7
Posts
3
Posters
3.4k
Views
3
Watching
-
ehh, but how?
Could you give me a code-snipset?lets say this is the menu:
menuBar: MenuBar { Menu { title: qsTr("&File") MenuItem { text: qsTr("&Open") onTriggered: messageDialog.show(qsTr("Open action triggered")); } MenuItem { text: qsTr("E&xit") onTriggered: Qt.quit(); } } }
-
@mcosta
Thanks, this brought me closer. I didn't know that I can simply set a rectangle as background.Can you tell me how to change the font-color as well?
@themts You can set a custom palette to the application itself. For eg:
QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///Example.qml"))); QPalette customPalette(app.palette()); customPalette.setColor(QPalette::WindowText,QColor("yellow")); app.setPalette(customPalette); return app.exec();