From: vsr Date: Tue, 12 Aug 2014 07:46:16 +0000 (+0400) Subject: 0022614: [CEA 1146] SalomePyQt python API tabifyDockWidgets and findDockByWT X-Git-Tag: V7_5_0a1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13fd6c79d62aa5cb907ae0dcf32a757a6e1de9a0;p=modules%2Fgui.git 0022614: [CEA 1146] SalomePyQt python API tabifyDockWidgets and findDockByWT Unify object names of dock widgets --- diff --git a/src/TreeData/DockWidgets.cxx b/src/TreeData/DockWidgets.cxx index 3fda8715c..8ed5b6551 100644 --- a/src/TreeData/DockWidgets.cxx +++ b/src/TreeData/DockWidgets.cxx @@ -29,6 +29,20 @@ #include #include +namespace +{ + QString toObjectName( const QString& s ) + { + QStringList words = s.split( QRegExp("\\s+") ); + QStringList result; + if ( words.count() > 0 ) + result.append( words[0].left(1).toLower() + words[0].mid(1) ); + for ( int i = 1; i < words.count(); i++ ) + result.append( words[i].left(1).toUpper() + words[i].mid(1) ); + return result.join( "" ); + } +} + /*! * This create a gui container to hold widgets dedicated to the XCAD * data model. By default, the dock widgets are not visible. Use the @@ -49,7 +63,7 @@ DockWidgets::DockWidgets(SalomeApp_Application* salomeApp, _dwDataPanel = new QDockWidget(parent); _dwDataPanel->setVisible(false); _dwDataPanel->setWindowTitle(title); - _dwDataPanel->setObjectName(title); + _dwDataPanel->setObjectName(toObjectName(title)+"Dock"); parent->addDockWidget(Qt::LeftDockWidgetArea, _dwDataPanel); // // At this step, the _dwDataPanel is located side by side with the object @@ -105,3 +119,10 @@ void DockWidgets::setDataView(QTreeView * dataView) { void DockWidgets::setPropertiesView(QTreeView * propertiesView) { // Not implemented yet } + +/*! + * This function returns dock widget + */ +QDockWidget * DockWidgets::getDockWidget() { + return _dwDataPanel; +} diff --git a/src/TreeData/DockWidgets.hxx b/src/TreeData/DockWidgets.hxx index 5925b58e8..56da156c0 100644 --- a/src/TreeData/DockWidgets.hxx +++ b/src/TreeData/DockWidgets.hxx @@ -42,6 +42,8 @@ class TREEDATA_EXPORT DockWidgets { void setDataView(QTreeView * dataView); void setPropertiesView(QTreeView * propertyView); + QDockWidget * getDockWidget(); + private: SalomeApp_Application* _salomeApp; QDockWidget * _dwDataPanel; diff --git a/src/TreeData/TreeGuiManager.cxx b/src/TreeData/TreeGuiManager.cxx index 380c451bb..82a91d949 100644 --- a/src/TreeData/TreeGuiManager.cxx +++ b/src/TreeData/TreeGuiManager.cxx @@ -113,6 +113,12 @@ TreeView * TreeGuiManager::getDataTreeView() { return _dataTreeView; } +/*! + * This returns the dock widgets manager + */ +DockWidgets * TreeGuiManager::getDockWidgets() { + return _dockWidgets; +} /*! * This function specifies the data model to be used by the diff --git a/src/TreeData/TreeGuiManager.hxx b/src/TreeData/TreeGuiManager.hxx index 3321071f2..b2cb0d1c9 100644 --- a/src/TreeData/TreeGuiManager.hxx +++ b/src/TreeData/TreeGuiManager.hxx @@ -44,6 +44,7 @@ public: TreeModel * getDataTreeModel(); TreeView * getDataTreeView(); + DockWidgets * getDockWidgets(); void setDataModel(DataModel * dataModel); DataModel * getDataModel();