summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-17 13:27:31 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-28 17:07:46 +0000
commit00a720a81194befe2712c2858f1298e8f5461238 (patch)
tree6b28f9d3c3c918bfed79c43ed6ba1ac8f87c6e6b
parent247ed37d15202430e2e4ed1163e762848828ca2d (diff)
downloadqttools-00a720a81194befe2712c2858f1298e8f5461238.tar.gz
qttools-00a720a81194befe2712c2858f1298e8f5461238.tar.bz2
qttools-00a720a81194befe2712c2858f1298e8f5461238.zip
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 <jaroslaw.kobus@theqtcompany.com>
-rw-r--r--src/designer/src/components/propertyeditor/designerpropertymanager.cpp14
1 files 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<PropertySheetStringValue>(DesignerPropertyManager::value(property)).value());
- else if (QtVariantPropertyManager::valueType(property) == designerKeySequenceTypeId())
- property->setToolTip(qvariant_cast<PropertySheetKeySequenceValue>(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));
}