1 /********* 2 * 3 * In the name of the Father, and of the Son, and of the Holy Spirit. 4 * 5 * This file is part of BibleTime's source code, http://www.bibletime.info/. 6 * 7 * Copyright 1999-2016 by the BibleTime developers. 8 * The BibleTime source code is licensed under the GNU General Public License version 2.0. 9 * 10 **********/ 11 12 #ifndef BTSIGNAL_H 13 #define BTSIGNAL_H 14 15 #include <QObject> 16 17 18 /** 19 * BtSignal 20 * The purpose of this class is to emit Qt signals for other classes 21 * that are not derived from QObject. It can be used as a member 22 * variable of those classes. 23 * 24 * There are some classes it is not possible to derive from QObject and 25 * have the signals work. Certain multiple inheritance classes which cannot 26 * have QObject as the first derived class, cannot use Qt signals. 27 */ 28 class BtSignal: public QObject { 29 30 Q_OBJECT 31 32 public: 33 34 inline BtSignal(QObject *parent = nullptr) QObject(parent)35 : QObject(parent) {} 36 37 /** 38 Immediately emits the beforeChanged() signal. 39 */ emitSignal()40 inline void emitSignal() { emit signal(); } 41 42 signals: 43 44 void signal(); 45 46 }; 47 #endif 48