181 void slot_recentFile (); |
183 void slot_recentFile (); |
182 void slot_quickColor (); |
184 void slot_quickColor (); |
183 void slot_lastSecondCleanup (); |
185 void slot_lastSecondCleanup (); |
184 }; |
186 }; |
185 |
187 |
|
188 // ============================================================================= |
|
189 // LabeledWidget |
|
190 // |
|
191 // Convenience class for a widget with a label beside it. |
|
192 // ============================================================================= |
|
193 template<class R> class LabeledWidget : public QWidget { |
|
194 public: |
|
195 LabeledWidget (const char* labelstr, QWidget* parent) : QWidget (parent) { |
|
196 m_widget = new R (this); |
|
197 m_label = new QLabel (labelstr, this); |
|
198 |
|
199 m_layout = new QHBoxLayout; |
|
200 m_layout->addWidget (m_label); |
|
201 m_layout->addWidget (m_widget); |
|
202 setLayout (m_layout); |
|
203 } |
|
204 |
|
205 R* widget () const { return m_widget; } |
|
206 R* w () const { return m_widget; } |
|
207 QLabel* label () const { return m_label; } |
|
208 QLabel* l () const { return m_label; } |
|
209 void setWidget (R* widget) { m_widget = widget; } |
|
210 void setLabel (QLabel* label) { m_label = label; } |
|
211 operator R* () { return m_widget; } |
|
212 |
|
213 private: |
|
214 R* m_widget; |
|
215 QLabel* m_label; |
|
216 QHBoxLayout* m_layout; |
|
217 }; |
|
218 |
186 // ----------------------------------------------------------------------------- |
219 // ----------------------------------------------------------------------------- |
187 // Other GUI-related stuff not directly part of ForgeWindow: |
220 // Other GUI-related stuff not directly part of ForgeWindow: |
188 QPixmap getIcon (const char* sIconName); |
221 QPixmap getIcon (const char* sIconName); |
189 std::vector<quickColorMetaEntry> parseQuickColorMeta (); |
222 std::vector<quickColorMetaEntry> parseQuickColorMeta (); |
190 bool confirm (str title, str msg); |
223 bool confirm (str title, str msg); |