OpendTect-6_4  6.4
i_qlineedit.h
Go to the documentation of this file.
1 #ifndef i_qlineedit_h
2 #define i_qlineedit_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: 25/05/2000
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uilineedit.h"
16 
17 #include <QLineEdit>
18 
19 QT_BEGIN_NAMESPACE
20 
21 class QString;
22 
24 
27 class i_lineEditMessenger : public QObject
28 {
29  Q_OBJECT
30  friend class uiLineEditBody;
31 
32 protected:
33 i_lineEditMessenger( QLineEdit* sndr, uiLineEdit* receiver )
34  : sender_( sndr )
35  , receiver_( receiver )
36 {
37  connect( sndr, SIGNAL(returnPressed()),
38  this, SLOT(returnPressed()) );
39  connect( sndr, SIGNAL(editingFinished()),
40  this, SLOT(editingFinished()) );
41  connect( sndr, SIGNAL(textChanged(const QString&)),
42  this, SLOT(textChanged(const QString&)) );
43  connect( sndr, SIGNAL(selectionChanged()),
44  this, SLOT(selectionChanged()) );
45 }
46 
47 private:
48 
50  QLineEdit* sender_;
51 
52 private slots:
53 
54 #define mTrigger( notifier ) \
55  const int refnr = receiver_->beginCmdRecEvent( #notifier ); \
56  receiver_->notifier.trigger(*receiver_); \
57  receiver_->endCmdRecEvent( refnr, #notifier );
58 
60  {
61  if ( !sender_->isModified() )
62  return;
63 
65  }
66 
68  { mTrigger( returnPressed ); }
69  void textChanged(const QString&)
70  { mTrigger( textChanged ); }
71 
73  { receiver_->selectionChanged.trigger(*receiver_); }
74 #undef mTrigger
75 };
76 
77 QT_END_NAMESPACE
78 
79 #endif
#define mTrigger(notifier)
Definition: i_qlineedit.h:54
void selectionChanged()
Definition: i_qlineedit.h:72
friend class uiLineEditBody
Definition: i_qlineedit.h:30
void editingFinished()
Definition: i_qlineedit.h:59
uiLineEdit * receiver_
Definition: i_qlineedit.h:49
Helper class for uilineedit to relay Qt&#39;s messages.
Definition: i_qlineedit.h:27
QLineEdit * sender_
Definition: i_qlineedit.h:50
void textChanged(const QString &)
Definition: i_qlineedit.h:69
void trigger(T &t)
Definition: callback.h:258
i_lineEditMessenger(QLineEdit *sndr, uiLineEdit *receiver)
Definition: i_qlineedit.h:33
Notifier< uiLineEdit > selectionChanged
Definition: uilineedit.h:101
void returnPressed()
Definition: i_qlineedit.h:67
Definition: uilineedit.h:51

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