From 7cc4e549307c55f120bb0efcad8ffb703dd570c9 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@nokia.com> Date: Wed, 20 Jan 2010 15:23:49 +0100 Subject: [PATCH] QmlDesigner: adding buttonColor to QWidget in qml --- .../components/propertyeditor/basicwidgets.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index 7e644493b06..0a60a8bbf92 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -106,6 +106,7 @@ class QWidgetDeclarativeUI : public QObject Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor) Q_PROPERTY(QColor windowTextColor READ windowTextColor WRITE setWindowTextColor) Q_PROPERTY(QColor buttonTextColor READ buttonTextColor WRITE setButtonTextColor) + Q_PROPERTY(QColor buttonColor READ buttonColor WRITE setButtonColor) Q_PROPERTY(int fixedWidth READ width WRITE setFixedWidth) Q_PROPERTY(int fixedHeight READ height WRITE setFixedHeight) @@ -359,6 +360,17 @@ public: q->setPalette(pal); } + QColor buttonColor() const + { return q->palette().color(QPalette::Button); } + + void setButtonColor(const QColor &color) + { + QPalette pal = q->palette(); + pal.setColor(QPalette::Button, color); + q->setPalette(pal); + } + + void setStyleSheetFile(const QUrl &url) { _styleSheetFile = url; _styleSheetFile.setScheme("file"); //### todo -- GitLab