OpendTect  6.3
i_qtoolbar.h
Go to the documentation of this file.
1 #ifndef i_qtoolbar_h
2 #define i_qtoolbar_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Nanne Hemstra
9  Date: January 2010
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include <QToolBar>
15 #include "uitoolbar.h"
16 
17 
19 
23 QT_BEGIN_NAMESPACE
24 
25 class i_ToolBarMessenger : public QObject
26 {
27  Q_OBJECT
28  friend class uiToolBar;
29 
30 protected:
31 i_ToolBarMessenger( QToolBar* sndr, uiToolBar* receiver )
32  : sender_(sndr)
33  , receiver_(receiver)
34 {
35  connect( sndr, SIGNAL(actionTriggered(QAction*)),
36  this, SLOT(actionTriggered(QAction*)) );
37  connect( sndr, SIGNAL(orientationChanged(Qt::Orientation)),
38  this, SLOT(orientationChanged(Qt::Orientation)) );
39 }
40 
41 private:
43  QToolBar* sender_;
44 
45 private slots:
46 
47 void actionTriggered( QAction* qaction )
48 {
49  const int butid = receiver_->getID( qaction );
50  receiver_->buttonClicked.trigger( butid, *receiver_ );
51 }
52 
54 { receiver_->orientationChanged.trigger( *receiver_ ); }
55 
56 };
57 
58 QT_END_NAMESPACE
59 
60 #endif
Definition: uitoolbar.h:30
QToolBar * sender_
Definition: i_qtoolbar.h:43
Helper class for uiToolBar to relay Qt&#39;s messages.
Definition: i_qtoolbar.h:25
void actionTriggered(QAction *qaction)
Definition: i_qtoolbar.h:47
void trigger()
Definition: notify.h:128
void trigger(PayLoad pl)
Definition: notify.h:171
Notifier< uiToolBar > orientationChanged
Definition: uitoolbar.h:109
i_ToolBarMessenger(QToolBar *sndr, uiToolBar *receiver)
Definition: i_qtoolbar.h:31
int getID(const uiAction *) const
CNotifier< uiToolBar, int > buttonClicked
Definition: uitoolbar.h:108
uiToolBar * receiver_
Definition: i_qtoolbar.h:42
void orientationChanged(Qt::Orientation)
Definition: i_qtoolbar.h:53
Orientation
Fundamental orientation in 2D UIs.
Definition: oduicommon.h:21

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