Computer Assited Medical Intervention Tool Kit
version 4.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
sdk
libraries
core
utils
SliderSpinBoxWidget.h
Go to the documentation of this file.
1
/*****************************************************************************
2
* $CAMITK_LICENCE_BEGIN$
3
*
4
* CamiTK - Computer Assisted Medical Intervention ToolKit
5
* (c) 2001-2016 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6
*
7
* Visit http://camitk.imag.fr for more information
8
*
9
* This file is part of CamiTK.
10
*
11
* CamiTK is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License version 3
13
* only, as published by the Free Software Foundation.
14
*
15
* CamiTK 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 version 3 for more details.
19
*
20
* You should have received a copy of the GNU Lesser General Public License
21
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22
*
23
* $CAMITK_LICENCE_END$
24
****************************************************************************/
25
26
#ifndef SLIDER_SPIN_BOX_WIDGET_H
27
#define SLIDER_SPIN_BOX_WIDGET_H
28
29
// -- QT stuff
30
#include <QSpinBox>
31
#include <QSlider>
32
33
34
namespace
camitk
{
42
class
SliderSpinBoxWidget
:
public
QWidget {
43
Q_OBJECT
44
45
public
:
47
SliderSpinBoxWidget
(QWidget *parent=0);
48
50
~SliderSpinBoxWidget
();
51
53
int
getValue
()
const
;
54
56
void
setValue
(
int
value);
57
59
void
setRange
(
int
min,
int
max);
60
62
void
addSingleStep
();
63
65
void
subSingleStep
();
66
68
void
addPageStep
();
69
71
void
subPageStep
();
72
74
QSpinBox *
getSpinBox
() {
75
return
spinBox
;
76
}
77
79
QSlider *
getSlider
() {
80
return
slider
;
81
}
82
83
84
signals:
88
void
valueChanged
(
int
);
89
90
protected
slots:
92
void
spinBoxValueChanged
(
int
);
93
95
void
sliderValueChanged
(
int
);
96
97
private
:
99
QSpinBox *
spinBox
;
100
102
QSlider *
slider
;
103
105
void
updateSpinBoxValue
(
int
);
106
108
void
updateSliderValue
(
int
);
109
110
};
111
112
}
113
114
#endif
camitk::SliderSpinBoxWidget
A utility class to have QSpinBox and QSlider synchronized.
Definition:
SliderSpinBoxWidget.h:42
camitk::SliderSpinBoxWidget::getValue
int getValue() const
get the current value
Definition:
SliderSpinBoxWidget.cpp:62
camitk::SliderSpinBoxWidget::addPageStep
void addPageStep()
add a larger number of natural steps to the value, for information exact number of added step is min(...
Definition:
SliderSpinBoxWidget.cpp:148
camitk::SliderSpinBoxWidget::subSingleStep
void subSingleStep()
substract 1 to the value
Definition:
SliderSpinBoxWidget.cpp:139
camitk::SliderSpinBoxWidget::spinBox
QSpinBox * spinBox
the QSpinBox instance
Definition:
SliderSpinBoxWidget.h:99
camitk
Definition:
Action.cpp:40
camitk::SliderSpinBoxWidget::updateSliderValue
void updateSliderValue(int)
update the slider value (block signals)
Definition:
SliderSpinBoxWidget.cpp:116
camitk::SliderSpinBoxWidget::slider
QSlider * slider
the QSlider instance
Definition:
SliderSpinBoxWidget.h:102
camitk::SliderSpinBoxWidget::setValue
void setValue(int value)
set the value (force)
Definition:
SliderSpinBoxWidget.cpp:67
camitk::SliderSpinBoxWidget::~SliderSpinBoxWidget
~SliderSpinBoxWidget()
destructor
Definition:
SliderSpinBoxWidget.cpp:58
camitk::SliderSpinBoxWidget::setRange
void setRange(int min, int max)
set the range
Definition:
SliderSpinBoxWidget.cpp:75
camitk::SliderSpinBoxWidget::updateSpinBoxValue
void updateSpinBoxValue(int)
update the spinBox value (block signals)
Definition:
SliderSpinBoxWidget.cpp:102
camitk::SliderSpinBoxWidget::SliderSpinBoxWidget
SliderSpinBoxWidget(QWidget *parent=0)
constructor (have to give the parent widget)
Definition:
SliderSpinBoxWidget.cpp:36
camitk::SliderSpinBoxWidget::sliderValueChanged
void sliderValueChanged(int)
any change in the slider value is connected to this slot (update the spinBox)
Definition:
SliderSpinBoxWidget.cpp:96
camitk::SliderSpinBoxWidget::valueChanged
void valueChanged(int)
if the user change the value either in the slider or the spinBox, this signal is emitted with the new...
camitk::SliderSpinBoxWidget::addSingleStep
void addSingleStep()
add 1 to the value
Definition:
SliderSpinBoxWidget.cpp:131
camitk::SliderSpinBoxWidget::spinBoxValueChanged
void spinBoxValueChanged(int)
any change in the spinBox value is connected to this slot (update the slider)
Definition:
SliderSpinBoxWidget.cpp:90
camitk::SliderSpinBoxWidget::getSlider
QSlider * getSlider()
the QSlider instance
Definition:
SliderSpinBoxWidget.h:79
camitk::SliderSpinBoxWidget::getSpinBox
QSpinBox * getSpinBox()
the QSpinBox instance
Definition:
SliderSpinBoxWidget.h:74
camitk::SliderSpinBoxWidget::subPageStep
void subPageStep()
substract a larger number of natural steps to the value, for information exact number of added step i...
Definition:
SliderSpinBoxWidget.cpp:156
Generated by
1.8.11