Added skeletal MergePropertyEditor.

This commit is contained in:
Jim Evins
2015-09-13 15:49:41 -04:00
parent b12f4a2478
commit 1f4330ff6e
6 changed files with 265 additions and 8 deletions
+3
View File
@@ -31,6 +31,7 @@ set (glabels_sources
LabelRegion.cpp LabelRegion.cpp
MainWindow.cpp MainWindow.cpp
MergeField.cpp MergeField.cpp
MergePropertyEditor.cpp
MergeRecord.cpp MergeRecord.cpp
NewLabelDialog.cpp NewLabelDialog.cpp
ObjectEditor.cpp ObjectEditor.cpp
@@ -66,6 +67,7 @@ set (glabels_qobject_headers
LabelModelBoxObject.h LabelModelBoxObject.h
LabelModelShapeObject.h LabelModelShapeObject.h
MainWindow.h MainWindow.h
MergePropertyEditor.h
NewLabelDialog.h NewLabelDialog.h
ObjectEditor.h ObjectEditor.h
PrintView.h PrintView.h
@@ -78,6 +80,7 @@ set (glabels_qobject_headers
set (glabels_forms set (glabels_forms
ui/NewLabelDialog.ui ui/NewLabelDialog.ui
ui/ObjectEditor.ui ui/ObjectEditor.ui
ui/MergePropertyEditor.ui
ui/PrintView.ui ui/PrintView.ui
) )
+3 -2
View File
@@ -35,6 +35,7 @@
#include "libglabels/Db.h" #include "libglabels/Db.h"
#include "View.h" #include "View.h"
#include "ObjectEditor.h" #include "ObjectEditor.h"
#include "MergePropertyEditor.h"
#include "PrintView.h" #include "PrintView.h"
#include "LabelModel.h" #include "LabelModel.h"
#include "LabelModelBoxObject.h" #include "LabelModelBoxObject.h"
@@ -652,9 +653,9 @@ namespace glabels
/// ///
QWidget* MainWindow::createMergePage() QWidget* MainWindow::createMergePage()
{ {
QWidget* page = new QWidget; mMergePropertyEditor = new MergePropertyEditor();
return page; return mMergePropertyEditor;
} }
+2
View File
@@ -38,6 +38,7 @@ namespace glabels
class LabelModel; class LabelModel;
class View; class View;
class ObjectEditor; class ObjectEditor;
class MergePropertyEditor;
class PrintView; class PrintView;
@@ -202,6 +203,7 @@ namespace glabels
QScrollArea* mViewScrollArea; QScrollArea* mViewScrollArea;
View* mView; View* mView;
ObjectEditor* mObjectEditor; ObjectEditor* mObjectEditor;
MergePropertyEditor* mMergePropertyEditor;
PrintView* mPrintView; PrintView* mPrintView;
QLabel* zoomInfoLabel; QLabel* zoomInfoLabel;
+66
View File
@@ -0,0 +1,66 @@
/* MergePropertyEditor.cpp
*
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "MergePropertyEditor.h"
#include "LabelModel.h"
#include <QtDebug>
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()
{
}
}
+71
View File
@@ -0,0 +1,71 @@
/* MergePropertyEditor.h
*
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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
+114
View File
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MergePropertyEditor</class>
<widget class="QWidget" name="MergePropertyEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>570</width>
<height>605</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Source</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Format:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Location:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Placeholder</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>360</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Records</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget"/>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>Select all</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<property name="text">
<string>Unselect all</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>