diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-03-21 14:54:49 (GMT) |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-03-21 14:54:49 (GMT) |
commit | 8a9dd3f463a312963dc420ee83ca75fd52e24463 (patch) | |
tree | a333c84a41aa87a8bd4f01b805c67c7014c63b36 /tools/designer/src/lib | |
parent | 3d91f9a971990324ef1d785c9c0b8bbed1175711 (diff) | |
download | Qt-8a9dd3f463a312963dc420ee83ca75fd52e24463.zip Qt-8a9dd3f463a312963dc420ee83ca75fd52e24463.tar.gz Qt-8a9dd3f463a312963dc420ee83ca75fd52e24463.tar.bz2 |
Designer: Remember default of main container's object name.
as a default property value. Users can then safely reset it
to its original value. The default-generated name previously
led to the uic-generated file names to be different,
causing build errors in IDE's.
Task-number: QTBUG-18256
Diffstat (limited to 'tools/designer/src/lib')
-rw-r--r-- | tools/designer/src/lib/shared/qdesigner_propertysheet.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp index babe20e..27527da 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -1195,8 +1195,17 @@ bool QDesignerPropertySheet::reset(int index) { if (d->invalidIndex(Q_FUNC_INFO, index)) return false; - if (d->isStringProperty(index)) - setProperty(index, QVariant::fromValue(qdesigner_internal::PropertySheetStringValue())); + if (d->isStringProperty(index)) { + qdesigner_internal::PropertySheetStringValue value; + // Main container: Reset to stored class name as not to change the file names generated by uic. + if (propertyName(index) == QLatin1String("objectName")) { + const QVariant classNameDefaultV = d->m_object->property("_q_classname"); + if (classNameDefaultV.isValid()) + value.setValue(classNameDefaultV.toString()); + } + setProperty(index, QVariant::fromValue(value)); + return true; + } if (d->isKeySequenceProperty(index)) setProperty(index, QVariant::fromValue(qdesigner_internal::PropertySheetKeySequenceValue())); if (d->isResourceProperty(index)) { |