Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
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-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
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// -- Core stuff
30#include "CamiTKAPI.h"
31
32// -- QT stuff
33#include <QSpinBox>
34#include <QSlider>
35
36
37namespace camitk {
45class CAMITK_API SliderSpinBoxWidget : public QWidget {
46 Q_OBJECT
47
48public:
50 SliderSpinBoxWidget(QWidget* parent = nullptr);
51
53 ~SliderSpinBoxWidget() override = default;
54
56 int getValue() const;
57
59 void setValue(int value);
60
62 void setRange(int min, int max);
63
65 void addSingleStep();
66
68 void subSingleStep();
69
71 void addPageStep();
72
74 void subPageStep();
75
77 QSpinBox* getSpinBox() {
78 return spinBox;
79 }
80
82 QSlider* getSlider() {
83 return slider;
84 }
85
86
87signals:
91 void valueChanged(int);
92
93protected slots:
95 void spinBoxValueChanged(int);
96
98 void sliderValueChanged(int);
99
100private:
102 QSpinBox* spinBox;
103
105 QSlider* slider;
106
108 void updateSpinBoxValue(int);
109
111 void updateSliderValue(int);
112
113};
114
115}
116
117#endif
#define CAMITK_API
Definition CamiTKAPI.h:66
void subSingleStep()
subtract 1 to the value
Definition SliderSpinBoxWidget.cpp:146
void setValue(int value)
set the value (force)
Definition SliderSpinBoxWidget.cpp:67
void valueChanged(int)
if the user change the value either in the slider or the spinBox, this signal is emitted with the new...
void spinBoxValueChanged(int)
any change in the spinBox value is connected to this slot (update the slider)
Definition SliderSpinBoxWidget.cpp:91
~SliderSpinBoxWidget() override=default
destructor
QSlider * getSlider()
the QSlider instance
Definition SliderSpinBoxWidget.h:82
void sliderValueChanged(int)
any change in the slider value is connected to this slot (update the spinBox)
Definition SliderSpinBoxWidget.cpp:97
SliderSpinBoxWidget(QWidget *parent=nullptr)
constructor (have to give the parent widget)
Definition SliderSpinBoxWidget.cpp:36
void subPageStep()
subtract a larger number of natural steps to the value, for information exact number of added step is...
Definition SliderSpinBoxWidget.cpp:167
void addSingleStep()
add 1 to the value
Definition SliderSpinBoxWidget.cpp:136
QSpinBox * getSpinBox()
the QSpinBox instance
Definition SliderSpinBoxWidget.h:77
void addPageStep()
add a larger number of natural steps to the value, for information exact number of added step is min(...
Definition SliderSpinBoxWidget.cpp:157
void setRange(int min, int max)
set the range
Definition SliderSpinBoxWidget.cpp:75
Definition Action.cpp:40
static Value getValue(const QMap< const QtProperty *, PrivateData > &propertyMap, const QtProperty *property, const Value &defaultValue=Value())
Definition qtpropertymanager.cpp:222