ui/qt/toolkit.h

changeset 536
4a1c2eae4bcd
parent 535
ede57f5b6178
equal deleted inserted replaced
535:ede57f5b6178 536:4a1c2eae4bcd
47 void *userdata; 47 void *userdata;
48 48
49 public: 49 public:
50 UiVar *var; 50 UiVar *var;
51 51
52 void *customdata1 = NULL; 52 void *customdata1 = nullptr;
53 void *customdata2 = NULL; 53 void *customdata2 = nullptr;
54 int customvalue1 = 0; 54 int customvalue1 = 0;
55 int customvalue2 = 0; 55 int customvalue2 = 0;
56 56
57 ui_prepare_event_func prepare_event = NULL; 57 ui_prepare_event_func prepare_event = nullptr;
58 58
59 UiEventWrapper(UiObject *obj, ui_callback f, void *userdata); 59 UiEventWrapper(UiObject *obj, ui_callback f, void *userdata);
60 60
61 public slots: 61 public slots:
62 void slot(); 62 void slot();
63 void destroy(); 63 void destroy();
64 }; 64 };
65
66 class UiAction;
67
68 typedef void (*ui_prepare_action_event_func)(UiEvent *event, UiAction *action);
65 69
66 class UiAction : public QAction { 70 class UiAction : public QAction {
67 Q_OBJECT 71 Q_OBJECT
68 72
69 UiObject *obj; 73 UiObject *obj;
71 void *userdata; 75 void *userdata;
72 76
73 public: 77 public:
74 UiVar *var; 78 UiVar *var;
75 79
80 ui_prepare_action_event_func prepare_event = nullptr;
81 void *customdata1 = nullptr;
82 void *customdata2 = nullptr;
83 int customvalue1 = 0;
84 int customvalue2 = 0;
85
76 UiAction(UiObject *obj, QString &label, ui_callback f, void *userdata); 86 UiAction(UiObject *obj, QString &label, ui_callback f, void *userdata);
77 ~UiAction(); 87 ~UiAction();
78 88
79 private slots: 89 private slots:
80 void trigger(); 90 void trigger();
81 }; 91 };
82 92
93 void ui_action_enable(UiAction *action, int enable);
83 94
84 #endif /* TOOLKIT_H */ 95 #endif /* TOOLKIT_H */
85 96

mercurial