diff options
Diffstat (limited to 'doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp')
-rw-r--r-- | doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp b/doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp new file mode 100644 index 000000000..bbc396fcf --- /dev/null +++ b/doc/codesnippets/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] + + |