OpendTect-6_4  6.4
i_qsystemtrayicon.h
Go to the documentation of this file.
1 #ifndef i_qsystemtrayicon_h
2 #define i_qsystemtrayicon_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 
16 #include "uisystemtrayicon.h"
17 
18 #include <QSystemTrayIcon>
19 
21 
25 QT_BEGIN_NAMESPACE
26 
27 class QSystemTrayIconMessenger : public QObject
28 {
29 Q_OBJECT
30 friend class uiSystemTrayIcon;
31 
32 protected:
33 
34 QSystemTrayIconMessenger( QSystemTrayIcon* sndr, uiSystemTrayIcon* receiver )
35  : sender_(sndr)
36  , receiver_(receiver)
37 {
38  connect( sndr, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
39  this, SLOT(activated(QSystemTrayIcon::ActivationReason)) );
40  connect( sndr, SIGNAL(messageClicked()), this, SLOT(messageClicked()) );
41 }
42 
43 
44 private:
45 
47  QSystemTrayIcon* sender_;
48 
49 
50 private slots:
51 
53 { receiver_->messageClicked.trigger( *receiver_ ); }
54 
55 void activated( QSystemTrayIcon::ActivationReason reason )
56 {
57  if ( reason == QSystemTrayIcon::Context )
58  receiver_->rightClicked.trigger( *receiver_ );
59  else if ( reason == QSystemTrayIcon::DoubleClick )
60  receiver_->doubleClicked.trigger( *receiver_ );
61  else if ( reason == QSystemTrayIcon::Trigger )
62  receiver_->clicked.trigger( *receiver_ );
63  else if ( reason == QSystemTrayIcon::MiddleClick )
64  receiver_->middleClicked.trigger( *receiver_ );
65 }
66 
67 };
68 
69 QT_END_NAMESPACE
70 
71 #endif
QSystemTrayIcon * sender_
Definition: i_qsystemtrayicon.h:47
QSystemTrayIconMessenger(QSystemTrayIcon *sndr, uiSystemTrayIcon *receiver)
Definition: i_qsystemtrayicon.h:34
void activated(QSystemTrayIcon::ActivationReason reason)
Definition: i_qsystemtrayicon.h:55
Notifier< uiSystemTrayIcon > clicked
Definition: uisystemtrayicon.h:39
Notifier< uiSystemTrayIcon > doubleClicked
Definition: uisystemtrayicon.h:42
void messageClicked()
Definition: i_qsystemtrayicon.h:52
void trigger(T &t)
Definition: callback.h:258
Definition: uisystemtrayicon.h:25
Helper class for uiSystemTrayIcon to relay Qt&#39;s messages.
Definition: i_qsystemtrayicon.h:27
Notifier< uiSystemTrayIcon > middleClicked
Definition: uisystemtrayicon.h:41
Notifier< uiSystemTrayIcon > messageClicked
Definition: uisystemtrayicon.h:38
Notifier< uiSystemTrayIcon > rightClicked
Definition: uisystemtrayicon.h:40
uiSystemTrayIcon * receiver_
Definition: i_qsystemtrayicon.h:46

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