From: sbh Date: Fri, 4 Apr 2014 08:36:14 +0000 (+0400) Subject: Merge branch 'master' of newgeom:newgeom.git X-Git-Tag: V_0.1~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=401394b2e312e5c4ecd6a410b90eb2c159a675bf;p=modules%2Fshaper.git Merge branch 'master' of newgeom:newgeom.git Conflicts: src/XGUI/CMakeLists.txt src/XGUI/XGUI_MainWindow.cpp src/XGUI/XGUI_MainWindow.h --- 401394b2e312e5c4ecd6a410b90eb2c159a675bf diff --cc src/XGUI/CMakeLists.txt index 38deae122,90632e71e..713f9b905 --- a/src/XGUI/CMakeLists.txt +++ b/src/XGUI/CMakeLists.txt @@@ -18,7 -18,9 +18,10 @@@ SET(PROJECT_HEADER XGUI_RubberBand.h XGUI_Constants.h XGUI_ViewBackground.h + XGUI_WidgetFactory.h + XGUI_DocumentDataModel.h + XGUI_DataModel.h + XGUI_ObjectsBrowser.h ) SET(PROJECT_AUTOMOC @@@ -39,7 -41,9 +42,10 @@@ SET(PROJECT_SOURCE XGUI_Viewer.cpp XGUI_RubberBand.cpp XGUI_ViewBackground.cpp + XGUI_WidgetFactory.cpp + XGUI_DocumentDataModel.cpp + XGUI_DataModel.cpp + XGUI_ObjectsBrowser.cpp ) SET(PROJECT_RESOURCES diff --cc src/XGUI/XGUI_MainWindow.cpp index 40a0d26cf,007198fc2..c89e0fc0a --- a/src/XGUI/XGUI_MainWindow.cpp +++ b/src/XGUI/XGUI_MainWindow.cpp @@@ -29,9 -29,20 +30,9 @@@ XGUI_MainWindow::XGUI_MainWindow(QWidge myObjectBrowser(0), myPythonConsole(0) { - setWindowTitle(tr("WINDOW_TITLE")); + setWindowTitle(tr("New Geom")); myMenuBar = new XGUI_MainMenu(this); - QDockWidget* aDoc = new QDockWidget(this); - aDoc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - aDoc->setWindowTitle(tr("Object browser")); - - myObjectBrowser = new XGUI_ObjectsBrowser(aDoc); - //myObjectBrowser->setColumnCount(1); - //myObjectBrowser->setHeaderHidden(true); - aDoc->setWidget(myObjectBrowser); - addDockWidget(Qt::LeftDockWidgetArea, aDoc); - //aDoc->hide(); - QMdiArea* aMdiArea = new QMdiArea(this); setCentralWidget(aMdiArea); @@@ -138,69 -233,5 +139,18 @@@ QDockWidget* XGUI_MainWindow::createPro aBtn->setFlat(true); aBtnLay->addWidget(aBtn); - addDockWidget(Qt::RightDockWidgetArea, aPropPanel); + return aPropPanel; +} + +QDockWidget* XGUI_MainWindow::createObjectBrowser() +{ + QDockWidget* aObjDock = new QDockWidget(this); + aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - aObjDock->setWindowTitle(tr("OBJECT_BROWSER_TITLE")); - myObjectBrowser = new QTreeWidget(aObjDock); - myObjectBrowser->setColumnCount(1); - myObjectBrowser->setHeaderHidden(true); ++ aObjDock->setWindowTitle(tr("Object browser")); ++ myObjectBrowser = new XGUI_ObjectsBrowser(aObjDock); ++ //myObjectBrowser->setColumnCount(1); ++ //myObjectBrowser->setHeaderHidden(true); + aObjDock->setWidget(myObjectBrowser); +// fillObjectBrowser(); + return aObjDock; } - - //****************************************************** - - // TEST FUNCTIONS - - //****************************************************** - void XGUI_MainWindow::fillObjectBrowser() - { - QStringList aNames; - aNames << "Parameters" << "Constructions"; - aNames << "Part 1" << "Part 2" << "Part 3"; - aNames << "Properties"; - - QStringList aIcons; - aIcons << ":pictures/params_folder.png"; - aIcons << ":pictures/constr_folder.png"; - aIcons << ":pictures/part_ico.png"; - aIcons << ":pictures/part_ico.png"; - aIcons << ":pictures/part_ico.png"; - aIcons << ":pictures/properties.png"; - - QList aItems; - foreach(QString aName, aNames) - { - QTreeWidgetItem* aItem = new QTreeWidgetItem(myObjectBrowser); - aItem->setText(0, aName); - aItems.append(aItem); - } - for(int i = 0; i < aItems.length(); i++) { - aItems[i]->setIcon(0, QIcon(aIcons[i])); - } - myObjectBrowser->addTopLevelItems(aItems); - - for(int i = 2; i < 5; i++) { - QTreeWidgetItem* aItem = new QTreeWidgetItem(aItems[i]); - aItem->setText(0, "Parameters"); - aItem->setIcon(0, QIcon(":pictures/params_folder.png")); - - aItem = new QTreeWidgetItem(aItems[i]); - aItem->setText(0, "Construction"); - aItem->setIcon(0, QIcon(":pictures/constr_folder.png")); - - aItem = new QTreeWidgetItem(aItems[i]); - aItem->setText(0, "Bodies"); - aItem->setIcon(0, QIcon(":pictures/part_ico.png")); - - aItem = new QTreeWidgetItem(aItems[i]); - aItem->setText(0, "Features"); - aItem->setIcon(0, QIcon(":pictures/features.png")); - } - } diff --cc src/XGUI/XGUI_MainWindow.h index 0806b5863,2f85d1c01..e12614a73 --- a/src/XGUI/XGUI_MainWindow.h +++ b/src/XGUI/XGUI_MainWindow.h @@@ -41,14 -41,12 +41,12 @@@ public void hidePythonConsole(); private: - //!! For test purposes only - //void fillObjectBrowser(); - void addPropertyPanel(); + void createDockWidgets(); + QDockWidget* createObjectBrowser(); + QDockWidget* createPropertyPanel(); - //!! For test purposes only - void fillObjectBrowser(); XGUI_MainMenu* myMenuBar; - QTreeWidget* myObjectBrowser; + XGUI_ObjectsBrowser* myObjectBrowser; XGUI_Viewer* myViewer;