Guest User

klasy

a guest
Nov 16th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef EVERYTHING_H
  2. #define EVERYTHING_H
  3.  
  4. #include <QString>
  5. #include <QObject>
  6.  
  7. enum class AE
  8. {
  9.     A1,
  10.     A2
  11. };
  12.  
  13. struct Base
  14. {
  15. public:
  16.     const QString name;
  17.     explicit Base(const QString& n)
  18.         : name { n } {}
  19. };
  20.  
  21. template<typename T>
  22. struct Templ : public Base
  23. {
  24. public:
  25.     explicit Templ(const QString& n)
  26.         : Base(n) {}
  27. };
  28.  
  29. class A : public QObject, public Templ<AE>
  30. {
  31.     Q_OBJECT
  32.  
  33. public:
  34.     explicit A(QObject *parent = nullptr)
  35.         : QObject(parent),
  36.           Templ<AE>("a") {}
  37. };
  38.  
  39. #endif // EVERYTHING_H
Advertisement
Add Comment
Please, Sign In to add comment