Reconcile style accross all source files.
- All glabels code is in "glabels" top-level namespace. - Other assorted cleanup.
This commit is contained in:
+38
-1
@@ -57,7 +57,38 @@ information.
|
|||||||
- Never use parens in return statements when not necessary.
|
- Never use parens in return statements when not necessary.
|
||||||
|
|
||||||
|
|
||||||
File Organization
|
Naming
|
||||||
|
------
|
||||||
|
|
||||||
|
### Type Names
|
||||||
|
|
||||||
|
- Start with a capital letter.
|
||||||
|
- Each new word is capitalized.
|
||||||
|
- No underscores.
|
||||||
|
|
||||||
|
|
||||||
|
### Variable Names
|
||||||
|
|
||||||
|
- Start each variable name with a lowercase letter.
|
||||||
|
- Each subsequent word is capitalized.
|
||||||
|
- No underscores.
|
||||||
|
- Data members start with a lowercase "m" with the 2nd letter capitalized.
|
||||||
|
- Use "i" prefix for indexes and "n" prefix for total number of indexes.
|
||||||
|
|
||||||
|
|
||||||
|
### Function names
|
||||||
|
|
||||||
|
- Start each function name with a lowercase letter.
|
||||||
|
- Each subsequent word is capitalized.
|
||||||
|
- No underscores.
|
||||||
|
|
||||||
|
|
||||||
|
### Constant Names
|
||||||
|
|
||||||
|
- TBD (currently not uniform)
|
||||||
|
|
||||||
|
|
||||||
|
Code Organization
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Generally code is organized into modules. Usually a module defines a single
|
Generally code is organized into modules. Usually a module defines a single
|
||||||
@@ -87,6 +118,7 @@ All header files should have an ifndef guard to prevent multiple inclusion.
|
|||||||
#endif // ns_Module_h
|
#endif // ns_Module_h
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Include Directives
|
### Include Directives
|
||||||
|
|
||||||
Header files should be included in the following order.
|
Header files should be included in the following order.
|
||||||
@@ -111,3 +143,8 @@ glabels header files.
|
|||||||
Do not use forward declarations to any external entities. Use the appropriate
|
Do not use forward declarations to any external entities. Use the appropriate
|
||||||
include directives instead.
|
include directives instead.
|
||||||
|
|
||||||
|
|
||||||
|
### Namespaces
|
||||||
|
|
||||||
|
- Private definitions are placed in unnamed namespaces to limit scope to the current translation unit.
|
||||||
|
- All other glabels code is placed in the top-level "glabels" namespace.
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
#include "Version.h"
|
#include "Version.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -81,3 +84,5 @@ void AboutDialog::onWebsiteButtonClicked()
|
|||||||
{
|
{
|
||||||
QDesktopServices::openUrl( QUrl(Version::WEBSITE) );
|
QDesktopServices::openUrl( QUrl(Version::WEBSITE) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "ui_AboutDialog.h"
|
#include "ui_AboutDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// About Dialog Widget
|
/// About Dialog Widget
|
||||||
///
|
///
|
||||||
@@ -49,5 +52,7 @@ private slots:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // AboutDialog_h
|
#endif // AboutDialog_h
|
||||||
|
|||||||
@@ -21,11 +21,12 @@
|
|||||||
#include "BarcodeBackends.h"
|
#include "BarcodeBackends.h"
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace glabels
|
||||||
{
|
{
|
||||||
const std::string default_id = "code39";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Static data
|
||||||
|
//
|
||||||
BarcodeBackends::BackendMap BarcodeBackends::mBackendIdMap;
|
BarcodeBackends::BackendMap BarcodeBackends::mBackendIdMap;
|
||||||
BarcodeBackends::BackendMap BarcodeBackends::mBackendNameMap;
|
BarcodeBackends::BackendMap BarcodeBackends::mBackendNameMap;
|
||||||
|
|
||||||
@@ -169,7 +170,8 @@ void BarcodeBackends::registerStyle( const char* id,
|
|||||||
BarcodeStyle* style = new BarcodeStyle( QString(id), QString(backendId), name,
|
BarcodeStyle* style = new BarcodeStyle( QString(id), QString(backendId), name,
|
||||||
canText, textOptional,
|
canText, textOptional,
|
||||||
canChecksum, checksumOptional,
|
canChecksum, checksumOptional,
|
||||||
QString(defaultDigits), canFreeForm, preferedN );
|
QString(defaultDigits),
|
||||||
|
canFreeForm, preferedN );
|
||||||
|
|
||||||
QString fqName = QString(backendId) + QString(".") + name; // Name may not be unique
|
QString fqName = QString(backendId) + QString(".") + name; // Name may not be unique
|
||||||
|
|
||||||
@@ -177,3 +179,5 @@ void BarcodeBackends::registerStyle( const char* id,
|
|||||||
mStyleIdMap.insert( id, style );
|
mStyleIdMap.insert( id, style );
|
||||||
mStyleNameMap.insert( fqName, style );
|
mStyleNameMap.insert( fqName, style );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Backends Database
|
/// Barcode Backends Database
|
||||||
///
|
///
|
||||||
@@ -93,5 +96,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeBackends_h
|
#endif // BarcodeBackends_h
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -60,3 +63,5 @@ void BarcodeMenu::onMenuItemActivated( BarcodeStyle *bcStyle )
|
|||||||
|
|
||||||
emit styleChanged();
|
emit styleChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Menu
|
/// Barcode Menu
|
||||||
///
|
///
|
||||||
@@ -70,5 +73,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeMenu_h
|
#endif // BarcodeMenu_h
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -60,3 +63,5 @@ void BarcodeMenuButton::onMenuStyleChanged()
|
|||||||
|
|
||||||
emit styleChanged();
|
emit styleChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Menu Button
|
/// Barcode Menu Button
|
||||||
///
|
///
|
||||||
@@ -72,5 +75,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeMenuButton_h
|
#endif // BarcodeMenuButton_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor From Data
|
/// Constructor From Data
|
||||||
///
|
///
|
||||||
@@ -49,3 +52,5 @@ void BarcodeMenuItem::onTriggered()
|
|||||||
{
|
{
|
||||||
emit activated( mBcStyle );
|
emit activated( mBcStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Menu Item
|
/// Barcode Menu Item
|
||||||
///
|
///
|
||||||
@@ -70,5 +73,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeMenuItem_h
|
#endif // BarcodeMenuItem_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Default Constructor
|
/// Default Constructor
|
||||||
///
|
///
|
||||||
@@ -36,6 +39,7 @@ BarcodeStyle::BarcodeStyle ()
|
|||||||
mCanFreeform( false ),
|
mCanFreeform( false ),
|
||||||
mPreferedN( 0 )
|
mPreferedN( 0 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +67,7 @@ BarcodeStyle::BarcodeStyle ( const QString& id,
|
|||||||
mCanFreeform( canFreeform ),
|
mCanFreeform( canFreeform ),
|
||||||
mPreferedN( preferedN )
|
mPreferedN( preferedN )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -170,3 +175,5 @@ QString BarcodeStyle::exampleDigits( int n ) const
|
|||||||
return mDefaultDigits;
|
return mDefaultDigits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Style Type
|
/// Barcode Style Type
|
||||||
///
|
///
|
||||||
@@ -96,5 +99,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // BarcodeStyle_h
|
#endif // BarcodeStyle_h
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace glabels
|
|||||||
Category::Category( const QString &id, const QString &name )
|
Category::Category( const QString &id, const QString &name )
|
||||||
: mId(id), mName(name)
|
: mId(id), mName(name)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+12
-1
@@ -28,6 +28,12 @@
|
|||||||
#include "ColorSwatch.h"
|
#include "ColorSwatch.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const int SWATCH_W = 64;
|
const int SWATCH_W = 64;
|
||||||
@@ -38,10 +44,13 @@ namespace
|
|||||||
ColorButton::ColorButton( QWidget* parent )
|
ColorButton::ColorButton( QWidget* parent )
|
||||||
: QPushButton( parent )
|
: QPushButton( parent )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ColorButton::init( const QString& defaultLabel, const QColor& defaultColor, const QColor& color )
|
void ColorButton::init( const QString& defaultLabel,
|
||||||
|
const QColor& defaultColor,
|
||||||
|
const QColor& color )
|
||||||
{
|
{
|
||||||
mDefaultColor = defaultColor;
|
mDefaultColor = defaultColor;
|
||||||
mColorNode = ColorNode( color );
|
mColorNode = ColorNode( color );
|
||||||
@@ -173,3 +182,5 @@ void ColorButton::onPaletteDialogChanged( ColorNode colorNode, bool isDefault )
|
|||||||
|
|
||||||
emit colorChanged();
|
emit colorChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
#include "ColorPaletteDialog.h"
|
#include "ColorPaletteDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Button
|
/// Color Button
|
||||||
///
|
///
|
||||||
@@ -90,5 +93,7 @@ private:
|
|||||||
ColorPaletteDialog* mDialog;
|
ColorPaletteDialog* mDialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorButton_h
|
#endif // ColorButton_h
|
||||||
|
|||||||
@@ -25,8 +25,12 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
ColorHistory::ColorHistory()
|
ColorHistory::ColorHistory()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,3 +115,5 @@ void ColorHistory::writeColorList( const QList<QColor>& colorList )
|
|||||||
settings.setValue( "colors", colorNameList );
|
settings.setValue( "colors", colorNameList );
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color History
|
/// Color History
|
||||||
///
|
///
|
||||||
@@ -76,5 +79,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorHistory_h
|
#endif // ColorHistory_h
|
||||||
|
|||||||
@@ -24,12 +24,16 @@
|
|||||||
#include "Merge/Record.h"
|
#include "Merge/Record.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Default Constructor
|
/// Default Constructor
|
||||||
///
|
///
|
||||||
ColorNode::ColorNode()
|
ColorNode::ColorNode()
|
||||||
: mIsField(false), mColor(QColor::fromRgba(0x00000000)), mKey("")
|
: mIsField(false), mColor(QColor::fromRgba(0x00000000)), mKey("")
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -39,6 +43,7 @@ ColorNode::ColorNode()
|
|||||||
ColorNode::ColorNode( bool isField, const QColor& color, const QString& key )
|
ColorNode::ColorNode( bool isField, const QColor& color, const QString& key )
|
||||||
: mIsField(isField), mColor(color), mKey(key)
|
: mIsField(isField), mColor(color), mKey(key)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -61,6 +66,7 @@ ColorNode::ColorNode( bool isField, uint32_t rgba, const QString& key )
|
|||||||
ColorNode::ColorNode( const QColor& color )
|
ColorNode::ColorNode( const QColor& color )
|
||||||
: mIsField(false), mColor(color), mKey("")
|
: mIsField(false), mColor(color), mKey("")
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -70,6 +76,7 @@ ColorNode::ColorNode( const QColor& color )
|
|||||||
ColorNode::ColorNode( const QString& key )
|
ColorNode::ColorNode( const QString& key )
|
||||||
: mIsField(true), mColor(QColor::fromRgba(0x00000000)), mKey(key)
|
: mIsField(true), mColor(QColor::fromRgba(0x00000000)), mKey(key)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -192,3 +199,5 @@ QColor ColorNode::color( merge::Record* record ) const
|
|||||||
return mColor;
|
return mColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
#include "Merge/Record.h"
|
#include "Merge/Record.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Node Type
|
/// Color Node Type
|
||||||
///
|
///
|
||||||
@@ -103,5 +106,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorNode_h
|
#endif // ColorNode_h
|
||||||
|
|||||||
@@ -25,8 +25,11 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private Configuration Data
|
// Private
|
||||||
//
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -118,3 +121,5 @@ void ColorPaletteButtonItem::mousePressEvent( QMouseEvent* event )
|
|||||||
{
|
{
|
||||||
emit activated();
|
emit activated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Palette Item
|
/// Color Palette Item
|
||||||
///
|
///
|
||||||
@@ -66,5 +69,7 @@ private:
|
|||||||
bool mHover;
|
bool mHover;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorPaletteButtonItem_h
|
#endif // ColorPaletteButtonItem_h
|
||||||
|
|||||||
@@ -30,6 +30,12 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Static data
|
||||||
|
//
|
||||||
ColorPaletteDialog::ColorTableEntry ColorPaletteDialog::mColorTable[] = {
|
ColorPaletteDialog::ColorTableEntry ColorPaletteDialog::mColorTable[] = {
|
||||||
|
|
||||||
{ "#ef2929", tr("Light Scarlet Red", "Color name") },
|
{ "#ef2929", tr("Light Scarlet Red", "Color name") },
|
||||||
@@ -71,6 +77,7 @@ ColorPaletteDialog::ColorTableEntry ColorPaletteDialog::mColorTable[] = {
|
|||||||
{ "#eeeeec", tr("Lighter Gray", "Color name") },
|
{ "#eeeeec", tr("Lighter Gray", "Color name") },
|
||||||
{ "#f3f3f3", tr("Very Light Gray", "Color name") },
|
{ "#f3f3f3", tr("Very Light Gray", "Color name") },
|
||||||
{ "#ffffff", tr("White", "Color name") }
|
{ "#ffffff", tr("White", "Color name") }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -316,3 +323,5 @@ void ColorPaletteDialog::showEvent( QShowEvent* event )
|
|||||||
|
|
||||||
QDialog::showEvent( event );
|
QDialog::showEvent( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@
|
|||||||
#include "ColorPaletteButtonItem.h"
|
#include "ColorPaletteButtonItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Palette Dialog
|
/// Color Palette Dialog
|
||||||
///
|
///
|
||||||
@@ -112,5 +115,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorPaletteDialog_h
|
#endif // ColorPaletteDialog_h
|
||||||
|
|||||||
@@ -25,8 +25,11 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private Configuration Data
|
// Private
|
||||||
//
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -142,3 +145,5 @@ void ColorPaletteItem::mousePressEvent( QMouseEvent* event )
|
|||||||
{
|
{
|
||||||
emit activated( mId );
|
emit activated( mId );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Palette Item
|
/// Color Palette Item
|
||||||
///
|
///
|
||||||
@@ -80,5 +83,7 @@ private:
|
|||||||
bool mHover;
|
bool mHover;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorPaletteItem_h
|
#endif // ColorPaletteItem_h
|
||||||
|
|||||||
@@ -24,8 +24,11 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private Configuration Data
|
// Private
|
||||||
//
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -54,3 +57,5 @@ ColorSwatch::ColorSwatch( int w, int h, const QColor& color )
|
|||||||
painter.setPen( pen );
|
painter.setPen( pen );
|
||||||
painter.drawRect( 1, 1, w-2, h-2 );
|
painter.drawRect( 1, 1, w-2, h-2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Simple Preview Widget
|
/// Simple Preview Widget
|
||||||
///
|
///
|
||||||
@@ -39,5 +42,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // ColorSwatch_h
|
#endif // ColorSwatch_h
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace glabels
|
|||||||
const double PTS_PER_CM = (10.0*PTS_PER_MM);
|
const double PTS_PER_CM = (10.0*PTS_PER_MM);
|
||||||
const double PTS_PER_PICA = 12.0;
|
const double PTS_PER_PICA = 12.0;
|
||||||
|
|
||||||
|
const Distance EPSILON( 0.5, Units::PT );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // glabels_Constants_h
|
#endif // glabels_Constants_h
|
||||||
|
|||||||
@@ -23,37 +23,48 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
Cursors::Barcode::Barcode()
|
Cursors::Barcode::Barcode()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_barcode.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_barcode.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Cursors::Box::Box()
|
Cursors::Box::Box()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_box.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_box.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Cursors::Ellipse::Ellipse()
|
Cursors::Ellipse::Ellipse()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_ellipse.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_ellipse.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Cursors::Image::Image()
|
Cursors::Image::Image()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_image.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_image.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Cursors::Line::Line()
|
Cursors::Line::Line()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_line.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_line.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Cursors::Text::Text()
|
Cursors::Text::Text()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_text.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_text.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Glabels Cursors
|
/// Glabels Cursors
|
||||||
///
|
///
|
||||||
@@ -75,5 +78,7 @@ namespace Cursors
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // Cursors_h
|
#endif // Cursors_h
|
||||||
|
|||||||
+23
-16
@@ -32,18 +32,26 @@
|
|||||||
#include "XmlVendorParser.h"
|
#include "XmlVendorParser.h"
|
||||||
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
bool partNameLessThan( const glabels::Template *a, const glabels::Template *b )
|
|
||||||
{
|
|
||||||
return glabels::StrUtil::comparePartNames( a->name(), b->name() ) < 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
const QString empty = "";
|
||||||
|
|
||||||
|
bool partNameLessThan( const Template *a, const Template *b )
|
||||||
|
{
|
||||||
|
return StrUtil::comparePartNames( a->name(), b->name() ) < 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Static data
|
||||||
|
//
|
||||||
QList<Paper*> Db::mPapers;
|
QList<Paper*> Db::mPapers;
|
||||||
QStringList Db::mPaperIds;
|
QStringList Db::mPaperIds;
|
||||||
QStringList Db::mPaperNames;
|
QStringList Db::mPaperNames;
|
||||||
@@ -53,9 +61,8 @@ namespace glabels
|
|||||||
QList<Vendor*> Db::mVendors;
|
QList<Vendor*> Db::mVendors;
|
||||||
QStringList Db::mVendorNames;
|
QStringList Db::mVendorNames;
|
||||||
QList<Template*> Db::mTemplates;
|
QList<Template*> Db::mTemplates;
|
||||||
|
|
||||||
QString Db::mPaperNameOther;
|
QString Db::mPaperNameOther;
|
||||||
QString Db::mEmpty = "";
|
|
||||||
|
|
||||||
Db::Db()
|
Db::Db()
|
||||||
{
|
{
|
||||||
@@ -204,7 +211,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
qWarning() << "Unknown paper name: " << name;
|
qWarning() << "Unknown paper name: " << name;
|
||||||
return mEmpty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -225,7 +232,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
qWarning() << "Unknown paper id: " << id;
|
qWarning() << "Unknown paper id: " << id;
|
||||||
return mEmpty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -318,7 +325,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
qWarning() << "Unknown category name: " << name;
|
qWarning() << "Unknown category name: " << name;
|
||||||
return mEmpty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -334,7 +341,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
qWarning() << "Unknown category id: " << id;
|
qWarning() << "Unknown category id: " << id;
|
||||||
return mEmpty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -399,7 +406,7 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
qWarning() << "Unknown vendor name: " << name;
|
qWarning() << "Unknown vendor name: " << name;
|
||||||
return mEmpty;
|
return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -132,7 +132,7 @@ namespace glabels
|
|||||||
static QList<Template*> mTemplates;
|
static QList<Template*> mTemplates;
|
||||||
|
|
||||||
static QString mPaperNameOther;
|
static QString mPaperNameOther;
|
||||||
static QString mEmpty;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "EnumUtil.h"
|
#include "EnumUtil.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace EnumUtil
|
namespace EnumUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -119,3 +122,5 @@ namespace EnumUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
#include <Qt>
|
#include <Qt>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace EnumUtil
|
namespace EnumUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -41,5 +44,7 @@ namespace EnumUtil
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // EnumUtil_h
|
#endif // EnumUtil_h
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -102,3 +105,5 @@ void FieldButton::onIndexChanged( int index )
|
|||||||
setCurrentIndex( 0 );
|
setCurrentIndex( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Field Button
|
/// Field Button
|
||||||
///
|
///
|
||||||
@@ -71,5 +74,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // FieldButton_h
|
#endif // FieldButton_h
|
||||||
|
|||||||
+10
-5
@@ -33,9 +33,12 @@
|
|||||||
#include "XmlLabelCreator.h"
|
#include "XmlLabelCreator.h"
|
||||||
|
|
||||||
|
|
||||||
///
|
namespace glabels
|
||||||
/// Static data
|
{
|
||||||
///
|
|
||||||
|
//
|
||||||
|
// Static data
|
||||||
|
//
|
||||||
QString File::mCwd = ".";
|
QString File::mCwd = ".";
|
||||||
|
|
||||||
|
|
||||||
@@ -47,7 +50,7 @@ bool File::newLabel( MainWindow *window )
|
|||||||
SelectProductDialog dialog( window );
|
SelectProductDialog dialog( window );
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
|
|
||||||
const glabels::Template* tmplate = dialog.tmplate();
|
const Template* tmplate = dialog.tmplate();
|
||||||
if ( tmplate )
|
if ( tmplate )
|
||||||
{
|
{
|
||||||
LabelModel* label = new LabelModel();
|
LabelModel* label = new LabelModel();
|
||||||
@@ -55,7 +58,7 @@ bool File::newLabel( MainWindow *window )
|
|||||||
label->clearModified();
|
label->clearModified();
|
||||||
|
|
||||||
// Intelligently decide to rotate label by default
|
// Intelligently decide to rotate label by default
|
||||||
const glabels::Frame* frame = tmplate->frames().first();
|
const Frame* frame = tmplate->frames().first();
|
||||||
label->setRotate( frame->h() > frame->w() );
|
label->setRotate( frame->h() > frame->w() );
|
||||||
|
|
||||||
// Either apply to current window or open a new one
|
// Either apply to current window or open a new one
|
||||||
@@ -240,3 +243,5 @@ void File::exit()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,10 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
@@ -50,5 +54,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // File_h
|
#endif // File_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "FileUtil.h"
|
#include "FileUtil.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace FileUtil
|
namespace FileUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -35,3 +38,5 @@ namespace FileUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace FileUtil
|
namespace FileUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -32,5 +35,7 @@ namespace FileUtil
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // FileUtil_h
|
#endif // FileUtil_h
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ namespace glabels
|
|||||||
Frame::Frame( const QString& id )
|
Frame::Frame( const QString& id )
|
||||||
: mId(id), mNLabels(0), mLayoutDescription("")
|
: mId(id), mNLabels(0), mLayoutDescription("")
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
#include "privateConstants.h"
|
#include "Constants.h"
|
||||||
#include "StrUtil.h"
|
#include "StrUtil.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -96,6 +96,7 @@ namespace glabels
|
|||||||
: mR1(other.mR1), mR2(other.mR2), mW(other.mW), mH(other.mH), mWaste(other.mWaste),
|
: mR1(other.mR1), mR2(other.mR2), mW(other.mW), mH(other.mH), mWaste(other.mWaste),
|
||||||
mPath(other.mPath), Frame(other)
|
mPath(other.mPath), Frame(other)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -160,10 +161,10 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
if ( FrameCd *otherCd = dynamic_cast<FrameCd*>(other) )
|
if ( FrameCd *otherCd = dynamic_cast<FrameCd*>(other) )
|
||||||
{
|
{
|
||||||
if ( (fabs( mW - otherCd->mW ) <= Constants::EPSILON) &&
|
if ( (fabs( mW - otherCd->mW ) <= EPSILON) &&
|
||||||
(fabs( mH - otherCd->mH ) <= Constants::EPSILON) &&
|
(fabs( mH - otherCd->mH ) <= EPSILON) &&
|
||||||
(fabs( mR1 - otherCd->mR1 ) <= Constants::EPSILON) &&
|
(fabs( mR1 - otherCd->mR1 ) <= EPSILON) &&
|
||||||
(fabs( mR2 - otherCd->mR2 ) <= Constants::EPSILON) )
|
(fabs( mR2 - otherCd->mR2 ) <= EPSILON) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "FrameEllipse.h"
|
#include "FrameEllipse.h"
|
||||||
|
|
||||||
|
|
||||||
#include "privateConstants.h"
|
#include "Constants.h"
|
||||||
#include "StrUtil.h"
|
#include "StrUtil.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -41,6 +41,7 @@ namespace glabels
|
|||||||
FrameEllipse::FrameEllipse( const FrameEllipse& other )
|
FrameEllipse::FrameEllipse( const FrameEllipse& other )
|
||||||
: mW(other.mW), mH(other.mH), mWaste(other.mWaste), mPath(other.mPath), Frame(other)
|
: mW(other.mW), mH(other.mH), mWaste(other.mWaste), mPath(other.mPath), Frame(other)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -94,8 +95,8 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
if ( FrameEllipse* otherEllipse = dynamic_cast<FrameEllipse*>(other) )
|
if ( FrameEllipse* otherEllipse = dynamic_cast<FrameEllipse*>(other) )
|
||||||
{
|
{
|
||||||
if ( (fabs( mW - otherEllipse->mW ) <= Constants::EPSILON) &&
|
if ( (fabs( mW - otherEllipse->mW ) <= EPSILON) &&
|
||||||
(fabs( mH - otherEllipse->mH ) <= Constants::EPSILON) )
|
(fabs( mH - otherEllipse->mH ) <= EPSILON) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "FrameRect.h"
|
#include "FrameRect.h"
|
||||||
|
|
||||||
|
|
||||||
#include "privateConstants.h"
|
#include "Constants.h"
|
||||||
#include "StrUtil.h"
|
#include "StrUtil.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -48,6 +48,7 @@ namespace glabels
|
|||||||
: mW(other.mW), mH(other.mH), mR(other.mR), mXWaste(other.mXWaste),
|
: mW(other.mW), mH(other.mH), mR(other.mR), mXWaste(other.mXWaste),
|
||||||
mYWaste(other.mYWaste), mPath(other.mPath), Frame(other)
|
mYWaste(other.mYWaste), mPath(other.mPath), Frame(other)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -113,8 +114,8 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
if ( FrameRect *otherRect = dynamic_cast<FrameRect*>(other) )
|
if ( FrameRect *otherRect = dynamic_cast<FrameRect*>(other) )
|
||||||
{
|
{
|
||||||
if ( (fabs( mW - otherRect->mW ) <= Constants::EPSILON) &&
|
if ( (fabs( mW - otherRect->mW ) <= EPSILON) &&
|
||||||
(fabs( mH - otherRect->mH ) <= Constants::EPSILON) )
|
(fabs( mH - otherRect->mH ) <= EPSILON) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "FrameRound.h"
|
#include "FrameRound.h"
|
||||||
|
|
||||||
|
|
||||||
#include "privateConstants.h"
|
#include "Constants.h"
|
||||||
#include "StrUtil.h"
|
#include "StrUtil.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -34,13 +34,15 @@ namespace glabels
|
|||||||
: mR(r), mWaste(waste), Frame(id)
|
: mR(r), mWaste(waste), Frame(id)
|
||||||
{
|
{
|
||||||
mPath.addEllipse( 0, 0, 2*mR.pt(), 2*mR.pt() );
|
mPath.addEllipse( 0, 0, 2*mR.pt(), 2*mR.pt() );
|
||||||
mClipPath.addEllipse( -mWaste.pt(), -mWaste.pt(), 2*(mR+mWaste).pt(), 2*(mR+mWaste).pt() );
|
mClipPath.addEllipse( -mWaste.pt(), -mWaste.pt(),
|
||||||
|
2*(mR+mWaste).pt(), 2*(mR+mWaste).pt() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FrameRound::FrameRound( const FrameRound& other )
|
FrameRound::FrameRound( const FrameRound& other )
|
||||||
: mR(other.mR), mWaste(other.mWaste), mPath(other.mPath), Frame(other)
|
: mR(other.mR), mWaste(other.mWaste), mPath(other.mPath), Frame(other)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -99,7 +101,7 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
if ( FrameRound *otherRound = dynamic_cast<FrameRound*>(other) )
|
if ( FrameRound *otherRound = dynamic_cast<FrameRound*>(other) )
|
||||||
{
|
{
|
||||||
if ( fabs( mR - otherRound->mR ) <= Constants::EPSILON )
|
if ( fabs( mR - otherRound->mR ) <= EPSILON )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-5
@@ -27,6 +27,12 @@
|
|||||||
#include "LabelModelObject.h"
|
#include "LabelModelObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const double handlePixels = 7;
|
const double handlePixels = 7;
|
||||||
@@ -44,6 +50,7 @@ namespace
|
|||||||
Handle::Handle( LabelModelObject* owner, Location location )
|
Handle::Handle( LabelModelObject* owner, Location location )
|
||||||
: mOwner(owner), mLocation(location)
|
: mOwner(owner), mLocation(location)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,6 +59,7 @@ Handle::Handle( LabelModelObject* owner, Location location )
|
|||||||
///
|
///
|
||||||
Handle::~Handle()
|
Handle::~Handle()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -78,8 +86,8 @@ Handle::Location Handle::location() const
|
|||||||
///
|
///
|
||||||
void Handle::drawAt( QPainter* painter,
|
void Handle::drawAt( QPainter* painter,
|
||||||
double scale,
|
double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y,
|
const Distance& y,
|
||||||
QColor color ) const
|
QColor color ) const
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
@@ -95,7 +103,8 @@ void Handle::drawAt( QPainter* painter,
|
|||||||
painter->setPen( pen );
|
painter->setPen( pen );
|
||||||
painter->setBrush( color );
|
painter->setBrush( color );
|
||||||
|
|
||||||
painter->drawRect( QRectF( -s*handlePixels/2.0, -s*handlePixels/2.0, s*handlePixels, s*handlePixels ) );
|
painter->drawRect( QRectF( -s*handlePixels/2.0, -s*handlePixels/2.0,
|
||||||
|
s*handlePixels, s*handlePixels ) );
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
@@ -105,8 +114,8 @@ void Handle::drawAt( QPainter* painter,
|
|||||||
/// Create Handle path at x,y
|
/// Create Handle path at x,y
|
||||||
///
|
///
|
||||||
QPainterPath Handle::pathAt( double scale,
|
QPainterPath Handle::pathAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const
|
const Distance& y ) const
|
||||||
{
|
{
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
|
|
||||||
@@ -125,6 +134,7 @@ QPainterPath Handle::pathAt( double scale,
|
|||||||
HandleNorth::HandleNorth( LabelModelObject* owner )
|
HandleNorth::HandleNorth( LabelModelObject* owner )
|
||||||
: Handle( owner, N )
|
: Handle( owner, N )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -133,6 +143,7 @@ HandleNorth::HandleNorth( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleNorth::~HandleNorth()
|
HandleNorth::~HandleNorth()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -169,6 +180,7 @@ QPainterPath HandleNorth::path( double scale ) const
|
|||||||
HandleNorthEast::HandleNorthEast( LabelModelObject* owner )
|
HandleNorthEast::HandleNorthEast( LabelModelObject* owner )
|
||||||
: Handle( owner, NE )
|
: Handle( owner, NE )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -177,6 +189,7 @@ HandleNorthEast::HandleNorthEast( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleNorthEast::~HandleNorthEast()
|
HandleNorthEast::~HandleNorthEast()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -213,6 +226,7 @@ QPainterPath HandleNorthEast::path( double scale ) const
|
|||||||
HandleEast::HandleEast( LabelModelObject* owner )
|
HandleEast::HandleEast( LabelModelObject* owner )
|
||||||
: Handle( owner, E )
|
: Handle( owner, E )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -221,6 +235,7 @@ HandleEast::HandleEast( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleEast::~HandleEast()
|
HandleEast::~HandleEast()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -257,6 +272,7 @@ QPainterPath HandleEast::path( double scale ) const
|
|||||||
HandleSouthEast::HandleSouthEast( LabelModelObject* owner )
|
HandleSouthEast::HandleSouthEast( LabelModelObject* owner )
|
||||||
: Handle( owner, SE )
|
: Handle( owner, SE )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -265,6 +281,7 @@ HandleSouthEast::HandleSouthEast( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleSouthEast::~HandleSouthEast()
|
HandleSouthEast::~HandleSouthEast()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -301,6 +318,7 @@ QPainterPath HandleSouthEast::path( double scale ) const
|
|||||||
HandleSouth::HandleSouth( LabelModelObject* owner )
|
HandleSouth::HandleSouth( LabelModelObject* owner )
|
||||||
: Handle( owner, S )
|
: Handle( owner, S )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -309,6 +327,7 @@ HandleSouth::HandleSouth( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleSouth::~HandleSouth()
|
HandleSouth::~HandleSouth()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -345,6 +364,7 @@ QPainterPath HandleSouth::path( double scale ) const
|
|||||||
HandleSouthWest::HandleSouthWest( LabelModelObject* owner )
|
HandleSouthWest::HandleSouthWest( LabelModelObject* owner )
|
||||||
: Handle( owner, SW )
|
: Handle( owner, SW )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -353,6 +373,7 @@ HandleSouthWest::HandleSouthWest( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleSouthWest::~HandleSouthWest()
|
HandleSouthWest::~HandleSouthWest()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -389,6 +410,7 @@ QPainterPath HandleSouthWest::path( double scale ) const
|
|||||||
HandleWest::HandleWest( LabelModelObject* owner )
|
HandleWest::HandleWest( LabelModelObject* owner )
|
||||||
: Handle( owner, W )
|
: Handle( owner, W )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -397,6 +419,7 @@ HandleWest::HandleWest( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleWest::~HandleWest()
|
HandleWest::~HandleWest()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -433,6 +456,7 @@ QPainterPath HandleWest::path( double scale ) const
|
|||||||
HandleNorthWest::HandleNorthWest( LabelModelObject* owner )
|
HandleNorthWest::HandleNorthWest( LabelModelObject* owner )
|
||||||
: Handle( owner, NW )
|
: Handle( owner, NW )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -441,6 +465,7 @@ HandleNorthWest::HandleNorthWest( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleNorthWest::~HandleNorthWest()
|
HandleNorthWest::~HandleNorthWest()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -476,6 +501,7 @@ QPainterPath HandleNorthWest::path( double scale ) const
|
|||||||
HandleP1::HandleP1( LabelModelObject* owner )
|
HandleP1::HandleP1( LabelModelObject* owner )
|
||||||
: Handle( owner, P1 )
|
: Handle( owner, P1 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -484,6 +510,7 @@ HandleP1::HandleP1( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleP1::~HandleP1()
|
HandleP1::~HandleP1()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -520,6 +547,7 @@ QPainterPath HandleP1::path( double scale ) const
|
|||||||
HandleP2::HandleP2( LabelModelObject* owner )
|
HandleP2::HandleP2( LabelModelObject* owner )
|
||||||
: Handle( owner, P2 )
|
: Handle( owner, P2 )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -528,6 +556,7 @@ HandleP2::HandleP2( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
HandleP2::~HandleP2()
|
HandleP2::~HandleP2()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -556,3 +585,5 @@ QPainterPath HandleP2::path( double scale ) const
|
|||||||
{
|
{
|
||||||
return pathAt( scale, mOwner->w(), mOwner->h() );
|
return pathAt( scale, mOwner->w(), mOwner->h() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
+10
-4
@@ -27,6 +27,10 @@
|
|||||||
|
|
||||||
#include "Distance.h"
|
#include "Distance.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
|
|
||||||
@@ -74,13 +78,13 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void drawAt( QPainter* painter,
|
void drawAt( QPainter* painter,
|
||||||
double scale,
|
double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y,
|
const Distance& y,
|
||||||
QColor color ) const;
|
QColor color ) const;
|
||||||
|
|
||||||
QPainterPath pathAt( double scale,
|
QPainterPath pathAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const;
|
const Distance& y ) const;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
@@ -326,5 +330,7 @@ public:
|
|||||||
virtual QPainterPath path( double scale ) const;
|
virtual QPainterPath path( double scale ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // Handles_h
|
#endif // Handles_h
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
#include "AboutDialog.h"
|
#include "AboutDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Display Help Contents
|
/// Display Help Contents
|
||||||
///
|
///
|
||||||
@@ -43,3 +46,5 @@ void Help::displayAbout( QWidget *parent )
|
|||||||
AboutDialog dialog( parent );
|
AboutDialog dialog( parent );
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Help Actions
|
/// Help Actions
|
||||||
///
|
///
|
||||||
@@ -36,5 +39,6 @@ namespace Help
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif // Help_h
|
#endif // Help_h
|
||||||
|
|||||||
+3
-7
@@ -25,6 +25,9 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Glabels Icons
|
/// Glabels Icons
|
||||||
///
|
///
|
||||||
@@ -336,13 +339,6 @@ namespace Icons
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Fallback Icons. These are fallbacks for icons that would normally come from the current theme,
|
|
||||||
/// if supported. These icons are copied from the mate-icon-theme (GPL-v3 or CC-BY-SA-v3).
|
|
||||||
///
|
|
||||||
namespace Fallback
|
|
||||||
{
|
|
||||||
|
|
||||||
class EditCopy : public QIcon
|
class EditCopy : public QIcon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
+38
-35
@@ -42,15 +42,17 @@
|
|||||||
#include "UndoRedoModel.h"
|
#include "UndoRedoModel.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private Configuration Data
|
// Private
|
||||||
//
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const int nZoomLevels = 11;
|
const int nZoomLevels = 11;
|
||||||
const double zoomLevels[nZoomLevels] = { 8, 6, 4, 3, 2, 1.5, 1, 0.75, 0.67, 0.50, 0.33 };
|
const double zoomLevels[nZoomLevels] = { 8, 6, 4, 3, 2, 1.5, 1, 0.75, 0.67, 0.50, 0.33 };
|
||||||
|
|
||||||
const double PTS_PER_INCH = 72.0;
|
|
||||||
const double ZOOM_TO_FIT_PAD = 16.0;
|
const double ZOOM_TO_FIT_PAD = 16.0;
|
||||||
|
|
||||||
const QColor backgroundColor( 192, 192, 192 );
|
const QColor backgroundColor( 192, 192, 192 );
|
||||||
@@ -64,7 +66,7 @@ namespace
|
|||||||
|
|
||||||
const QColor gridLineColor( 192, 192, 192 );
|
const QColor gridLineColor( 192, 192, 192 );
|
||||||
const double gridLineWidthPixels = 1;
|
const double gridLineWidthPixels = 1;
|
||||||
const glabels::Distance gridSpacing = glabels::Distance::pt(9); // TODO: determine from locale.
|
const Distance gridSpacing = Distance::pt(9); // TODO: determine from locale.
|
||||||
|
|
||||||
const QColor markupLineColor( 240, 99, 99 );
|
const QColor markupLineColor( 240, 99, 99 );
|
||||||
const double markupLineWidthPixels = 1;
|
const double markupLineWidthPixels = 1;
|
||||||
@@ -75,7 +77,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -418,8 +419,8 @@ LabelEditor::mousePressEvent( QMouseEvent* event )
|
|||||||
transform.translate( mX0.pt(), mY0.pt() );
|
transform.translate( mX0.pt(), mY0.pt() );
|
||||||
|
|
||||||
QPointF pWorld = transform.inverted().map( event->pos() );
|
QPointF pWorld = transform.inverted().map( event->pos() );
|
||||||
glabels::Distance xWorld = glabels::Distance::pt( pWorld.x() );
|
Distance xWorld = Distance::pt( pWorld.x() );
|
||||||
glabels::Distance yWorld = glabels::Distance::pt( pWorld.y() );
|
Distance yWorld = Distance::pt( pWorld.y() );
|
||||||
|
|
||||||
|
|
||||||
if ( event->button() & Qt::LeftButton )
|
if ( event->button() & Qt::LeftButton )
|
||||||
@@ -584,8 +585,8 @@ LabelEditor::mouseMoveEvent( QMouseEvent* event )
|
|||||||
transform.translate( mX0.pt(), mY0.pt() );
|
transform.translate( mX0.pt(), mY0.pt() );
|
||||||
|
|
||||||
QPointF pWorld = transform.inverted().map( event->pos() );
|
QPointF pWorld = transform.inverted().map( event->pos() );
|
||||||
glabels::Distance xWorld = glabels::Distance::pt( pWorld.x() );
|
Distance xWorld = Distance::pt( pWorld.x() );
|
||||||
glabels::Distance yWorld = glabels::Distance::pt( pWorld.y() );
|
Distance yWorld = Distance::pt( pWorld.y() );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -686,8 +687,8 @@ LabelEditor::mouseReleaseEvent( QMouseEvent* event )
|
|||||||
transform.translate( mX0.pt(), mY0.pt() );
|
transform.translate( mX0.pt(), mY0.pt() );
|
||||||
|
|
||||||
QPointF pWorld = transform.inverted().map( event->pos() );
|
QPointF pWorld = transform.inverted().map( event->pos() );
|
||||||
glabels::Distance xWorld = glabels::Distance::pt( pWorld.x() );
|
Distance xWorld = Distance::pt( pWorld.x() );
|
||||||
glabels::Distance yWorld = glabels::Distance::pt( pWorld.y() );
|
Distance yWorld = Distance::pt( pWorld.y() );
|
||||||
|
|
||||||
|
|
||||||
if ( event->button() & Qt::LeftButton )
|
if ( event->button() & Qt::LeftButton )
|
||||||
@@ -762,8 +763,8 @@ LabelEditor::leaveEvent( QEvent* event )
|
|||||||
/// Handle resize motion
|
/// Handle resize motion
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
LabelEditor::handleResizeMotion( const glabels::Distance& xWorld,
|
LabelEditor::handleResizeMotion( const Distance& xWorld,
|
||||||
const glabels::Distance& yWorld )
|
const Distance& yWorld )
|
||||||
{
|
{
|
||||||
QPointF p( xWorld.pt(), yWorld.pt() );
|
QPointF p( xWorld.pt(), yWorld.pt() );
|
||||||
Handle::Location location = mResizeHandle->location();
|
Handle::Location location = mResizeHandle->location();
|
||||||
@@ -853,22 +854,22 @@ LabelEditor::handleResizeMotion( const glabels::Distance& xWorld,
|
|||||||
{
|
{
|
||||||
case Handle::E:
|
case Handle::E:
|
||||||
case Handle::W:
|
case Handle::W:
|
||||||
mResizeObject->setWHonorAspect( glabels::Distance::pt(w) );
|
mResizeObject->setWHonorAspect( Distance::pt(w) );
|
||||||
break;
|
break;
|
||||||
case Handle::N:
|
case Handle::N:
|
||||||
case Handle::S:
|
case Handle::S:
|
||||||
mResizeObject->setHHonorAspect( glabels::Distance::pt(h) );
|
mResizeObject->setHHonorAspect( Distance::pt(h) );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mResizeObject->setSizeHonorAspect( glabels::Distance::pt(w),
|
mResizeObject->setSizeHonorAspect( Distance::pt(w),
|
||||||
glabels::Distance::pt(h) );
|
Distance::pt(h) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mResizeObject->setSize( glabels::Distance::pt(w),
|
mResizeObject->setSize( Distance::pt(w),
|
||||||
glabels::Distance::pt(h) );
|
Distance::pt(h) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -894,8 +895,8 @@ LabelEditor::handleResizeMotion( const glabels::Distance& xWorld,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mResizeObject->setSize( glabels::Distance::pt(w),
|
mResizeObject->setSize( Distance::pt(w),
|
||||||
glabels::Distance::pt(h) );
|
Distance::pt(h) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -904,8 +905,8 @@ LabelEditor::handleResizeMotion( const glabels::Distance& xWorld,
|
|||||||
QPointF p0( x0, y0 );
|
QPointF p0( x0, y0 );
|
||||||
p0 = mResizeObject->matrix().map( p0 );
|
p0 = mResizeObject->matrix().map( p0 );
|
||||||
p0 += QPointF( mResizeObject->x0().pt(), mResizeObject->y0().pt() );
|
p0 += QPointF( mResizeObject->x0().pt(), mResizeObject->y0().pt() );
|
||||||
mResizeObject->setPosition( glabels::Distance::pt(p0.x()),
|
mResizeObject->setPosition( Distance::pt(p0.x()),
|
||||||
glabels::Distance::pt(p0.y()) );
|
Distance::pt(p0.y()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -921,22 +922,22 @@ LabelEditor::keyPressEvent( QKeyEvent* event )
|
|||||||
|
|
||||||
case Qt::Key_Left:
|
case Qt::Key_Left:
|
||||||
mUndoRedoModel->checkpoint( tr("Move") );
|
mUndoRedoModel->checkpoint( tr("Move") );
|
||||||
mModel->moveSelection( -mStepSize, glabels::Distance(0) );
|
mModel->moveSelection( -mStepSize, Distance(0) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
mUndoRedoModel->checkpoint( tr("Move") );
|
mUndoRedoModel->checkpoint( tr("Move") );
|
||||||
mModel->moveSelection( glabels::Distance(0), -mStepSize );
|
mModel->moveSelection( Distance(0), -mStepSize );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_Right:
|
case Qt::Key_Right:
|
||||||
mUndoRedoModel->checkpoint( tr("Move") );
|
mUndoRedoModel->checkpoint( tr("Move") );
|
||||||
mModel->moveSelection( mStepSize, glabels::Distance(0) );
|
mModel->moveSelection( mStepSize, Distance(0) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_Down:
|
case Qt::Key_Down:
|
||||||
mUndoRedoModel->checkpoint( tr("Move") );
|
mUndoRedoModel->checkpoint( tr("Move") );
|
||||||
mModel->moveSelection( glabels::Distance(0), mStepSize );
|
mModel->moveSelection( Distance(0), mStepSize );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_Delete:
|
case Qt::Key_Delete:
|
||||||
@@ -1046,11 +1047,11 @@ LabelEditor::drawGridLayer( QPainter* painter )
|
|||||||
{
|
{
|
||||||
if ( mGridVisible )
|
if ( mGridVisible )
|
||||||
{
|
{
|
||||||
glabels::Distance w = mModel->frame()->w();
|
Distance w = mModel->frame()->w();
|
||||||
glabels::Distance h = mModel->frame()->h();
|
Distance h = mModel->frame()->h();
|
||||||
|
|
||||||
glabels::Distance x0, y0;
|
Distance x0, y0;
|
||||||
if ( dynamic_cast<const glabels::FrameRect*>( mModel->frame() ) )
|
if ( dynamic_cast<const FrameRect*>( mModel->frame() ) )
|
||||||
{
|
{
|
||||||
x0 = gridSpacing;
|
x0 = gridSpacing;
|
||||||
y0 = gridSpacing;
|
y0 = gridSpacing;
|
||||||
@@ -1075,12 +1076,12 @@ LabelEditor::drawGridLayer( QPainter* painter )
|
|||||||
pen.setCosmetic( true );
|
pen.setCosmetic( true );
|
||||||
painter->setPen( pen );
|
painter->setPen( pen );
|
||||||
|
|
||||||
for ( glabels::Distance x = x0; x < w; x += gridSpacing )
|
for ( Distance x = x0; x < w; x += gridSpacing )
|
||||||
{
|
{
|
||||||
painter->drawLine( x.pt(), 0, x.pt(), h.pt() );
|
painter->drawLine( x.pt(), 0, x.pt(), h.pt() );
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( glabels::Distance y = y0; y < h; y += gridSpacing )
|
for ( Distance y = y0; y < h; y += gridSpacing )
|
||||||
{
|
{
|
||||||
painter->drawLine( 0, y.pt(), w.pt(), y.pt() );
|
painter->drawLine( 0, y.pt(), w.pt(), y.pt() );
|
||||||
}
|
}
|
||||||
@@ -1112,7 +1113,7 @@ LabelEditor::drawMarkupLayer( QPainter* painter )
|
|||||||
painter->translate( -mModel->frame()->w().pt(), 0 );
|
painter->translate( -mModel->frame()->w().pt(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach( glabels::Markup* markup, mModel->frame()->markups() )
|
foreach( Markup* markup, mModel->frame()->markups() )
|
||||||
{
|
{
|
||||||
painter->drawPath( markup->path() );
|
painter->drawPath( markup->path() );
|
||||||
}
|
}
|
||||||
@@ -1207,9 +1208,9 @@ LabelEditor::drawSelectRegionLayer( QPainter* painter )
|
|||||||
///
|
///
|
||||||
void LabelEditor::onSettingsChanged()
|
void LabelEditor::onSettingsChanged()
|
||||||
{
|
{
|
||||||
glabels::Units units = Settings::units();
|
Units units = Settings::units();
|
||||||
|
|
||||||
mStepSize = glabels::Distance( units.resolution(), units );
|
mStepSize = Distance( units.resolution(), units );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1248,3 +1249,5 @@ void LabelEditor::onModelSizeChanged()
|
|||||||
|
|
||||||
emit zoomChanged();
|
emit zoomChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
+16
-10
@@ -28,6 +28,10 @@
|
|||||||
|
|
||||||
#include "Region.h"
|
#include "Region.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
@@ -55,7 +59,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void contextMenuActivate();
|
void contextMenuActivate();
|
||||||
void zoomChanged();
|
void zoomChanged();
|
||||||
void pointerMoved( const glabels::Distance& x, const glabels::Distance& y );
|
void pointerMoved( const Distance& x, const Distance& y );
|
||||||
void pointerExited();
|
void pointerExited();
|
||||||
void modeChanged();
|
void modeChanged();
|
||||||
|
|
||||||
@@ -128,8 +132,8 @@ protected:
|
|||||||
// Private methods
|
// Private methods
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
private:
|
private:
|
||||||
void handleResizeMotion( const glabels::Distance& xWorld,
|
void handleResizeMotion( const Distance& xWorld,
|
||||||
const glabels::Distance& yWorld );
|
const Distance& yWorld );
|
||||||
|
|
||||||
void drawBgLayer( QPainter* painter );
|
void drawBgLayer( QPainter* painter );
|
||||||
void drawGridLayer( QPainter* painter );
|
void drawGridLayer( QPainter* painter );
|
||||||
@@ -175,14 +179,14 @@ private:
|
|||||||
double mZoom;
|
double mZoom;
|
||||||
bool mZoomToFitFlag;
|
bool mZoomToFitFlag;
|
||||||
double mScale;
|
double mScale;
|
||||||
glabels::Distance mX0;
|
Distance mX0;
|
||||||
glabels::Distance mY0;
|
Distance mY0;
|
||||||
|
|
||||||
bool mMarkupVisible;
|
bool mMarkupVisible;
|
||||||
bool mGridVisible;
|
bool mGridVisible;
|
||||||
|
|
||||||
double mGridSpacing;
|
double mGridSpacing;
|
||||||
glabels::Distance mStepSize;
|
Distance mStepSize;
|
||||||
|
|
||||||
LabelModel* mModel;
|
LabelModel* mModel;
|
||||||
UndoRedoModel* mUndoRedoModel;
|
UndoRedoModel* mUndoRedoModel;
|
||||||
@@ -194,8 +198,8 @@ private:
|
|||||||
Region mSelectRegion;
|
Region mSelectRegion;
|
||||||
|
|
||||||
/* ArrowMove state */
|
/* ArrowMove state */
|
||||||
glabels::Distance mMoveLastX;
|
Distance mMoveLastX;
|
||||||
glabels::Distance mMoveLastY;
|
Distance mMoveLastY;
|
||||||
|
|
||||||
/* ArrowResize state */
|
/* ArrowResize state */
|
||||||
LabelModelObject* mResizeObject;
|
LabelModelObject* mResizeObject;
|
||||||
@@ -205,11 +209,13 @@ private:
|
|||||||
/* CreateDrag state */
|
/* CreateDrag state */
|
||||||
CreateType mCreateObjectType;
|
CreateType mCreateObjectType;
|
||||||
LabelModelObject* mCreateObject;
|
LabelModelObject* mCreateObject;
|
||||||
glabels::Distance mCreateX0;
|
Distance mCreateX0;
|
||||||
glabels::Distance mCreateY0;
|
Distance mCreateY0;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelEditor_h
|
#endif // LabelEditor_h
|
||||||
|
|||||||
+65
-57
@@ -35,6 +35,12 @@
|
|||||||
#include "Merge/None.h"
|
#include "Merge/None.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const QString MIME_TYPE = "application/x-glabels-objects";
|
const QString MIME_TYPE = "application/x-glabels-objects";
|
||||||
@@ -161,7 +167,7 @@ void LabelModel::setCompressionLevel( int compressionLevel )
|
|||||||
///
|
///
|
||||||
/// Get template
|
/// Get template
|
||||||
///
|
///
|
||||||
const glabels::Template* LabelModel::tmplate() const
|
const Template* LabelModel::tmplate() const
|
||||||
{
|
{
|
||||||
return mTmplate;
|
return mTmplate;
|
||||||
}
|
}
|
||||||
@@ -170,7 +176,7 @@ const glabels::Template* LabelModel::tmplate() const
|
|||||||
///
|
///
|
||||||
/// Get frame
|
/// Get frame
|
||||||
///
|
///
|
||||||
const glabels::Frame* LabelModel::frame() const
|
const Frame* LabelModel::frame() const
|
||||||
{
|
{
|
||||||
return mFrame;
|
return mFrame;
|
||||||
}
|
}
|
||||||
@@ -179,7 +185,7 @@ const glabels::Frame* LabelModel::frame() const
|
|||||||
///
|
///
|
||||||
/// Set template
|
/// Set template
|
||||||
///
|
///
|
||||||
void LabelModel::setTmplate( const glabels::Template* tmplate )
|
void LabelModel::setTmplate( const Template* tmplate )
|
||||||
{
|
{
|
||||||
if (mTmplate != tmplate)
|
if (mTmplate != tmplate)
|
||||||
{
|
{
|
||||||
@@ -225,7 +231,7 @@ void LabelModel::setRotate( bool rotate )
|
|||||||
///
|
///
|
||||||
/// Get width
|
/// Get width
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModel::w() const
|
Distance LabelModel::w() const
|
||||||
{
|
{
|
||||||
return mRotate ? mFrame->h() : mFrame->w();
|
return mRotate ? mFrame->h() : mFrame->w();
|
||||||
}
|
}
|
||||||
@@ -234,7 +240,7 @@ glabels::Distance LabelModel::w() const
|
|||||||
///
|
///
|
||||||
/// Get height
|
/// Get height
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModel::h() const
|
Distance LabelModel::h() const
|
||||||
{
|
{
|
||||||
return mRotate ? mFrame->w() : mFrame->h();
|
return mRotate ? mFrame->w() : mFrame->h();
|
||||||
}
|
}
|
||||||
@@ -365,8 +371,8 @@ void LabelModel::deleteObject( LabelModelObject* object )
|
|||||||
/// Object at x,y
|
/// Object at x,y
|
||||||
///
|
///
|
||||||
LabelModelObject* LabelModel::objectAt( double scale,
|
LabelModelObject* LabelModel::objectAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const
|
const Distance& y ) const
|
||||||
{
|
{
|
||||||
/* Search object list in reverse order. I.e. from top to bottom. */
|
/* Search object list in reverse order. I.e. from top to bottom. */
|
||||||
QList<LabelModelObject*>::const_iterator it = mObjectList.end();
|
QList<LabelModelObject*>::const_iterator it = mObjectList.end();
|
||||||
@@ -388,8 +394,8 @@ LabelModelObject* LabelModel::objectAt( double scale,
|
|||||||
/// Handle at x,y
|
/// Handle at x,y
|
||||||
///
|
///
|
||||||
Handle* LabelModel::handleAt( double scale,
|
Handle* LabelModel::handleAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const
|
const Distance& y ) const
|
||||||
{
|
{
|
||||||
foreach( LabelModelObject* object, mObjectList )
|
foreach( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -500,10 +506,10 @@ void LabelModel::unselectAll()
|
|||||||
///
|
///
|
||||||
void LabelModel::selectRegion( const Region ®ion )
|
void LabelModel::selectRegion( const Region ®ion )
|
||||||
{
|
{
|
||||||
glabels::Distance rX1 = min( region.x1(), region.x2() );
|
Distance rX1 = min( region.x1(), region.x2() );
|
||||||
glabels::Distance rY1 = min( region.y1(), region.y2() );
|
Distance rY1 = min( region.y1(), region.y2() );
|
||||||
glabels::Distance rX2 = max( region.x1(), region.x2() );
|
Distance rX2 = max( region.x1(), region.x2() );
|
||||||
glabels::Distance rY2 = max( region.y1(), region.y2() );
|
Distance rY2 = max( region.y1(), region.y2() );
|
||||||
|
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -695,7 +701,7 @@ void LabelModel::raiseSelectionToTop()
|
|||||||
mObjectList.removeOne( object );
|
mObjectList.removeOne( object );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move to end of list, representing top most object.
|
// Move to end of list, representing top most object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
mObjectList.push_back( object );
|
mObjectList.push_back( object );
|
||||||
@@ -719,7 +725,7 @@ void LabelModel::lowerSelectionToBottom()
|
|||||||
mObjectList.removeOne( object );
|
mObjectList.removeOne( object );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Move to front of list, representing bottom most object.
|
// Move to front of list, representing bottom most object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
mObjectList.push_front( object );
|
mObjectList.push_front( object );
|
||||||
@@ -818,19 +824,19 @@ void LabelModel::alignSelectionLeft()
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find left-most edge.
|
// Find left-most edge.
|
||||||
glabels::Distance x1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
Distance x1_min = 7200; // Start with a very large value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
if ( r.x1() < x1_min ) x1_min = r.x1();
|
if ( r.x1() < x1_min ) x1_min = r.x1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Now adjust the object positions to line up the left edges at left-most edge.
|
// Now adjust the object positions to line up the left edges at left-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dx = x1_min - r.x1();
|
Distance dx = x1_min - r.x1();
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -852,19 +858,19 @@ void LabelModel::alignSelectionRight()
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find right-most edge.
|
// Find right-most edge.
|
||||||
glabels::Distance x1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
Distance x1_max = -7200; // Start with a very large negative value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
if ( r.x1() > x1_max ) x1_max = r.x1();
|
if ( r.x1() > x1_max ) x1_max = r.x1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Now adjust the object positions to line up the right edges at right-most edge.
|
// Now adjust the object positions to line up the right edges at right-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dx = x1_max - r.x1();
|
Distance dx = x1_max - r.x1();
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -886,8 +892,8 @@ void LabelModel::alignSelectionHCenter()
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find average center of objects.
|
// Find average center of objects.
|
||||||
glabels::Distance xsum = 0;
|
Distance xsum = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
@@ -895,15 +901,15 @@ void LabelModel::alignSelectionHCenter()
|
|||||||
xsum += (r.x1() + r.x2()) / 2.0;
|
xsum += (r.x1() + r.x2()) / 2.0;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
glabels::Distance xavg = xsum / n;
|
Distance xavg = xsum / n;
|
||||||
|
|
||||||
/// Find object closest to average center of objects.
|
// Find object closest to average center of objects.
|
||||||
glabels::Distance xcenter = 7200; /// Start with very large value.
|
Distance xcenter = 7200; // Start with very large value.
|
||||||
glabels::Distance dxmin = fabs( xavg - xcenter );
|
Distance dxmin = fabs( xavg - xcenter );
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dx = fabs( xavg - (r.x1() + r.x2())/2.0 );
|
Distance dx = fabs( xavg - (r.x1() + r.x2())/2.0 );
|
||||||
if ( dx < dxmin )
|
if ( dx < dxmin )
|
||||||
{
|
{
|
||||||
dxmin = dx;
|
dxmin = dx;
|
||||||
@@ -911,11 +917,11 @@ void LabelModel::alignSelectionHCenter()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Now adjust the object positions to line up with the center of this object.
|
// Now adjust the object positions to line up with the center of this object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dx = xcenter - (r.x1() + r.x2())/2.0;
|
Distance dx = xcenter - (r.x1() + r.x2())/2.0;
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -937,19 +943,19 @@ void LabelModel::alignSelectionTop()
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find top-most edge.
|
// Find top-most edge.
|
||||||
glabels::Distance y1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
Distance y1_min = 7200; // Start with a very large value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
if ( r.y1() < y1_min ) y1_min = r.y1();
|
if ( r.y1() < y1_min ) y1_min = r.y1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Now adjust the object positions to line up the top edges at top-most edge.
|
// Now adjust the object positions to line up the top edges at top-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dy = y1_min - r.y1();
|
Distance dy = y1_min - r.y1();
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -971,19 +977,19 @@ void LabelModel::alignSelectionBottom()
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find bottom-most edge.
|
// Find bottom-most edge.
|
||||||
glabels::Distance y1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
Distance y1_max = -7200; // Start with a very large negative value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
if ( r.y1() > y1_max ) y1_max = r.y1();
|
if ( r.y1() > y1_max ) y1_max = r.y1();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Now adjust the object positions to line up the bottom edges at bottom-most edge.
|
// Now adjust the object positions to line up the bottom edges at bottom-most edge.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dy = y1_max - r.y1();
|
Distance dy = y1_max - r.y1();
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1005,8 +1011,8 @@ void LabelModel::alignSelectionVCenter()
|
|||||||
|
|
||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find average center of objects.
|
// Find average center of objects.
|
||||||
glabels::Distance ysum = 0;
|
Distance ysum = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
@@ -1014,15 +1020,15 @@ void LabelModel::alignSelectionVCenter()
|
|||||||
ysum += (r.y1() + r.y2()) / 2.0;
|
ysum += (r.y1() + r.y2()) / 2.0;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
glabels::Distance yavg = ysum / n;
|
Distance yavg = ysum / n;
|
||||||
|
|
||||||
/// Find object closest to average center of objects.
|
// Find object closest to average center of objects.
|
||||||
glabels::Distance ycenter = 7200; /// Start with very large value.
|
Distance ycenter = 7200; // Start with very large value.
|
||||||
glabels::Distance dymin = fabs( yavg - ycenter );
|
Distance dymin = fabs( yavg - ycenter );
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dy = fabs( yavg - (r.y1() + r.y2())/2.0 );
|
Distance dy = fabs( yavg - (r.y1() + r.y2())/2.0 );
|
||||||
if ( dy < dymin )
|
if ( dy < dymin )
|
||||||
{
|
{
|
||||||
dymin = dy;
|
dymin = dy;
|
||||||
@@ -1030,11 +1036,11 @@ void LabelModel::alignSelectionVCenter()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Now adjust the object positions to line up with the center of this object.
|
// Now adjust the object positions to line up with the center of this object.
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance dy = ycenter - (r.y1() + r.y2())/2.0;
|
Distance dy = ycenter - (r.y1() + r.y2())/2.0;
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1049,15 +1055,15 @@ void LabelModel::alignSelectionVCenter()
|
|||||||
///
|
///
|
||||||
void LabelModel::centerSelectionHoriz()
|
void LabelModel::centerSelectionHoriz()
|
||||||
{
|
{
|
||||||
glabels::Distance xLabelCenter = w() / 2.0;
|
Distance xLabelCenter = w() / 2.0;
|
||||||
|
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
if ( object->isSelected() )
|
if ( object->isSelected() )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance xObjectCenter = (r.x1() + r.x2()) / 2.0;
|
Distance xObjectCenter = (r.x1() + r.x2()) / 2.0;
|
||||||
glabels::Distance dx = xLabelCenter - xObjectCenter;
|
Distance dx = xLabelCenter - xObjectCenter;
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1073,15 +1079,15 @@ void LabelModel::centerSelectionHoriz()
|
|||||||
///
|
///
|
||||||
void LabelModel::centerSelectionVert()
|
void LabelModel::centerSelectionVert()
|
||||||
{
|
{
|
||||||
glabels::Distance yLabelCenter = h() / 2.0;
|
Distance yLabelCenter = h() / 2.0;
|
||||||
|
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
if ( object->isSelected() )
|
if ( object->isSelected() )
|
||||||
{
|
{
|
||||||
Region r = object->getExtent();
|
Region r = object->getExtent();
|
||||||
glabels::Distance yObjectCenter = (r.y1() + r.y2()) / 2.0;
|
Distance yObjectCenter = (r.y1() + r.y2()) / 2.0;
|
||||||
glabels::Distance dy = yLabelCenter - yObjectCenter;
|
Distance dy = yLabelCenter - yObjectCenter;
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1095,7 +1101,7 @@ void LabelModel::centerSelectionVert()
|
|||||||
///
|
///
|
||||||
/// Move Selected Objects By dx,dy
|
/// Move Selected Objects By dx,dy
|
||||||
///
|
///
|
||||||
void LabelModel::moveSelection( const glabels::Distance& dx, const glabels::Distance& dy )
|
void LabelModel::moveSelection( const Distance& dx, const Distance& dy )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -1266,7 +1272,7 @@ void LabelModel::setSelectionTextColorNode( ColorNode textColorNode )
|
|||||||
///
|
///
|
||||||
/// Set Line Width Of Selected Objects
|
/// Set Line Width Of Selected Objects
|
||||||
///
|
///
|
||||||
void LabelModel::setSelectionLineWidth( const glabels::Distance& lineWidth )
|
void LabelModel::setSelectionLineWidth( const Distance& lineWidth )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -1415,3 +1421,5 @@ void LabelModel::draw( QPainter* painter, bool inEditor, merge::Record* record )
|
|||||||
object->draw( painter, inEditor, record );
|
object->draw( painter, inEditor, record );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
+22
-19
@@ -32,18 +32,19 @@
|
|||||||
#include "Merge/Merge.h"
|
#include "Merge/Merge.h"
|
||||||
#include "Merge/Record.h"
|
#include "Merge/Record.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class ColorNode;
|
class ColorNode;
|
||||||
class Handle;
|
class Handle;
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
class Region;
|
class Region;
|
||||||
|
|
||||||
|
///
|
||||||
//////////////////////////////////////////////
|
/// LabelModel
|
||||||
//////////////////////////////////////////////
|
///
|
||||||
// LabelModel
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
//////////////////////////////////////////////
|
|
||||||
class LabelModel : public QObject
|
class LabelModel : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -93,15 +94,15 @@ public:
|
|||||||
int compressionLevel() const;
|
int compressionLevel() const;
|
||||||
void setCompressionLevel( int compressionLevel );
|
void setCompressionLevel( int compressionLevel );
|
||||||
|
|
||||||
const glabels::Template* tmplate() const;
|
const Template* tmplate() const;
|
||||||
const glabels::Frame* frame() const;
|
const Frame* frame() const;
|
||||||
void setTmplate( const glabels::Template* tmplate );
|
void setTmplate( const Template* tmplate );
|
||||||
|
|
||||||
bool rotate() const;
|
bool rotate() const;
|
||||||
void setRotate( bool rotate );
|
void setRotate( bool rotate );
|
||||||
|
|
||||||
glabels::Distance w() const;
|
Distance w() const;
|
||||||
glabels::Distance h() const;
|
Distance h() const;
|
||||||
|
|
||||||
const QList<LabelModelObject*>& objectList() const;
|
const QList<LabelModelObject*>& objectList() const;
|
||||||
|
|
||||||
@@ -117,12 +118,12 @@ public:
|
|||||||
void deleteObject( LabelModelObject* object );
|
void deleteObject( LabelModelObject* object );
|
||||||
|
|
||||||
LabelModelObject* objectAt( double scale,
|
LabelModelObject* objectAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const;
|
const Distance& y ) const;
|
||||||
|
|
||||||
Handle* handleAt( double scale,
|
Handle* handleAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const;
|
const Distance& y ) const;
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -176,7 +177,7 @@ public:
|
|||||||
void alignSelectionVCenter();
|
void alignSelectionVCenter();
|
||||||
void centerSelectionHoriz();
|
void centerSelectionHoriz();
|
||||||
void centerSelectionVert();
|
void centerSelectionVert();
|
||||||
void moveSelection( const glabels::Distance& dx, const glabels::Distance& dy );
|
void moveSelection( const Distance& dx, const Distance& dy );
|
||||||
void setSelectionFontFamily( const QString& fontFamily );
|
void setSelectionFontFamily( const QString& fontFamily );
|
||||||
void setSelectionFontSize( double fontSize );
|
void setSelectionFontSize( double fontSize );
|
||||||
void setSelectionFontWeight( QFont::Weight fontWeight );
|
void setSelectionFontWeight( QFont::Weight fontWeight );
|
||||||
@@ -185,7 +186,7 @@ public:
|
|||||||
void setSelectionTextVAlign( Qt::Alignment textVAlign );
|
void setSelectionTextVAlign( Qt::Alignment textVAlign );
|
||||||
void setSelectionTextLineSpacing( double textLineSpacing );
|
void setSelectionTextLineSpacing( double textLineSpacing );
|
||||||
void setSelectionTextColorNode( ColorNode textColorNode );
|
void setSelectionTextColorNode( ColorNode textColorNode );
|
||||||
void setSelectionLineWidth( const glabels::Distance& lineWidth );
|
void setSelectionLineWidth( const Distance& lineWidth );
|
||||||
void setSelectionLineColorNode( ColorNode lineColorNode );
|
void setSelectionLineColorNode( ColorNode lineColorNode );
|
||||||
void setSelectionFillColorNode( ColorNode fillColorNode );
|
void setSelectionFillColorNode( ColorNode fillColorNode );
|
||||||
|
|
||||||
@@ -223,8 +224,8 @@ private:
|
|||||||
bool mModified;
|
bool mModified;
|
||||||
QString mFileName;
|
QString mFileName;
|
||||||
int mCompressionLevel;
|
int mCompressionLevel;
|
||||||
const glabels::Template* mTmplate;
|
const Template* mTmplate;
|
||||||
const glabels::Frame* mFrame;
|
const Frame* mFrame;
|
||||||
bool mRotate;
|
bool mRotate;
|
||||||
|
|
||||||
QList<LabelModelObject*> mObjectList;
|
QList<LabelModelObject*> mObjectList;
|
||||||
@@ -232,5 +233,7 @@ private:
|
|||||||
merge::Merge* mMerge;
|
merge::Merge* mMerge;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModel_h
|
#endif // LabelModel_h
|
||||||
|
|||||||
@@ -25,6 +25,12 @@
|
|||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const double slopPixels = 2;
|
const double slopPixels = 2;
|
||||||
@@ -36,14 +42,17 @@ namespace
|
|||||||
///
|
///
|
||||||
LabelModelBoxObject::LabelModelBoxObject()
|
LabelModelBoxObject::LabelModelBoxObject()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copy constructor
|
/// Copy constructor
|
||||||
///
|
///
|
||||||
LabelModelBoxObject::LabelModelBoxObject( const LabelModelBoxObject* object ) : LabelModelShapeObject( object )
|
LabelModelBoxObject::LabelModelBoxObject( const LabelModelBoxObject* object )
|
||||||
|
: LabelModelShapeObject( object )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,6 +61,7 @@ LabelModelBoxObject::LabelModelBoxObject( const LabelModelBoxObject* object ) :
|
|||||||
///
|
///
|
||||||
LabelModelBoxObject::~LabelModelBoxObject()
|
LabelModelBoxObject::~LabelModelBoxObject()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -156,3 +166,5 @@ QPainterPath LabelModelBoxObject::hoverPath( double scale ) const
|
|||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "LabelModelShapeObject.h"
|
#include "LabelModelShapeObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Box Object
|
/// Label Model Box Object
|
||||||
///
|
///
|
||||||
@@ -57,5 +60,7 @@ protected:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModelBoxObject_h
|
#endif // LabelModelBoxObject_h
|
||||||
|
|||||||
@@ -25,6 +25,12 @@
|
|||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const double slopPixels = 2;
|
const double slopPixels = 2;
|
||||||
@@ -36,14 +42,17 @@ namespace
|
|||||||
///
|
///
|
||||||
LabelModelEllipseObject::LabelModelEllipseObject()
|
LabelModelEllipseObject::LabelModelEllipseObject()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copy constructor
|
/// Copy constructor
|
||||||
///
|
///
|
||||||
LabelModelEllipseObject::LabelModelEllipseObject( const LabelModelEllipseObject* object ) : LabelModelShapeObject( object )
|
LabelModelEllipseObject::LabelModelEllipseObject( const LabelModelEllipseObject* object )
|
||||||
|
: LabelModelShapeObject( object )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,6 +61,7 @@ LabelModelEllipseObject::LabelModelEllipseObject( const LabelModelEllipseObject*
|
|||||||
///
|
///
|
||||||
LabelModelEllipseObject::~LabelModelEllipseObject()
|
LabelModelEllipseObject::~LabelModelEllipseObject()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -156,3 +166,5 @@ QPainterPath LabelModelEllipseObject::hoverPath( double scale ) const
|
|||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "LabelModelShapeObject.h"
|
#include "LabelModelShapeObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Ellipse Object
|
/// Label Model Ellipse Object
|
||||||
///
|
///
|
||||||
@@ -57,5 +60,7 @@ protected:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModelEllipseObject_h
|
#endif // LabelModelEllipseObject_h
|
||||||
|
|||||||
@@ -30,10 +30,8 @@
|
|||||||
#include "Size.h"
|
#include "Size.h"
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace glabels
|
||||||
{
|
{
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Static data
|
/// Static data
|
||||||
@@ -126,19 +124,19 @@ void LabelModelImageObject::setFilenameNode( const TextNode& value )
|
|||||||
///
|
///
|
||||||
Size LabelModelImageObject::originalSize() const
|
Size LabelModelImageObject::originalSize() const
|
||||||
{
|
{
|
||||||
Size size( glabels::Distance::pt(72), glabels::Distance::pt(72) );
|
Size size( Distance::pt(72), Distance::pt(72) );
|
||||||
|
|
||||||
if ( mImage )
|
if ( mImage )
|
||||||
{
|
{
|
||||||
QSize qsize = mImage->size();
|
QSize qsize = mImage->size();
|
||||||
size.setW( glabels::Distance::pt( qsize.width() ) );
|
size.setW( Distance::pt( qsize.width() ) );
|
||||||
size.setH( glabels::Distance::pt( qsize.height() ) );
|
size.setH( Distance::pt( qsize.height() ) );
|
||||||
}
|
}
|
||||||
else if ( mSvg )
|
else if ( mSvg )
|
||||||
{
|
{
|
||||||
QSize qsize = mSvg->defaultSize();
|
QSize qsize = mSvg->defaultSize();
|
||||||
size.setW( glabels::Distance::pt( qsize.width() ) );
|
size.setW( Distance::pt( qsize.width() ) );
|
||||||
size.setH( glabels::Distance::pt( qsize.height() ) );
|
size.setH( Distance::pt( qsize.height() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
@@ -314,3 +312,5 @@ QImage* LabelModelImageObject::createShadowImage( const QColor& color ) const
|
|||||||
|
|
||||||
return shadow;
|
return shadow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
#include "LabelModelObject.h"
|
#include "LabelModelObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Image Object
|
/// Label Model Image Object
|
||||||
///
|
///
|
||||||
@@ -98,5 +101,7 @@ protected:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModelImageObject_h
|
#endif // LabelModelImageObject_h
|
||||||
|
|||||||
@@ -25,6 +25,12 @@
|
|||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const double slopPixels = 2;
|
const double slopPixels = 2;
|
||||||
@@ -49,7 +55,8 @@ LabelModelLineObject::LabelModelLineObject()
|
|||||||
///
|
///
|
||||||
/// Copy constructor
|
/// Copy constructor
|
||||||
///
|
///
|
||||||
LabelModelLineObject::LabelModelLineObject( const LabelModelLineObject* object ) : LabelModelObject(object)
|
LabelModelLineObject::LabelModelLineObject( const LabelModelLineObject* object )
|
||||||
|
: LabelModelObject(object)
|
||||||
{
|
{
|
||||||
mLineWidth = object->mLineWidth;
|
mLineWidth = object->mLineWidth;
|
||||||
mLineColorNode = object->mLineColorNode;
|
mLineColorNode = object->mLineColorNode;
|
||||||
@@ -81,7 +88,7 @@ LabelModelLineObject* LabelModelLineObject::clone() const
|
|||||||
///
|
///
|
||||||
/// Line Width Property Getter
|
/// Line Width Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelLineObject::lineWidth( void ) const
|
Distance LabelModelLineObject::lineWidth( void ) const
|
||||||
{
|
{
|
||||||
return mLineWidth;
|
return mLineWidth;
|
||||||
}
|
}
|
||||||
@@ -90,7 +97,7 @@ glabels::Distance LabelModelLineObject::lineWidth( void ) const
|
|||||||
///
|
///
|
||||||
/// Line Width Property Setter
|
/// Line Width Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelLineObject::setLineWidth( const glabels::Distance& value )
|
void LabelModelLineObject::setLineWidth( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mLineWidth != value )
|
if ( mLineWidth != value )
|
||||||
{
|
{
|
||||||
@@ -198,3 +205,5 @@ QPainterPath LabelModelLineObject::hoverPath( double scale ) const
|
|||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "LabelModelObject.h"
|
#include "LabelModelObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Line Object
|
/// Label Model Line Object
|
||||||
///
|
///
|
||||||
@@ -54,8 +57,8 @@ public:
|
|||||||
//
|
//
|
||||||
// Line Property: lineWidth
|
// Line Property: lineWidth
|
||||||
//
|
//
|
||||||
virtual glabels::Distance lineWidth( void ) const;
|
virtual Distance lineWidth( void ) const;
|
||||||
virtual void setLineWidth( const glabels::Distance& value );
|
virtual void setLineWidth( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -86,10 +89,12 @@ protected:
|
|||||||
// Private Members
|
// Private Members
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
protected:
|
protected:
|
||||||
glabels::Distance mLineWidth;
|
Distance mLineWidth;
|
||||||
ColorNode mLineColorNode;
|
ColorNode mLineColorNode;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModelLineObject_h
|
#endif // LabelModelLineObject_h
|
||||||
|
|||||||
@@ -31,6 +31,9 @@
|
|||||||
#include "TextNode.h"
|
#include "TextNode.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Next Object ID
|
/// Next Object ID
|
||||||
///
|
///
|
||||||
@@ -105,6 +108,7 @@ LabelModelObject::LabelModelObject( const LabelModelObject* object )
|
|||||||
///
|
///
|
||||||
LabelModelObject::~LabelModelObject()
|
LabelModelObject::~LabelModelObject()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -147,7 +151,7 @@ void LabelModelObject::unselect()
|
|||||||
///
|
///
|
||||||
/// X0 Property Getter
|
/// X0 Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelObject::x0() const
|
Distance LabelModelObject::x0() const
|
||||||
{
|
{
|
||||||
return mX0;
|
return mX0;
|
||||||
}
|
}
|
||||||
@@ -156,7 +160,7 @@ glabels::Distance LabelModelObject::x0() const
|
|||||||
///
|
///
|
||||||
/// X0 Property Setter
|
/// X0 Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setX0( const glabels::Distance& value )
|
void LabelModelObject::setX0( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mX0 != value )
|
if ( mX0 != value )
|
||||||
{
|
{
|
||||||
@@ -169,7 +173,7 @@ void LabelModelObject::setX0( const glabels::Distance& value )
|
|||||||
///
|
///
|
||||||
/// Y0 Property Getter
|
/// Y0 Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelObject::y0() const
|
Distance LabelModelObject::y0() const
|
||||||
{
|
{
|
||||||
return mY0;
|
return mY0;
|
||||||
}
|
}
|
||||||
@@ -178,7 +182,7 @@ glabels::Distance LabelModelObject::y0() const
|
|||||||
///
|
///
|
||||||
/// Y0 Property Setter
|
/// Y0 Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setY0( const glabels::Distance& value )
|
void LabelModelObject::setY0( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mY0 != value )
|
if ( mY0 != value )
|
||||||
{
|
{
|
||||||
@@ -191,7 +195,7 @@ void LabelModelObject::setY0( const glabels::Distance& value )
|
|||||||
///
|
///
|
||||||
/// W (Width) Property Getter
|
/// W (Width) Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelObject::w() const
|
Distance LabelModelObject::w() const
|
||||||
{
|
{
|
||||||
return mW;
|
return mW;
|
||||||
}
|
}
|
||||||
@@ -200,7 +204,7 @@ glabels::Distance LabelModelObject::w() const
|
|||||||
///
|
///
|
||||||
/// W (Width) Property Setter
|
/// W (Width) Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setW( const glabels::Distance& value )
|
void LabelModelObject::setW( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mW != value )
|
if ( mW != value )
|
||||||
{
|
{
|
||||||
@@ -214,7 +218,7 @@ void LabelModelObject::setW( const glabels::Distance& value )
|
|||||||
///
|
///
|
||||||
/// H (Height) Property Getter
|
/// H (Height) Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelObject::h() const
|
Distance LabelModelObject::h() const
|
||||||
{
|
{
|
||||||
return mH;
|
return mH;
|
||||||
}
|
}
|
||||||
@@ -223,7 +227,7 @@ glabels::Distance LabelModelObject::h() const
|
|||||||
///
|
///
|
||||||
/// H (Height) Property Setter
|
/// H (Height) Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setH( const glabels::Distance& value )
|
void LabelModelObject::setH( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mH != value )
|
if ( mH != value )
|
||||||
{
|
{
|
||||||
@@ -281,7 +285,7 @@ void LabelModelObject::setShadow( bool value )
|
|||||||
///
|
///
|
||||||
/// Shadow X Property Getter
|
/// Shadow X Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelObject::shadowX() const
|
Distance LabelModelObject::shadowX() const
|
||||||
{
|
{
|
||||||
return mShadowX;
|
return mShadowX;
|
||||||
}
|
}
|
||||||
@@ -290,7 +294,7 @@ glabels::Distance LabelModelObject::shadowX() const
|
|||||||
///
|
///
|
||||||
/// Shadow X Property Setter
|
/// Shadow X Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setShadowX( const glabels::Distance& value )
|
void LabelModelObject::setShadowX( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mShadowX != value )
|
if ( mShadowX != value )
|
||||||
{
|
{
|
||||||
@@ -303,7 +307,7 @@ void LabelModelObject::setShadowX( const glabels::Distance& value )
|
|||||||
///
|
///
|
||||||
/// Shadow Y Property Getter
|
/// Shadow Y Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelObject::shadowY() const
|
Distance LabelModelObject::shadowY() const
|
||||||
{
|
{
|
||||||
return mShadowY;
|
return mShadowY;
|
||||||
}
|
}
|
||||||
@@ -312,7 +316,7 @@ glabels::Distance LabelModelObject::shadowY() const
|
|||||||
///
|
///
|
||||||
/// Shadow Y Property Setter
|
/// Shadow Y Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setShadowY( const glabels::Distance& value )
|
void LabelModelObject::setShadowY( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mShadowY != value )
|
if ( mShadowY != value )
|
||||||
{
|
{
|
||||||
@@ -382,6 +386,7 @@ QString LabelModelObject::text() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setText( const QString& value )
|
void LabelModelObject::setText( const QString& value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -401,6 +406,7 @@ QString LabelModelObject::fontFamily() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setFontFamily( const QString& value )
|
void LabelModelObject::setFontFamily( const QString& value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -420,6 +426,7 @@ double LabelModelObject::fontSize() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setFontSize( double value )
|
void LabelModelObject::setFontSize( double value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -439,6 +446,7 @@ QFont::Weight LabelModelObject::fontWeight() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setFontWeight( QFont::Weight value )
|
void LabelModelObject::setFontWeight( QFont::Weight value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -458,6 +466,7 @@ bool LabelModelObject::fontItalicFlag() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setFontItalicFlag( bool value )
|
void LabelModelObject::setFontItalicFlag( bool value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -477,6 +486,7 @@ bool LabelModelObject::fontUnderlineFlag() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setFontUnderlineFlag( bool value )
|
void LabelModelObject::setFontUnderlineFlag( bool value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -496,6 +506,7 @@ ColorNode LabelModelObject::textColorNode() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setTextColorNode( const ColorNode &value )
|
void LabelModelObject::setTextColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -515,6 +526,7 @@ Qt::Alignment LabelModelObject::textHAlign() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setTextHAlign( Qt::Alignment value )
|
void LabelModelObject::setTextHAlign( Qt::Alignment value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -534,6 +546,7 @@ Qt::Alignment LabelModelObject::textVAlign() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setTextVAlign( Qt::Alignment value )
|
void LabelModelObject::setTextVAlign( Qt::Alignment value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -553,6 +566,7 @@ double LabelModelObject::textLineSpacing() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setTextLineSpacing( double value )
|
void LabelModelObject::setTextLineSpacing( double value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -572,6 +586,7 @@ TextNode LabelModelObject::filenameNode() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setFilenameNode( const TextNode& value )
|
void LabelModelObject::setFilenameNode( const TextNode& value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -581,7 +596,7 @@ void LabelModelObject::setFilenameNode( const TextNode& value )
|
|||||||
///
|
///
|
||||||
Size LabelModelObject::originalSize() const
|
Size LabelModelObject::originalSize() const
|
||||||
{
|
{
|
||||||
return Size( glabels::Distance::pt(0), glabels::Distance::pt(0) );
|
return Size( Distance::pt(0), Distance::pt(0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -589,7 +604,7 @@ Size LabelModelObject::originalSize() const
|
|||||||
/// Virtual Line Width Property Default Getter
|
/// Virtual Line Width Property Default Getter
|
||||||
/// (Overridden by concrete class)
|
/// (Overridden by concrete class)
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelObject::lineWidth() const
|
Distance LabelModelObject::lineWidth() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -599,8 +614,9 @@ glabels::Distance LabelModelObject::lineWidth() const
|
|||||||
/// Virtual Line Width Property Default Setter
|
/// Virtual Line Width Property Default Setter
|
||||||
/// (Overridden by concrete class)
|
/// (Overridden by concrete class)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setLineWidth( const glabels::Distance& value )
|
void LabelModelObject::setLineWidth( const Distance& value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -620,6 +636,7 @@ ColorNode LabelModelObject::lineColorNode() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setLineColorNode( const ColorNode &value )
|
void LabelModelObject::setLineColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -639,6 +656,7 @@ ColorNode LabelModelObject::fillColorNode() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setFillColorNode( const ColorNode &value )
|
void LabelModelObject::setFillColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -658,6 +676,7 @@ TextNode LabelModelObject::bcDataNode() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setBcDataNode( const TextNode &value )
|
void LabelModelObject::setBcDataNode( const TextNode &value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -677,6 +696,7 @@ bool LabelModelObject::bcTextFlag() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setBcTextFlag( bool value )
|
void LabelModelObject::setBcTextFlag( bool value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -696,6 +716,7 @@ bool LabelModelObject::bcChecksumFlag() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setBcChecksumFlag( bool value )
|
void LabelModelObject::setBcChecksumFlag( bool value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -715,6 +736,7 @@ ColorNode LabelModelObject::bcColorNode() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setBcColorNode( const ColorNode &value )
|
void LabelModelObject::setBcColorNode( const ColorNode &value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -734,6 +756,7 @@ BarcodeStyle LabelModelObject::bcStyle() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setBcStyle( const BarcodeStyle &value )
|
void LabelModelObject::setBcStyle( const BarcodeStyle &value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -753,6 +776,7 @@ int LabelModelObject::bcFormatDigits() const
|
|||||||
///
|
///
|
||||||
void LabelModelObject::setBcFormatDigits( int value )
|
void LabelModelObject::setBcFormatDigits( int value )
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -799,8 +823,8 @@ bool LabelModelObject::canLineWidth() const
|
|||||||
///
|
///
|
||||||
/// Set Absolute Position
|
/// Set Absolute Position
|
||||||
///
|
///
|
||||||
void LabelModelObject::setPosition( const glabels::Distance& x0,
|
void LabelModelObject::setPosition( const Distance& x0,
|
||||||
const glabels::Distance& y0 )
|
const Distance& y0 )
|
||||||
{
|
{
|
||||||
if ( ( mX0 != x0 ) || ( mY0 != y0 ) )
|
if ( ( mX0 != x0 ) || ( mY0 != y0 ) )
|
||||||
{
|
{
|
||||||
@@ -815,8 +839,8 @@ void LabelModelObject::setPosition( const glabels::Distance& x0,
|
|||||||
///
|
///
|
||||||
/// Set Relative Position
|
/// Set Relative Position
|
||||||
///
|
///
|
||||||
void LabelModelObject::setPositionRelative( const glabels::Distance& dx,
|
void LabelModelObject::setPositionRelative( const Distance& dx,
|
||||||
const glabels::Distance& dy )
|
const Distance& dy )
|
||||||
{
|
{
|
||||||
if ( ( dx != 0 ) || ( dy != 0 ) )
|
if ( ( dx != 0 ) || ( dy != 0 ) )
|
||||||
{
|
{
|
||||||
@@ -840,8 +864,8 @@ Size LabelModelObject::size() const
|
|||||||
///
|
///
|
||||||
/// Set Size
|
/// Set Size
|
||||||
///
|
///
|
||||||
void LabelModelObject::setSize( const glabels::Distance& w,
|
void LabelModelObject::setSize( const Distance& w,
|
||||||
const glabels::Distance& h )
|
const Distance& h )
|
||||||
{
|
{
|
||||||
mW = w;
|
mW = w;
|
||||||
mH = h;
|
mH = h;
|
||||||
@@ -867,12 +891,12 @@ void LabelModelObject::setSize( const Size& size )
|
|||||||
///
|
///
|
||||||
/// Set Size (But Maintain Current Aspect Ratio)
|
/// Set Size (But Maintain Current Aspect Ratio)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setSizeHonorAspect( const glabels::Distance& w,
|
void LabelModelObject::setSizeHonorAspect( const Distance& w,
|
||||||
const glabels::Distance& h )
|
const Distance& h )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
glabels::Distance wNew = w;
|
Distance wNew = w;
|
||||||
glabels::Distance hNew = h;
|
Distance hNew = h;
|
||||||
|
|
||||||
if ( h > (w*aspectRatio) )
|
if ( h > (w*aspectRatio) )
|
||||||
{
|
{
|
||||||
@@ -890,10 +914,10 @@ void LabelModelObject::setSizeHonorAspect( const glabels::Distance& w,
|
|||||||
///
|
///
|
||||||
/// Set Width (But Maintain Current Aspect Ratio)
|
/// Set Width (But Maintain Current Aspect Ratio)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setWHonorAspect( const glabels::Distance& w )
|
void LabelModelObject::setWHonorAspect( const Distance& w )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
glabels::Distance h = w * aspectRatio;
|
Distance h = w * aspectRatio;
|
||||||
|
|
||||||
if ( ( mW != w ) || ( mH != h ) )
|
if ( ( mW != w ) || ( mH != h ) )
|
||||||
{
|
{
|
||||||
@@ -909,10 +933,10 @@ void LabelModelObject::setWHonorAspect( const glabels::Distance& w )
|
|||||||
///
|
///
|
||||||
/// Set Height (But Maintain Current Aspect Ratio)
|
/// Set Height (But Maintain Current Aspect Ratio)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setHHonorAspect( const glabels::Distance& h )
|
void LabelModelObject::setHHonorAspect( const Distance& h )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
glabels::Distance w = h / aspectRatio;
|
Distance w = h / aspectRatio;
|
||||||
|
|
||||||
if ( ( mW != w ) || ( mH != h ) )
|
if ( ( mW != w ) || ( mH != h ) )
|
||||||
{
|
{
|
||||||
@@ -930,8 +954,6 @@ void LabelModelObject::setHHonorAspect( const glabels::Distance& h )
|
|||||||
///
|
///
|
||||||
Region LabelModelObject::getExtent()
|
Region LabelModelObject::getExtent()
|
||||||
{
|
{
|
||||||
using namespace glabels;
|
|
||||||
|
|
||||||
QPointF a1( ( - lineWidth()/2).pt(), ( - lineWidth()/2).pt() );
|
QPointF a1( ( - lineWidth()/2).pt(), ( - lineWidth()/2).pt() );
|
||||||
QPointF a2( (mW + lineWidth()/2).pt(), ( - lineWidth()/2).pt() );
|
QPointF a2( (mW + lineWidth()/2).pt(), ( - lineWidth()/2).pt() );
|
||||||
QPointF a3( (mW + lineWidth()/2).pt(), (mH + lineWidth()/2).pt() );
|
QPointF a3( (mW + lineWidth()/2).pt(), (mH + lineWidth()/2).pt() );
|
||||||
@@ -998,8 +1020,8 @@ void LabelModelObject::flipVert()
|
|||||||
/// Is this object located at x,y?
|
/// Is this object located at x,y?
|
||||||
///
|
///
|
||||||
bool LabelModelObject::isLocatedAt( double scale,
|
bool LabelModelObject::isLocatedAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const
|
const Distance& y ) const
|
||||||
{
|
{
|
||||||
QPointF p( x.pt(), y.pt() );
|
QPointF p( x.pt(), y.pt() );
|
||||||
|
|
||||||
@@ -1029,8 +1051,8 @@ bool LabelModelObject::isLocatedAt( double scale,
|
|||||||
/// Is one of this object's handles locate at x,y? If so, return it.
|
/// Is one of this object's handles locate at x,y? If so, return it.
|
||||||
///
|
///
|
||||||
Handle* LabelModelObject::handleAt( double scale,
|
Handle* LabelModelObject::handleAt( double scale,
|
||||||
const glabels::Distance& x,
|
const Distance& x,
|
||||||
const glabels::Distance& y ) const
|
const Distance& y ) const
|
||||||
{
|
{
|
||||||
if ( mSelectedFlag )
|
if ( mSelectedFlag )
|
||||||
{
|
{
|
||||||
@@ -1104,4 +1126,7 @@ void LabelModelObject::drawSelectionHighlight( QPainter* painter, double scale )
|
|||||||
///
|
///
|
||||||
void LabelModelObject::sizeUpdated()
|
void LabelModelObject::sizeUpdated()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-28
@@ -37,6 +37,9 @@
|
|||||||
#include "Merge/Record.h"
|
#include "Merge/Record.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class Region;
|
class Region;
|
||||||
class Size;
|
class Size;
|
||||||
@@ -93,29 +96,29 @@ public:
|
|||||||
//
|
//
|
||||||
// x0 Property ( x coordinate of origin )
|
// x0 Property ( x coordinate of origin )
|
||||||
//
|
//
|
||||||
glabels::Distance x0() const;
|
Distance x0() const;
|
||||||
void setX0( const glabels::Distance& value );
|
void setX0( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// y0 Property ( y coordinate of origin )
|
// y0 Property ( y coordinate of origin )
|
||||||
//
|
//
|
||||||
glabels::Distance y0() const;
|
Distance y0() const;
|
||||||
void setY0( const glabels::Distance& value );
|
void setY0( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// w Property ( width of bounding box )
|
// w Property ( width of bounding box )
|
||||||
//
|
//
|
||||||
glabels::Distance w() const;
|
Distance w() const;
|
||||||
void setW( const glabels::Distance& value );
|
void setW( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// h Property ( height of bounding box )
|
// h Property ( height of bounding box )
|
||||||
//
|
//
|
||||||
glabels::Distance h() const;
|
Distance h() const;
|
||||||
void setH( const glabels::Distance& value );
|
void setH( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -135,15 +138,15 @@ public:
|
|||||||
//
|
//
|
||||||
// Shadow x Offset Property
|
// Shadow x Offset Property
|
||||||
//
|
//
|
||||||
glabels::Distance shadowX() const;
|
Distance shadowX() const;
|
||||||
void setShadowX( const glabels::Distance& value );
|
void setShadowX( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Shadow y Offset Property
|
// Shadow y Offset Property
|
||||||
//
|
//
|
||||||
glabels::Distance shadowY() const;
|
Distance shadowY() const;
|
||||||
void setShadowY( const glabels::Distance& value );
|
void setShadowY( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -257,8 +260,8 @@ public:
|
|||||||
//
|
//
|
||||||
// Virtual Shape Property: lineWidth
|
// Virtual Shape Property: lineWidth
|
||||||
//
|
//
|
||||||
virtual glabels::Distance lineWidth() const;
|
virtual Distance lineWidth() const;
|
||||||
virtual void setLineWidth( const glabels::Distance& value );
|
virtual void setLineWidth( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -335,20 +338,20 @@ public:
|
|||||||
// Position and Size methods
|
// Position and Size methods
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
void setPosition( const glabels::Distance& x0, const glabels::Distance& y0 );
|
void setPosition( const Distance& x0, const Distance& y0 );
|
||||||
void setPositionRelative( const glabels::Distance& dx, const glabels::Distance& dy );
|
void setPositionRelative( const Distance& dx, const Distance& dy );
|
||||||
Size size() const;
|
Size size() const;
|
||||||
void setSize( const glabels::Distance& w, const glabels::Distance& h );
|
void setSize( const Distance& w, const Distance& h );
|
||||||
void setSize( const Size& size );
|
void setSize( const Size& size );
|
||||||
void setSizeHonorAspect( const glabels::Distance& w, const glabels::Distance& h );
|
void setSizeHonorAspect( const Distance& w, const Distance& h );
|
||||||
void setWHonorAspect( const glabels::Distance& w );
|
void setWHonorAspect( const Distance& w );
|
||||||
void setHHonorAspect( const glabels::Distance& h );
|
void setHHonorAspect( const Distance& h );
|
||||||
Region getExtent();
|
Region getExtent();
|
||||||
void rotate( double thetaDegs );
|
void rotate( double thetaDegs );
|
||||||
void flipHoriz();
|
void flipHoriz();
|
||||||
void flipVert();
|
void flipVert();
|
||||||
bool isLocatedAt( double scale, const glabels::Distance& x, const glabels::Distance& y ) const;
|
bool isLocatedAt( double scale, const Distance& x, const Distance& y ) const;
|
||||||
Handle* handleAt( double scale, const glabels::Distance& x, const glabels::Distance& y ) const;
|
Handle* handleAt( double scale, const Distance& x, const Distance& y ) const;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
@@ -372,14 +375,14 @@ protected:
|
|||||||
protected:
|
protected:
|
||||||
bool mSelectedFlag;
|
bool mSelectedFlag;
|
||||||
|
|
||||||
glabels::Distance mX0;
|
Distance mX0;
|
||||||
glabels::Distance mY0;
|
Distance mY0;
|
||||||
glabels::Distance mW;
|
Distance mW;
|
||||||
glabels::Distance mH;
|
Distance mH;
|
||||||
|
|
||||||
bool mShadowState;
|
bool mShadowState;
|
||||||
glabels::Distance mShadowX;
|
Distance mShadowX;
|
||||||
glabels::Distance mShadowY;
|
Distance mShadowY;
|
||||||
double mShadowOpacity;
|
double mShadowOpacity;
|
||||||
ColorNode mShadowColorNode;
|
ColorNode mShadowColorNode;
|
||||||
|
|
||||||
@@ -398,5 +401,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModelObject_h
|
#endif // LabelModelObject_h
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -76,7 +79,7 @@ LabelModelShapeObject::~LabelModelShapeObject()
|
|||||||
///
|
///
|
||||||
/// Line Width Property Getter
|
/// Line Width Property Getter
|
||||||
///
|
///
|
||||||
glabels::Distance LabelModelShapeObject::lineWidth( void ) const
|
Distance LabelModelShapeObject::lineWidth( void ) const
|
||||||
{
|
{
|
||||||
return mLineWidth;
|
return mLineWidth;
|
||||||
}
|
}
|
||||||
@@ -85,7 +88,7 @@ glabels::Distance LabelModelShapeObject::lineWidth( void ) const
|
|||||||
///
|
///
|
||||||
/// Line Width Property Setter
|
/// Line Width Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelShapeObject::setLineWidth( const glabels::Distance& value )
|
void LabelModelShapeObject::setLineWidth( const Distance& value )
|
||||||
{
|
{
|
||||||
if ( mLineWidth != value )
|
if ( mLineWidth != value )
|
||||||
{
|
{
|
||||||
@@ -164,3 +167,5 @@ bool LabelModelShapeObject::canLineWidth()
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include "LabelModelObject.h"
|
#include "LabelModelObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Shape Object (Box or Ellipse)
|
/// Label Model Shape Object (Box or Ellipse)
|
||||||
///
|
///
|
||||||
@@ -49,8 +52,8 @@ public:
|
|||||||
//
|
//
|
||||||
// Shape Property: lineWidth
|
// Shape Property: lineWidth
|
||||||
//
|
//
|
||||||
virtual glabels::Distance lineWidth( void ) const;
|
virtual Distance lineWidth( void ) const;
|
||||||
virtual void setLineWidth( const glabels::Distance& value );
|
virtual void setLineWidth( const Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -80,11 +83,13 @@ public:
|
|||||||
// Private Members
|
// Private Members
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
protected:
|
protected:
|
||||||
glabels::Distance mLineWidth;
|
Distance mLineWidth;
|
||||||
ColorNode mLineColorNode;
|
ColorNode mLineColorNode;
|
||||||
ColorNode mFillColorNode;
|
ColorNode mFillColorNode;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModelShapeObject_h
|
#endif // LabelModelShapeObject_h
|
||||||
|
|||||||
@@ -29,6 +29,12 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Private
|
||||||
|
//
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const double marginPts = 3;
|
const double marginPts = 3;
|
||||||
@@ -67,7 +73,8 @@ LabelModelTextObject::LabelModelTextObject()
|
|||||||
///
|
///
|
||||||
/// Copy constructor
|
/// Copy constructor
|
||||||
///
|
///
|
||||||
LabelModelTextObject::LabelModelTextObject( const LabelModelTextObject* object ) : LabelModelObject(object)
|
LabelModelTextObject::LabelModelTextObject( const LabelModelTextObject* object )
|
||||||
|
: LabelModelObject(object)
|
||||||
{
|
{
|
||||||
mText = object->mText;
|
mText = object->mText;
|
||||||
mFontFamily = object->mFontFamily;
|
mFontFamily = object->mFontFamily;
|
||||||
@@ -337,7 +344,7 @@ void LabelModelTextObject::setTextLineSpacing( double value )
|
|||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
// Can Text Capability Implementation
|
/// Can Text Capability Implementation
|
||||||
///
|
///
|
||||||
bool LabelModelTextObject::canText()
|
bool LabelModelTextObject::canText()
|
||||||
{
|
{
|
||||||
@@ -348,7 +355,9 @@ bool LabelModelTextObject::canText()
|
|||||||
///
|
///
|
||||||
/// Draw shadow of object
|
/// Draw shadow of object
|
||||||
///
|
///
|
||||||
void LabelModelTextObject::drawShadow( QPainter* painter, bool inEditor, merge::Record* record ) const
|
void LabelModelTextObject::drawShadow( QPainter* painter,
|
||||||
|
bool inEditor,
|
||||||
|
merge::Record* record ) const
|
||||||
{
|
{
|
||||||
QColor textColor = mTextColorNode.color( record );
|
QColor textColor = mTextColorNode.color( record );
|
||||||
|
|
||||||
@@ -372,7 +381,9 @@ void LabelModelTextObject::drawShadow( QPainter* painter, bool inEditor, merge::
|
|||||||
///
|
///
|
||||||
/// Draw object itself
|
/// Draw object itself
|
||||||
///
|
///
|
||||||
void LabelModelTextObject::drawObject( QPainter* painter, bool inEditor, merge::Record* record ) const
|
void LabelModelTextObject::drawObject( QPainter* painter,
|
||||||
|
bool inEditor,
|
||||||
|
merge::Record* record ) const
|
||||||
{
|
{
|
||||||
QColor textColor = mTextColorNode.color( record );
|
QColor textColor = mTextColorNode.color( record );
|
||||||
|
|
||||||
@@ -516,7 +527,9 @@ void LabelModelTextObject::drawTextInEditor( QPainter* painter, const QColor& co
|
|||||||
/// Draw text in final printout or preview
|
/// Draw text in final printout or preview
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
LabelModelTextObject::drawText( QPainter* painter, const QColor&color, merge::Record* record ) const
|
LabelModelTextObject::drawText( QPainter* painter,
|
||||||
|
const QColor& color,
|
||||||
|
merge::Record* record ) const
|
||||||
{
|
{
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setFamily( mFontFamily );
|
font.setFamily( mFontFamily );
|
||||||
@@ -626,3 +639,5 @@ QString LabelModelTextObject::expandText( QString text, merge::Record* record )
|
|||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@
|
|||||||
#include "LabelModelObject.h"
|
#include "LabelModelObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Line Object
|
/// Label Model Line Object
|
||||||
///
|
///
|
||||||
@@ -170,5 +173,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // LabelModelTextObject_h
|
#endif // LabelModelTextObject_h
|
||||||
|
|||||||
+7
-5
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "privateConstants.h"
|
#include "Constants.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
namespace glabels
|
||||||
@@ -37,6 +37,7 @@ namespace glabels
|
|||||||
const Distance& dy )
|
const Distance& dy )
|
||||||
: mNx(nx), mNy(ny), mX0(x0), mY0(y0), mDx(dx), mDy(dy)
|
: mNx(nx), mNy(ny), mX0(x0), mY0(y0), mDx(dx), mDy(dy)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ namespace glabels
|
|||||||
: mNx(other.mNx), mNy(other.mNy), mX0(other.mX0), mY0(other.mY0),
|
: mNx(other.mNx), mNy(other.mNy), mX0(other.mX0), mY0(other.mY0),
|
||||||
mDx(other.mDx), mDy(other.mDy)
|
mDx(other.mDx), mDy(other.mDy)
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -87,10 +89,10 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
return ( (mNx == other->mNx) &&
|
return ( (mNx == other->mNx) &&
|
||||||
(mNy == other->mNy) &&
|
(mNy == other->mNy) &&
|
||||||
(fabs(mX0 - other->mX0) < Constants::EPSILON) &&
|
(fabs(mX0 - other->mX0) < EPSILON) &&
|
||||||
(fabs(mY0 - other->mY0) < Constants::EPSILON) &&
|
(fabs(mY0 - other->mY0) < EPSILON) &&
|
||||||
(fabs(mDx - other->mDx) < Constants::EPSILON) &&
|
(fabs(mDx - other->mDx) < EPSILON) &&
|
||||||
(fabs(mDy - other->mDy) < Constants::EPSILON) );
|
(fabs(mDy - other->mDy) < EPSILON) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+21
-14
@@ -52,6 +52,9 @@
|
|||||||
#include "UndoRedoModel.h"
|
#include "UndoRedoModel.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -149,6 +152,7 @@ MainWindow::MainWindow()
|
|||||||
///
|
///
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -226,25 +230,25 @@ void MainWindow::createActions()
|
|||||||
{
|
{
|
||||||
/* File actions */
|
/* File actions */
|
||||||
fileNewAction = new QAction( tr("&New..."), this );
|
fileNewAction = new QAction( tr("&New..."), this );
|
||||||
fileNewAction->setIcon( QIcon::fromTheme( "document-new", Icons::Fallback::FileNew() ) );
|
fileNewAction->setIcon( QIcon::fromTheme( "document-new", Icons::FileNew() ) );
|
||||||
fileNewAction->setShortcut( QKeySequence::New );
|
fileNewAction->setShortcut( QKeySequence::New );
|
||||||
fileNewAction->setStatusTip( tr("Create a new gLabels project") );
|
fileNewAction->setStatusTip( tr("Create a new gLabels project") );
|
||||||
connect( fileNewAction, SIGNAL(triggered()), this, SLOT(fileNew()) );
|
connect( fileNewAction, SIGNAL(triggered()), this, SLOT(fileNew()) );
|
||||||
|
|
||||||
fileOpenAction = new QAction( tr("&Open..."), this );
|
fileOpenAction = new QAction( tr("&Open..."), this );
|
||||||
fileOpenAction->setIcon( QIcon::fromTheme( "document-open", Icons::Fallback::FileOpen() ) );
|
fileOpenAction->setIcon( QIcon::fromTheme( "document-open", Icons::FileOpen() ) );
|
||||||
fileOpenAction->setShortcut( QKeySequence::Open );
|
fileOpenAction->setShortcut( QKeySequence::Open );
|
||||||
fileOpenAction->setStatusTip( tr("Open an existing gLabels project") );
|
fileOpenAction->setStatusTip( tr("Open an existing gLabels project") );
|
||||||
connect( fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen()) );
|
connect( fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen()) );
|
||||||
|
|
||||||
fileSaveAction = new QAction( tr("&Save"), this );
|
fileSaveAction = new QAction( tr("&Save"), this );
|
||||||
fileSaveAction->setIcon( QIcon::fromTheme( "document-save", Icons::Fallback::FileSave() ) );
|
fileSaveAction->setIcon( QIcon::fromTheme( "document-save", Icons::FileSave() ) );
|
||||||
fileSaveAction->setShortcut( QKeySequence::Save );
|
fileSaveAction->setShortcut( QKeySequence::Save );
|
||||||
fileSaveAction->setStatusTip( tr("Save current gLabels project") );
|
fileSaveAction->setStatusTip( tr("Save current gLabels project") );
|
||||||
connect( fileSaveAction, SIGNAL(triggered()), this, SLOT(fileSave()) );
|
connect( fileSaveAction, SIGNAL(triggered()), this, SLOT(fileSave()) );
|
||||||
|
|
||||||
fileSaveAsAction = new QAction( tr("Save &As..."), this );
|
fileSaveAsAction = new QAction( tr("Save &As..."), this );
|
||||||
fileSaveAsAction->setIcon( QIcon::fromTheme( "document-save-as", Icons::Fallback::FileSaveAs() ) );
|
fileSaveAsAction->setIcon( QIcon::fromTheme( "document-save-as", Icons::FileSaveAs() ) );
|
||||||
fileSaveAsAction->setShortcut( QKeySequence::SaveAs );
|
fileSaveAsAction->setShortcut( QKeySequence::SaveAs );
|
||||||
fileSaveAsAction->setStatusTip( tr("Save current gLabels project to a different name") );
|
fileSaveAsAction->setStatusTip( tr("Save current gLabels project to a different name") );
|
||||||
connect( fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs()) );
|
connect( fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs()) );
|
||||||
@@ -280,19 +284,19 @@ void MainWindow::createActions()
|
|||||||
connect( editRedoAction, SIGNAL(triggered()), this, SLOT(editRedo()) );
|
connect( editRedoAction, SIGNAL(triggered()), this, SLOT(editRedo()) );
|
||||||
|
|
||||||
editCutAction = new QAction( tr("Cut"), this );
|
editCutAction = new QAction( tr("Cut"), this );
|
||||||
editCutAction->setIcon( QIcon::fromTheme( "edit-cut", Icons::Fallback::EditCut() ) );
|
editCutAction->setIcon( QIcon::fromTheme( "edit-cut", Icons::EditCut() ) );
|
||||||
editCutAction->setShortcut( QKeySequence::Cut );
|
editCutAction->setShortcut( QKeySequence::Cut );
|
||||||
editCutAction->setStatusTip( tr("Cut the selection") );
|
editCutAction->setStatusTip( tr("Cut the selection") );
|
||||||
connect( editCutAction, SIGNAL(triggered()), this, SLOT(editCut()) );
|
connect( editCutAction, SIGNAL(triggered()), this, SLOT(editCut()) );
|
||||||
|
|
||||||
editCopyAction = new QAction( tr("&Copy"), this );
|
editCopyAction = new QAction( tr("&Copy"), this );
|
||||||
editCopyAction->setIcon( QIcon::fromTheme( "edit-copy", Icons::Fallback::EditCopy() ) );
|
editCopyAction->setIcon( QIcon::fromTheme( "edit-copy", Icons::EditCopy() ) );
|
||||||
editCopyAction->setShortcut( QKeySequence::Copy );
|
editCopyAction->setShortcut( QKeySequence::Copy );
|
||||||
editCopyAction->setStatusTip( tr("Copy the selection") );
|
editCopyAction->setStatusTip( tr("Copy the selection") );
|
||||||
connect( editCopyAction, SIGNAL(triggered()), this, SLOT(editCopy()) );
|
connect( editCopyAction, SIGNAL(triggered()), this, SLOT(editCopy()) );
|
||||||
|
|
||||||
editPasteAction = new QAction( tr("&Paste"), this );
|
editPasteAction = new QAction( tr("&Paste"), this );
|
||||||
editPasteAction->setIcon( QIcon::fromTheme( "edit-paste", Icons::Fallback::EditPaste() ) );
|
editPasteAction->setIcon( QIcon::fromTheme( "edit-paste", Icons::EditPaste() ) );
|
||||||
editPasteAction->setShortcut( QKeySequence::Paste );
|
editPasteAction->setShortcut( QKeySequence::Paste );
|
||||||
editPasteAction->setStatusTip( tr("Paste the clipboard") );
|
editPasteAction->setStatusTip( tr("Paste the clipboard") );
|
||||||
connect( editPasteAction, SIGNAL(triggered()), this, SLOT(editPaste()) );
|
connect( editPasteAction, SIGNAL(triggered()), this, SLOT(editPaste()) );
|
||||||
@@ -344,24 +348,24 @@ void MainWindow::createActions()
|
|||||||
connect( viewMarkupAction, SIGNAL(toggled(bool)), this, SLOT(viewMarkup(bool)) );
|
connect( viewMarkupAction, SIGNAL(toggled(bool)), this, SLOT(viewMarkup(bool)) );
|
||||||
|
|
||||||
viewZoomInAction = new QAction( tr("Zoom &In"), this );
|
viewZoomInAction = new QAction( tr("Zoom &In"), this );
|
||||||
viewZoomInAction->setIcon( QIcon::fromTheme( "zoom-in", Icons::Fallback::ZoomIn() ) );
|
viewZoomInAction->setIcon( QIcon::fromTheme( "zoom-in", Icons::ZoomIn() ) );
|
||||||
viewZoomInAction->setShortcut( QKeySequence::ZoomIn );
|
viewZoomInAction->setShortcut( QKeySequence::ZoomIn );
|
||||||
viewZoomInAction->setStatusTip( tr("Increase magnification") );
|
viewZoomInAction->setStatusTip( tr("Increase magnification") );
|
||||||
connect( viewZoomInAction, SIGNAL(triggered()), this, SLOT(viewZoomIn()) );
|
connect( viewZoomInAction, SIGNAL(triggered()), this, SLOT(viewZoomIn()) );
|
||||||
|
|
||||||
viewZoomOutAction = new QAction( tr("Zoom &Out"), this );
|
viewZoomOutAction = new QAction( tr("Zoom &Out"), this );
|
||||||
viewZoomOutAction->setIcon( QIcon::fromTheme( "zoom-out", Icons::Fallback::ZoomOut() ) );
|
viewZoomOutAction->setIcon( QIcon::fromTheme( "zoom-out", Icons::ZoomOut() ) );
|
||||||
viewZoomOutAction->setShortcut( QKeySequence::ZoomOut );
|
viewZoomOutAction->setShortcut( QKeySequence::ZoomOut );
|
||||||
viewZoomOutAction->setStatusTip( tr("Decrease magnification") );
|
viewZoomOutAction->setStatusTip( tr("Decrease magnification") );
|
||||||
connect( viewZoomOutAction, SIGNAL(triggered()), this, SLOT(viewZoomOut()) );
|
connect( viewZoomOutAction, SIGNAL(triggered()), this, SLOT(viewZoomOut()) );
|
||||||
|
|
||||||
viewZoom1To1Action = new QAction( tr("Zoom &1 to 1"), this );
|
viewZoom1To1Action = new QAction( tr("Zoom &1 to 1"), this );
|
||||||
viewZoom1To1Action->setIcon( QIcon::fromTheme( "zoom-original", Icons::Fallback::ZoomOriginal() ) );
|
viewZoom1To1Action->setIcon( QIcon::fromTheme( "zoom-original", Icons::ZoomOriginal() ) );
|
||||||
viewZoom1To1Action->setStatusTip( tr("Restore scale to 100%") );
|
viewZoom1To1Action->setStatusTip( tr("Restore scale to 100%") );
|
||||||
connect( viewZoom1To1Action, SIGNAL(triggered()), this, SLOT(viewZoom1To1()) );
|
connect( viewZoom1To1Action, SIGNAL(triggered()), this, SLOT(viewZoom1To1()) );
|
||||||
|
|
||||||
viewZoomToFitAction = new QAction( tr("Zoom to &Fit"), this );
|
viewZoomToFitAction = new QAction( tr("Zoom to &Fit"), this );
|
||||||
viewZoomToFitAction->setIcon( QIcon::fromTheme( "zoom-fit-best", Icons::Fallback::ZoomBestFit() ) );
|
viewZoomToFitAction->setIcon( QIcon::fromTheme( "zoom-fit-best", Icons::ZoomBestFit() ) );
|
||||||
viewZoomToFitAction->setStatusTip( tr("Set scale to fit window") );
|
viewZoomToFitAction->setStatusTip( tr("Set scale to fit window") );
|
||||||
connect( viewZoomToFitAction, SIGNAL(triggered()), this, SLOT(viewZoomToFit()) );
|
connect( viewZoomToFitAction, SIGNAL(triggered()), this, SLOT(viewZoomToFit()) );
|
||||||
|
|
||||||
@@ -488,17 +492,17 @@ void MainWindow::createActions()
|
|||||||
|
|
||||||
/* Context menu version of edit actions */
|
/* Context menu version of edit actions */
|
||||||
contextCutAction = new QAction( tr("Cut"), this );
|
contextCutAction = new QAction( tr("Cut"), this );
|
||||||
contextCutAction->setIcon( QIcon::fromTheme( "edit-cut", Icons::Fallback::EditCut() ) );
|
contextCutAction->setIcon( QIcon::fromTheme( "edit-cut", Icons::EditCut() ) );
|
||||||
contextCutAction->setStatusTip( tr("Cut the selection") );
|
contextCutAction->setStatusTip( tr("Cut the selection") );
|
||||||
connect( contextCutAction, SIGNAL(triggered()), this, SLOT(editCut()) );
|
connect( contextCutAction, SIGNAL(triggered()), this, SLOT(editCut()) );
|
||||||
|
|
||||||
contextCopyAction = new QAction( tr("&Copy"), this );
|
contextCopyAction = new QAction( tr("&Copy"), this );
|
||||||
contextCopyAction->setIcon( QIcon::fromTheme( "edit-copy", Icons::Fallback::EditCopy() ) );
|
contextCopyAction->setIcon( QIcon::fromTheme( "edit-copy", Icons::EditCopy() ) );
|
||||||
contextCopyAction->setStatusTip( tr("Copy the selection") );
|
contextCopyAction->setStatusTip( tr("Copy the selection") );
|
||||||
connect( contextCopyAction, SIGNAL(triggered()), this, SLOT(editCopy()) );
|
connect( contextCopyAction, SIGNAL(triggered()), this, SLOT(editCopy()) );
|
||||||
|
|
||||||
contextPasteAction = new QAction( tr("&Paste"), this );
|
contextPasteAction = new QAction( tr("&Paste"), this );
|
||||||
contextPasteAction->setIcon( QIcon::fromTheme( "edit-paste", Icons::Fallback::EditPaste() ) );
|
contextPasteAction->setIcon( QIcon::fromTheme( "edit-paste", Icons::EditPaste() ) );
|
||||||
contextPasteAction->setStatusTip( tr("Paste the clipboard") );
|
contextPasteAction->setStatusTip( tr("Paste the clipboard") );
|
||||||
connect( contextPasteAction, SIGNAL(triggered()), this, SLOT(editPaste()) );
|
connect( contextPasteAction, SIGNAL(triggered()), this, SLOT(editPaste()) );
|
||||||
|
|
||||||
@@ -1525,6 +1529,7 @@ void MainWindow::onSelectionChanged()
|
|||||||
///
|
///
|
||||||
void MainWindow::onLabelChanged()
|
void MainWindow::onLabelChanged()
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1536,3 +1541,5 @@ void MainWindow::onUndoRedoChanged()
|
|||||||
editUndoAction->setEnabled( mUndoRedoModel->canUndo() );
|
editUndoAction->setEnabled( mUndoRedoModel->canUndo() );
|
||||||
editRedoAction->setEnabled( mUndoRedoModel->canRedo() );
|
editRedoAction->setEnabled( mUndoRedoModel->canRedo() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -33,6 +33,10 @@
|
|||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class LabelEditor;
|
class LabelEditor;
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
@@ -286,4 +290,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // MainWindow_h
|
#endif // MainWindow_h
|
||||||
|
|||||||
@@ -31,15 +31,17 @@
|
|||||||
#include "TextSemicolonKeys.h"
|
#include "TextSemicolonKeys.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
///
|
//
|
||||||
/// Static data
|
// Static data
|
||||||
///
|
//
|
||||||
QMap<QString,Factory::BackendEntry> Factory::mBackendIdMap;
|
QMap<QString,Factory::BackendEntry> Factory::mBackendIdMap;
|
||||||
QMap<QString,Factory::BackendEntry> Factory::mBackendNameMap;
|
QMap<QString,Factory::BackendEntry> Factory::mBackendNameMap;
|
||||||
|
|
||||||
QStringList Factory::mNameList;
|
QStringList Factory::mNameList;
|
||||||
|
|
||||||
|
|
||||||
@@ -219,3 +221,4 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,9 +26,14 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
class Merge; // Forward reference
|
|
||||||
|
// Forward references
|
||||||
|
class Merge;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -100,4 +105,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Factory_h
|
#endif // merge_Factory_h
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
#include "Record.h"
|
#include "Record.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -208,3 +211,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,9 +27,14 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
class Record; // Forward reference
|
|
||||||
|
// Forward references
|
||||||
|
class Record;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -113,4 +118,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Merge_h
|
#endif // merge_Merge_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "None.h"
|
#include "None.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -120,3 +123,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Merge.h"
|
#include "Merge.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -71,4 +74,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_None_h
|
#endif // merge_None_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "Record.h"
|
#include "Record.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -68,3 +71,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -66,4 +69,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Record_h
|
#endif // merge_Record_h
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -413,3 +416,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -77,4 +80,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_Text_h
|
#endif // merge_Text_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextColon.h"
|
#include "TextColon.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Colon";
|
static const QString ID = "Text/Colon";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextColon_h
|
#endif // merge_TextColon_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextColonKeys.h"
|
#include "TextColonKeys.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Colon/Line1Keys";
|
static const QString ID = "Text/Colon/Line1Keys";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextColonKeys_h
|
#endif // merge_TextColonKeys_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextCsv.h"
|
#include "TextCsv.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Comma";
|
static const QString ID = "Text/Comma";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextCsv_h
|
#endif // merge_TextCsv_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextCsvKeys.h"
|
#include "TextCsvKeys.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Comma/Line1Keys";
|
static const QString ID = "Text/Comma/Line1Keys";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextCsvKeys_h
|
#endif // merge_TextCsvKeys_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextSemicolon.h"
|
#include "TextSemicolon.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Semicolon";
|
static const QString ID = "Text/Semicolon";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextSemicolon_h
|
#endif // merge_TextSemicolon_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextSemicolonKeys.h"
|
#include "TextSemicolonKeys.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Semicolon/Keys";
|
static const QString ID = "Text/Semicolon/Keys";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextSemicolonKeys_h
|
#endif // merge_TextSemicolonKeys_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextTsv.h"
|
#include "TextTsv.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Tab";
|
static const QString ID = "Text/Tab";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextTsv_h
|
#endif // merge_TextTsv_h
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "TextTsvKeys.h"
|
#include "TextTsvKeys.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
static const QString ID = "Text/Tab/Line1Keys";
|
static const QString ID = "Text/Tab/Line1Keys";
|
||||||
@@ -78,3 +81,5 @@ namespace merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
namespace merge
|
namespace merge
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -60,4 +63,7 @@ namespace merge
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // merge_TextTsvKeys_h
|
#endif // merge_TextTsvKeys_h
|
||||||
|
|||||||
+19
-6
@@ -30,6 +30,9 @@
|
|||||||
#include "Merge/Factory.h"
|
#include "Merge/Factory.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -48,6 +51,7 @@ MergeView::MergeView( QWidget *parent )
|
|||||||
///
|
///
|
||||||
MergeView::~MergeView()
|
MergeView::~MergeView()
|
||||||
{
|
{
|
||||||
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +83,8 @@ void MergeView::setModel( LabelModel* model, UndoRedoModel* undoRedoModel )
|
|||||||
///
|
///
|
||||||
void MergeView::onMergeChanged()
|
void MergeView::onMergeChanged()
|
||||||
{
|
{
|
||||||
int index = mMergeFormatNames.indexOf( merge::Factory::idToName( mModel->merge()->id() ) );
|
QString name = merge::Factory::idToName( mModel->merge()->id() );
|
||||||
|
int index = mMergeFormatNames.indexOf( name );
|
||||||
mOldFormatComboIndex = index;
|
mOldFormatComboIndex = index;
|
||||||
formatCombo->setCurrentIndex( index );
|
formatCombo->setCurrentIndex( index );
|
||||||
|
|
||||||
@@ -115,10 +120,14 @@ void MergeView::onMergeChanged()
|
|||||||
loadHeaders( mModel->merge() );
|
loadHeaders( mModel->merge() );
|
||||||
loadTable( mModel->merge() );
|
loadTable( mModel->merge() );
|
||||||
|
|
||||||
connect( mModel->merge(), SIGNAL(sourceChanged()), this, SLOT(onMergeSourceChanged()) );
|
connect( mModel->merge(), SIGNAL(sourceChanged()),
|
||||||
connect( mModel->merge(), SIGNAL(selectionChanged()), this, SLOT(onMergeSelectionChanged()) );
|
this, SLOT(onMergeSourceChanged()) );
|
||||||
|
|
||||||
connect( recordsTable, SIGNAL(cellChanged(int,int)), this, SLOT(onCellChanged(int,int)) );
|
connect( mModel->merge(), SIGNAL(selectionChanged()),
|
||||||
|
this, SLOT(onMergeSelectionChanged()) );
|
||||||
|
|
||||||
|
connect( recordsTable, SIGNAL(cellChanged(int,int)),
|
||||||
|
this, SLOT(onCellChanged(int,int)) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -160,6 +169,7 @@ void MergeView::onMergeSelectionChanged()
|
|||||||
|
|
||||||
///
|
///
|
||||||
/// Format combo changed handler
|
/// Format combo changed handler
|
||||||
|
///
|
||||||
void MergeView::onFormatComboActivated()
|
void MergeView::onFormatComboActivated()
|
||||||
{
|
{
|
||||||
int index = formatCombo->currentIndex();
|
int index = formatCombo->currentIndex();
|
||||||
@@ -167,7 +177,8 @@ void MergeView::onFormatComboActivated()
|
|||||||
{
|
{
|
||||||
mOldFormatComboIndex = index;
|
mOldFormatComboIndex = index;
|
||||||
|
|
||||||
mModel->setMerge( merge::Factory::createMerge( merge::Factory::indexToId(index) ) );
|
QString id = merge::Factory::indexToId(index);
|
||||||
|
mModel->setMerge( merge::Factory::createMerge( id ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +299,7 @@ void MergeView::loadTable( merge::Merge* merge )
|
|||||||
recordsTable->setItem( iRow, 0, item );
|
recordsTable->setItem( iRow, 0, item );
|
||||||
recordsTable->resizeColumnToContents( 0 );
|
recordsTable->resizeColumnToContents( 0 );
|
||||||
|
|
||||||
// Starting on second column, one column per field (even if empty), skip primary field
|
// Starting on 2nd column, 1 column per field, skip primary field
|
||||||
int iCol = 1;
|
int iCol = 1;
|
||||||
foreach ( QString key, mKeys )
|
foreach ( QString key, mKeys )
|
||||||
{
|
{
|
||||||
@@ -316,3 +327,5 @@ void MergeView::loadTable( merge::Merge* merge )
|
|||||||
|
|
||||||
mBlock = false;
|
mBlock = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,10 @@
|
|||||||
|
|
||||||
#include "Merge/Merge.h"
|
#include "Merge/Merge.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace glabels
|
||||||
|
{
|
||||||
|
|
||||||
// Forward references
|
// Forward references
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class UndoRedoModel;
|
class UndoRedoModel;
|
||||||
@@ -95,5 +99,7 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // MergeView_h
|
#endif // MergeView_h
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user