X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Command.cpp;h=01b3bf83595f4d8a4dd6d420da4e021285dc1d80;hb=4224f4dbe7ceaefe74b5d6b79a5840a9f5df2d7a;hp=b289f8014ec6b65c6efe2084978bebd0fe0a6068;hpb=55ad86799133b4560ed637387201406170a52248;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Command.cpp b/src/XGUI/XGUI_Command.cpp index b289f8014..01b3bf835 100644 --- a/src/XGUI/XGUI_Command.cpp +++ b/src/XGUI/XGUI_Command.cpp @@ -1,5 +1,5 @@ #include "XGUI_Command.h" - +#include #include XGUI_Command::XGUI_Command(const QString& theId, QObject * parent, bool isCheckable) @@ -27,24 +27,22 @@ QWidget* XGUI_Command::createWidget(QWidget* theParent) QToolButton* aButton = new QToolButton(theParent); aButton->setIcon(icon()); aButton->setText(text()); - aButton->setStyleSheet("QToolButton::menu-indicator { image: none; }"); - aButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - aButton->setAutoRaise(true); - aButton->setArrowType(Qt::NoArrow); - aButton->setCheckable(myCheckable); - aButton->setMinimumSize(MIN_BUTTON_WIDTH, MIN_BUTTON_HEIGHT); - aButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); QKeySequence aKeys = shortcut(); QString aToolTip = toolTip(); - if (!aKeys.isEmpty()) - aToolTip = aToolTip + " (" + aKeys.toString() + ")"; - if (!aToolTip.isEmpty()) + if (!aKeys.isEmpty()) { + aToolTip = QString("%1 (%2)").arg(aToolTip).arg(aKeys.toString()); + } + if (!aToolTip.isEmpty()) { aButton->setToolTip(aToolTip); + } + aButton->setCheckable(myCheckable); + aButton->setAutoRaise(true); + aButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + aButton->setMinimumSize(MIN_BUTTON_WIDTH, MIN_BUTTON_HEIGHT); + aButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); - aButton->addAction(this); connect(aButton, SIGNAL(clicked()), this, SLOT(trigger())); connect(this, SIGNAL(toggled(bool)), aButton, SLOT(setChecked(bool))); - connect(this, SIGNAL(toggled(bool)), aButton, SLOT(setChecked(bool))); this->setCheckable(myCheckable); return aButton;