1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| #ifndef LAUNCHER_H
#define LAUNCHER_H
#include <QObject>
class Launcher : public QObject
{
Q_OBJECT
public:
Launcher(QObject *parent = 0);
void load();
private:
typedef void (Launcher::*fptr)();
typedef struct {
fptr f;
QString name;
} function_t;
void loadFunction1();
void loadFunction2();
void loadFunction3();
std::vector<function_t> array = {
function_t{Launcher::loadFunction1, "Load function 1"},
function_t{Launcher::loadFunction2, "Load function 2"},
function_t{Launcher::loadFunction3, "Load function 3"}
};
};
#endif // LAUNCHER_H |