X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MenuGroupPanel.cpp;h=a1883f26baec7d7eb14dce73bb02302f07784e91;hb=3e2000ab472f5885de9ce1fbe1e2eb27669b5596;hp=8d5d24b2146206e706922eff835521861c478797;hpb=06a0c72422f28c04ea7341a010c0b3f649d30ac2;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MenuGroupPanel.cpp b/src/XGUI/XGUI_MenuGroupPanel.cpp index 8d5d24b21..a1883f26b 100644 --- a/src/XGUI/XGUI_MenuGroupPanel.cpp +++ b/src/XGUI/XGUI_MenuGroupPanel.cpp @@ -10,12 +10,16 @@ #include XGUI_MenuGroupPanel::XGUI_MenuGroupPanel(QWidget *parent) - : QWidget(parent), myNewRow(0), myNewCol(0), myMaxRow(1) + : QFrame(parent), + myNewRow(0), + myNewCol(0), + myMaxRow(1) { myLayout = new QGridLayout(this); myLayout->setSpacing(0); myLayout->setMargin(0); myLayout->setContentsMargins(0, 0, 0, 0); + setFrameShape(QFrame::NoFrame); } void XGUI_MenuGroupPanel::addCommand(XGUI_Command* theAction) @@ -56,29 +60,44 @@ void XGUI_MenuGroupPanel::resizeEvent(QResizeEvent* theEvent) myMaxRow = aMaxRow; myNewRow = 0; myNewCol = 0; - foreach(QWidget* eachWidget, myActionWidget) { + foreach(QWidget* eachWidget, myActionWidget) + { placeWidget(eachWidget); } - myLayout->setRowStretch(myMaxRow + 1, 1); + myLayout->setRowStretch(myMaxRow + 1, 1); } -XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle, - const QString& theTip, const QIcon& theIcon, - const QKeySequence& theKeys, bool isCheckable) +XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, + const QString& theTip, + const QString& theTitle, + const QIcon& theIcon, + const QKeySequence& theKeys) { - XGUI_Command* aCommand = new XGUI_Command(theId, theIcon, theTitle, this, isCheckable); + return addFeature(theId, theTip, theTitle, theIcon, QString(), theKeys, false); +} + +XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, + const QString& theTitle, + const QString& theTip, + const QIcon& theIcon, + const QString& theDocumentKind, + const QKeySequence& theKeys, + bool isCheckable) +{ + XGUI_Command* aCommand = new XGUI_Command(theId, theDocumentKind, theIcon, + theTitle, this, isCheckable); aCommand->setToolTip(theTip); - if (!theKeys.isEmpty()) + if (!theKeys.isEmpty()) { aCommand->setShortcut(theKeys); - + } addCommand(aCommand); return aCommand; } - XGUI_Command* XGUI_MenuGroupPanel::feature(const QString& theId) const { - foreach (XGUI_Command* aCmd, myActions) { + foreach (XGUI_Command* aCmd, myActions) + { if (aCmd->data().toString() == theId) return aCmd; }