1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "HYDROGUI_ZLevelsDlg.h"
24 #include "HYDROGUI_ListModel.h"
29 #include <QPushButton>
32 HYDROGUI_ZLevelsDlg::HYDROGUI_ZLevelsDlg( QWidget* theParent )
33 : QDialog( theParent )
35 QVBoxLayout* aMainLayout = new QVBoxLayout( this );
36 aMainLayout->setMargin( 5 );
38 QHBoxLayout* aListLayout = new QHBoxLayout();
40 myList = new QListView( this );
41 myList->setModel( new HYDROGUI_ListModel );
43 myTop = new QPushButton( tr("TOP") );
44 myUp = new QPushButton( tr("UP") );
45 myDown = new QPushButton( tr("DOWN") );
46 myBottom = new QPushButton( tr("BOTTOM") );
47 QVBoxLayout* aListButtonsLayout = new QVBoxLayout();
48 aListButtonsLayout->addWidget( myTop );
49 aListButtonsLayout->addWidget( myUp );
50 aListButtonsLayout->addWidget( myDown );
51 aListButtonsLayout->addWidget( myBottom );
52 aListButtonsLayout->addStretch();
53 aListLayout->addWidget( myList );
54 aListLayout->addLayout( aListButtonsLayout );
55 aMainLayout->addLayout( aListLayout );
57 myAllObjects = new QCheckBox( tr( "ALL_OBJECTS" ) );
58 aMainLayout->addWidget( myAllObjects );
60 QHBoxLayout* aDlgButtonsLayout = new QHBoxLayout();
61 myApply = new QPushButton( tr("APPLY") );
62 myClose = new QPushButton( tr("CLOSE") );
63 aDlgButtonsLayout->addWidget( myApply );
64 aDlgButtonsLayout->addWidget( myClose );
65 aDlgButtonsLayout->addStretch();
66 aMainLayout->addLayout( aDlgButtonsLayout );
69 HYDROGUI_ZLevelsDlg::~HYDROGUI_ZLevelsDlg()
73 void HYDROGUI_ZLevelsDlg::setObjects( const QList<QString>& theObjects )
75 HYDROGUI_ListModel* aModel = dynamic_cast<HYDROGUI_ListModel*>( myList->model() );
76 aModel->setObjects( theObjects );