OpenWalnut  1.5.0dev
WQtIntervalEdit.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #include "../WGuiConsts.h"
26 
27 #include "WQtIntervalEdit.h"
28 
30 
32  QWidget( parent ),
33  m_minSlider( Qt::Horizontal, this ),
34  m_maxSlider( Qt::Horizontal, this ),
35  m_minEdit( this ),
36  m_maxEdit( this ),
37  m_minLabel( "Minimum:", this ),
38  m_maxLabel( "Maximum:", this ),
39  m_layout( this )
40 {
41  // initialize members
42  m_layout.setMargin( WGLOBAL_MARGIN );
43  m_layout.setSpacing( WGLOBAL_SPACING );
44 
45  m_layout.addWidget( &m_minLabel, 0, 0 );
46  m_layout.addWidget( &m_minSlider, 0, 1 );
47  m_layout.addWidget( &m_minEdit, 0, 2 );
48  m_layout.addWidget( &m_maxLabel, 1, 0 );
49  m_layout.addWidget( &m_maxSlider, 1, 1 );
50  m_layout.addWidget( &m_maxEdit, 1, 2 );
51 
52  m_minSlider.setMinimum( 0 );
53  m_minSlider.setMaximum( SliderResolution );
54  m_maxSlider.setMinimum( 0 );
55  m_maxSlider.setMaximum( SliderResolution );
56 
57  m_minSlider.setValue( 0 );
58  m_maxSlider.setValue( SliderResolution );
59 
60  setLayout( &m_layout );
61 
62  connect( &m_minSlider, SIGNAL( valueChanged( int ) ), this, SLOT( minSliderChanged() ) );
63  connect( &m_maxSlider, SIGNAL( valueChanged( int ) ), this, SLOT( maxSliderChanged() ) );
64  connect( &m_minEdit, SIGNAL( editingFinished() ), this, SLOT( minEditChanged() ) );
65  connect( &m_maxEdit, SIGNAL( editingFinished() ), this, SLOT( maxEditChanged() ) );
66 }
67 
69 {
70  // cleanup
71 }
72 
74 {
75 }
76 
78 {
79 }
80 
82 {
83 }
84 
86 {
87 }
88 
QLineEdit m_maxEdit
The maximum edit.
virtual void maxEditChanged()
Slot called when the maximum edit changes.
QGridLayout m_layout
The layout containing min and max layout.
QLabel m_maxLabel
A label for the maximum.
static int SliderResolution
Resolution of the sliders.
virtual ~WQtIntervalEditBase()
Destructor.
virtual void minSliderChanged()
Slot called when the minimum slider changes.
WQtIntervalEditBase(QWidget *parent)
Default constructor.
virtual void maxSliderChanged()
Slot called when the maximum slider changes.
QSlider m_maxSlider
The slider for the maximumum.
QSlider m_minSlider
The slider for the minimum.
virtual void minEditChanged()
Slot called when the minimum edit changes.
QLineEdit m_minEdit
The minimum edit.
QLabel m_minLabel
A label for the minimum.