OpendTect-6_4  6.4
i_qslider.h
Go to the documentation of this file.
1 #ifndef i_qslider_h
2 #define i_qslider_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Lammertink
9  Date: 01/02/2001
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uislider.h"
16 
17 #include <QObject>
18 #include <QSlider>
19 
21 
25 QT_BEGIN_NAMESPACE
26 
27 class QString;
28 
29 class i_SliderMessenger : public QObject
30 {
31  Q_OBJECT
32  friend class uiSliderBody;
33 
34 protected:
35 
36 i_SliderMessenger( QSlider* sndr, uiSlider* receiver )
37  : sender_(sndr)
38  , receiver_(receiver)
39 {
40  connect( sndr, SIGNAL(sliderMoved(int)), this, SLOT(sliderMoved(int)) );
41  connect( sndr, SIGNAL(sliderPressed()), this, SLOT(sliderPressed()) );
42  connect( sndr, SIGNAL(sliderReleased()), this, SLOT(sliderReleased()) );
43  connect( sndr, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int)) );
44 }
45 
46 
47 private:
48 
50  QSlider* sender_;
51 
52 #define mTrigger( notifier ) \
53  const int refnr = receiver_->slider()->beginCmdRecEvent( #notifier ); \
54  receiver_->notifier.trigger(*receiver_); \
55  receiver_->slider()->endCmdRecEvent( refnr, #notifier );
56 
57 private slots:
58 
63 
64 #undef mTrigger
65 
66 };
67 
68 QT_END_NAMESPACE
69 
70 #endif
Definition: uislider.h:42
#define mTrigger(notifier)
Definition: i_qslider.h:52
void valueChanged(int)
Definition: i_qslider.h:62
uiSlider * receiver_
Definition: i_qslider.h:49
QSlider * sender_
Definition: i_qslider.h:50
i_SliderMessenger(QSlider *sndr, uiSlider *receiver)
Definition: i_qslider.h:36
friend class uiSliderBody
Definition: i_qslider.h:32
void sliderReleased()
Definition: i_qslider.h:61
void sliderPressed()
Definition: i_qslider.h:60
Definition: i_qslider.h:29
void sliderMoved(int)
Definition: i_qslider.h:59

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019