X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTreeData%2FDockWidgets.cxx;h=bcd7b08dd98335c02c429d56341c1fb97f7b695a;hb=a6c6f1e04c7c1a22e856db2d6538bf5197f86c6c;hp=3fda8715cb2f970ef0b68df37e5dbaa86b3150ba;hpb=c47605c13ccf37a7b3fcb9cb6c8baf38d3643f77;p=modules%2Fgui.git diff --git a/src/TreeData/DockWidgets.cxx b/src/TreeData/DockWidgets.cxx old mode 100755 new mode 100644 index 3fda8715c..bcd7b08dd --- a/src/TreeData/DockWidgets.cxx +++ b/src/TreeData/DockWidgets.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -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; +}