Back to index

salome-med  6.5.0
MEDGUIDataBaseDockWidget.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "MEDGUIDataBaseDockWidget.hxx"
00021 
00022 #include "CAM_Application.h"
00023 #include "SUIT_ResourceMgr.h"
00024 
00025 #include <QTreeWidget>
00026 #include <QHeaderView>
00027 #include <QGridLayout>
00028 
00029 MEDGUIDataBaseDockWidget::MEDGUIDataBaseDockWidget(CAM_Application *app, QWidget * parent):QDockWidget(parent),_app(app)
00030 {
00031   setWindowTitle("MEDUtils DataBase");
00032   setMinimumWidth(270);
00033   setMinimumHeight(300);
00034   QWidget *content = new QWidget;
00035   setWidget(content);
00036   QGridLayout *gridLayout1 = new QGridLayout(content);
00037   _tree_widget=new QTreeWidget(content);
00038   QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
00039   QTreeWidgetItem *item1 = new QTreeWidgetItem;
00040   item1->setText(0, QString::fromUtf8("Name"));
00041   _tree_widget->setHeaderItem(item1);
00042   sizePolicy.setHeightForWidth(_tree_widget->sizePolicy().hasHeightForWidth());
00043   _tree_widget->setSizePolicy(sizePolicy);
00044   _tree_widget->setMinimumSize(QSize(0, 0));
00045   _tree_widget->setSizeIncrement(QSize(0, 0));
00046   _tree_widget->header()->setCascadingSectionResizes(true);
00047   gridLayout1->addWidget(_tree_widget,0,0,1,1);
00048   //
00049   QPixmap pixmap;
00050   SUIT_ResourceMgr* mgr=_app->resourceMgr();
00051   pixmap=mgr->loadPixmap("MED","med_field.png");
00052   _fields=new QTreeWidgetItem((QTreeWidget*)0,QStringList(QString("Fields")));
00053   _fields->setIcon(0,QIcon(pixmap));
00054   _tree_widget->addTopLevelItem(_fields);
00055   pixmap=mgr->loadPixmap("MED","med_mesh.png");
00056   _meshes=new QTreeWidgetItem((QTreeWidget*)0,QStringList(QString("Meshes")));
00057   _meshes->setIcon(0,QIcon(pixmap));
00058   _tree_widget->addTopLevelItem(_meshes);
00059 }
00060 
00061 void MEDGUIDataBaseDockWidget::appendFieldLT(const std::vector<ParaMEDMEM::MEDCalculatorBrowserLiteStruct>& lts)
00062 {
00063 }