OpendTect-6_4  6.4
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  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include <QToolBar>
16 #include "uitoolbar.h"
17 
18 
20 
24 QT_BEGIN_NAMESPACE
25 
26 class i_ToolBarMessenger : public QObject
27 {
28  Q_OBJECT
29  friend class uiToolBar;
30 
31 protected:
32 i_ToolBarMessenger( QToolBar* sndr, uiToolBar* receiver )
33  : sender_(sndr)
34  , receiver_(receiver)
35 {
36  connect( sndr, SIGNAL(actionTriggered(QAction*)),
37  this, SLOT(actionTriggered(QAction*)) );
38  connect( sndr, SIGNAL(orientationChanged(Qt::Orientation)),
39  this, SLOT(orientationChanged(Qt::Orientation)) );
40 }
41 
42 private:
44  QToolBar* sender_;
45 
46 private slots:
47 
48 void actionTriggered( QAction* qaction )
49 {
50  const int butid = receiver_->getID( qaction );
51  receiver_->buttonClicked.trigger( butid, *receiver_ );
52 }
53 
55 { receiver_->orientationChanged.trigger( *receiver_ ); }
56 
57 };
58 
59 QT_END_NAMESPACE
60 
61 #endif
Definition: uitoolbar.h:31
void trigger(C c, T &t)
Definition: callback.h:399
QToolBar * sender_
Definition: i_qtoolbar.h:44
Helper class for uiToolBar to relay Qt&#39;s messages.
Definition: i_qtoolbar.h:26
void actionTriggered(QAction *qaction)
Definition: i_qtoolbar.h:48
Notifier< uiToolBar > orientationChanged
Definition: uitoolbar.h:110
i_ToolBarMessenger(QToolBar *sndr, uiToolBar *receiver)
Definition: i_qtoolbar.h:32
int getID(const uiAction *) const
void trigger(T &t)
Definition: callback.h:258
CNotifier< uiToolBar, int > buttonClicked
Definition: uitoolbar.h:109
uiToolBar * receiver_
Definition: i_qtoolbar.h:43
void orientationChanged(Qt::Orientation)
Definition: i_qtoolbar.h:54
Orientation
Fundamental orientation in 2D UIs.
Definition: oduicommon.h:23

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