Computer Assited Medical Intervention Tool Kit
version 3.3
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
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-2014 UJF-Grenoble 1, 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
35
{
43
class
SliderSpinBoxWidget
:
public
QWidget {
44
Q_OBJECT
45
46
public
:
48
SliderSpinBoxWidget
(QWidget *parent=0);
49
51
~SliderSpinBoxWidget
();
52
54
int
getValue
()
const
;
55
57
void
setValue
(
int
value);
58
60
void
setRange
(
int
min,
int
max);
61
63
void
addSingleStep
();
64
66
void
subSingleStep
();
67
69
void
addPageStep
();
70
72
void
subPageStep
();
73
75
QSpinBox *
getSpinBox
() {
return
spinBox
; }
76
78
QSlider *
getSlider
() {
return
slider
; }
79
80
81
signals:
85
void
valueChanged
(
int
);
86
87
protected
slots:
89
void
spinBoxValueChanged
(
int
);
90
92
void
sliderValueChanged
(
int
);
93
94
private
:
96
QSpinBox *
spinBox
;
97
99
QSlider *
slider
;
100
102
void
updateSpinBoxValue
(
int
);
103
105
void
updateSliderValue
(
int
);
106
107
};
108
109
}
110
111
#endif
camitk::SliderSpinBoxWidget
A utility class to have QSpinBox and QSlider synchronized.
Definition:
SliderSpinBoxWidget.h:43
camitk::SliderSpinBoxWidget::getValue
int getValue() const
get the current value
camitk::SliderSpinBoxWidget::addPageStep
void addPageStep()
add a larger number of natural steps to the value, for information exact number of added step is min(...
camitk::SliderSpinBoxWidget::subSingleStep
void subSingleStep()
substract 1 to the value
camitk::SliderSpinBoxWidget::spinBox
QSpinBox * spinBox
the QSpinBox instance
Definition:
SliderSpinBoxWidget.h:96
camitk
Definition:
Action.h:40
camitk::SliderSpinBoxWidget::updateSliderValue
void updateSliderValue(int)
update the slider value (block signals)
camitk::SliderSpinBoxWidget::slider
QSlider * slider
the QSlider instance
Definition:
SliderSpinBoxWidget.h:99
camitk::SliderSpinBoxWidget::setValue
void setValue(int value)
set the value (force)
camitk::SliderSpinBoxWidget::~SliderSpinBoxWidget
~SliderSpinBoxWidget()
destructor
camitk::SliderSpinBoxWidget::setRange
void setRange(int min, int max)
set the range
camitk::SliderSpinBoxWidget::updateSpinBoxValue
void updateSpinBoxValue(int)
update the spinBox value (block signals)
camitk::SliderSpinBoxWidget::SliderSpinBoxWidget
SliderSpinBoxWidget(QWidget *parent=0)
constructor (have to give the parent widget)
camitk::SliderSpinBoxWidget::sliderValueChanged
void sliderValueChanged(int)
any change in the slider value is connected to this slot (update the spinBox)
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
camitk::SliderSpinBoxWidget::spinBoxValueChanged
void spinBoxValueChanged(int)
any change in the spinBox value is connected to this slot (update the slider)
camitk::SliderSpinBoxWidget::getSlider
QSlider * getSlider()
the QSlider instance
Definition:
SliderSpinBoxWidget.h:78
camitk::SliderSpinBoxWidget::getSpinBox
QSpinBox * getSpinBox()
the QSpinBox instance
Definition:
SliderSpinBoxWidget.h:75
camitk::SliderSpinBoxWidget::subPageStep
void subPageStep()
substract a larger number of natural steps to the value, for information exact number of added step i...
Generated on Fri Oct 24 2014 11:07:04 for Computer Assited Medical Intervention Tool Kit by
1.8.8