diff options
Diffstat (limited to 'doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp')
-rw-r--r-- | doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp b/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp new file mode 100644 index 0000000..bbc396f --- /dev/null +++ b/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp @@ -0,0 +1,23 @@ +//! [0] + QDesignerPropertyEditorInterface *propertyEditor = 0; + propertyEditor = formEditor->propertyEditor(); + + connect(propertyEditor, SIGNAL(propertyChanged(QString, QVariant)), + this, SLOT(checkProperty(QString, QVariant))); +//! [0] + + +//! [1] + void checkProperty(QString property, QVariant value) { + QDesignerPropertyEditorInterface *propertyEditor = 0; + propertyEditor = formEditor->propertyEditor(); + + QObject *object = propertyeditor->object(); + MyCustomWidget *widget = qobject_cast<MyCustomWidget>(object); + + if (widget && property == aProperty && value != expectedValue) + {...} + } +//! [1] + + |