1 #include "XGUI_Command.h"
5 XGUI_Command::XGUI_Command(QObject * parent) :
10 XGUI_Command::XGUI_Command(const QIcon& icon, const QString& text, QObject* parent):
18 XGUI_Command::~XGUI_Command()
22 QWidget* XGUI_Command::createWidget(QWidget* theParent)
24 if (theParent->inherits("XGUI_MenuGroupPanel")) {
25 QPushButton* aBtn = new QPushButton(theParent);
26 aBtn->setIcon(icon());
27 aBtn->setText(text());
28 QKeySequence aKeys = shortcut();
29 QString aToolTip = toolTip();
31 aToolTip = aToolTip + " (" + aKeys.toString() + ")";
32 if (!aToolTip.isEmpty())
33 aBtn->setToolTip(aToolTip);
35 aBtn->addAction(this);
36 connect(aBtn, SIGNAL(clicked()), this, SLOT(trigger()));
38 aBtn->setMinimumSize(MIN_BUTTON_WIDTH, MIN_BUTTON_HEIGHT);
41 return QWidgetAction::createWidget(theParent);