summaryrefslogtreecommitdiff
path: root/src/util/btsignal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/btsignal.h')
-rw-r--r--src/util/btsignal.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/util/btsignal.h b/src/util/btsignal.h
new file mode 100644
index 0000000..ff4afa1
--- /dev/null
+++ b/src/util/btsignal.h
@@ -0,0 +1,40 @@
+/*********
+*
+* This file is part of BibleTime's source code, http://www.bibletime.info/.
+*
+* Copyright 1999-2011 by the BibleTime developers.
+* The BibleTime source code is licensed under the GNU General Public License version 2.0.
+*
+**********/
+
+#ifndef BTSIGNAL_H
+#define BTSIGNAL_H
+
+#include <QObject>
+
+
+/**
+* BtSignal
+* The purpose of this class is to emit Qt signals for other classes
+* that are not derived from QObject. It can be used as a member
+* variable of those classes.
+*
+* There are some classes it is not possible to derive from QObject and
+* have the signals work. Certain multiple inheritance classes which cannot
+* have QObject as the first derived class, cannot use Qt signals.
+*/
+class BtSignal : public QObject {
+ Q_OBJECT
+
+ public:
+ inline BtSignal(QObject *parent = 0) : QObject(parent) {};
+
+ /**
+ Immediately emits the changed() signal.
+ */
+ inline void emitChanged() { emit changed(); }
+
+ signals:
+ void changed();
+};
+#endif