summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp
index 5752c7e..5405be5 100644
--- a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp
@@ -43,6 +43,9 @@
#include "pluginmanager_p.h"
#include <QtDesigner/QDesignerFormEditorInterface>
+#include <QtDesigner/QDesignerDynamicPropertySheetExtension>
+#include <QtDesigner/QDesignerPropertySheetExtension>
+#include <QtDesigner/QExtensionManager>
#include <widgetfactory_p.h>
#include <QtGui/QAction>
#include <QtGui/QLineEdit>
@@ -99,6 +102,20 @@ QDesignerPropertyEditor::QDesignerPropertyEditor(QWidget *parent, Qt::WindowFlag
connect(this, SIGNAL(propertyChanged(QString,QVariant)), this, SLOT(slotPropertyChanged(QString,QVariant)));
}
+static inline bool isDynamicProperty(QDesignerFormEditorInterface *core, QObject *object,
+ const QString &propertyName)
+{
+ if (const QDesignerDynamicPropertySheetExtension *dynamicSheet = qt_extension<QDesignerDynamicPropertySheetExtension*>(core->extensionManager(), object)) {
+ if (dynamicSheet->dynamicPropertiesAllowed()) {
+ if (QDesignerPropertySheetExtension *propertySheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), object)) {
+ const int index = propertySheet->indexOf(propertyName);
+ return index >= 0 && dynamicSheet->isDynamicProperty(index);
+ }
+ }
+ }
+ return false;
+}
+
QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textPropertyValidationMode(
QDesignerFormEditorInterface *core, const QObject *object,
const QString &propertyName, bool isMainContainer)
@@ -118,6 +135,9 @@ QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textP
return customType;
}
+ if (isDynamicProperty(core, const_cast<QObject *>(object), propertyName))
+ return StringPropertyParameters(ValidationMultiLine, true);
+
// Check hardcoded property ames
const PropertyNameTypeMap::const_iterator hit = stringPropertyTypes().constFind(propertyName);
if (hit != stringPropertyTypes().constEnd())