From: vsv Date: Wed, 19 Sep 2018 09:18:04 +0000 (+0300) Subject: Process tool tip property for radio buttons X-Git-Tag: V9_2_0a1~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=731fbfb172f1cb05aa7a5063d9e2296e888cc805;p=modules%2Fshaper.git Process tool tip property for radio buttons --- diff --git a/src/ModuleBase/ModuleBase_PagedContainer.cpp b/src/ModuleBase/ModuleBase_PagedContainer.cpp index b02d23b47..586b33b81 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.cpp +++ b/src/ModuleBase/ModuleBase_PagedContainer.cpp @@ -50,7 +50,8 @@ ModuleBase_PagedContainer::~ModuleBase_PagedContainer() int ModuleBase_PagedContainer::addPage(ModuleBase_PageBase* thePage, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon ) + const QPixmap& theIcon, + const QString& theTooltip) { if (!myPages.count()) { setDefaultValue(theCaseId.toStdString()); diff --git a/src/ModuleBase/ModuleBase_PagedContainer.h b/src/ModuleBase/ModuleBase_PagedContainer.h index 265b3474f..689e0ca9a 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.h +++ b/src/ModuleBase/ModuleBase_PagedContainer.h @@ -48,7 +48,8 @@ class MODULEBASE_EXPORT ModuleBase_PagedContainer : public ModuleBase_ModelWidge virtual int addPage( ModuleBase_PageBase* theWidget, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon ); + const QPixmap& theIcon, + const QString& theTooltip); /// Redefinition of virtual function virtual QList getControls() const; diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.cpp b/src/ModuleBase/ModuleBase_WidgetFactory.cpp index 80f8419d1..af75ebd12 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFactory.cpp @@ -132,6 +132,7 @@ void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage, bool a if (myWidgetApi->toChildWidget()) { do { QString aPageName = qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME)); + QString aTooltip = qs(myWidgetApi->getProperty(FEATURE_TOOLTIP)); QString aCaseId = qs(myWidgetApi->getProperty(_ID)); ModuleBase_PageBase* aPage = new ModuleBase_PageWidget(aWidget); createWidget(aPage); @@ -141,7 +142,7 @@ void ModuleBase_WidgetFactory::createWidget(ModuleBase_PageBase* thePage, bool a QString anIconPath = qs( myWidgetApi->getProperty( CONTAINER_PAGE_ICON ) ); QPixmap anIcon = ModuleBase_IconFactory::loadPixmap( anIconPath ); - aContainer->addPage( aPage, aPageName, aCaseId, anIcon ); + aContainer->addPage( aPage, aPageName, aCaseId, anIcon, aTooltip); } } while (myWidgetApi->toNextWidget()); } diff --git a/src/ModuleBase/ModuleBase_WidgetRadiobox.cpp b/src/ModuleBase/ModuleBase_WidgetRadiobox.cpp index 11f4a0642..f939ad513 100644 --- a/src/ModuleBase/ModuleBase_WidgetRadiobox.cpp +++ b/src/ModuleBase/ModuleBase_WidgetRadiobox.cpp @@ -46,19 +46,23 @@ ModuleBase_WidgetRadiobox::~ModuleBase_WidgetRadiobox() int ModuleBase_WidgetRadiobox::addPage(ModuleBase_PageBase* thePage, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon) + const QPixmap& theIcon, + const QString& theTooltip) { - ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon); + ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon, theTooltip); QWidget* aWgt = new QWidget(this); QVBoxLayout* aLay = new QVBoxLayout(aWgt); aLay->setContentsMargins(0, 0, 0, 0); QRadioButton* aButton; - if (theIcon.isNull()) + if (theIcon.isNull()) { aButton = new QRadioButton(theName, aWgt); - else + aButton->setToolTip(theTooltip); + } + else { aButton = new QRadioButton(aWgt); - aButton->setToolTip(theName); + aButton->setToolTip(theName); + } aLay->addStretch(); aLay->addWidget(aButton); aLay->addStretch(); diff --git a/src/ModuleBase/ModuleBase_WidgetRadiobox.h b/src/ModuleBase/ModuleBase_WidgetRadiobox.h index 81713d824..29c42cfdc 100644 --- a/src/ModuleBase/ModuleBase_WidgetRadiobox.h +++ b/src/ModuleBase/ModuleBase_WidgetRadiobox.h @@ -47,7 +47,8 @@ public: virtual int addPage(ModuleBase_PageBase* theWidget, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon); + const QPixmap& theIcon, + const QString& theTooltip); protected: /// Implements ModuleBase_PagedContainer diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp index bf1b29749..11d4be0d7 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp @@ -55,9 +55,11 @@ ModuleBase_WidgetSwitch::~ModuleBase_WidgetSwitch() int ModuleBase_WidgetSwitch::addPage(ModuleBase_PageBase* thePage, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon ) + const QPixmap& theIcon, + const QString& theTooltip) { - int aSuperCount = ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon); + int aSuperCount = + ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon, theTooltip); myCombo->addItem(theName); int aResultCount = myCombo->count(); if (aResultCount == 2) diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.h b/src/ModuleBase/ModuleBase_WidgetSwitch.h index 3a5de0f9b..065df920e 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.h +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.h @@ -54,7 +54,8 @@ class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public ModuleBase_PagedContain virtual int addPage( ModuleBase_PageBase* theWidget, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon ); + const QPixmap& theIcon, + const QString& theTooltip); protected: /// Returns index of the current page diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp index 3a9666b55..0827a699f 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp @@ -67,9 +67,10 @@ ModuleBase_WidgetToolbox::~ModuleBase_WidgetToolbox() int ModuleBase_WidgetToolbox::addPage(ModuleBase_PageBase* thePage, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon ) + const QPixmap& theIcon, + const QString& theTooltip) { - ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon); + ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon, theTooltip); QFrame* aFrame = dynamic_cast(thePage); myToolBox->addItem(aFrame, theName, theIcon ); return myToolBox->count(); diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.h b/src/ModuleBase/ModuleBase_WidgetToolbox.h index bac5c1f83..5b8c1e6d7 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.h +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.h @@ -53,7 +53,8 @@ class MODULEBASE_EXPORT ModuleBase_WidgetToolbox : public ModuleBase_PagedContai virtual int addPage( ModuleBase_PageBase* theWidget, const QString& theName, const QString& theCaseId, - const QPixmap& theIcon ); + const QPixmap& theIcon, + const QString& theTooltip); protected: /// Implements ModuleBase_PagedContainer