OpendTect  6.6
i_qtabbar.h
Go to the documentation of this file.
1 #ifndef i_qtabbar_h
2 #define i_qtabbar_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: 14/02/2003
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uitabbar.h"
16 
17 #include <QTabBar>
18 
19 
21 // uiAction.
26 QT_BEGIN_NAMESPACE
27 
28 class i_tabbarMessenger : public QObject
29 {
30  Q_OBJECT
31  friend class uiTabBarBody;
32 
33 protected:
34 i_tabbarMessenger( QTabBar* sndr, uiTabBar* receiver )
35  : sender_(sndr)
36  , receiver_(receiver)
37 {
38  connect( sndr, SIGNAL(currentChanged(int)), this, SLOT(selected(int)) );
39  connect( sndr, SIGNAL(tabCloseRequested(int)),
40  this, SLOT(tabToBeClosed(int)) );
41 }
42 
43 private:
44 
46  QTabBar* sender_;
47 
48 private slots:
49 
50  void selected ( int id )
51  {
52  const int refnr = receiver_->beginCmdRecEvent();
54  receiver_->endCmdRecEvent( refnr );
55  }
56 
57  void tabToBeClosed( int tabidx )
58  {
59  const int refnr = receiver_->beginCmdRecEvent();
61  *receiver_);
62  receiver_->endCmdRecEvent( refnr );
63  }
64 
65 };
66 
67 QT_END_NAMESPACE
68 
69 #endif
Notifier::trigger
void trigger()
Definition: notify.h:132
i_tabbarMessenger::i_tabbarMessenger
i_tabbarMessenger(QTabBar *sndr, uiTabBar *receiver)
Definition: i_qtabbar.h:34
i_tabbarMessenger::tabToBeClosed
void tabToBeClosed(int tabidx)
Definition: i_qtabbar.h:57
uitabbar.h
i_tabbarMessenger::receiver_
uiTabBar * receiver_
Definition: i_qtabbar.h:45
i_tabbarMessenger::selected
void selected(int id)
Definition: i_qtabbar.h:50
uiTabBar::selected
Notifier< uiTabBar > selected
Definition: uitabbar.h:53
CNotifier::trigger
void trigger(PayLoad pl)
Definition: notify.h:175
i_tabbarMessenger
Helper class for uitabbar to relay Qt's 'currentChanged' messages to.
Definition: i_qtabbar.h:29
uiTabBar
TabBar widget only. Normally you'd want to use the uiTabStack class.
Definition: uitabbar.h:25
uiTabBar::tabToBeClosed
CNotifier< uiTabBar, int > tabToBeClosed
Definition: uitabbar.h:54
i_tabbarMessenger::uiTabBarBody
friend class uiTabBarBody
Definition: i_qtabbar.h:31
i_tabbarMessenger::sender_
QTabBar * sender_
Definition: i_qtabbar.h:46

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