From 00a720a81194befe2712c2858f1298e8f5461238 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 17 Jul 2015 13:27:31 +0200 Subject: Qt Designer: Clean up tooltips and value texts in property editor. Remove code setting tooltips that duplicate texts already set in DesignerPropertyManager::valueText() (which is used as tooltip QtTreePropertyBrowserPrivate::updateItem(). Boolean values and the paths of icons and pixmaps are the only remaining tooltips that differ from valueText(). Fix display of the paths. Task-number: QTBUG-45442 Change-Id: Iedb5936e52f051f38c9922285efc5136387f4442 Reviewed-by: Jarek Kobus --- .../components/propertyeditor/designerpropertymanager.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp index 49908805..85f462f1 100644 --- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp @@ -1866,7 +1866,8 @@ void DesignerPropertyManager::setValue(QtProperty *property, const QVariant &val iconPaths.constFind(qMakePair(QIcon::Normal, QIcon::Off)); if (itNormalOff != iconPaths.constEnd()) toolTip = itNormalOff.value().path(); - property->setToolTip(toolTip); + // valueText() only show the file name; show full path as ToolTip. + property->setToolTip(QDir::toNativeSeparators(toolTip)); return; } else if (m_pixmapValues.contains(property)) { @@ -1884,7 +1885,8 @@ void DesignerPropertyManager::setValue(QtProperty *property, const QVariant &val emit QtVariantPropertyManager::valueChanged(property, QVariant::fromValue(pixmap)); emit propertyChanged(property); - property->setToolTip(pixmap.path()); + // valueText() only show the file name; show full path as ToolTip. + property->setToolTip(QDir::toNativeSeparators(pixmap.path())); return; } else if (m_uintValues.contains(property)) { @@ -1970,13 +1972,7 @@ void DesignerPropertyManager::setValue(QtProperty *property, const QVariant &val } m_fontManager.setValue(this, property, value); QtVariantPropertyManager::setValue(property, value); - if (QtVariantPropertyManager::valueType(property) == QVariant::String) - property->setToolTip(DesignerPropertyManager::value(property).toString()); - else if (QtVariantPropertyManager::valueType(property) == designerStringTypeId()) - property->setToolTip(qvariant_cast(DesignerPropertyManager::value(property)).value()); - else if (QtVariantPropertyManager::valueType(property) == designerKeySequenceTypeId()) - property->setToolTip(qvariant_cast(DesignerPropertyManager::value(property)).value().toString(QKeySequence::NativeText)); - else if (QtVariantPropertyManager::valueType(property) == QVariant::Bool) + if (QtVariantPropertyManager::valueType(property) == QVariant::Bool) property->setToolTip(QtVariantPropertyManager::valueText(property)); } -- cgit v1.2.3