Sat, 24 Aug 2013 16:30:30 +0300
removed unused LabeledWidget
src/extprogs.cpp | file | annotate | diff | comparison | revisions | |
src/labeledwidget.h | file | annotate | diff | comparison | revisions | |
src/ldconfig.cpp | file | annotate | diff | comparison | revisions |
--- a/src/extprogs.cpp Sat Aug 24 16:17:48 2013 +0300 +++ b/src/extprogs.cpp Sat Aug 24 16:30:30 2013 +0300 @@ -31,7 +31,6 @@ #include "file.h" #include "widgets.h" #include "history.h" -#include "labeledwidget.h" #include "ui_ytruder.h" #include "ui_intersector.h" #include "ui_rectifier.h" @@ -393,12 +392,6 @@ insertOutput (outDATName, true, {}); } -LabeledWidget<QComboBox>* buildColorSelector (const char* label) { - LabeledWidget<QComboBox>* widget = new LabeledWidget<QComboBox> (label, new QComboBox); - makeColorSelector (widget->w()); - return widget; -} - // ============================================================================= // Intersector interface // -----------------------------------------------------------------------------
--- a/src/labeledwidget.h Sat Aug 24 16:17:48 2013 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * LDForge: LDraw parts authoring CAD - * Copyright (C) 2013 Santeri Piippo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef LABELEDWIDGET_H -#define LABELEDWIDGET_H - -#include "common.h" -#include <QLabel> -#include <QBoxLayout> - -// ============================================================================= -// LabeledWidget -// -// Convenience class for a widget with a label beside it. -// ============================================================================= -template<class R> class LabeledWidget : public QWidget { - PROPERTY (QLabel*, label, setLabel) - PROPERTY (R*, widget, setWidget) - -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* w() const { return m_widget; } - 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); - } - - QHBoxLayout* m_layout; -}; - -#endif // LABELEDWIDGET_H \ No newline at end of file