Some reconciling of widget naming conventions.
This commit is contained in:
@@ -25,6 +25,7 @@ set (glabels_sources
|
|||||||
FileUtil.cpp
|
FileUtil.cpp
|
||||||
Handles.cpp
|
Handles.cpp
|
||||||
Help.cpp
|
Help.cpp
|
||||||
|
LabelEditor.cpp
|
||||||
LabelModel.cpp
|
LabelModel.cpp
|
||||||
LabelModelObject.cpp
|
LabelModelObject.cpp
|
||||||
LabelModelBoxObject.cpp
|
LabelModelBoxObject.cpp
|
||||||
@@ -33,7 +34,7 @@ set (glabels_sources
|
|||||||
MainWindow.cpp
|
MainWindow.cpp
|
||||||
Merge.cpp
|
Merge.cpp
|
||||||
MergeField.cpp
|
MergeField.cpp
|
||||||
MergePropertyEditor.cpp
|
MergeView.cpp
|
||||||
MergeRecord.cpp
|
MergeRecord.cpp
|
||||||
ObjectEditor.cpp
|
ObjectEditor.cpp
|
||||||
Outline.cpp
|
Outline.cpp
|
||||||
@@ -50,7 +51,6 @@ set (glabels_sources
|
|||||||
TemplatePicker.cpp
|
TemplatePicker.cpp
|
||||||
TemplatePickerItem.cpp
|
TemplatePickerItem.cpp
|
||||||
TextNode.cpp
|
TextNode.cpp
|
||||||
View.cpp
|
|
||||||
XmlLabelCreator.cpp
|
XmlLabelCreator.cpp
|
||||||
XmlLabelParser.cpp
|
XmlLabelParser.cpp
|
||||||
)
|
)
|
||||||
@@ -69,13 +69,14 @@ set (glabels_qobject_headers
|
|||||||
FieldMenu.h
|
FieldMenu.h
|
||||||
FieldMenuItem.h
|
FieldMenuItem.h
|
||||||
File.h
|
File.h
|
||||||
|
LabelEditor.h
|
||||||
LabelModel.h
|
LabelModel.h
|
||||||
LabelModelObject.h
|
LabelModelObject.h
|
||||||
LabelModelBoxObject.h
|
LabelModelBoxObject.h
|
||||||
LabelModelShapeObject.h
|
LabelModelShapeObject.h
|
||||||
MainWindow.h
|
MainWindow.h
|
||||||
Merge.h
|
Merge.h
|
||||||
MergePropertyEditor.h
|
MergeView.h
|
||||||
ObjectEditor.h
|
ObjectEditor.h
|
||||||
PreferencesDialog.h
|
PreferencesDialog.h
|
||||||
PrintView.h
|
PrintView.h
|
||||||
@@ -86,12 +87,11 @@ set (glabels_qobject_headers
|
|||||||
SimplePreview.h
|
SimplePreview.h
|
||||||
StartupWizard.h
|
StartupWizard.h
|
||||||
TemplatePicker.h
|
TemplatePicker.h
|
||||||
View.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set (glabels_forms
|
set (glabels_forms
|
||||||
ui/AboutDialog.ui
|
ui/AboutDialog.ui
|
||||||
ui/MergePropertyEditor.ui
|
ui/MergeView.ui
|
||||||
ui/ObjectEditor.ui
|
ui/ObjectEditor.ui
|
||||||
ui/PreferencesDialog.ui
|
ui/PreferencesDialog.ui
|
||||||
ui/PrintView.ui
|
ui/PrintView.ui
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* View.cpp
|
/* LabelEditor.cpp
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "View.h"
|
#include "LabelEditor.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
@@ -75,7 +75,7 @@ namespace
|
|||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
View::View( QScrollArea* scrollArea, QWidget* parent )
|
LabelEditor::LabelEditor( QScrollArea* scrollArea, QWidget* parent )
|
||||||
: QWidget(parent), mScrollArea(scrollArea)
|
: QWidget(parent), mScrollArea(scrollArea)
|
||||||
{
|
{
|
||||||
mState = IdleState;
|
mState = IdleState;
|
||||||
@@ -97,7 +97,7 @@ View::View( QScrollArea* scrollArea, QWidget* parent )
|
|||||||
/// Zoom property
|
/// Zoom property
|
||||||
///
|
///
|
||||||
double
|
double
|
||||||
View::zoom() const
|
LabelEditor::zoom() const
|
||||||
{
|
{
|
||||||
return mZoom;
|
return mZoom;
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ View::zoom() const
|
|||||||
/// Markup visible? property
|
/// Markup visible? property
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
View::markupVisible() const
|
LabelEditor::markupVisible() const
|
||||||
{
|
{
|
||||||
return mMarkupVisible;
|
return mMarkupVisible;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ View::markupVisible() const
|
|||||||
/// Grid visible? property
|
/// Grid visible? property
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
View::qridVisible() const
|
LabelEditor::qridVisible() const
|
||||||
{
|
{
|
||||||
return mGridVisible;
|
return mGridVisible;
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ View::qridVisible() const
|
|||||||
/// Model Parameter Setter
|
/// Model Parameter Setter
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::setModel( LabelModel* model )
|
LabelEditor::setModel( LabelModel* model )
|
||||||
{
|
{
|
||||||
mModel = model;
|
mModel = model;
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ View::setModel( LabelModel* model )
|
|||||||
/// Grid Visibility Parameter Setter
|
/// Grid Visibility Parameter Setter
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::setGridVisible( bool visibleFlag )
|
LabelEditor::setGridVisible( bool visibleFlag )
|
||||||
{
|
{
|
||||||
mGridVisible = visibleFlag;
|
mGridVisible = visibleFlag;
|
||||||
update();
|
update();
|
||||||
@@ -159,7 +159,7 @@ View::setGridVisible( bool visibleFlag )
|
|||||||
/// Markup Visibility Parameter Setter
|
/// Markup Visibility Parameter Setter
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::setMarkupVisible( bool visibleFlag )
|
LabelEditor::setMarkupVisible( bool visibleFlag )
|
||||||
{
|
{
|
||||||
mMarkupVisible = visibleFlag;
|
mMarkupVisible = visibleFlag;
|
||||||
update();
|
update();
|
||||||
@@ -170,7 +170,7 @@ View::setMarkupVisible( bool visibleFlag )
|
|||||||
/// Zoom In "One Notch"
|
/// Zoom In "One Notch"
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::zoomIn()
|
LabelEditor::zoomIn()
|
||||||
{
|
{
|
||||||
// Find closest standard zoom level to our current zoom
|
// Find closest standard zoom level to our current zoom
|
||||||
// Start with 2nd largest scale
|
// Start with 2nd largest scale
|
||||||
@@ -196,7 +196,7 @@ View::zoomIn()
|
|||||||
/// Zoom Out "One Notch"
|
/// Zoom Out "One Notch"
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::zoomOut()
|
LabelEditor::zoomOut()
|
||||||
{
|
{
|
||||||
// Find closest standard zoom level to our current zoom
|
// Find closest standard zoom level to our current zoom
|
||||||
// Start with largest scale, end on 2nd smallest
|
// Start with largest scale, end on 2nd smallest
|
||||||
@@ -222,7 +222,7 @@ View::zoomOut()
|
|||||||
/// Zoom To 1:1 Scale
|
/// Zoom To 1:1 Scale
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::zoom1To1()
|
LabelEditor::zoom1To1()
|
||||||
{
|
{
|
||||||
setZoomReal( 1.0, false );
|
setZoomReal( 1.0, false );
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@ View::zoom1To1()
|
|||||||
/// Zoom To Fit
|
/// Zoom To Fit
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::zoomToFit()
|
LabelEditor::zoomToFit()
|
||||||
{
|
{
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
@@ -256,7 +256,7 @@ View::zoomToFit()
|
|||||||
/// Is Zoom at Maximum?
|
/// Is Zoom at Maximum?
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
View::isZoomMax() const
|
LabelEditor::isZoomMax() const
|
||||||
{
|
{
|
||||||
return ( mZoom >= zoomLevels[0] );
|
return ( mZoom >= zoomLevels[0] );
|
||||||
}
|
}
|
||||||
@@ -266,7 +266,7 @@ View::isZoomMax() const
|
|||||||
/// Is Zoom at Minimum?
|
/// Is Zoom at Minimum?
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
View::isZoomMin() const
|
LabelEditor::isZoomMin() const
|
||||||
{
|
{
|
||||||
return ( mZoom <= zoomLevels[nZoomLevels-1] );
|
return ( mZoom <= zoomLevels[nZoomLevels-1] );
|
||||||
}
|
}
|
||||||
@@ -276,7 +276,7 @@ View::isZoomMin() const
|
|||||||
/// Set Zoom to Value
|
/// Set Zoom to Value
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::setZoomReal( double zoom, bool zoomToFitFlag )
|
LabelEditor::setZoomReal( double zoom, bool zoomToFitFlag )
|
||||||
{
|
{
|
||||||
mZoom = zoom;
|
mZoom = zoom;
|
||||||
mZoomToFitFlag = zoomToFitFlag;
|
mZoomToFitFlag = zoomToFitFlag;
|
||||||
@@ -301,7 +301,7 @@ View::setZoomReal( double zoom, bool zoomToFitFlag )
|
|||||||
/// Arrow mode (normal mode)
|
/// Arrow mode (normal mode)
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::arrowMode()
|
LabelEditor::arrowMode()
|
||||||
{
|
{
|
||||||
setCursor( Qt::ArrowCursor );
|
setCursor( Qt::ArrowCursor );
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ View::arrowMode()
|
|||||||
/// Create box mode
|
/// Create box mode
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::createBoxMode()
|
LabelEditor::createBoxMode()
|
||||||
{
|
{
|
||||||
setCursor( Cursors::Box() );
|
setCursor( Cursors::Box() );
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ View::createBoxMode()
|
|||||||
/// Resize Event Handler
|
/// Resize Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::resizeEvent( QResizeEvent *event )
|
LabelEditor::resizeEvent( QResizeEvent *event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -350,7 +350,7 @@ View::resizeEvent( QResizeEvent *event )
|
|||||||
/// Mouse Button Press Event Handler
|
/// Mouse Button Press Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::mousePressEvent( QMouseEvent* event )
|
LabelEditor::mousePressEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -470,7 +470,7 @@ View::mousePressEvent( QMouseEvent* event )
|
|||||||
// mCreateObject = new LabelModelBarcodeObject();
|
// mCreateObject = new LabelModelBarcodeObject();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug() << "View::mousePressEvent: Invalid creation type. Should not happen!";
|
qDebug() << "LabelEditor::mousePressEvent: Invalid creation type. Should not happen!";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,7 +491,7 @@ View::mousePressEvent( QMouseEvent* event )
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
qDebug() << "View::mousePressEvent: Invalid state. Should not happen!";
|
qDebug() << "LabelEditor::mousePressEvent: Invalid state. Should not happen!";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -516,7 +516,7 @@ View::mousePressEvent( QMouseEvent* event )
|
|||||||
/// Mouse Movement Event Handler
|
/// Mouse Movement Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::mouseMoveEvent( QMouseEvent* event )
|
LabelEditor::mouseMoveEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
@@ -602,13 +602,13 @@ View::mouseMoveEvent( QMouseEvent* event )
|
|||||||
mCreateObject->setSize( xWorld - mCreateX0, yWorld - mCreateY0 );
|
mCreateObject->setSize( xWorld - mCreateX0, yWorld - mCreateY0 );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug() << "View::mouseMoveEvent: Invalid creation mode. Should not happen!";
|
qDebug() << "LabelEditor::mouseMoveEvent: Invalid creation mode. Should not happen!";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qDebug() << "View::mouseMoveEvent: Invalid state. Should not happen!";
|
qDebug() << "LabelEditor::mouseMoveEvent: Invalid state. Should not happen!";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -620,7 +620,7 @@ View::mouseMoveEvent( QMouseEvent* event )
|
|||||||
/// Mouse Button Release Event Handler
|
/// Mouse Button Release Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::mouseReleaseEvent( QMouseEvent* event )
|
LabelEditor::mouseReleaseEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -696,7 +696,7 @@ View::mouseReleaseEvent( QMouseEvent* event )
|
|||||||
/// Leave Event Handler
|
/// Leave Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::leaveEvent( QEvent* event )
|
LabelEditor::leaveEvent( QEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -709,7 +709,7 @@ View::leaveEvent( QEvent* event )
|
|||||||
/// Handle resize motion
|
/// Handle resize motion
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::handleResizeMotion( const glabels::Distance& xWorld,
|
LabelEditor::handleResizeMotion( const glabels::Distance& xWorld,
|
||||||
const glabels::Distance& yWorld )
|
const glabels::Distance& yWorld )
|
||||||
{
|
{
|
||||||
QPointF p( xWorld.pt(), yWorld.pt() );
|
QPointF p( xWorld.pt(), yWorld.pt() );
|
||||||
@@ -786,7 +786,7 @@ View::handleResizeMotion( const glabels::Distance& xWorld,
|
|||||||
y0 = y0 + y1;
|
y0 = y0 + y1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug() << "View::handleResizeMotion: Invalid Handle Location. Should not happen!";
|
qDebug() << "LabelEditor::handleResizeMotion: Invalid Handle Location. Should not happen!";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -859,7 +859,7 @@ View::handleResizeMotion( const glabels::Distance& xWorld,
|
|||||||
///
|
///
|
||||||
/// Key Press Event Handler
|
/// Key Press Event Handler
|
||||||
void
|
void
|
||||||
View::keyPressEvent( QKeyEvent* event )
|
LabelEditor::keyPressEvent( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
if ( mState == IdleState )
|
if ( mState == IdleState )
|
||||||
{
|
{
|
||||||
@@ -904,7 +904,7 @@ View::keyPressEvent( QKeyEvent* event )
|
|||||||
/// Paint Event Handler
|
/// Paint Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::paintEvent( QPaintEvent* event )
|
LabelEditor::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -939,7 +939,7 @@ View::paintEvent( QPaintEvent* event )
|
|||||||
/// Draw Background Layer
|
/// Draw Background Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::drawBgLayer( QPainter* painter )
|
LabelEditor::drawBgLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Draw shadow
|
* Draw shadow
|
||||||
@@ -984,7 +984,7 @@ View::drawBgLayer( QPainter* painter )
|
|||||||
/// Draw Grid Layer
|
/// Draw Grid Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::drawGridLayer( QPainter* painter )
|
LabelEditor::drawGridLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
if ( mGridVisible )
|
if ( mGridVisible )
|
||||||
{
|
{
|
||||||
@@ -1036,7 +1036,7 @@ View::drawGridLayer( QPainter* painter )
|
|||||||
/// Draw Markup Layer
|
/// Draw Markup Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::drawMarkupLayer( QPainter* painter )
|
LabelEditor::drawMarkupLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
if ( mMarkupVisible )
|
if ( mMarkupVisible )
|
||||||
{
|
{
|
||||||
@@ -1065,7 +1065,7 @@ View::drawMarkupLayer( QPainter* painter )
|
|||||||
/// Draw Objects Layer
|
/// Draw Objects Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::drawObjectsLayer( QPainter* painter )
|
LabelEditor::drawObjectsLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
mModel->draw( painter );
|
mModel->draw( painter );
|
||||||
}
|
}
|
||||||
@@ -1075,7 +1075,7 @@ View::drawObjectsLayer( QPainter* painter )
|
|||||||
/// Draw Foreground Layer
|
/// Draw Foreground Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::drawFgLayer( QPainter* painter )
|
LabelEditor::drawFgLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Draw label outline
|
* Draw label outline
|
||||||
@@ -1102,7 +1102,7 @@ View::drawFgLayer( QPainter* painter )
|
|||||||
/// Draw Highlight Layer
|
/// Draw Highlight Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::drawHighlightLayer( QPainter* painter )
|
LabelEditor::drawHighlightLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
@@ -1122,7 +1122,7 @@ View::drawHighlightLayer( QPainter* painter )
|
|||||||
/// Draw Select Region Layer
|
/// Draw Select Region Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
View::drawSelectRegionLayer( QPainter* painter )
|
LabelEditor::drawSelectRegionLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
if ( mSelectRegionVisible )
|
if ( mSelectRegionVisible )
|
||||||
{
|
{
|
||||||
@@ -1144,7 +1144,7 @@ View::drawSelectRegionLayer( QPainter* painter )
|
|||||||
///
|
///
|
||||||
/// Settings changed handler
|
/// Settings changed handler
|
||||||
///
|
///
|
||||||
void View::onSettingsChanged()
|
void LabelEditor::onSettingsChanged()
|
||||||
{
|
{
|
||||||
glabels::Units units = Settings::units();
|
glabels::Units units = Settings::units();
|
||||||
|
|
||||||
@@ -1155,7 +1155,7 @@ void View::onSettingsChanged()
|
|||||||
///
|
///
|
||||||
/// Model size changed handler
|
/// Model size changed handler
|
||||||
///
|
///
|
||||||
void View::onModelSizeChanged()
|
void LabelEditor::onModelSizeChanged()
|
||||||
{
|
{
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/* View.h
|
/* LabelEditor.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef View_h
|
#ifndef LabelEditor_h
|
||||||
#define View_h
|
#define LabelEditor_h
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
@@ -35,9 +35,9 @@ class Handle;
|
|||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// View Widget
|
/// LabelEditor Widget
|
||||||
///
|
///
|
||||||
class View : public QWidget
|
class LabelEditor : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ class View : public QWidget
|
|||||||
// Lifecycle
|
// Lifecycle
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
View( QScrollArea* scrollArea, QWidget* parent = 0 );
|
LabelEditor( QScrollArea* scrollArea, QWidget* parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
@@ -210,4 +210,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // View_h
|
#endif // LabelEditor_h
|
||||||
+28
-28
@@ -35,9 +35,9 @@
|
|||||||
#include "libglabels/Db.h"
|
#include "libglabels/Db.h"
|
||||||
#include "PreferencesDialog.h"
|
#include "PreferencesDialog.h"
|
||||||
#include "PropertiesView.h"
|
#include "PropertiesView.h"
|
||||||
#include "View.h"
|
#include "LabelEditor.h"
|
||||||
#include "ObjectEditor.h"
|
#include "ObjectEditor.h"
|
||||||
#include "MergePropertyEditor.h"
|
#include "MergeView.h"
|
||||||
#include "PrintView.h"
|
#include "PrintView.h"
|
||||||
#include "LabelModel.h"
|
#include "LabelModel.h"
|
||||||
#include "LabelModelBoxObject.h"
|
#include "LabelModelBoxObject.h"
|
||||||
@@ -82,11 +82,11 @@ MainWindow::MainWindow()
|
|||||||
setPasteVerbsEnabled( false );
|
setPasteVerbsEnabled( false );
|
||||||
setTitle();
|
setTitle();
|
||||||
|
|
||||||
connect( mView, SIGNAL(zoomChanged()), this, SLOT(onZoomChanged()) );
|
connect( mLabelEditor, SIGNAL(zoomChanged()), this, SLOT(onZoomChanged()) );
|
||||||
#if 0
|
#if 0
|
||||||
connect( mView, SIGNAL(pointerMoved(double, double)),
|
connect( mLabelEditor, SIGNAL(pointerMoved(double, double)),
|
||||||
this, SLOT(onPointerMoved(double, double)) );
|
this, SLOT(onPointerMoved(double, double)) );
|
||||||
connect( mView, SIGNAL(pointerExited()), this, SLOT(onPointerExit()) );
|
connect( mLabelEditor, SIGNAL(pointerExited()), this, SLOT(onPointerExit()) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
@@ -120,7 +120,7 @@ void MainWindow::setModel( LabelModel *label )
|
|||||||
{
|
{
|
||||||
mModel = label;
|
mModel = label;
|
||||||
mPropertiesView->setModel( mModel );
|
mPropertiesView->setModel( mModel );
|
||||||
mView->setModel( mModel );
|
mLabelEditor->setModel( mModel );
|
||||||
mObjectEditor->setModel( mModel );
|
mObjectEditor->setModel( mModel );
|
||||||
mPrintView->setModel( mModel );
|
mPrintView->setModel( mModel );
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ void MainWindow::setModel( LabelModel *label )
|
|||||||
setMultiSelectionVerbsEnabled( false );
|
setMultiSelectionVerbsEnabled( false );
|
||||||
setTitle();
|
setTitle();
|
||||||
|
|
||||||
connect( mView, SIGNAL(contextMenuActivate()), this, SLOT(onContextMenuActivate()) );
|
connect( mLabelEditor, SIGNAL(contextMenuActivate()), this, SLOT(onContextMenuActivate()) );
|
||||||
connect( mModel, SIGNAL(nameChanged()), this, SLOT(onNameChanged()) );
|
connect( mModel, SIGNAL(nameChanged()), this, SLOT(onNameChanged()) );
|
||||||
connect( mModel, SIGNAL(modifiedChanged()), this, SLOT(onModifiedChanged()) );
|
connect( mModel, SIGNAL(modifiedChanged()), this, SLOT(onModifiedChanged()) );
|
||||||
connect( mModel, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()) );
|
connect( mModel, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()) );
|
||||||
@@ -627,18 +627,18 @@ QWidget* MainWindow::createEditorPage()
|
|||||||
{
|
{
|
||||||
QWidget* page = new QWidget;
|
QWidget* page = new QWidget;
|
||||||
|
|
||||||
mViewScrollArea = new QScrollArea();
|
mLabelEditorScrollArea = new QScrollArea();
|
||||||
mViewScrollArea->setMinimumSize( 640, 450 );
|
mLabelEditorScrollArea->setMinimumSize( 640, 450 );
|
||||||
mViewScrollArea->setWidgetResizable( true );
|
mLabelEditorScrollArea->setWidgetResizable( true );
|
||||||
|
|
||||||
mView = new View( mViewScrollArea );
|
mLabelEditor = new LabelEditor( mLabelEditorScrollArea );
|
||||||
mObjectEditor = new ObjectEditor();
|
mObjectEditor = new ObjectEditor();
|
||||||
|
|
||||||
mViewScrollArea->setWidget( mView );
|
mLabelEditorScrollArea->setWidget( mLabelEditor );
|
||||||
|
|
||||||
QVBoxLayout* editorVLayout = new QVBoxLayout;
|
QVBoxLayout* editorVLayout = new QVBoxLayout;
|
||||||
editorVLayout->addWidget( editorToolBar );
|
editorVLayout->addWidget( editorToolBar );
|
||||||
editorVLayout->addWidget( mViewScrollArea );
|
editorVLayout->addWidget( mLabelEditorScrollArea );
|
||||||
|
|
||||||
QHBoxLayout* editorHLayout = new QHBoxLayout;
|
QHBoxLayout* editorHLayout = new QHBoxLayout;
|
||||||
editorHLayout->addLayout( editorVLayout );
|
editorHLayout->addLayout( editorVLayout );
|
||||||
@@ -655,9 +655,9 @@ QWidget* MainWindow::createEditorPage()
|
|||||||
///
|
///
|
||||||
QWidget* MainWindow::createMergePage()
|
QWidget* MainWindow::createMergePage()
|
||||||
{
|
{
|
||||||
mMergePropertyEditor = new MergePropertyEditor();
|
mMergeView = new MergeView();
|
||||||
|
|
||||||
return mMergePropertyEditor;
|
return mMergeView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -823,8 +823,8 @@ void MainWindow::readSettings()
|
|||||||
|
|
||||||
fileToolBar ->setVisible( showFileToolBar );
|
fileToolBar ->setVisible( showFileToolBar );
|
||||||
editorToolBar ->setVisible( showEditorToolBar );
|
editorToolBar ->setVisible( showEditorToolBar );
|
||||||
mView ->setGridVisible( showGrid );
|
mLabelEditor ->setGridVisible( showGrid );
|
||||||
mView ->setMarkupVisible( showMarkup );
|
mLabelEditor ->setMarkupVisible( showMarkup );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1012,7 +1012,7 @@ void MainWindow::viewEditorToolBar( bool state )
|
|||||||
///
|
///
|
||||||
void MainWindow::viewGrid( bool state )
|
void MainWindow::viewGrid( bool state )
|
||||||
{
|
{
|
||||||
mView->setGridVisible( state );
|
mLabelEditor->setGridVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1021,7 +1021,7 @@ void MainWindow::viewGrid( bool state )
|
|||||||
///
|
///
|
||||||
void MainWindow::viewMarkup( bool state )
|
void MainWindow::viewMarkup( bool state )
|
||||||
{
|
{
|
||||||
mView->setMarkupVisible( state );
|
mLabelEditor->setMarkupVisible( state );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1030,7 +1030,7 @@ void MainWindow::viewMarkup( bool state )
|
|||||||
///
|
///
|
||||||
void MainWindow::viewZoomIn()
|
void MainWindow::viewZoomIn()
|
||||||
{
|
{
|
||||||
mView->zoomIn();
|
mLabelEditor->zoomIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1039,7 +1039,7 @@ void MainWindow::viewZoomIn()
|
|||||||
///
|
///
|
||||||
void MainWindow::viewZoomOut()
|
void MainWindow::viewZoomOut()
|
||||||
{
|
{
|
||||||
mView->zoomOut();
|
mLabelEditor->zoomOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1048,7 +1048,7 @@ void MainWindow::viewZoomOut()
|
|||||||
///
|
///
|
||||||
void MainWindow::viewZoom1To1()
|
void MainWindow::viewZoom1To1()
|
||||||
{
|
{
|
||||||
mView->zoom1To1();
|
mLabelEditor->zoom1To1();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1057,7 +1057,7 @@ void MainWindow::viewZoom1To1()
|
|||||||
///
|
///
|
||||||
void MainWindow::viewZoomToFit()
|
void MainWindow::viewZoomToFit()
|
||||||
{
|
{
|
||||||
mView->zoomToFit();
|
mLabelEditor->zoomToFit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1066,7 +1066,7 @@ void MainWindow::viewZoomToFit()
|
|||||||
///
|
///
|
||||||
void MainWindow::objectsArrowMode()
|
void MainWindow::objectsArrowMode()
|
||||||
{
|
{
|
||||||
mView->arrowMode();
|
mLabelEditor->arrowMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1084,7 +1084,7 @@ void MainWindow::objectsCreateText()
|
|||||||
///
|
///
|
||||||
void MainWindow::objectsCreateBox()
|
void MainWindow::objectsCreateBox()
|
||||||
{
|
{
|
||||||
mView->createBoxMode();
|
mLabelEditor->createBoxMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1289,10 +1289,10 @@ void MainWindow::onContextMenuActivate()
|
|||||||
///
|
///
|
||||||
void MainWindow::onZoomChanged()
|
void MainWindow::onZoomChanged()
|
||||||
{
|
{
|
||||||
zoomInfoLabel->setText( QString( " %1% " ).arg(100*mView->zoom(), 0, 'f', 0) );
|
zoomInfoLabel->setText( QString( " %1% " ).arg(100*mLabelEditor->zoom(), 0, 'f', 0) );
|
||||||
|
|
||||||
viewZoomInAction->setEnabled( !mView->isZoomMax() );
|
viewZoomInAction->setEnabled( !mLabelEditor->isZoomMax() );
|
||||||
viewZoomOutAction->setEnabled( !mView->isZoomMin() );
|
viewZoomOutAction->setEnabled( !mLabelEditor->isZoomMin() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ class QScrollArea;
|
|||||||
// Forward References
|
// Forward References
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class PropertiesView;
|
class PropertiesView;
|
||||||
class View;
|
class LabelEditor;
|
||||||
class ObjectEditor;
|
class ObjectEditor;
|
||||||
class MergePropertyEditor;
|
class MergeView;
|
||||||
class PrintView;
|
class PrintView;
|
||||||
|
|
||||||
|
|
||||||
@@ -200,10 +200,10 @@ private:
|
|||||||
QTabWidget* mNotebook;
|
QTabWidget* mNotebook;
|
||||||
LabelModel* mModel;
|
LabelModel* mModel;
|
||||||
PropertiesView* mPropertiesView;
|
PropertiesView* mPropertiesView;
|
||||||
QScrollArea* mViewScrollArea;
|
QScrollArea* mLabelEditorScrollArea;
|
||||||
View* mView;
|
LabelEditor* mLabelEditor;
|
||||||
ObjectEditor* mObjectEditor;
|
ObjectEditor* mObjectEditor;
|
||||||
MergePropertyEditor* mMergePropertyEditor;
|
MergeView* mMergeView;
|
||||||
PrintView* mPrintView;
|
PrintView* mPrintView;
|
||||||
|
|
||||||
QLabel* zoomInfoLabel;
|
QLabel* zoomInfoLabel;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* MergePropertyEditor.cpp
|
/* MergeView.cpp
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
* This file is part of gLabels-qt.
|
* This file is part of gLabels-qt.
|
||||||
*
|
*
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "MergePropertyEditor.h"
|
#include "MergeView.h"
|
||||||
|
|
||||||
#include "LabelModel.h"
|
#include "LabelModel.h"
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
MergePropertyEditor::MergePropertyEditor( QWidget *parent )
|
MergeView::MergeView( QWidget *parent )
|
||||||
: QWidget(parent), mModel(0)
|
: QWidget(parent), mModel(0)
|
||||||
{
|
{
|
||||||
setupUi( this );
|
setupUi( this );
|
||||||
@@ -37,7 +37,7 @@ MergePropertyEditor::MergePropertyEditor( QWidget *parent )
|
|||||||
///
|
///
|
||||||
/// Destructor
|
/// Destructor
|
||||||
///
|
///
|
||||||
MergePropertyEditor::~MergePropertyEditor()
|
MergeView::~MergeView()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ MergePropertyEditor::~MergePropertyEditor()
|
|||||||
///
|
///
|
||||||
/// Set Model
|
/// Set Model
|
||||||
///
|
///
|
||||||
void MergePropertyEditor::setModel( LabelModel* model )
|
void MergeView::setModel( LabelModel* model )
|
||||||
{
|
{
|
||||||
mModel = model;
|
mModel = model;
|
||||||
|
|
||||||
@@ -56,6 +56,6 @@ void MergePropertyEditor::setModel( LabelModel* model )
|
|||||||
///
|
///
|
||||||
/// Label changed handler
|
/// Label changed handler
|
||||||
///
|
///
|
||||||
void MergePropertyEditor::onLabelChanged()
|
void MergeView::onLabelChanged()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* MergePropertyEditor.h
|
/* MergeView.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
* This file is part of gLabels-qt.
|
* This file is part of gLabels-qt.
|
||||||
*
|
*
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MergePropertyEditor_h
|
#ifndef MergeView_h
|
||||||
#define MergePropertyEditor_h
|
#define MergeView_h
|
||||||
|
|
||||||
#include "ui_MergePropertyEditor.h"
|
#include "ui_MergeView.h"
|
||||||
|
|
||||||
|
|
||||||
class LabelModel; // Forward reference
|
class LabelModel; // Forward reference
|
||||||
@@ -30,7 +30,7 @@ class LabelModel; // Forward reference
|
|||||||
///
|
///
|
||||||
/// Merge Property Editor Widget
|
/// Merge Property Editor Widget
|
||||||
///
|
///
|
||||||
class MergePropertyEditor : public QWidget, public Ui_MergePropertyEditor
|
class MergeView : public QWidget, public Ui_MergeView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -39,8 +39,8 @@ class MergePropertyEditor : public QWidget, public Ui_MergePropertyEditor
|
|||||||
// Life Cycle
|
// Life Cycle
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
MergePropertyEditor( QWidget *parent = 0 );
|
MergeView( QWidget *parent = 0 );
|
||||||
~MergePropertyEditor();
|
~MergeView();
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -65,4 +65,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // MergePropertyEditor_h
|
#endif // MergeView_h
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>MergePropertyEditor</class>
|
<class>MergeView</class>
|
||||||
<widget class="QWidget" name="MergePropertyEditor">
|
<widget class="QWidget" name="MergePropertyEditor">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
Reference in New Issue
Block a user