From 7133b932ac2af6e5a09323f09ee8024d0042bce3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:00:10 +0200 Subject: Made it possible to set string properties using QDesignerFormWindowCursor::setProperty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure the text does not get clobbered by the subproperty handling. Reviewed-by: Kai Köhne Task-number: 253278 --- tools/designer/src/lib/shared/qdesigner_propertycommand.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp index ff3b50b..94e8044 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -316,6 +316,10 @@ Qt::Alignment variantToAlignment(const QVariant & q) // find changed subproperties of a variant unsigned compareSubProperties(const QVariant & q1, const QVariant & q2, qdesigner_internal::SpecialProperty specialProperty) { + // Do not clobber new value in the comparison function in + // case someone sets a QString on a PropertySheetStringValue. + if (q1.type() != q2.type()) + return SubPropertyAll; switch (q1.type()) { case QVariant::Rect: return compareSubProperties(q1.toRect(), q2.toRect()); -- cgit v0.12