From d98db945e11f834b88904ce700e512e4233f57e3 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 21 Oct 2015 11:53:20 +0300 Subject: [PATCH] Set tooltips on icons --- src/ModuleBase/ModuleBase_WidgetChoice.cpp | 5 +++++ src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp | 1 + src/ModuleBase/ModuleBase_WidgetIntValue.cpp | 1 + src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp | 1 + src/PartSet/PartSet_WidgetSketchCreator.cpp | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.cpp b/src/ModuleBase/ModuleBase_WidgetChoice.cpp index 3bb748f63..c89508324 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.cpp +++ b/src/ModuleBase/ModuleBase_WidgetChoice.cpp @@ -31,6 +31,11 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, myLabel->setPixmap(QPixmap(aLabelIcon)); aLayout->addWidget(myLabel); + std::string aToolstr = theData->widgetTooltip(); + if (!aToolstr.empty()) { + myLabel->setToolTip(QString::fromStdString(aToolstr)); + } + myCombo = new QComboBox(this); aLayout->addWidget(myCombo, 1); diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 2687b72a2..9b478cc8e 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -85,6 +85,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, QString aTTip = QString::fromStdString(theData->widgetTooltip()); mySpinBox->setToolTip(aTTip); + myLabel->setToolTip(aTTip); aControlLay->addRow(myLabel, mySpinBox); #ifdef APPLY_BY_ENTER_OR_TAB diff --git a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp index 54e737c11..95045d0c2 100644 --- a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp @@ -84,6 +84,7 @@ ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent, QString aTTip = QString::fromStdString(theData->widgetTooltip()); mySpinBox->setToolTip(aTTip); + myLabel->setToolTip(aTTip); aControlLay->addRow(myLabel, mySpinBox); #ifdef APPLY_BY_ENTER_OR_TAB diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 113a6113f..1e60ec404 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -87,6 +87,7 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParen myTextLine->installEventFilter(this); aLayout->addRow(myLabel, myTextLine); + myLabel->setToolTip(aToolTip); std::string aTypes = theData->getProperty("shape_types"); myShapeTypes = QString(aTypes.c_str()).split(' ', QString::SkipEmptyParts); diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index 4a90a591f..08e46a64d 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -59,6 +59,8 @@ PartSet_WidgetSketchCreator::PartSet_WidgetSketchCreator(QWidget* theParent, myTextLine->setToolTip(aToolTip); myTextLine->installEventFilter(this); + myLabel->setToolTip(aToolTip); + QString aUseBody = QString::fromStdString(theData->getProperty(USE_BODY)); if(!aUseBody.isEmpty()) { myUseBody = QVariant(aUseBody).toBool(); -- 2.39.2