1 // Copyright (C) 2009-2022 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "BL_MainWindows_Qt.hxx"
23 #include <QMainWindow>
27 BL::MainWindows_Qt::MainWindows_Qt(QMainWindow * main_window)
29 DEBTRACE("Creating BL::MainWindows_Qt");
30 BL_ASSERT(main_window);
31 _main_window = main_window;
35 BL::MainWindows_Qt::~MainWindows_Qt()
37 DEBTRACE("Destroying BL::MainWindows_Qt");
41 BL::MainWindows_Qt::getDockParent()
47 BL::MainWindows_Qt::getTabParent()
53 BL::MainWindows_Qt::createAction(const QString& toolTip,
56 const QString& status,
62 const QString& shortCut)
64 QAction * action = new QAction(icon, menu, parent);
65 action->setStatusTip(status);
66 action->setToolTip(toolTip);
68 connect(action, SIGNAL(triggered()), receiver, member);
73 BL::MainWindows_Qt::createTopMenu(const QString & menu_name)
75 QMenu * new_menu = _main_window->menuBar()->addMenu(menu_name);
76 _menu_map[getMenuId()] = new_menu;
81 BL::MainWindows_Qt::addActionToMenu(QAction * action, int menu_id)
83 _menu_map[menu_id]->addAction(action);