diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml index e394e1ed29b2b0ce7f0959d3dd74e54ed777ff9c..e4d10b53b98a330ff961d7026d05c891fa55f136 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml @@ -25,6 +25,10 @@ QWidget { //This is a special doubleSpinBox that does color coding for states evaluate(); } + onEnabledChanged: { + evaluate(); + } + Script { function evaluate() { if (!enabled) { diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml index 0a188ae728028a1c9a299e2fba0b883f47e4e89b..868e6e6ac41be7e760c56819420195dbdca684b2 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Layout.qml @@ -56,6 +56,7 @@ GroupBox { QWidget { layout : HorizontalLayout { IntEditor { + id:topbox slider: false caption: "Margin" backendValue: backendValues.anchors_topMargin diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml index 16f720c2f5968cfcc46aefc52d172adebf5d6555..da69cb2b492ab2f5d73b93254cedaea43febb231 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml @@ -63,7 +63,6 @@ QWidget { //This is a special spinBox that does color coding for states ColorScheme { id:scheme; } layout: HorizontalLayout { - QSpinBox { property alias backendValue: spinBox.backendValue diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index bec233003262e9cd7ba44400ca8980aa93816e4d..e547b45a629513ed2667a8248c67b3161992e8af 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -139,6 +139,7 @@ class QWidgetDeclarativeUI : public QObject Q_PROPERTY(bool mouseOver READ mouseOver NOTIFY mouseOverChanged) Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) Q_CLASSINFO("DefaultProperty", "children") @@ -151,6 +152,7 @@ signals: void mouseOverChanged(); void opacityChanged(); void visibleChanged(); + void enabledChanged(); public: QWidgetDeclarativeUI(QObject *other) : QObject(other), _layout(0), _graphicsOpacityEffect(0) { @@ -201,6 +203,11 @@ public: emit visibleChanged(); } + void emitEnabledChanged() + { + emit enabledChanged(); + } + QDeclarativeListProperty<QObject> children() { return QDeclarativeListProperty<QObject>(this, 0, children_append, children_count, children_at, children_clear); } @@ -267,6 +274,14 @@ public: q->setVisible(visible); } + bool enabled() const { + return q->isEnabled(); + } + + void setEnabled(bool enabled) { + q->setEnabled(enabled); + } + int globalY() const { if (q->parentWidget()) return q->mapToGlobal(QPoint(1,y())).y(); @@ -534,7 +549,14 @@ bool ResizeEventFilter::eventFilter(QObject *obj, QEvent *event) && obj == m_target) { m_dui_target->emitVisibleChanged(); return QObject::eventFilter(obj, event); - } + } + } else if (event->type() == QEvent::EnabledChange) { + if (obj + && obj->isWidgetType() + && obj == m_target) { + m_dui_target->emitEnabledChanged(); + return QObject::eventFilter(obj,event); + } } return QObject::eventFilter(obj, event); }