Created
May 26, 2023 10:31
-
-
Save FMeinicke/30808ac9622724e4cf369ea3f1fc8a77 to your computer and use it in GitHub Desktop.
QObjectWrapper - a quick way to wrap any class and make it inherit from `QObject`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template<typename T> | |
| class QObjectWrapper : public T, public QObject | |
| { | |
| Q_OBJECT | |
| public: | |
| explicit QObjectWrapper(QObject* parent = nullptr) : T{}, QObject{parent} {} | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment