From 1f4330ff6ed0672a231b630c47e969a180c399ce Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sun, 13 Sep 2015 15:49:41 -0400 Subject: [PATCH] Added skeletal MergePropertyEditor. --- glabels/CMakeLists.txt | 3 + glabels/MainWindow.cpp | 5 +- glabels/MainWindow.h | 14 ++-- glabels/MergePropertyEditor.cpp | 66 +++++++++++++++++ glabels/MergePropertyEditor.h | 71 +++++++++++++++++++ glabels/ui/MergePropertyEditor.ui | 114 ++++++++++++++++++++++++++++++ 6 files changed, 265 insertions(+), 8 deletions(-) create mode 100644 glabels/MergePropertyEditor.cpp create mode 100644 glabels/MergePropertyEditor.h create mode 100644 glabels/ui/MergePropertyEditor.ui diff --git a/glabels/CMakeLists.txt b/glabels/CMakeLists.txt index 05f6db1..cea1482 100644 --- a/glabels/CMakeLists.txt +++ b/glabels/CMakeLists.txt @@ -31,6 +31,7 @@ set (glabels_sources LabelRegion.cpp MainWindow.cpp MergeField.cpp + MergePropertyEditor.cpp MergeRecord.cpp NewLabelDialog.cpp ObjectEditor.cpp @@ -66,6 +67,7 @@ set (glabels_qobject_headers LabelModelBoxObject.h LabelModelShapeObject.h MainWindow.h + MergePropertyEditor.h NewLabelDialog.h ObjectEditor.h PrintView.h @@ -78,6 +80,7 @@ set (glabels_qobject_headers set (glabels_forms ui/NewLabelDialog.ui ui/ObjectEditor.ui + ui/MergePropertyEditor.ui ui/PrintView.ui ) diff --git a/glabels/MainWindow.cpp b/glabels/MainWindow.cpp index e0aad3e..8378591 100644 --- a/glabels/MainWindow.cpp +++ b/glabels/MainWindow.cpp @@ -35,6 +35,7 @@ #include "libglabels/Db.h" #include "View.h" #include "ObjectEditor.h" +#include "MergePropertyEditor.h" #include "PrintView.h" #include "LabelModel.h" #include "LabelModelBoxObject.h" @@ -652,9 +653,9 @@ namespace glabels /// QWidget* MainWindow::createMergePage() { - QWidget* page = new QWidget; + mMergePropertyEditor = new MergePropertyEditor(); - return page; + return mMergePropertyEditor; } diff --git a/glabels/MainWindow.h b/glabels/MainWindow.h index 9b8fbdc..a328aec 100644 --- a/glabels/MainWindow.h +++ b/glabels/MainWindow.h @@ -38,6 +38,7 @@ namespace glabels class LabelModel; class View; class ObjectEditor; + class MergePropertyEditor; class PrintView; @@ -197,12 +198,13 @@ namespace glabels QToolBar* fileToolBar; QToolBar* editorToolBar; - QTabWidget* mNotebook; - LabelModel* mModel; - QScrollArea* mViewScrollArea; - View* mView; - ObjectEditor* mObjectEditor; - PrintView* mPrintView; + QTabWidget* mNotebook; + LabelModel* mModel; + QScrollArea* mViewScrollArea; + View* mView; + ObjectEditor* mObjectEditor; + MergePropertyEditor* mMergePropertyEditor; + PrintView* mPrintView; QLabel* zoomInfoLabel; QLabel* cursorInfoLabel; diff --git a/glabels/MergePropertyEditor.cpp b/glabels/MergePropertyEditor.cpp new file mode 100644 index 0000000..ceae55f --- /dev/null +++ b/glabels/MergePropertyEditor.cpp @@ -0,0 +1,66 @@ +/* MergePropertyEditor.cpp + * + * Copyright (C) 2013 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt 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. + * + * gLabels-qt 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 gLabels-qt. If not, see . + */ + +#include "MergePropertyEditor.h" + +#include "LabelModel.h" +#include + + +namespace glabels +{ + + /// + /// Constructor + /// + MergePropertyEditor::MergePropertyEditor( QWidget *parent ) + : QWidget(parent), mModel(0) + { + setupUi( this ); + } + + + /// + /// Destructor + /// + MergePropertyEditor::~MergePropertyEditor() + { + } + + + /// + /// Set Model + /// + void MergePropertyEditor::setModel( LabelModel* model ) + { + mModel = model; + + connect( mModel, SIGNAL(changed()), this, SLOT(onLabelChanged()) ); + } + + + /// + /// Label changed handler + /// + void MergePropertyEditor::onLabelChanged() + { + } + +} diff --git a/glabels/MergePropertyEditor.h b/glabels/MergePropertyEditor.h new file mode 100644 index 0000000..515a681 --- /dev/null +++ b/glabels/MergePropertyEditor.h @@ -0,0 +1,71 @@ +/* MergePropertyEditor.h + * + * Copyright (C) 2013 Jim Evins + * + * This file is part of gLabels-qt. + * + * gLabels-qt 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. + * + * gLabels-qt 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 gLabels-qt. If not, see . + */ + +#ifndef glabels_MergePropertyEditor_h +#define glabels_MergePropertyEditor_h + +#include "ui_MergePropertyEditor.h" + + +namespace glabels +{ + class LabelModel; // Forward reference + + + /// + /// Merge Property Editor Widget + /// + class MergePropertyEditor : public QWidget, public Ui_MergePropertyEditor + { + Q_OBJECT + + + ///////////////////////////////// + // Life Cycle + ///////////////////////////////// + public: + MergePropertyEditor( QWidget *parent = 0 ); + ~MergePropertyEditor(); + + + ///////////////////////////////// + // Public methods + ///////////////////////////////// + void setModel( LabelModel* model ); + + + ///////////////////////////////// + // Slots + ///////////////////////////////// + private slots: + void onLabelChanged(); + + + ///////////////////////////////// + // Private Data + ///////////////////////////////// + private: + LabelModel* mModel; + + }; + +} + +#endif // glabels_MergePropertyEditor_h diff --git a/glabels/ui/MergePropertyEditor.ui b/glabels/ui/MergePropertyEditor.ui new file mode 100644 index 0000000..c2032e2 --- /dev/null +++ b/glabels/ui/MergePropertyEditor.ui @@ -0,0 +1,114 @@ + + + MergePropertyEditor + + + + 0 + 0 + 570 + 605 + + + + Form + + + + + + Source + + + + + + + + Format: + + + + + + + + + + Location: + + + + + + + Placeholder + + + + + + + + + Qt::Horizontal + + + + 360 + 20 + + + + + + + + + + + Records + + + + + + + + + + + Select all + + + + + + + Unselect all + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + +