src/gui.h

changeset 198
f246725199dc
parent 194
cfe9ae5f1124
child 199
10dd5909a50e
--- a/src/gui.h	Tue May 14 02:28:28 2013 +0300
+++ b/src/gui.h	Tue May 14 03:23:01 2013 +0300
@@ -20,17 +20,10 @@
 #define GUI_H
 
 #include <QMainWindow>
-#include <QMenu>
-#include <QToolBar>
 #include <QAction>
-#include <QToolBar>
-#include <QTextEdit>
-#include <qpushbutton.h>
-#include <qlistwidget.h>
-#include <qlabel.h>
-#include <qboxlayout.h>
-#include "gldraw.h"
+#include <QListWidget>
 #include "config.h"
+#include "ldtypes.h"
 
 class QComboBox;
 class ForgeWindow;
@@ -39,6 +32,7 @@
 class DelHistory;
 class QToolButton;
 class QDialogButtonBox;
+class GLRenderer;
 
 // Stuff for dialogs
 #define IMPLEMENT_DIALOG_BUTTONS \
@@ -187,53 +181,6 @@
 	void slot_lastSecondCleanup ();
 };
 
-// =============================================================================
-// LabeledWidget
-//
-// Convenience class for a widget with a label beside it.
-// =============================================================================
-template<class R> class LabeledWidget : public QWidget {
-public:
-	explicit LabeledWidget (const char* labelstr, QWidget* parent = null) : QWidget (parent) {
-		m_widget = new R (this);
-		commonInit (labelstr);
-	}
-	
-	explicit LabeledWidget (const char* labelstr, R* widget, QWidget* parent = null) :
-		QWidget (parent), m_widget (widget)
-	{
-		commonInit (labelstr);
-	}
-	
-	explicit LabeledWidget (QWidget* parent = 0, Qt::WindowFlags f = 0) {
-		m_widget = new R (this);
-		commonInit ("");
-	}
-	
-	R* widget () const { return m_widget; }
-	R* w () const { return m_widget; }
-	QLabel* label () const { return m_label; }
-	QLabel* l () const { return m_label; }
-	void setWidget (R* widget) { m_widget = widget; }
-	void setLabel (QLabel* label) { m_label = label; }
-	operator R* () { return m_widget; }
-	
-private:
-	Q_DISABLE_COPY (LabeledWidget<R>)
-	
-	void commonInit (const char* labelstr) {
-		m_label = new QLabel (labelstr, this);
-		m_layout = new QHBoxLayout;
-		m_layout->addWidget (m_label);
-		m_layout->addWidget (m_widget);
-		setLayout (m_layout);
-	}
-	
-	R* m_widget;
-	QLabel* m_label;
-	QHBoxLayout* m_layout;
-};
-
 // -----------------------------------------------------------------------------
 // Other GUI-related stuff not directly part of ForgeWindow:
 QPixmap getIcon (const char* sIconName);

mercurial