Some namespace cleanup.
This commit is contained in:
@@ -21,9 +21,6 @@
|
|||||||
#include "BarcodeBackends.h"
|
#include "BarcodeBackends.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const std::string default_id = "code39";
|
const std::string default_id = "code39";
|
||||||
@@ -180,7 +177,3 @@ namespace glabels
|
|||||||
mStyleIdMap.insert( id, style );
|
mStyleIdMap.insert( id, style );
|
||||||
mStyleNameMap.insert( fqName, style );
|
mStyleNameMap.insert( fqName, style );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_BarcodeBackends_h
|
#ifndef BarcodeBackends_h
|
||||||
#define glabels_BarcodeBackends_h
|
#define BarcodeBackends_h
|
||||||
|
|
||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Backends Database
|
/// Barcode Backends Database
|
||||||
///
|
///
|
||||||
@@ -95,7 +92,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#endif // BarcodeBackends_h
|
||||||
#endif // glabels_BarcodeBackends_h
|
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -62,7 +59,3 @@ namespace glabels
|
|||||||
|
|
||||||
emit styleChanged();
|
emit styleChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_BarcodeMenu_h
|
#ifndef BarcodeMenu_h
|
||||||
#define glabels_BarcodeMenu_h
|
#define BarcodeMenu_h
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Menu
|
/// Barcode Menu
|
||||||
///
|
///
|
||||||
@@ -72,6 +69,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // BarcodeMenu_h
|
||||||
|
|
||||||
#endif // glabels_BarcodeMenu_h
|
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -62,7 +59,3 @@ namespace glabels
|
|||||||
|
|
||||||
emit styleChanged();
|
emit styleChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,17 +18,14 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_BarcodeMenuButton_h
|
#ifndef BarcodeMenuButton_h
|
||||||
#define glabels_BarcodeMenuButton_h
|
#define BarcodeMenuButton_h
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include "BarcodeMenu.h"
|
#include "BarcodeMenu.h"
|
||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Menu Button
|
/// Barcode Menu Button
|
||||||
///
|
///
|
||||||
@@ -74,6 +71,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // BarcodeMenuButton_h
|
||||||
|
|
||||||
#endif // glabels_BarcodeMenuButton_h
|
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#include "BarcodeMenuItem.h"
|
#include "BarcodeMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor From Data
|
/// Constructor From Data
|
||||||
///
|
///
|
||||||
@@ -52,6 +49,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
emit activated( mBcStyle );
|
emit activated( mBcStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_BarcodeMenuItem_h
|
#ifndef BarcodeMenuItem_h
|
||||||
#define glabels_BarcodeMenuItem_h
|
#define BarcodeMenuItem_h
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include "BarcodeStyle.h"
|
#include "BarcodeStyle.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Menu Item
|
/// Barcode Menu Item
|
||||||
///
|
///
|
||||||
@@ -72,6 +69,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // BarcodeMenuItem_h
|
||||||
|
|
||||||
#endif // glabels_BarcodeMenuItem_h
|
|
||||||
|
|||||||
@@ -23,9 +23,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Default Constructor
|
/// Default Constructor
|
||||||
///
|
///
|
||||||
@@ -177,6 +174,3 @@ namespace glabels
|
|||||||
return mDefaultDigits;
|
return mDefaultDigits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,15 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_BarcodeStyle_h
|
#ifndef BarcodeStyle_h
|
||||||
#define glabels_BarcodeStyle_h
|
#define BarcodeStyle_h
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Style Type
|
/// Barcode Style Type
|
||||||
///
|
///
|
||||||
@@ -100,6 +97,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // BarcodeStyle_h
|
||||||
|
|
||||||
#endif // glabels_BarcodeStyle_h
|
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
ColorButton::ColorButton( QWidget* parent )
|
ColorButton::ColorButton( QWidget* parent )
|
||||||
: QPushButton( parent )
|
: QPushButton( parent )
|
||||||
{
|
{
|
||||||
@@ -161,6 +158,3 @@ namespace glabels
|
|||||||
|
|
||||||
emit colorChanged();
|
emit colorChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ColorButton_h
|
#ifndef ColorButton_h
|
||||||
#define glabels_ColorButton_h
|
#define ColorButton_h
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
@@ -27,9 +27,6 @@
|
|||||||
#include "ColorPaletteDialog.h"
|
#include "ColorPaletteDialog.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Button
|
/// Color Button
|
||||||
///
|
///
|
||||||
@@ -92,7 +89,5 @@ namespace glabels
|
|||||||
ColorPaletteDialog* mDialog;
|
ColorPaletteDialog* mDialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#endif // ColorButton_h
|
||||||
#endif // glabels_ColorButton_h
|
|
||||||
|
|||||||
@@ -23,9 +23,6 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
ColorHistory::ColorHistory()
|
ColorHistory::ColorHistory()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -117,5 +114,3 @@ namespace glabels
|
|||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ColorHistory_h
|
#ifndef ColorHistory_h
|
||||||
#define glabels_ColorHistory_h
|
#define ColorHistory_h
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Barcode Backends Database
|
/// Barcode Backends Database
|
||||||
///
|
///
|
||||||
@@ -78,7 +75,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#endif // ColorHistory_h
|
||||||
#endif // glabels_ColorHistory_h
|
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#include "ColorNode.h"
|
#include "ColorNode.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Default Constructor
|
/// Default Constructor
|
||||||
///
|
///
|
||||||
@@ -198,6 +195,3 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -18,17 +18,14 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ColorNode_h
|
#ifndef ColorNode_h
|
||||||
#define glabels_ColorNode_h
|
#define ColorNode_h
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Node Type
|
/// Color Node Type
|
||||||
///
|
///
|
||||||
@@ -106,6 +103,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_ColorNode_h
|
#endif // ColorNode_h
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor From Data
|
/// Constructor From Data
|
||||||
///
|
///
|
||||||
@@ -121,6 +118,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
emit activated();
|
emit activated();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ColorPaletteButtonItem_h
|
#ifndef ColorPaletteButtonItem_h
|
||||||
#define glabels_ColorPaletteButtonItem_h
|
#define ColorPaletteButtonItem_h
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Palette Item
|
/// Color Palette Item
|
||||||
///
|
///
|
||||||
@@ -69,6 +66,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // ColorPaletteButtonItem_h
|
||||||
|
|
||||||
#endif // glabels_ColorPaletteButtonItem_h
|
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
ColorPaletteDialog::ColorTableEntry ColorPaletteDialog::mColorTable[] = {
|
ColorPaletteDialog::ColorTableEntry ColorPaletteDialog::mColorTable[] = {
|
||||||
|
|
||||||
{ "#ef2929", tr("Light Scarlet Red", "Color name") },
|
{ "#ef2929", tr("Light Scarlet Red", "Color name") },
|
||||||
@@ -234,5 +231,3 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ColorPaletteDialog_h
|
#ifndef ColorPaletteDialog_h
|
||||||
#define glabels_ColorPaletteDialog_h
|
#define ColorPaletteDialog_h
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
#include "ColorPaletteItem.h"
|
#include "ColorPaletteItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Palette Dialog
|
/// Color Palette Dialog
|
||||||
///
|
///
|
||||||
@@ -105,7 +102,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#endif // ColorPaletteDialog_h
|
||||||
#endif // glabels_ColorPaletteDialog_h
|
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor From Data
|
/// Constructor From Data
|
||||||
///
|
///
|
||||||
@@ -145,6 +142,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
emit activated( mId );
|
emit activated( mId );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ColorPaletteItem_h
|
#ifndef ColorPaletteItem_h
|
||||||
#define glabels_ColorPaletteItem_h
|
#define ColorPaletteItem_h
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Color Palette Item
|
/// Color Palette Item
|
||||||
///
|
///
|
||||||
@@ -83,6 +80,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // ColorPaletteItem_h
|
||||||
|
|
||||||
#endif // glabels_ColorPaletteItem_h
|
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -56,5 +53,3 @@ namespace glabels
|
|||||||
painter.setPen( pen );
|
painter.setPen( pen );
|
||||||
painter.drawRect( 1, 1, w-2, h-2 );
|
painter.drawRect( 1, 1, w-2, h-2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,15 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ColorSwatch_h
|
#ifndef ColorSwatch_h
|
||||||
#define glabels_ColorSwatch_h
|
#define ColorSwatch_h
|
||||||
|
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Simple Preview Widget
|
/// Simple Preview Widget
|
||||||
///
|
///
|
||||||
@@ -41,6 +38,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_ColorSwatch_h
|
#endif // ColorSwatch_h
|
||||||
|
|||||||
+6
-6
@@ -24,37 +24,37 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
|
|
||||||
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 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glabels::Cursors::Box::Box()
|
Cursors::Box::Box()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_box.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_box.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glabels::Cursors::Ellipse::Ellipse()
|
Cursors::Ellipse::Ellipse()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_ellipse.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_ellipse.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glabels::Cursors::Image::Image()
|
Cursors::Image::Image()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_image.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_image.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glabels::Cursors::Line::Line()
|
Cursors::Line::Line()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_line.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_line.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glabels::Cursors::Text::Text()
|
Cursors::Text::Text()
|
||||||
: QCursor( QPixmap(":cursors/32x32/cursor_text.png"), 7, 7 )
|
: QCursor( QPixmap(":cursors/32x32/cursor_text.png"), 7, 7 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-8
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_Cursors_h
|
#ifndef Cursors_h
|
||||||
#define glabels_Cursors_h
|
#define Cursors_h
|
||||||
|
|
||||||
|
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Glabels Cursors
|
/// Glabels Cursors
|
||||||
///
|
///
|
||||||
@@ -76,8 +73,7 @@ namespace glabels
|
|||||||
Text();
|
Text();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // glabels_Cursors_h
|
|
||||||
|
#endif // Cursors_h
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#include "FieldButton.h"
|
#include "FieldButton.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -115,7 +112,3 @@ namespace glabels
|
|||||||
|
|
||||||
emit keySelected( key );
|
emit keySelected( key );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,17 +18,14 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_FieldButton_h
|
#ifndef FieldButton_h
|
||||||
#define glabels_FieldButton_h
|
#define FieldButton_h
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include "FieldMenu.h"
|
#include "FieldMenu.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Field Button
|
/// Field Button
|
||||||
///
|
///
|
||||||
@@ -84,6 +81,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // FieldButton_h
|
||||||
|
|
||||||
#endif // glabels_FieldButton_h
|
|
||||||
|
|||||||
@@ -23,9 +23,6 @@
|
|||||||
#include "FieldMenuItem.h"
|
#include "FieldMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -58,7 +55,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
emit keySelected( key );
|
emit keySelected( key );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+3
-8
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_FieldMenu_h
|
#ifndef FieldMenu_h
|
||||||
#define glabels_FieldMenu_h
|
#define FieldMenu_h
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Field Menu
|
/// Field Menu
|
||||||
///
|
///
|
||||||
@@ -71,6 +68,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // FieldMenu_h
|
||||||
|
|
||||||
#endif // glabels_FieldMenu_h
|
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#include "FieldMenuItem.h"
|
#include "FieldMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor From Data
|
/// Constructor From Data
|
||||||
///
|
///
|
||||||
@@ -52,6 +49,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
emit activated( mKey );
|
emit activated( mKey );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_FieldMenuItem_h
|
#ifndef FieldMenuItem_h
|
||||||
#define glabels_FieldMenuItem_h
|
#define FieldMenuItem_h
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Field Menu Item
|
/// Field Menu Item
|
||||||
///
|
///
|
||||||
@@ -72,6 +69,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // FieldMenuItem_h
|
||||||
|
|
||||||
#endif // glabels_FieldMenuItem_h
|
|
||||||
|
|||||||
+1
-7
@@ -31,8 +31,6 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
/// @TODO keep track of cwd between open/save dialogs
|
/// @TODO keep track of cwd between open/save dialogs
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -41,7 +39,7 @@ namespace glabels
|
|||||||
void File::newLabel( MainWindow *window )
|
void File::newLabel( MainWindow *window )
|
||||||
{
|
{
|
||||||
// @TODO lookup latest template, if none default based on locale
|
// @TODO lookup latest template, if none default based on locale
|
||||||
const libglabels::Template* tmplate = libglabels::Db::lookupTemplateFromBrandPart( "Avery", "5159" );
|
const glabels::Template* tmplate = glabels::Db::lookupTemplateFromBrandPart( "Avery", "5159" );
|
||||||
LabelModel* label = new LabelModel();
|
LabelModel* label = new LabelModel();
|
||||||
label->setTmplate( tmplate );
|
label->setTmplate( tmplate );
|
||||||
label->setRotate( false );
|
label->setRotate( false );
|
||||||
@@ -219,7 +217,3 @@ namespace glabels
|
|||||||
close( window );
|
close( window );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+4
-6
@@ -18,17 +18,16 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_File_h
|
#ifndef File_h
|
||||||
#define glabels_File_h
|
#define File_h
|
||||||
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// File Actions
|
/// File Actions
|
||||||
///
|
///
|
||||||
@@ -46,6 +45,5 @@ namespace glabels
|
|||||||
static void exit();
|
static void exit();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_File_h
|
#endif // File_h
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#include "FileUtil.h"
|
#include "FileUtil.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace FileUtil
|
namespace FileUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -38,7 +35,3 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+4
-7
@@ -18,21 +18,18 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_FileUtil_h
|
#ifndef FileUtil_h
|
||||||
#define glabels_FileUtil_h
|
#define FileUtil_h
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace FileUtil
|
namespace FileUtil
|
||||||
{
|
{
|
||||||
|
|
||||||
QString addExtension( const QString& rawFilename, const QString& extension );
|
QString addExtension( const QString& rawFilename, const QString& extension );
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // glabels_FileUtil_h
|
|
||||||
|
#endif // FileUtil_h
|
||||||
|
|||||||
+50
-50
@@ -41,7 +41,7 @@ namespace
|
|||||||
///
|
///
|
||||||
/// Handle Constructor
|
/// Handle Constructor
|
||||||
///
|
///
|
||||||
glabels::Handle::Handle( LabelModelObject* owner, Location location )
|
Handle::Handle( LabelModelObject* owner, Location location )
|
||||||
: mOwner(owner), mLocation(location)
|
: mOwner(owner), mLocation(location)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ glabels::Handle::Handle( LabelModelObject* owner, Location location )
|
|||||||
///
|
///
|
||||||
/// Handle Destructor
|
/// Handle Destructor
|
||||||
///
|
///
|
||||||
glabels::Handle::~Handle()
|
Handle::~Handle()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ glabels::Handle::~Handle()
|
|||||||
///
|
///
|
||||||
/// Handle owner
|
/// Handle owner
|
||||||
///
|
///
|
||||||
glabels::LabelModelObject* glabels::Handle::owner() const
|
LabelModelObject* Handle::owner() const
|
||||||
{
|
{
|
||||||
return mOwner;
|
return mOwner;
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ glabels::LabelModelObject* glabels::Handle::owner() const
|
|||||||
///
|
///
|
||||||
/// Handle location
|
/// Handle location
|
||||||
///
|
///
|
||||||
glabels::Handle::Location glabels::Handle::location() const
|
Handle::Location Handle::location() const
|
||||||
{
|
{
|
||||||
return mLocation;
|
return mLocation;
|
||||||
}
|
}
|
||||||
@@ -76,10 +76,10 @@ glabels::Handle::Location glabels::Handle::location() const
|
|||||||
///
|
///
|
||||||
/// Draw Handle at x,y
|
/// Draw Handle at x,y
|
||||||
///
|
///
|
||||||
void glabels::Handle::drawAt( QPainter* painter,
|
void Handle::drawAt( QPainter* painter,
|
||||||
double scale,
|
double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y,
|
const glabels::Distance& y,
|
||||||
QColor color ) const
|
QColor color ) const
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
@@ -104,9 +104,9 @@ void glabels::Handle::drawAt( QPainter* painter,
|
|||||||
///
|
///
|
||||||
/// Create Handle path at x,y
|
/// Create Handle path at x,y
|
||||||
///
|
///
|
||||||
QPainterPath glabels::Handle::pathAt( double scale,
|
QPainterPath Handle::pathAt( double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const
|
const glabels::Distance& y ) const
|
||||||
{
|
{
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ QPainterPath glabels::Handle::pathAt( double scale,
|
|||||||
///
|
///
|
||||||
/// HandleNorthWest Constructor
|
/// HandleNorthWest Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleNorthWest::HandleNorthWest( LabelModelObject* owner )
|
HandleNorthWest::HandleNorthWest( LabelModelObject* owner )
|
||||||
: Handle( owner, NW )
|
: Handle( owner, NW )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ glabels::HandleNorthWest::HandleNorthWest( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleNorthWest Destructor
|
/// HandleNorthWest Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleNorthWest::~HandleNorthWest()
|
HandleNorthWest::~HandleNorthWest()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ glabels::HandleNorthWest::~HandleNorthWest()
|
|||||||
///
|
///
|
||||||
/// Draw HandleNorthWest
|
/// Draw HandleNorthWest
|
||||||
///
|
///
|
||||||
void glabels::HandleNorthWest::draw( QPainter* painter, double scale ) const
|
void HandleNorthWest::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, 0, 0, originHandleFillColor );
|
drawAt( painter, scale, 0, 0, originHandleFillColor );
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ void glabels::HandleNorthWest::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleNorthWest Path
|
/// HandleNorthWest Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleNorthWest::path( double scale ) const
|
QPainterPath HandleNorthWest::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, 0, 0 );
|
return pathAt( scale, 0, 0 );
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ QPainterPath glabels::HandleNorthWest::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleNorth Constructor
|
/// HandleNorth Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleNorth::HandleNorth( LabelModelObject* owner )
|
HandleNorth::HandleNorth( LabelModelObject* owner )
|
||||||
: Handle( owner, N )
|
: Handle( owner, N )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ glabels::HandleNorth::HandleNorth( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleNorth Destructor
|
/// HandleNorth Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleNorth::~HandleNorth()
|
HandleNorth::~HandleNorth()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ glabels::HandleNorth::~HandleNorth()
|
|||||||
///
|
///
|
||||||
/// Draw HandleNorth
|
/// Draw HandleNorth
|
||||||
///
|
///
|
||||||
void glabels::HandleNorth::draw( QPainter* painter, double scale ) const
|
void HandleNorth::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, mOwner->w()/2, 0, handleFillColor );
|
drawAt( painter, scale, mOwner->w()/2, 0, handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ void glabels::HandleNorth::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleNorth Path
|
/// HandleNorth Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleNorth::path( double scale ) const
|
QPainterPath HandleNorth::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, mOwner->w()/2, 0 );
|
return pathAt( scale, mOwner->w()/2, 0 );
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ QPainterPath glabels::HandleNorth::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleNorthEast Constructor
|
/// HandleNorthEast Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleNorthEast::HandleNorthEast( LabelModelObject* owner )
|
HandleNorthEast::HandleNorthEast( LabelModelObject* owner )
|
||||||
: Handle( owner, NE )
|
: Handle( owner, NE )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,7 @@ glabels::HandleNorthEast::HandleNorthEast( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleNorthEast Destructor
|
/// HandleNorthEast Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleNorthEast::~HandleNorthEast()
|
HandleNorthEast::~HandleNorthEast()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ glabels::HandleNorthEast::~HandleNorthEast()
|
|||||||
///
|
///
|
||||||
/// Draw HandleNorthEast
|
/// Draw HandleNorthEast
|
||||||
///
|
///
|
||||||
void glabels::HandleNorthEast::draw( QPainter* painter, double scale ) const
|
void HandleNorthEast::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, mOwner->w(), 0, handleFillColor );
|
drawAt( painter, scale, mOwner->w(), 0, handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ void glabels::HandleNorthEast::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleNorthEast Path
|
/// HandleNorthEast Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleNorthEast::path( double scale ) const
|
QPainterPath HandleNorthEast::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, mOwner->w(), 0 );
|
return pathAt( scale, mOwner->w(), 0 );
|
||||||
}
|
}
|
||||||
@@ -227,7 +227,7 @@ QPainterPath glabels::HandleNorthEast::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleEast Constructor
|
/// HandleEast Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleEast::HandleEast( LabelModelObject* owner )
|
HandleEast::HandleEast( LabelModelObject* owner )
|
||||||
: Handle( owner, E )
|
: Handle( owner, E )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -236,7 +236,7 @@ glabels::HandleEast::HandleEast( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleEast Destructor
|
/// HandleEast Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleEast::~HandleEast()
|
HandleEast::~HandleEast()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ glabels::HandleEast::~HandleEast()
|
|||||||
///
|
///
|
||||||
/// Draw HandleEast
|
/// Draw HandleEast
|
||||||
///
|
///
|
||||||
void glabels::HandleEast::draw( QPainter* painter, double scale ) const
|
void HandleEast::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, mOwner->w(), mOwner->h()/2, handleFillColor );
|
drawAt( painter, scale, mOwner->w(), mOwner->h()/2, handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -253,7 +253,7 @@ void glabels::HandleEast::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleEast Path
|
/// HandleEast Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleEast::path( double scale ) const
|
QPainterPath HandleEast::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, mOwner->w(), mOwner->h()/2 );
|
return pathAt( scale, mOwner->w(), mOwner->h()/2 );
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ QPainterPath glabels::HandleEast::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleSouthEast Constructor
|
/// HandleSouthEast Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleSouthEast::HandleSouthEast( LabelModelObject* owner )
|
HandleSouthEast::HandleSouthEast( LabelModelObject* owner )
|
||||||
: Handle( owner, SE )
|
: Handle( owner, SE )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,7 @@ glabels::HandleSouthEast::HandleSouthEast( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleSouthEast Destructor
|
/// HandleSouthEast Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleSouthEast::~HandleSouthEast()
|
HandleSouthEast::~HandleSouthEast()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ glabels::HandleSouthEast::~HandleSouthEast()
|
|||||||
///
|
///
|
||||||
/// Draw HandleSouthEast
|
/// Draw HandleSouthEast
|
||||||
///
|
///
|
||||||
void glabels::HandleSouthEast::draw( QPainter* painter, double scale ) const
|
void HandleSouthEast::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, mOwner->w(), mOwner->h(), handleFillColor );
|
drawAt( painter, scale, mOwner->w(), mOwner->h(), handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ void glabels::HandleSouthEast::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleSouthEast Path
|
/// HandleSouthEast Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleSouthEast::path( double scale ) const
|
QPainterPath HandleSouthEast::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, mOwner->w(), mOwner->h() );
|
return pathAt( scale, mOwner->w(), mOwner->h() );
|
||||||
}
|
}
|
||||||
@@ -297,7 +297,7 @@ QPainterPath glabels::HandleSouthEast::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleSouth Constructor
|
/// HandleSouth Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleSouth::HandleSouth( LabelModelObject* owner )
|
HandleSouth::HandleSouth( LabelModelObject* owner )
|
||||||
: Handle( owner, S )
|
: Handle( owner, S )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -306,7 +306,7 @@ glabels::HandleSouth::HandleSouth( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleSouth Destructor
|
/// HandleSouth Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleSouth::~HandleSouth()
|
HandleSouth::~HandleSouth()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,7 +314,7 @@ glabels::HandleSouth::~HandleSouth()
|
|||||||
///
|
///
|
||||||
/// Draw HandleSouth
|
/// Draw HandleSouth
|
||||||
///
|
///
|
||||||
void glabels::HandleSouth::draw( QPainter* painter, double scale ) const
|
void HandleSouth::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, mOwner->w()/2, mOwner->h(), handleFillColor );
|
drawAt( painter, scale, mOwner->w()/2, mOwner->h(), handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -323,7 +323,7 @@ void glabels::HandleSouth::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleSouth Path
|
/// HandleSouth Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleSouth::path( double scale ) const
|
QPainterPath HandleSouth::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, mOwner->w()/2, mOwner->h() );
|
return pathAt( scale, mOwner->w()/2, mOwner->h() );
|
||||||
}
|
}
|
||||||
@@ -332,7 +332,7 @@ QPainterPath glabels::HandleSouth::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleSouthWest Constructor
|
/// HandleSouthWest Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleSouthWest::HandleSouthWest( LabelModelObject* owner )
|
HandleSouthWest::HandleSouthWest( LabelModelObject* owner )
|
||||||
: Handle( owner, SW )
|
: Handle( owner, SW )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -341,7 +341,7 @@ glabels::HandleSouthWest::HandleSouthWest( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleSouthWest Destructor
|
/// HandleSouthWest Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleSouthWest::~HandleSouthWest()
|
HandleSouthWest::~HandleSouthWest()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ glabels::HandleSouthWest::~HandleSouthWest()
|
|||||||
///
|
///
|
||||||
/// Draw HandleSouthWest
|
/// Draw HandleSouthWest
|
||||||
///
|
///
|
||||||
void glabels::HandleSouthWest::draw( QPainter* painter, double scale ) const
|
void HandleSouthWest::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, 0, mOwner->h(), handleFillColor );
|
drawAt( painter, scale, 0, mOwner->h(), handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@ void glabels::HandleSouthWest::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleSouthWest Path
|
/// HandleSouthWest Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleSouthWest::path( double scale ) const
|
QPainterPath HandleSouthWest::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, 0, mOwner->h() );
|
return pathAt( scale, 0, mOwner->h() );
|
||||||
}
|
}
|
||||||
@@ -367,7 +367,7 @@ QPainterPath glabels::HandleSouthWest::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleWest Constructor
|
/// HandleWest Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleWest::HandleWest( LabelModelObject* owner )
|
HandleWest::HandleWest( LabelModelObject* owner )
|
||||||
: Handle( owner, W )
|
: Handle( owner, W )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -376,7 +376,7 @@ glabels::HandleWest::HandleWest( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleWest Destructor
|
/// HandleWest Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleWest::~HandleWest()
|
HandleWest::~HandleWest()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ glabels::HandleWest::~HandleWest()
|
|||||||
///
|
///
|
||||||
/// Draw HandleWest
|
/// Draw HandleWest
|
||||||
///
|
///
|
||||||
void glabels::HandleWest::draw( QPainter* painter, double scale ) const
|
void HandleWest::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, 0, mOwner->h()/2, handleFillColor );
|
drawAt( painter, scale, 0, mOwner->h()/2, handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ void glabels::HandleWest::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleWest Path
|
/// HandleWest Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleWest::path( double scale ) const
|
QPainterPath HandleWest::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, 0, mOwner->h()/2 );
|
return pathAt( scale, 0, mOwner->h()/2 );
|
||||||
}
|
}
|
||||||
@@ -402,7 +402,7 @@ QPainterPath glabels::HandleWest::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleP1 Constructor
|
/// HandleP1 Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleP1::HandleP1( LabelModelObject* owner )
|
HandleP1::HandleP1( LabelModelObject* owner )
|
||||||
: Handle( owner, P1 )
|
: Handle( owner, P1 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -411,7 +411,7 @@ glabels::HandleP1::HandleP1( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleP1 Destructor
|
/// HandleP1 Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleP1::~HandleP1()
|
HandleP1::~HandleP1()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,7 +419,7 @@ glabels::HandleP1::~HandleP1()
|
|||||||
///
|
///
|
||||||
/// Draw HandleP1
|
/// Draw HandleP1
|
||||||
///
|
///
|
||||||
void glabels::HandleP1::draw( QPainter* painter, double scale ) const
|
void HandleP1::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, 0, 0, originHandleFillColor );
|
drawAt( painter, scale, 0, 0, originHandleFillColor );
|
||||||
}
|
}
|
||||||
@@ -428,7 +428,7 @@ void glabels::HandleP1::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleP1 Path
|
/// HandleP1 Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleP1::path( double scale ) const
|
QPainterPath HandleP1::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, 0, 0 );
|
return pathAt( scale, 0, 0 );
|
||||||
}
|
}
|
||||||
@@ -437,7 +437,7 @@ QPainterPath glabels::HandleP1::path( double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleP2 Constructor
|
/// HandleP2 Constructor
|
||||||
///
|
///
|
||||||
glabels::HandleP2::HandleP2( LabelModelObject* owner )
|
HandleP2::HandleP2( LabelModelObject* owner )
|
||||||
: Handle( owner, P2 )
|
: Handle( owner, P2 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -446,7 +446,7 @@ glabels::HandleP2::HandleP2( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// HandleP2 Destructor
|
/// HandleP2 Destructor
|
||||||
///
|
///
|
||||||
glabels::HandleP2::~HandleP2()
|
HandleP2::~HandleP2()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,7 +454,7 @@ glabels::HandleP2::~HandleP2()
|
|||||||
///
|
///
|
||||||
/// Draw HandleP2
|
/// Draw HandleP2
|
||||||
///
|
///
|
||||||
void glabels::HandleP2::draw( QPainter* painter, double scale ) const
|
void HandleP2::draw( QPainter* painter, double scale ) const
|
||||||
{
|
{
|
||||||
drawAt( painter, scale, mOwner->w(), mOwner->h(), handleFillColor );
|
drawAt( painter, scale, mOwner->w(), mOwner->h(), handleFillColor );
|
||||||
}
|
}
|
||||||
@@ -463,7 +463,7 @@ void glabels::HandleP2::draw( QPainter* painter, double scale ) const
|
|||||||
///
|
///
|
||||||
/// HandleP2 Path
|
/// HandleP2 Path
|
||||||
///
|
///
|
||||||
QPainterPath glabels::HandleP2::path( double scale ) const
|
QPainterPath HandleP2::path( double scale ) const
|
||||||
{
|
{
|
||||||
return pathAt( scale, mOwner->w(), mOwner->h() );
|
return pathAt( scale, mOwner->w(), mOwner->h() );
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-12
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_Handles_h
|
#ifndef Handles_h
|
||||||
#define glabels_Handles_h
|
#define Handles_h
|
||||||
|
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
@@ -27,9 +27,6 @@
|
|||||||
#include "libglabels/Distance.h"
|
#include "libglabels/Distance.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
|
|
||||||
|
|
||||||
@@ -70,13 +67,13 @@ namespace glabels
|
|||||||
protected:
|
protected:
|
||||||
void drawAt( QPainter* painter,
|
void drawAt( QPainter* painter,
|
||||||
double scale,
|
double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y,
|
const glabels::Distance& y,
|
||||||
QColor color ) const;
|
QColor color ) const;
|
||||||
|
|
||||||
QPainterPath pathAt( double scale,
|
QPainterPath pathAt( double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const;
|
const glabels::Distance& y ) const;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
@@ -309,6 +306,4 @@ namespace glabels
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // Handles_h
|
||||||
|
|
||||||
#endif // glabels_Handles_h
|
|
||||||
|
|||||||
@@ -25,9 +25,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Display Help Contents
|
/// Display Help Contents
|
||||||
///
|
///
|
||||||
@@ -57,6 +54,3 @@ namespace glabels
|
|||||||
|
|
||||||
aboutBox.exec();
|
aboutBox.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+5
-7
@@ -18,25 +18,23 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_Help_h
|
#ifndef Help_h
|
||||||
#define glabels_Help_h
|
#define Help_h
|
||||||
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Help Actions
|
/// Help Actions
|
||||||
///
|
///
|
||||||
namespace Help
|
namespace Help
|
||||||
{
|
{
|
||||||
|
|
||||||
void displayContents( QWidget *parent );
|
void displayContents( QWidget *parent );
|
||||||
void displayAbout( QWidget *parent );
|
void displayAbout( QWidget *parent );
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // glabels_Help_h
|
|
||||||
|
#endif // Help_h
|
||||||
|
|||||||
+4
-7
@@ -18,15 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_Icons_h
|
#ifndef Icons_h
|
||||||
#define glabels_Icons_h
|
#define Icons_h
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Glabels Icons
|
/// Glabels Icons
|
||||||
///
|
///
|
||||||
@@ -468,6 +465,6 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_Icons_h
|
|
||||||
|
#endif // Icons_h
|
||||||
|
|||||||
+36
-42
@@ -29,9 +29,6 @@
|
|||||||
#include "LabelRegion.h"
|
#include "LabelRegion.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
///
|
///
|
||||||
@@ -117,8 +114,8 @@ namespace glabels
|
|||||||
/// Object at x,y
|
/// Object at x,y
|
||||||
///
|
///
|
||||||
LabelModelObject* LabelModel::objectAt( double scale,
|
LabelModelObject* LabelModel::objectAt( double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const
|
const glabels::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();
|
||||||
@@ -140,8 +137,8 @@ namespace glabels
|
|||||||
/// Handle at x,y
|
/// Handle at x,y
|
||||||
///
|
///
|
||||||
Handle* LabelModel::handleAt( double scale,
|
Handle* LabelModel::handleAt( double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const
|
const glabels::Distance& y ) const
|
||||||
{
|
{
|
||||||
foreach( LabelModelObject* object, mObjectList )
|
foreach( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -238,10 +235,10 @@ namespace glabels
|
|||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
|
|
||||||
libglabels::Distance rX1 = min( region.x1(), region.x2() );
|
glabels::Distance rX1 = min( region.x1(), region.x2() );
|
||||||
libglabels::Distance rY1 = min( region.y1(), region.y2() );
|
glabels::Distance rY1 = min( region.y1(), region.y2() );
|
||||||
libglabels::Distance rX2 = max( region.x1(), region.x2() );
|
glabels::Distance rX2 = max( region.x1(), region.x2() );
|
||||||
libglabels::Distance rY2 = max( region.y1(), region.y2() );
|
glabels::Distance rY2 = max( region.y1(), region.y2() );
|
||||||
|
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -563,7 +560,7 @@ namespace glabels
|
|||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find left-most edge.
|
/// Find left-most edge.
|
||||||
libglabels::Distance x1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
glabels::Distance x1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -574,7 +571,7 @@ namespace glabels
|
|||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dx = x1_min - r.x1();
|
glabels::Distance dx = x1_min - r.x1();
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,7 +595,7 @@ namespace glabels
|
|||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find right-most edge.
|
/// Find right-most edge.
|
||||||
libglabels::Distance x1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
glabels::Distance x1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -609,7 +606,7 @@ namespace glabels
|
|||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dx = x1_max - r.x1();
|
glabels::Distance dx = x1_max - r.x1();
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -633,7 +630,7 @@ namespace glabels
|
|||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find average center of objects.
|
/// Find average center of objects.
|
||||||
libglabels::Distance xsum = 0;
|
glabels::Distance xsum = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
@@ -641,15 +638,15 @@ namespace glabels
|
|||||||
xsum += (r.x1() + r.x2()) / 2.0;
|
xsum += (r.x1() + r.x2()) / 2.0;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
libglabels::Distance xavg = xsum / n;
|
glabels::Distance xavg = xsum / n;
|
||||||
|
|
||||||
/// Find object closest to average center of objects.
|
/// Find object closest to average center of objects.
|
||||||
libglabels::Distance xcenter = 7200; /// Start with very large value.
|
glabels::Distance xcenter = 7200; /// Start with very large value.
|
||||||
libglabels::Distance dxmin = fabs( xavg - xcenter );
|
glabels::Distance dxmin = fabs( xavg - xcenter );
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dx = fabs( xavg - (r.x1() + r.x2())/2.0 );
|
glabels::Distance dx = fabs( xavg - (r.x1() + r.x2())/2.0 );
|
||||||
if ( dx < dxmin )
|
if ( dx < dxmin )
|
||||||
{
|
{
|
||||||
dxmin = dx;
|
dxmin = dx;
|
||||||
@@ -661,7 +658,7 @@ namespace glabels
|
|||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dx = xcenter - (r.x1() + r.x2())/2.0;
|
glabels::Distance dx = xcenter - (r.x1() + r.x2())/2.0;
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,7 +682,7 @@ namespace glabels
|
|||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find top-most edge.
|
/// Find top-most edge.
|
||||||
libglabels::Distance y1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
glabels::Distance y1_min = 7200; /// Start with a very large value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -696,7 +693,7 @@ namespace glabels
|
|||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dy = y1_min - r.y1();
|
glabels::Distance dy = y1_min - r.y1();
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -720,7 +717,7 @@ namespace glabels
|
|||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find bottom-most edge.
|
/// Find bottom-most edge.
|
||||||
libglabels::Distance y1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
glabels::Distance y1_max = -7200; /// Start with a very large negative value: 7200pts = 100in
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
@@ -731,7 +728,7 @@ namespace glabels
|
|||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dy = y1_max - r.y1();
|
glabels::Distance dy = y1_max - r.y1();
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -755,7 +752,7 @@ namespace glabels
|
|||||||
QList<LabelModelObject*> selectedList = getSelection();
|
QList<LabelModelObject*> selectedList = getSelection();
|
||||||
|
|
||||||
/// Find average center of objects.
|
/// Find average center of objects.
|
||||||
libglabels::Distance ysum = 0;
|
glabels::Distance ysum = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
@@ -763,15 +760,15 @@ namespace glabels
|
|||||||
ysum += (r.y1() + r.y2()) / 2.0;
|
ysum += (r.y1() + r.y2()) / 2.0;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
libglabels::Distance yavg = ysum / n;
|
glabels::Distance yavg = ysum / n;
|
||||||
|
|
||||||
/// Find object closest to average center of objects.
|
/// Find object closest to average center of objects.
|
||||||
libglabels::Distance ycenter = 7200; /// Start with very large value.
|
glabels::Distance ycenter = 7200; /// Start with very large value.
|
||||||
libglabels::Distance dymin = fabs( yavg - ycenter );
|
glabels::Distance dymin = fabs( yavg - ycenter );
|
||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dy = fabs( yavg - (r.y1() + r.y2())/2.0 );
|
glabels::Distance dy = fabs( yavg - (r.y1() + r.y2())/2.0 );
|
||||||
if ( dy < dymin )
|
if ( dy < dymin )
|
||||||
{
|
{
|
||||||
dymin = dy;
|
dymin = dy;
|
||||||
@@ -783,7 +780,7 @@ namespace glabels
|
|||||||
foreach ( LabelModelObject* object, selectedList )
|
foreach ( LabelModelObject* object, selectedList )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance dy = ycenter - (r.y1() + r.y2())/2.0;
|
glabels::Distance dy = ycenter - (r.y1() + r.y2())/2.0;
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,15 +796,15 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void LabelModel::centerSelectionHoriz()
|
void LabelModel::centerSelectionHoriz()
|
||||||
{
|
{
|
||||||
libglabels::Distance xLabelCenter = w() / 2.0;
|
glabels::Distance xLabelCenter = w() / 2.0;
|
||||||
|
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
if ( object->isSelected() )
|
if ( object->isSelected() )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance xObjectCenter = (r.x1() + r.x2()) / 2.0;
|
glabels::Distance xObjectCenter = (r.x1() + r.x2()) / 2.0;
|
||||||
libglabels::Distance dx = xLabelCenter - xObjectCenter;
|
glabels::Distance dx = xLabelCenter - xObjectCenter;
|
||||||
object->setPositionRelative( dx, 0 );
|
object->setPositionRelative( dx, 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -824,15 +821,15 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void LabelModel::centerSelectionVert()
|
void LabelModel::centerSelectionVert()
|
||||||
{
|
{
|
||||||
libglabels::Distance yLabelCenter = h() / 2.0;
|
glabels::Distance yLabelCenter = h() / 2.0;
|
||||||
|
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
if ( object->isSelected() )
|
if ( object->isSelected() )
|
||||||
{
|
{
|
||||||
LabelRegion r = object->getExtent();
|
LabelRegion r = object->getExtent();
|
||||||
libglabels::Distance yObjectCenter = (r.y1() + r.y2()) / 2.0;
|
glabels::Distance yObjectCenter = (r.y1() + r.y2()) / 2.0;
|
||||||
libglabels::Distance dy = yLabelCenter - yObjectCenter;
|
glabels::Distance dy = yLabelCenter - yObjectCenter;
|
||||||
object->setPositionRelative( 0, dy );
|
object->setPositionRelative( 0, dy );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -847,7 +844,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Move Selected Objects By dx,dy
|
/// Move Selected Objects By dx,dy
|
||||||
///
|
///
|
||||||
void LabelModel::moveSelection( const libglabels::Distance& dx, const libglabels::Distance& dy )
|
void LabelModel::moveSelection( const glabels::Distance& dx, const glabels::Distance& dy )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -1027,7 +1024,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Set Line Width Of Selected Objects
|
/// Set Line Width Of Selected Objects
|
||||||
///
|
///
|
||||||
void LabelModel::setSelectionLineWidth( const libglabels::Distance& lineWidth )
|
void LabelModel::setSelectionLineWidth( const glabels::Distance& lineWidth )
|
||||||
{
|
{
|
||||||
foreach ( LabelModelObject* object, mObjectList )
|
foreach ( LabelModelObject* object, mObjectList )
|
||||||
{
|
{
|
||||||
@@ -1094,6 +1091,3 @@ namespace glabels
|
|||||||
object->draw( painter, inEditor, record );
|
object->draw( painter, inEditor, record );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+21
-25
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_LabelModel_h
|
#ifndef LabelModel_h
|
||||||
#define glabels_LabelModel_h
|
#define LabelModel_h
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -29,8 +29,6 @@
|
|||||||
#include "libglabels/Template.h"
|
#include "libglabels/Template.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
class Handle;
|
class Handle;
|
||||||
@@ -81,15 +79,15 @@ namespace glabels
|
|||||||
inline int compressionLevel() const;
|
inline int compressionLevel() const;
|
||||||
inline void setCompressionLevel( int compressionLevel );
|
inline void setCompressionLevel( int compressionLevel );
|
||||||
|
|
||||||
inline const libglabels::Template* tmplate() const;
|
inline const glabels::Template* tmplate() const;
|
||||||
inline const libglabels::Frame* frame() const;
|
inline const glabels::Frame* frame() const;
|
||||||
inline void setTmplate( const libglabels::Template* tmplate );
|
inline void setTmplate( const glabels::Template* tmplate );
|
||||||
|
|
||||||
inline bool rotate() const;
|
inline bool rotate() const;
|
||||||
inline void setRotate( bool rotate );
|
inline void setRotate( bool rotate );
|
||||||
|
|
||||||
inline libglabels::Distance w() const;
|
inline glabels::Distance w() const;
|
||||||
inline libglabels::Distance h() const;
|
inline glabels::Distance h() const;
|
||||||
|
|
||||||
inline const QList<LabelModelObject*>& objectList() const;
|
inline const QList<LabelModelObject*>& objectList() const;
|
||||||
|
|
||||||
@@ -102,12 +100,12 @@ namespace glabels
|
|||||||
void deleteObject( LabelModelObject* object );
|
void deleteObject( LabelModelObject* object );
|
||||||
|
|
||||||
LabelModelObject* objectAt( double scale,
|
LabelModelObject* objectAt( double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const;
|
const glabels::Distance& y ) const;
|
||||||
|
|
||||||
Handle* handleAt( double scale,
|
Handle* handleAt( double scale,
|
||||||
const libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const;
|
const glabels::Distance& y ) const;
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -161,7 +159,7 @@ namespace glabels
|
|||||||
void alignSelectionVCenter();
|
void alignSelectionVCenter();
|
||||||
void centerSelectionHoriz();
|
void centerSelectionHoriz();
|
||||||
void centerSelectionVert();
|
void centerSelectionVert();
|
||||||
void moveSelection( const libglabels::Distance& dx, const libglabels::Distance& dy );
|
void moveSelection( const glabels::Distance& dx, const glabels::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 );
|
||||||
@@ -170,7 +168,7 @@ namespace glabels
|
|||||||
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 libglabels::Distance& lineWidth );
|
void setSelectionLineWidth( const glabels::Distance& lineWidth );
|
||||||
void setSelectionLineColorNode( ColorNode lineColorNode );
|
void setSelectionLineColorNode( ColorNode lineColorNode );
|
||||||
void setSelectionFillColorNode( ColorNode fillColorNode );
|
void setSelectionFillColorNode( ColorNode fillColorNode );
|
||||||
|
|
||||||
@@ -198,8 +196,8 @@ namespace glabels
|
|||||||
bool mModified;
|
bool mModified;
|
||||||
QString mFileName;
|
QString mFileName;
|
||||||
int mCompressionLevel;
|
int mCompressionLevel;
|
||||||
const libglabels::Template* mTmplate;
|
const glabels::Template* mTmplate;
|
||||||
const libglabels::Frame* mFrame;
|
const glabels::Frame* mFrame;
|
||||||
bool mRotate;
|
bool mRotate;
|
||||||
|
|
||||||
QList<LabelModelObject*> mObjectList;
|
QList<LabelModelObject*> mObjectList;
|
||||||
@@ -246,19 +244,19 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const libglabels::Template* LabelModel::tmplate() const
|
inline const glabels::Template* LabelModel::tmplate() const
|
||||||
{
|
{
|
||||||
return mTmplate;
|
return mTmplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const libglabels::Frame* LabelModel::frame() const
|
inline const glabels::Frame* LabelModel::frame() const
|
||||||
{
|
{
|
||||||
return mFrame;
|
return mFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void LabelModel::setTmplate( const libglabels::Template* tmplate )
|
inline void LabelModel::setTmplate( const glabels::Template* tmplate )
|
||||||
{
|
{
|
||||||
if (mTmplate != tmplate)
|
if (mTmplate != tmplate)
|
||||||
{
|
{
|
||||||
@@ -289,13 +287,13 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline libglabels::Distance LabelModel::w() const
|
inline glabels::Distance LabelModel::w() const
|
||||||
{
|
{
|
||||||
return mRotate ? mFrame->h() : mFrame->w();
|
return mRotate ? mFrame->h() : mFrame->w();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline libglabels::Distance LabelModel::h() const
|
inline glabels::Distance LabelModel::h() const
|
||||||
{
|
{
|
||||||
return mRotate ? mFrame->w() : mFrame->h();
|
return mRotate ? mFrame->w() : mFrame->h();
|
||||||
}
|
}
|
||||||
@@ -307,6 +305,4 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // LabelModel_h
|
||||||
|
|
||||||
#endif // glabels_LabelModel_h
|
|
||||||
|
|||||||
@@ -30,9 +30,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -145,5 +142,3 @@ namespace glabels
|
|||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_LabelModelBoxObject_h
|
#ifndef LabelModelBoxObject_h
|
||||||
#define glabels_LabelModelBoxObject_h
|
#define LabelModelBoxObject_h
|
||||||
|
|
||||||
|
|
||||||
#include "LabelModelShapeObject.h"
|
#include "LabelModelShapeObject.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Box Object
|
/// Label Model Box Object
|
||||||
///
|
///
|
||||||
@@ -53,6 +50,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_LabelModelBoxObject_h
|
#endif // LabelModelBoxObject_h
|
||||||
|
|||||||
@@ -32,9 +32,6 @@
|
|||||||
#include "MergeRecord.h"
|
#include "MergeRecord.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Next Object ID
|
/// Next Object ID
|
||||||
///
|
///
|
||||||
@@ -113,7 +110,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// X0 Property Getter
|
/// X0 Property Getter
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelObject::x0() const
|
glabels::Distance LabelModelObject::x0() const
|
||||||
{
|
{
|
||||||
return mX0;
|
return mX0;
|
||||||
}
|
}
|
||||||
@@ -122,7 +119,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// X0 Property Setter
|
/// X0 Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setX0( const libglabels::Distance& value )
|
void LabelModelObject::setX0( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
if ( mX0 != value )
|
if ( mX0 != value )
|
||||||
{
|
{
|
||||||
@@ -135,7 +132,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Y0 Property Getter
|
/// Y0 Property Getter
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelObject::y0() const
|
glabels::Distance LabelModelObject::y0() const
|
||||||
{
|
{
|
||||||
return mY0;
|
return mY0;
|
||||||
}
|
}
|
||||||
@@ -144,7 +141,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Y0 Property Setter
|
/// Y0 Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setY0( const libglabels::Distance& value )
|
void LabelModelObject::setY0( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
if ( mY0 != value )
|
if ( mY0 != value )
|
||||||
{
|
{
|
||||||
@@ -157,7 +154,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// W (Width) Property Getter
|
/// W (Width) Property Getter
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelObject::w() const
|
glabels::Distance LabelModelObject::w() const
|
||||||
{
|
{
|
||||||
return mW;
|
return mW;
|
||||||
}
|
}
|
||||||
@@ -166,7 +163,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// W (Width) Property Setter
|
/// W (Width) Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setW( const libglabels::Distance& value )
|
void LabelModelObject::setW( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
if ( mW != value )
|
if ( mW != value )
|
||||||
{
|
{
|
||||||
@@ -179,7 +176,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// H (Height) Property Getter
|
/// H (Height) Property Getter
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelObject::h() const
|
glabels::Distance LabelModelObject::h() const
|
||||||
{
|
{
|
||||||
return mH;
|
return mH;
|
||||||
}
|
}
|
||||||
@@ -188,7 +185,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// H (Height) Property Setter
|
/// H (Height) Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setH( const libglabels::Distance& value )
|
void LabelModelObject::setH( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
if ( mH != value )
|
if ( mH != value )
|
||||||
{
|
{
|
||||||
@@ -245,7 +242,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Shadow X Property Getter
|
/// Shadow X Property Getter
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelObject::shadowX() const
|
glabels::Distance LabelModelObject::shadowX() const
|
||||||
{
|
{
|
||||||
return mShadowX;
|
return mShadowX;
|
||||||
}
|
}
|
||||||
@@ -254,7 +251,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Shadow X Property Setter
|
/// Shadow X Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setShadowX( const libglabels::Distance& value )
|
void LabelModelObject::setShadowX( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
if ( mShadowX != value )
|
if ( mShadowX != value )
|
||||||
{
|
{
|
||||||
@@ -267,7 +264,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Shadow Y Property Getter
|
/// Shadow Y Property Getter
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelObject::shadowY() const
|
glabels::Distance LabelModelObject::shadowY() const
|
||||||
{
|
{
|
||||||
return mShadowY;
|
return mShadowY;
|
||||||
}
|
}
|
||||||
@@ -276,7 +273,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Shadow Y Property Setter
|
/// Shadow Y Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelObject::setShadowY( const libglabels::Distance& value )
|
void LabelModelObject::setShadowY( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
if ( mShadowY != value )
|
if ( mShadowY != value )
|
||||||
{
|
{
|
||||||
@@ -524,7 +521,7 @@ namespace glabels
|
|||||||
/// Virtual Line Width Property Default Getter
|
/// Virtual Line Width Property Default Getter
|
||||||
/// (Overridden by concrete class)
|
/// (Overridden by concrete class)
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelObject::lineWidth() const
|
glabels::Distance LabelModelObject::lineWidth() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -534,7 +531,7 @@ namespace glabels
|
|||||||
/// Virtual Line Width Property Default Setter
|
/// Virtual Line Width Property Default Setter
|
||||||
/// (Overridden by concrete class)
|
/// (Overridden by concrete class)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setLineWidth( const libglabels::Distance& value )
|
void LabelModelObject::setLineWidth( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -734,8 +731,8 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Set Absolute Position
|
/// Set Absolute Position
|
||||||
///
|
///
|
||||||
void LabelModelObject::setPosition( const libglabels::Distance& x0,
|
void LabelModelObject::setPosition( const glabels::Distance& x0,
|
||||||
const libglabels::Distance& y0 )
|
const glabels::Distance& y0 )
|
||||||
{
|
{
|
||||||
if ( ( mX0 != x0 ) || ( mY0 != y0 ) )
|
if ( ( mX0 != x0 ) || ( mY0 != y0 ) )
|
||||||
{
|
{
|
||||||
@@ -750,8 +747,8 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Set Relative Position
|
/// Set Relative Position
|
||||||
///
|
///
|
||||||
void LabelModelObject::setPositionRelative( const libglabels::Distance& dx,
|
void LabelModelObject::setPositionRelative( const glabels::Distance& dx,
|
||||||
const libglabels::Distance& dy )
|
const glabels::Distance& dy )
|
||||||
{
|
{
|
||||||
if ( ( dx != 0 ) || ( dy != 0 ) )
|
if ( ( dx != 0 ) || ( dy != 0 ) )
|
||||||
{
|
{
|
||||||
@@ -766,8 +763,8 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Set Size
|
/// Set Size
|
||||||
///
|
///
|
||||||
void LabelModelObject::setSize( const libglabels::Distance& w,
|
void LabelModelObject::setSize( const glabels::Distance& w,
|
||||||
const libglabels::Distance& h )
|
const glabels::Distance& h )
|
||||||
{
|
{
|
||||||
mW = w;
|
mW = w;
|
||||||
mH = h;
|
mH = h;
|
||||||
@@ -779,12 +776,12 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Set Size (But Maintain Current Aspect Ratio)
|
/// Set Size (But Maintain Current Aspect Ratio)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setSizeHonorAspect( const libglabels::Distance& w,
|
void LabelModelObject::setSizeHonorAspect( const glabels::Distance& w,
|
||||||
const libglabels::Distance& h )
|
const glabels::Distance& h )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
libglabels::Distance wNew = w;
|
glabels::Distance wNew = w;
|
||||||
libglabels::Distance hNew = h;
|
glabels::Distance hNew = h;
|
||||||
|
|
||||||
if ( h > (w*aspectRatio) )
|
if ( h > (w*aspectRatio) )
|
||||||
{
|
{
|
||||||
@@ -802,10 +799,10 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Set Width (But Maintain Current Aspect Ratio)
|
/// Set Width (But Maintain Current Aspect Ratio)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setWHonorAspect( const libglabels::Distance& w )
|
void LabelModelObject::setWHonorAspect( const glabels::Distance& w )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
libglabels::Distance h = w * aspectRatio;
|
glabels::Distance h = w * aspectRatio;
|
||||||
|
|
||||||
if ( ( mW != w ) || ( mH != h ) )
|
if ( ( mW != w ) || ( mH != h ) )
|
||||||
{
|
{
|
||||||
@@ -820,10 +817,10 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Set Height (But Maintain Current Aspect Ratio)
|
/// Set Height (But Maintain Current Aspect Ratio)
|
||||||
///
|
///
|
||||||
void LabelModelObject::setHHonorAspect( const libglabels::Distance& h )
|
void LabelModelObject::setHHonorAspect( const glabels::Distance& h )
|
||||||
{
|
{
|
||||||
double aspectRatio = mH / mW;
|
double aspectRatio = mH / mW;
|
||||||
libglabels::Distance w = h / aspectRatio;
|
glabels::Distance w = h / aspectRatio;
|
||||||
|
|
||||||
if ( ( mW != w ) || ( mH != h ) )
|
if ( ( mW != w ) || ( mH != h ) )
|
||||||
{
|
{
|
||||||
@@ -854,10 +851,10 @@ namespace glabels
|
|||||||
a4 = mMatrix.map( a4 );
|
a4 = mMatrix.map( a4 );
|
||||||
|
|
||||||
LabelRegion region;
|
LabelRegion region;
|
||||||
region.setX1( libglabels::Distance(min( a1.x(), min( a2.x(), min( a3.x(), a4.x() ) ) )) + mX0 );
|
region.setX1( glabels::Distance(min( a1.x(), min( a2.x(), min( a3.x(), a4.x() ) ) )) + mX0 );
|
||||||
region.setY1( libglabels::Distance(min( a1.y(), min( a2.y(), min( a3.y(), a4.y() ) ) )) + mY0 );
|
region.setY1( glabels::Distance(min( a1.y(), min( a2.y(), min( a3.y(), a4.y() ) ) )) + mY0 );
|
||||||
region.setX2( libglabels::Distance(max( a1.x(), max( a2.x(), max( a3.x(), a4.x() ) ) )) + mX0 );
|
region.setX2( glabels::Distance(max( a1.x(), max( a2.x(), max( a3.x(), a4.x() ) ) )) + mX0 );
|
||||||
region.setY2( libglabels::Distance(max( a1.y(), max( a2.y(), max( a3.y(), a4.y() ) ) )) + mY0 );
|
region.setY2( glabels::Distance(max( a1.y(), max( a2.y(), max( a3.y(), a4.y() ) ) )) + mY0 );
|
||||||
|
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
@@ -909,8 +906,8 @@ namespace glabels
|
|||||||
/// 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 libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const
|
const glabels::Distance& y ) const
|
||||||
{
|
{
|
||||||
QPointF p( x.pt(), y.pt() );
|
QPointF p( x.pt(), y.pt() );
|
||||||
|
|
||||||
@@ -940,8 +937,8 @@ namespace glabels
|
|||||||
/// 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 libglabels::Distance& x,
|
const glabels::Distance& x,
|
||||||
const libglabels::Distance& y ) const
|
const glabels::Distance& y ) const
|
||||||
{
|
{
|
||||||
if ( mSelectedFlag )
|
if ( mSelectedFlag )
|
||||||
{
|
{
|
||||||
@@ -1008,7 +1005,3 @@ namespace glabels
|
|||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+31
-34
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_LabelModelObject_h
|
#ifndef LabelModelObject_h
|
||||||
#define glabels_LabelModelObject_h
|
#define LabelModelObject_h
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
@@ -34,8 +34,6 @@
|
|||||||
#include "Outline.h"
|
#include "Outline.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class LabelRegion;
|
class LabelRegion;
|
||||||
class MergeRecord;
|
class MergeRecord;
|
||||||
@@ -84,29 +82,29 @@ namespace glabels
|
|||||||
//
|
//
|
||||||
// x0 Property ( x coordinate of origin )
|
// x0 Property ( x coordinate of origin )
|
||||||
//
|
//
|
||||||
libglabels::Distance x0() const;
|
glabels::Distance x0() const;
|
||||||
void setX0( const libglabels::Distance& value );
|
void setX0( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// y0 Property ( y coordinate of origin )
|
// y0 Property ( y coordinate of origin )
|
||||||
//
|
//
|
||||||
libglabels::Distance y0() const;
|
glabels::Distance y0() const;
|
||||||
void setY0( const libglabels::Distance& value );
|
void setY0( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// w Property ( width of bounding box )
|
// w Property ( width of bounding box )
|
||||||
//
|
//
|
||||||
libglabels::Distance w() const;
|
glabels::Distance w() const;
|
||||||
void setW( const libglabels::Distance& value );
|
void setW( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// h Property ( height of bounding box )
|
// h Property ( height of bounding box )
|
||||||
//
|
//
|
||||||
libglabels::Distance h() const;
|
glabels::Distance h() const;
|
||||||
void setH( const libglabels::Distance& value );
|
void setH( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -126,15 +124,15 @@ namespace glabels
|
|||||||
//
|
//
|
||||||
// Shadow x Offset Property
|
// Shadow x Offset Property
|
||||||
//
|
//
|
||||||
libglabels::Distance shadowX() const;
|
glabels::Distance shadowX() const;
|
||||||
void setShadowX( const libglabels::Distance& value );
|
void setShadowX( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Shadow y Offset Property
|
// Shadow y Offset Property
|
||||||
//
|
//
|
||||||
libglabels::Distance shadowY() const;
|
glabels::Distance shadowY() const;
|
||||||
void setShadowY( const libglabels::Distance& value );
|
void setShadowY( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -236,8 +234,8 @@ namespace glabels
|
|||||||
//
|
//
|
||||||
// Virtual Shape Property: lineWidth
|
// Virtual Shape Property: lineWidth
|
||||||
//
|
//
|
||||||
virtual libglabels::Distance lineWidth() const;
|
virtual glabels::Distance lineWidth() const;
|
||||||
virtual void setLineWidth( const libglabels::Distance& value );
|
virtual void setLineWidth( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -314,18 +312,18 @@ namespace glabels
|
|||||||
// Position and Size methods
|
// Position and Size methods
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
public:
|
public:
|
||||||
void setPosition( const libglabels::Distance& x0, const libglabels::Distance& y0 );
|
void setPosition( const glabels::Distance& x0, const glabels::Distance& y0 );
|
||||||
void setPositionRelative( const libglabels::Distance& dx, const libglabels::Distance& dy );
|
void setPositionRelative( const glabels::Distance& dx, const glabels::Distance& dy );
|
||||||
void setSize( const libglabels::Distance& w, const libglabels::Distance& h );
|
void setSize( const glabels::Distance& w, const glabels::Distance& h );
|
||||||
void setSizeHonorAspect( const libglabels::Distance& w, const libglabels::Distance& h );
|
void setSizeHonorAspect( const glabels::Distance& w, const glabels::Distance& h );
|
||||||
void setWHonorAspect( const libglabels::Distance& w );
|
void setWHonorAspect( const glabels::Distance& w );
|
||||||
void setHHonorAspect( const libglabels::Distance& h );
|
void setHHonorAspect( const glabels::Distance& h );
|
||||||
LabelRegion getExtent();
|
LabelRegion getExtent();
|
||||||
void rotate( double thetaDegs );
|
void rotate( double thetaDegs );
|
||||||
void flipHoriz();
|
void flipHoriz();
|
||||||
void flipVert();
|
void flipVert();
|
||||||
bool isLocatedAt( double scale, const libglabels::Distance& x, const libglabels::Distance& y ) const;
|
bool isLocatedAt( double scale, const glabels::Distance& x, const glabels::Distance& y ) const;
|
||||||
Handle* handleAt( double scale, const libglabels::Distance& x, const libglabels::Distance& y ) const;
|
Handle* handleAt( double scale, const glabels::Distance& x, const glabels::Distance& y ) const;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
@@ -347,14 +345,14 @@ namespace glabels
|
|||||||
protected:
|
protected:
|
||||||
bool mSelectedFlag;
|
bool mSelectedFlag;
|
||||||
|
|
||||||
libglabels::Distance mX0;
|
glabels::Distance mX0;
|
||||||
libglabels::Distance mY0;
|
glabels::Distance mY0;
|
||||||
libglabels::Distance mW;
|
glabels::Distance mW;
|
||||||
libglabels::Distance mH;
|
glabels::Distance mH;
|
||||||
|
|
||||||
bool mShadowState;
|
bool mShadowState;
|
||||||
libglabels::Distance mShadowX;
|
glabels::Distance mShadowX;
|
||||||
libglabels::Distance mShadowY;
|
glabels::Distance mShadowY;
|
||||||
double mShadowOpacity;
|
double mShadowOpacity;
|
||||||
ColorNode mShadowColorNode;
|
ColorNode mShadowColorNode;
|
||||||
|
|
||||||
@@ -373,6 +371,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_LabelModelObject_h
|
#endif // LabelModelObject_h
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -67,7 +64,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Line Width Property Getter
|
/// Line Width Property Getter
|
||||||
///
|
///
|
||||||
libglabels::Distance LabelModelShapeObject::lineWidth( void ) const
|
glabels::Distance LabelModelShapeObject::lineWidth( void ) const
|
||||||
{
|
{
|
||||||
return mLineWidth;
|
return mLineWidth;
|
||||||
}
|
}
|
||||||
@@ -76,7 +73,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Line Width Property Setter
|
/// Line Width Property Setter
|
||||||
///
|
///
|
||||||
void LabelModelShapeObject::setLineWidth( const libglabels::Distance& value )
|
void LabelModelShapeObject::setLineWidth( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
if ( mLineWidth != value )
|
if ( mLineWidth != value )
|
||||||
{
|
{
|
||||||
@@ -155,6 +152,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,15 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_LabelModelShapeObject_h
|
#ifndef LabelModelShapeObject_h
|
||||||
#define glabels_LabelModelShapeObject_h
|
#define LabelModelShapeObject_h
|
||||||
|
|
||||||
#include "LabelModelObject.h"
|
#include "LabelModelObject.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Model Shape Object (Box or Ellipse)
|
/// Label Model Shape Object (Box or Ellipse)
|
||||||
///
|
///
|
||||||
@@ -50,8 +47,8 @@ namespace glabels
|
|||||||
//
|
//
|
||||||
// Shape Property: lineWidth
|
// Shape Property: lineWidth
|
||||||
//
|
//
|
||||||
virtual libglabels::Distance lineWidth( void ) const;
|
virtual glabels::Distance lineWidth( void ) const;
|
||||||
virtual void setLineWidth( const libglabels::Distance& value );
|
virtual void setLineWidth( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -81,12 +78,11 @@ namespace glabels
|
|||||||
// Private Members
|
// Private Members
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
protected:
|
protected:
|
||||||
libglabels::Distance mLineWidth;
|
glabels::Distance mLineWidth;
|
||||||
ColorNode mLineColorNode;
|
ColorNode mLineColorNode;
|
||||||
ColorNode mFillColorNode;
|
ColorNode mFillColorNode;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_LabelModelShapeObject_h
|
#endif // LabelModelShapeObject_h
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
QRectF LabelRegion::rect() const
|
QRectF LabelRegion::rect() const
|
||||||
{
|
{
|
||||||
using std::min;
|
using std::min;
|
||||||
@@ -41,5 +38,3 @@ namespace glabels
|
|||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+23
-27
@@ -18,16 +18,13 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_LabelRegion_h
|
#ifndef LabelRegion_h
|
||||||
#define glabels_LabelRegion_h
|
#define LabelRegion_h
|
||||||
|
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
#include "libglabels/Distance.h"
|
#include "libglabels/Distance.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Label Region Type
|
/// Label Region Type
|
||||||
///
|
///
|
||||||
@@ -41,30 +38,30 @@ namespace glabels
|
|||||||
//
|
//
|
||||||
// X1 Property
|
// X1 Property
|
||||||
//
|
//
|
||||||
libglabels::Distance x1( void ) const;
|
glabels::Distance x1( void ) const;
|
||||||
void setX1( const libglabels::Distance& value );
|
void setX1( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y1 Property
|
// Y1 Property
|
||||||
//
|
//
|
||||||
libglabels::Distance y1( void ) const;
|
glabels::Distance y1( void ) const;
|
||||||
void setY1( const libglabels::Distance& value );
|
void setY1( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// X2 Property
|
// X2 Property
|
||||||
//
|
//
|
||||||
libglabels::Distance x2( void ) const;
|
glabels::Distance x2( void ) const;
|
||||||
void setX2( const libglabels::Distance& value );
|
void setX2( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y2 Property
|
// Y2 Property
|
||||||
//
|
//
|
||||||
libglabels::Distance y2( void ) const;
|
glabels::Distance y2( void ) const;
|
||||||
void setY2( const libglabels::Distance& value );
|
void setY2( const glabels::Distance& value );
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -78,63 +75,62 @@ namespace glabels
|
|||||||
// Private Data
|
// Private Data
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
libglabels::Distance mX1;
|
glabels::Distance mX1;
|
||||||
libglabels::Distance mY1;
|
glabels::Distance mY1;
|
||||||
libglabels::Distance mX2;
|
glabels::Distance mX2;
|
||||||
libglabels::Distance mY2;
|
glabels::Distance mY2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// INLINE METHODS
|
// INLINE METHODS
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
inline libglabels::Distance LabelRegion::x1( void ) const
|
inline glabels::Distance LabelRegion::x1( void ) const
|
||||||
{
|
{
|
||||||
return mX1;
|
return mX1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void LabelRegion::setX1( const libglabels::Distance& value )
|
inline void LabelRegion::setX1( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
mX1 = value;
|
mX1 = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline libglabels::Distance LabelRegion::y1( void ) const
|
inline glabels::Distance LabelRegion::y1( void ) const
|
||||||
{
|
{
|
||||||
return mY1;
|
return mY1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void LabelRegion::setY1( const libglabels::Distance& value )
|
inline void LabelRegion::setY1( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
mY1 = value;
|
mY1 = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline libglabels::Distance LabelRegion::x2( void ) const
|
inline glabels::Distance LabelRegion::x2( void ) const
|
||||||
{
|
{
|
||||||
return mX2;
|
return mX2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void LabelRegion::setX2( const libglabels::Distance& value )
|
inline void LabelRegion::setX2( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
mX2 = value;
|
mX2 = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline libglabels::Distance LabelRegion::y2( void ) const
|
inline glabels::Distance LabelRegion::y2( void ) const
|
||||||
{
|
{
|
||||||
return mY2;
|
return mY2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void LabelRegion::setY2( const libglabels::Distance& value )
|
inline void LabelRegion::setY2( const glabels::Distance& value )
|
||||||
{
|
{
|
||||||
mY2 = value;
|
mY2 = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_LabelRegion_h
|
#endif // LabelRegion_h
|
||||||
|
|||||||
@@ -45,9 +45,6 @@
|
|||||||
#include "Help.h"
|
#include "Help.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Static window list
|
/// Static window list
|
||||||
///
|
///
|
||||||
@@ -1373,7 +1370,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
/* @TODO: update undo/redo verbs. */
|
/* @TODO: update undo/redo verbs. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_MainWindow_h
|
#ifndef MainWindow_h
|
||||||
#define glabels_MainWindow_h
|
#define MainWindow_h
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
@@ -32,8 +32,6 @@ class QLabel;
|
|||||||
class QScrollArea;
|
class QScrollArea;
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class PropertiesView;
|
class PropertiesView;
|
||||||
@@ -271,6 +269,5 @@ namespace glabels
|
|||||||
QAction* contextDeleteAction;
|
QAction* contextDeleteAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_MainWindow_h
|
#endif // MainWindow_h
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#include "Merge.h"
|
#include "Merge.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -129,7 +126,3 @@ namespace glabels
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_Merge_h
|
#ifndef Merge_h
|
||||||
#define glabels_Merge_h
|
#define Merge_h
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@@ -28,9 +28,6 @@
|
|||||||
#include "MergeRecord.h"
|
#include "MergeRecord.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Merge Record Structure
|
/// Merge Record Structure
|
||||||
///
|
///
|
||||||
@@ -143,6 +140,5 @@ namespace glabels
|
|||||||
return mRecordList;
|
return mRecordList;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_Merge_h
|
#endif // Merge_h
|
||||||
|
|||||||
@@ -18,15 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_MergeField_h
|
#ifndef MergeField_h
|
||||||
#define glabels_MergeField_h
|
#define MergeField_h
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Merge Field Structure
|
/// Merge Field Structure
|
||||||
///
|
///
|
||||||
@@ -87,6 +84,5 @@ namespace glabels
|
|||||||
mValue = value;
|
mValue = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_MergeField_h
|
#endif // MergeField_h
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -62,5 +59,3 @@ namespace glabels
|
|||||||
void MergePropertyEditor::onLabelChanged()
|
void MergePropertyEditor::onLabelChanged()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,14 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_MergePropertyEditor_h
|
#ifndef MergePropertyEditor_h
|
||||||
#define glabels_MergePropertyEditor_h
|
#define MergePropertyEditor_h
|
||||||
|
|
||||||
#include "ui_MergePropertyEditor.h"
|
#include "ui_MergePropertyEditor.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel; // Forward reference
|
class LabelModel; // Forward reference
|
||||||
|
|
||||||
|
|
||||||
@@ -66,6 +64,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_MergePropertyEditor_h
|
#endif // MergePropertyEditor_h
|
||||||
|
|||||||
@@ -21,16 +21,9 @@
|
|||||||
#include "MergeRecord.h"
|
#include "MergeRecord.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
MergeRecord::MergeRecord() : mSelected( false )
|
MergeRecord::MergeRecord() : mSelected( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_MergeRecord_h
|
#ifndef MergeRecord_h
|
||||||
#define glabels_MergeRecord_h
|
#define MergeRecord_h
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -27,9 +27,6 @@
|
|||||||
#include "MergeField.h"
|
#include "MergeField.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Merge Record Structure
|
/// Merge Record Structure
|
||||||
///
|
///
|
||||||
@@ -95,6 +92,5 @@ namespace glabels
|
|||||||
mFieldList = value;
|
mFieldList = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_MergeRecord_h
|
#endif // MergeRecord_h
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -138,7 +135,7 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
mBlocked = true;
|
mBlocked = true;
|
||||||
|
|
||||||
libglabels::Distance whMax = std::max( mModel->w(), mModel->h() );
|
glabels::Distance whMax = std::max( mModel->w(), mModel->h() );
|
||||||
|
|
||||||
posXSpin->setRange( -whMax.in(), 2*whMax.in() );
|
posXSpin->setRange( -whMax.in(), 2*whMax.in() );
|
||||||
posYSpin->setRange( -whMax.in(), 2*whMax.in() );
|
posYSpin->setRange( -whMax.in(), 2*whMax.in() );
|
||||||
@@ -236,7 +233,7 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
mBlocked = true;
|
mBlocked = true;
|
||||||
|
|
||||||
mObject->setLineWidth( libglabels::Distance::pt(lineWidthSpin->value()) );
|
mObject->setLineWidth( glabels::Distance::pt(lineWidthSpin->value()) );
|
||||||
mObject->setLineColorNode( lineColorButton->colorNode() );
|
mObject->setLineColorNode( lineColorButton->colorNode() );
|
||||||
|
|
||||||
mBlocked = false;
|
mBlocked = false;
|
||||||
@@ -276,8 +273,8 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
mBlocked = true;
|
mBlocked = true;
|
||||||
|
|
||||||
libglabels::Distance spinW = libglabels::Distance::in(sizeWSpin->value());
|
glabels::Distance spinW = glabels::Distance::in(sizeWSpin->value());
|
||||||
libglabels::Distance spinH = libglabels::Distance::in(sizeHSpin->value());
|
glabels::Distance spinH = glabels::Distance::in(sizeHSpin->value());
|
||||||
|
|
||||||
if ( sizeAspectCheck->isChecked() )
|
if ( sizeAspectCheck->isChecked() )
|
||||||
{
|
{
|
||||||
@@ -309,8 +306,8 @@ namespace glabels
|
|||||||
mBlocked = true;
|
mBlocked = true;
|
||||||
|
|
||||||
mObject->setShadow( shadowEnableCheck->isChecked() );
|
mObject->setShadow( shadowEnableCheck->isChecked() );
|
||||||
mObject->setShadowX( libglabels::Distance::in(shadowXSpin->value()) );
|
mObject->setShadowX( glabels::Distance::in(shadowXSpin->value()) );
|
||||||
mObject->setShadowY( libglabels::Distance::in(shadowYSpin->value()) );
|
mObject->setShadowY( glabels::Distance::in(shadowYSpin->value()) );
|
||||||
mObject->setShadowColorNode( shadowColorButton->colorNode() );
|
mObject->setShadowColorNode( shadowColorButton->colorNode() );
|
||||||
mObject->setShadowOpacity( shadowOpacitySpin->value()/100.0 );
|
mObject->setShadowOpacity( shadowOpacitySpin->value()/100.0 );
|
||||||
|
|
||||||
@@ -330,5 +327,3 @@ namespace glabels
|
|||||||
mBlocked = false;
|
mBlocked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,14 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_ObjectEditor_h
|
#ifndef ObjectEditor_h
|
||||||
#define glabels_ObjectEditor_h
|
#define ObjectEditor_h
|
||||||
|
|
||||||
#include "ui_ObjectEditor.h"
|
#include "ui_ObjectEditor.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel; // Forward reference
|
class LabelModel; // Forward reference
|
||||||
class LabelModelObject; // Forward reference
|
class LabelModelObject; // Forward reference
|
||||||
|
|
||||||
@@ -89,6 +87,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_ObjectEditor_h
|
#endif // ObjectEditor_h
|
||||||
|
|||||||
+4
-4
@@ -40,7 +40,7 @@ namespace
|
|||||||
///
|
///
|
||||||
/// Outline Constructor
|
/// Outline Constructor
|
||||||
///
|
///
|
||||||
glabels::Outline::Outline( LabelModelObject* owner )
|
Outline::Outline( LabelModelObject* owner )
|
||||||
: mOwner(owner)
|
: mOwner(owner)
|
||||||
{
|
{
|
||||||
mDashes << dashSize << dashSize;
|
mDashes << dashSize << dashSize;
|
||||||
@@ -63,7 +63,7 @@ glabels::Outline::Outline( LabelModelObject* owner )
|
|||||||
///
|
///
|
||||||
/// Outline Destructor
|
/// Outline Destructor
|
||||||
///
|
///
|
||||||
glabels::Outline::~Outline()
|
Outline::~Outline()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ glabels::Outline::~Outline()
|
|||||||
///
|
///
|
||||||
/// Draw Outline
|
/// Draw Outline
|
||||||
///
|
///
|
||||||
void glabels::Outline::draw( QPainter* painter ) const
|
void Outline::draw( QPainter* painter ) const
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ void glabels::Outline::draw( QPainter* painter ) const
|
|||||||
///
|
///
|
||||||
/// Create path for testing for hover condition
|
/// Create path for testing for hover condition
|
||||||
///
|
///
|
||||||
QPainterPath glabels::Outline::hoverPath( double scale ) const
|
QPainterPath Outline::hoverPath( double scale ) const
|
||||||
{
|
{
|
||||||
double s = 1 / scale;
|
double s = 1 / scale;
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -18,17 +18,14 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_Outline_h
|
#ifndef Outline_h
|
||||||
#define glabels_Outline_h
|
#define Outline_h
|
||||||
|
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
|
|
||||||
|
|
||||||
@@ -65,6 +62,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_Outline_h
|
#endif // Outline_h
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
PageRenderer::PageRenderer()
|
PageRenderer::PageRenderer()
|
||||||
: mModel(0), mNLabels(0), mStartLabel(0),
|
: mModel(0), mNLabels(0), mStartLabel(0),
|
||||||
mPrintOutlines(false), mPrintCropMarks(false), mPrintReverse(false),
|
mPrintOutlines(false), mPrintCropMarks(false), mPrintReverse(false),
|
||||||
@@ -251,5 +248,3 @@ namespace glabels
|
|||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_PageRenderer_h
|
#ifndef PageRenderer_h
|
||||||
#define glabels_PageRenderer_h
|
#define PageRenderer_h
|
||||||
|
|
||||||
|
|
||||||
#include "libglabels/Point.h"
|
#include "libglabels/Point.h"
|
||||||
@@ -31,8 +31,6 @@
|
|||||||
class QPainter; // Forward reference
|
class QPainter; // Forward reference
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel; // Forward reference
|
class LabelModel; // Forward reference
|
||||||
class MergeRecord; // Forward reference
|
class MergeRecord; // Forward reference
|
||||||
|
|
||||||
@@ -94,9 +92,8 @@ namespace glabels
|
|||||||
int mNPages;
|
int mNPages;
|
||||||
int mNLabelsPerPage;
|
int mNLabelsPerPage;
|
||||||
|
|
||||||
QVector<libglabels::Point> mOrigins;
|
QVector<glabels::Point> mOrigins;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_PageRenderer_h
|
#endif // PageRenderer_h
|
||||||
|
|||||||
+9
-15
@@ -47,9 +47,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -79,10 +76,10 @@ namespace glabels
|
|||||||
if ( mModel != NULL )
|
if ( mModel != NULL )
|
||||||
{
|
{
|
||||||
// Set scene up with a 5% margin around paper
|
// Set scene up with a 5% margin around paper
|
||||||
libglabels::Distance x = -0.05 * mModel->tmplate()->pageWidth();
|
glabels::Distance x = -0.05 * mModel->tmplate()->pageWidth();
|
||||||
libglabels::Distance y = -0.05 * mModel->tmplate()->pageHeight();
|
glabels::Distance y = -0.05 * mModel->tmplate()->pageHeight();
|
||||||
libglabels::Distance w = 1.10 * mModel->tmplate()->pageWidth();
|
glabels::Distance w = 1.10 * mModel->tmplate()->pageWidth();
|
||||||
libglabels::Distance h = 1.10 * mModel->tmplate()->pageHeight();
|
glabels::Distance h = 1.10 * mModel->tmplate()->pageHeight();
|
||||||
|
|
||||||
mScene->setSceneRect( x.pt(), y.pt(), w.pt(), h.pt() );
|
mScene->setSceneRect( x.pt(), y.pt(), w.pt(), h.pt() );
|
||||||
fitInView( mScene->sceneRect(), Qt::KeepAspectRatio );
|
fitInView( mScene->sceneRect(), Qt::KeepAspectRatio );
|
||||||
@@ -128,7 +125,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Draw Paper
|
/// Draw Paper
|
||||||
///
|
///
|
||||||
void Preview::drawPaper( const libglabels::Distance& pw, const libglabels::Distance& ph )
|
void Preview::drawPaper( const glabels::Distance& pw, const glabels::Distance& ph )
|
||||||
{
|
{
|
||||||
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
||||||
shadowEffect->setColor( shadowColor );
|
shadowEffect->setColor( shadowColor );
|
||||||
@@ -154,9 +151,9 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void Preview::drawLabels()
|
void Preview::drawLabels()
|
||||||
{
|
{
|
||||||
libglabels::Frame *frame = mModel->tmplate()->frames().first();
|
glabels::Frame *frame = mModel->tmplate()->frames().first();
|
||||||
|
|
||||||
foreach (libglabels::Point origin, frame->getOrigins() )
|
foreach (glabels::Point origin, frame->getOrigins() )
|
||||||
{
|
{
|
||||||
drawLabel( origin.x(), origin.y(), frame->path() );
|
drawLabel( origin.x(), origin.y(), frame->path() );
|
||||||
}
|
}
|
||||||
@@ -166,8 +163,8 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Draw a Single Label at x,y
|
/// Draw a Single Label at x,y
|
||||||
///
|
///
|
||||||
void Preview::drawLabel( const libglabels::Distance& x,
|
void Preview::drawLabel( const glabels::Distance& x,
|
||||||
const libglabels::Distance& y,
|
const glabels::Distance& y,
|
||||||
const QPainterPath& path )
|
const QPainterPath& path )
|
||||||
{
|
{
|
||||||
QBrush brush( Qt::NoBrush );
|
QBrush brush( Qt::NoBrush );
|
||||||
@@ -196,6 +193,3 @@ namespace glabels
|
|||||||
mScene->addItem( overlayItem );
|
mScene->addItem( overlayItem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+6
-9
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_Preview_h
|
#ifndef Preview_h
|
||||||
#define glabels_Preview_h
|
#define Preview_h
|
||||||
|
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
@@ -27,8 +27,6 @@
|
|||||||
#include "PageRenderer.h"
|
#include "PageRenderer.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel; // Forward reference
|
class LabelModel; // Forward reference
|
||||||
|
|
||||||
|
|
||||||
@@ -67,10 +65,10 @@ namespace glabels
|
|||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
void clearScene();
|
void clearScene();
|
||||||
void drawPaper( const libglabels::Distance& pw, const libglabels::Distance& ph );
|
void drawPaper( const glabels::Distance& pw, const glabels::Distance& ph );
|
||||||
void drawLabels();
|
void drawLabels();
|
||||||
void drawLabel( const libglabels::Distance& x,
|
void drawLabel( const glabels::Distance& x,
|
||||||
const libglabels::Distance& y,
|
const glabels::Distance& y,
|
||||||
const QPainterPath& path );
|
const QPainterPath& path );
|
||||||
|
|
||||||
void drawPreviewOverlay();
|
void drawPreviewOverlay();
|
||||||
@@ -86,6 +84,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_Preview_h
|
#endif // Preview_h
|
||||||
|
|||||||
@@ -23,9 +23,6 @@
|
|||||||
#include "PageRenderer.h"
|
#include "PageRenderer.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
PreviewOverlayItem::PreviewOverlayItem( const PageRenderer* renderer, QGraphicsItem* parent )
|
PreviewOverlayItem::PreviewOverlayItem( const PageRenderer* renderer, QGraphicsItem* parent )
|
||||||
: QGraphicsItem(parent), mRenderer(renderer)
|
: QGraphicsItem(parent), mRenderer(renderer)
|
||||||
{
|
{
|
||||||
@@ -42,5 +39,3 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
mRenderer->printPage( painter );
|
mRenderer->printPage( painter );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,14 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_PreviewOverlayItem_h
|
#ifndef PreviewOverlayItem_h
|
||||||
#define glabels_PreviewOverlayItem_h
|
#define PreviewOverlayItem_h
|
||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class PageRenderer; // Forward reference
|
class PageRenderer; // Forward reference
|
||||||
|
|
||||||
|
|
||||||
@@ -58,6 +56,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_PreviewOverlayItem_h
|
#endif // PreviewOverlayItem_h
|
||||||
|
|||||||
@@ -26,9 +26,6 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -171,5 +168,3 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+3
-6
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_PrintView_h
|
#ifndef PrintView_h
|
||||||
#define glabels_PrintView_h
|
#define PrintView_h
|
||||||
|
|
||||||
#include "ui_PrintView.h"
|
#include "ui_PrintView.h"
|
||||||
#include "PageRenderer.h"
|
#include "PageRenderer.h"
|
||||||
@@ -27,8 +27,6 @@
|
|||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel; // Forward reference
|
class LabelModel; // Forward reference
|
||||||
|
|
||||||
|
|
||||||
@@ -76,6 +74,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_PrintView_h
|
#endif // PrintView_h
|
||||||
|
|||||||
+10
-15
@@ -27,9 +27,6 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -69,14 +66,14 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void PropertiesView::onLabelSizeChanged()
|
void PropertiesView::onLabelSizeChanged()
|
||||||
{
|
{
|
||||||
const libglabels::Template *tmplate = mModel->tmplate();
|
const glabels::Template *tmplate = mModel->tmplate();
|
||||||
const libglabels::Frame *frame = tmplate->frames().first();
|
const glabels::Frame *frame = tmplate->frames().first();
|
||||||
bool isRotated = mModel->rotate();
|
bool isRotated = mModel->rotate();
|
||||||
|
|
||||||
preview->setTemplate( tmplate );
|
preview->setTemplate( tmplate );
|
||||||
preview->setRotate( isRotated );
|
preview->setRotate( isRotated );
|
||||||
|
|
||||||
const libglabels::Vendor *vendor = libglabels::Db::lookupVendorFromName( tmplate->brand() );
|
const glabels::Vendor *vendor = glabels::Db::lookupVendorFromName( tmplate->brand() );
|
||||||
if ( (vendor != NULL) && (vendor->url() != NULL) )
|
if ( (vendor != NULL) && (vendor->url() != NULL) )
|
||||||
{
|
{
|
||||||
QString markup = "<a href='" + vendor->url() + "'>" + vendor->name() + "</a>";
|
QString markup = "<a href='" + vendor->url() + "'>" + vendor->name() + "</a>";
|
||||||
@@ -99,16 +96,16 @@ namespace glabels
|
|||||||
|
|
||||||
descriptionLabel->setText( tmplate->description() );
|
descriptionLabel->setText( tmplate->description() );
|
||||||
|
|
||||||
QString pgSizeString = libglabels::Db::lookupPaperNameFromId( tmplate->paperId() );
|
QString pgSizeString = glabels::Db::lookupPaperNameFromId( tmplate->paperId() );
|
||||||
pageSizeLabel->setText( pgSizeString );
|
pageSizeLabel->setText( pgSizeString );
|
||||||
|
|
||||||
QString labelSizeString = frame->sizeDescription( libglabels::Distance::Units::IN );
|
QString labelSizeString = frame->sizeDescription( glabels::Distance::Units::IN );
|
||||||
labelSizeLabel->setText( labelSizeString );
|
labelSizeLabel->setText( labelSizeString );
|
||||||
|
|
||||||
QString layoutString = frame->layoutDescription();
|
QString layoutString = frame->layoutDescription();
|
||||||
layoutLabel->setText( layoutString );
|
layoutLabel->setText( layoutString );
|
||||||
|
|
||||||
QStringList list = libglabels::Db::getNameListOfSimilarTemplates( tmplate->name() );
|
QStringList list = glabels::Db::getNameListOfSimilarTemplates( tmplate->name() );
|
||||||
if ( list.isEmpty() )
|
if ( list.isEmpty() )
|
||||||
{
|
{
|
||||||
similarProductsGroupBox->hide();
|
similarProductsGroupBox->hide();
|
||||||
@@ -148,8 +145,8 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void PropertiesView::onFormChanged()
|
void PropertiesView::onFormChanged()
|
||||||
{
|
{
|
||||||
const libglabels::Template *tmplate = mModel->tmplate();
|
const glabels::Template *tmplate = mModel->tmplate();
|
||||||
const libglabels::Frame *frame = tmplate->frames().first();
|
const glabels::Frame *frame = tmplate->frames().first();
|
||||||
|
|
||||||
if ( frame->w() == frame->h() )
|
if ( frame->w() == frame->h() )
|
||||||
{
|
{
|
||||||
@@ -176,18 +173,16 @@ namespace glabels
|
|||||||
SelectProductDialog selectProductDialog( this );
|
SelectProductDialog selectProductDialog( this );
|
||||||
selectProductDialog.exec();
|
selectProductDialog.exec();
|
||||||
|
|
||||||
const libglabels::Template* tmplate = selectProductDialog.tmplate();
|
const glabels::Template* tmplate = selectProductDialog.tmplate();
|
||||||
if ( tmplate )
|
if ( tmplate )
|
||||||
{
|
{
|
||||||
mModel->setTmplate( tmplate );
|
mModel->setTmplate( tmplate );
|
||||||
|
|
||||||
// Don't rotate circular or round labels
|
// Don't rotate circular or round labels
|
||||||
const libglabels::Frame *frame = tmplate->frames().first();
|
const glabels::Frame *frame = tmplate->frames().first();
|
||||||
if ( frame->w() == frame->h() )
|
if ( frame->w() == frame->h() )
|
||||||
{
|
{
|
||||||
mModel->setRotate( false );
|
mModel->setRotate( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,14 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_PropertiesView_h
|
#ifndef PropertiesView_h
|
||||||
#define glabels_PropertiesView_h
|
#define PropertiesView_h
|
||||||
|
|
||||||
#include "ui_PropertiesView.h"
|
#include "ui_PropertiesView.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel; // Forward reference
|
class LabelModel; // Forward reference
|
||||||
|
|
||||||
|
|
||||||
@@ -68,6 +66,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_PropertiesView_h
|
#endif // PropertiesView_h
|
||||||
|
|||||||
@@ -26,9 +26,6 @@
|
|||||||
#include "TemplatePickerItem.h"
|
#include "TemplatePickerItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -43,7 +40,7 @@ namespace glabels
|
|||||||
pageSizeUsCheck->setChecked( true );
|
pageSizeUsCheck->setChecked( true );
|
||||||
pageSizeOtherCheck->setChecked( true );
|
pageSizeOtherCheck->setChecked( true );
|
||||||
|
|
||||||
QList<libglabels::Template*> tmplates = libglabels::Db::templates();
|
QList<glabels::Template*> tmplates = glabels::Db::templates();
|
||||||
templatePicker->setTemplates( tmplates );
|
templatePicker->setTemplates( tmplates );
|
||||||
|
|
||||||
templatePicker->applyFilter( searchEntry->text(),
|
templatePicker->applyFilter( searchEntry->text(),
|
||||||
@@ -55,7 +52,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Get selected template
|
/// Get selected template
|
||||||
///
|
///
|
||||||
const libglabels::Template* SelectProductDialog::tmplate() const
|
const glabels::Template* SelectProductDialog::tmplate() const
|
||||||
{
|
{
|
||||||
if ( !mCanceled )
|
if ( !mCanceled )
|
||||||
{
|
{
|
||||||
@@ -106,7 +103,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void SelectProductDialog::onTemplatePickerSelectionChanged()
|
void SelectProductDialog::onTemplatePickerSelectionChanged()
|
||||||
{
|
{
|
||||||
const libglabels::Template *tmplate = templatePicker->selectedTemplate();
|
const glabels::Template *tmplate = templatePicker->selectedTemplate();
|
||||||
|
|
||||||
selectButton->setEnabled( tmplate != NULL );
|
selectButton->setEnabled( tmplate != NULL );
|
||||||
}
|
}
|
||||||
@@ -129,5 +126,3 @@ namespace glabels
|
|||||||
mCanceled = true;
|
mCanceled = true;
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -18,15 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_SelectProductDialog_h
|
#ifndef SelectProductDialog_h
|
||||||
#define glabels_SelectProductDialog_h
|
#define SelectProductDialog_h
|
||||||
|
|
||||||
#include "ui_SelectProductDialog.h"
|
#include "ui_SelectProductDialog.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// New Label Dialog Widget
|
/// New Label Dialog Widget
|
||||||
///
|
///
|
||||||
@@ -45,7 +42,7 @@ namespace glabels
|
|||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// Accessors
|
// Accessors
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
const libglabels::Template* tmplate() const;
|
const glabels::Template* tmplate() const;
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -68,6 +65,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_SelectProductDialog_h
|
#endif // SelectProductDialog_h
|
||||||
|
|||||||
+17
-22
@@ -51,9 +51,6 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -74,7 +71,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Template Property Setter
|
/// Template Property Setter
|
||||||
///
|
///
|
||||||
void SimplePreview::setTemplate( const libglabels::Template *tmplate )
|
void SimplePreview::setTemplate( const glabels::Template *tmplate )
|
||||||
{
|
{
|
||||||
mTmplate = tmplate;
|
mTmplate = tmplate;
|
||||||
update();
|
update();
|
||||||
@@ -110,10 +107,10 @@ namespace glabels
|
|||||||
if ( mTmplate != NULL )
|
if ( mTmplate != NULL )
|
||||||
{
|
{
|
||||||
// Set scene up with a 5% margin around paper
|
// Set scene up with a 5% margin around paper
|
||||||
libglabels::Distance x = -0.05 * mTmplate->pageWidth();
|
glabels::Distance x = -0.05 * mTmplate->pageWidth();
|
||||||
libglabels::Distance y = -0.05 * mTmplate->pageHeight();
|
glabels::Distance y = -0.05 * mTmplate->pageHeight();
|
||||||
libglabels::Distance w = 1.10 * mTmplate->pageWidth();
|
glabels::Distance w = 1.10 * mTmplate->pageWidth();
|
||||||
libglabels::Distance h = 1.10 * mTmplate->pageHeight();
|
glabels::Distance h = 1.10 * mTmplate->pageHeight();
|
||||||
|
|
||||||
mScene->setSceneRect( x.pt(), y.pt(), w.pt(), h.pt() );
|
mScene->setSceneRect( x.pt(), y.pt(), w.pt(), h.pt() );
|
||||||
fitInView( mScene->sceneRect(), Qt::KeepAspectRatio );
|
fitInView( mScene->sceneRect(), Qt::KeepAspectRatio );
|
||||||
@@ -141,7 +138,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Draw Paper
|
/// Draw Paper
|
||||||
///
|
///
|
||||||
void SimplePreview::drawPaper( const libglabels::Distance& pw, const libglabels::Distance& ph )
|
void SimplePreview::drawPaper( const glabels::Distance& pw, const glabels::Distance& ph )
|
||||||
{
|
{
|
||||||
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
||||||
shadowEffect->setColor( shadowColor );
|
shadowEffect->setColor( shadowColor );
|
||||||
@@ -167,9 +164,9 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void SimplePreview::drawLabels()
|
void SimplePreview::drawLabels()
|
||||||
{
|
{
|
||||||
libglabels::Frame *frame = mTmplate->frames().first();
|
glabels::Frame *frame = mTmplate->frames().first();
|
||||||
|
|
||||||
foreach (libglabels::Point origin, frame->getOrigins() )
|
foreach (glabels::Point origin, frame->getOrigins() )
|
||||||
{
|
{
|
||||||
drawLabel( origin.x(), origin.y(), frame->path() );
|
drawLabel( origin.x(), origin.y(), frame->path() );
|
||||||
}
|
}
|
||||||
@@ -179,8 +176,8 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Draw a Single Label at x,y
|
/// Draw a Single Label at x,y
|
||||||
///
|
///
|
||||||
void SimplePreview::drawLabel( const libglabels::Distance& x,
|
void SimplePreview::drawLabel( const glabels::Distance& x,
|
||||||
const libglabels::Distance& y,
|
const glabels::Distance& y,
|
||||||
const QPainterPath& path )
|
const QPainterPath& path )
|
||||||
{
|
{
|
||||||
QBrush brush( labelColor );
|
QBrush brush( labelColor );
|
||||||
@@ -202,12 +199,12 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
void SimplePreview::drawArrow()
|
void SimplePreview::drawArrow()
|
||||||
{
|
{
|
||||||
libglabels::Frame *frame = mTmplate->frames().first();
|
glabels::Frame *frame = mTmplate->frames().first();
|
||||||
|
|
||||||
libglabels::Distance w = frame->w();
|
glabels::Distance w = frame->w();
|
||||||
libglabels::Distance h = frame->h();
|
glabels::Distance h = frame->h();
|
||||||
|
|
||||||
libglabels::Distance min = libglabels::min( w, h );
|
glabels::Distance min = glabels::min( w, h );
|
||||||
|
|
||||||
QPen pen( arrowColor );
|
QPen pen( arrowColor );
|
||||||
pen.setWidthF( 0.25*min.pt()*arrowScale );
|
pen.setWidthF( 0.25*min.pt()*arrowScale );
|
||||||
@@ -216,9 +213,9 @@ namespace glabels
|
|||||||
|
|
||||||
QBrush brush( upColor );
|
QBrush brush( upColor );
|
||||||
|
|
||||||
libglabels::Point origin = frame->getOrigins().first();
|
glabels::Point origin = frame->getOrigins().first();
|
||||||
libglabels::Distance x0 = origin.x();
|
glabels::Distance x0 = origin.x();
|
||||||
libglabels::Distance y0 = origin.y();
|
glabels::Distance y0 = origin.y();
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.moveTo( 0, min.pt()*arrowScale/3 );
|
path.moveTo( 0, min.pt()*arrowScale/3 );
|
||||||
@@ -253,5 +250,3 @@ namespace glabels
|
|||||||
mScene->addItem( arrowItem );
|
mScene->addItem( arrowItem );
|
||||||
mScene->addItem( upItem );
|
mScene->addItem( upItem );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+8
-12
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_SimplePreview_h
|
#ifndef SimplePreview_h
|
||||||
#define glabels_SimplePreview_h
|
#define SimplePreview_h
|
||||||
|
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
#include "libglabels/Template.h"
|
#include "libglabels/Template.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Simple Preview Widget
|
/// Simple Preview Widget
|
||||||
///
|
///
|
||||||
@@ -51,7 +48,7 @@ namespace glabels
|
|||||||
// Properties
|
// Properties
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
void setTemplate( const libglabels::Template *tmplate );
|
void setTemplate( const glabels::Template *tmplate );
|
||||||
void setRotate( bool rotateFlag );
|
void setRotate( bool rotateFlag );
|
||||||
|
|
||||||
|
|
||||||
@@ -68,10 +65,10 @@ namespace glabels
|
|||||||
private:
|
private:
|
||||||
void update();
|
void update();
|
||||||
void clearScene();
|
void clearScene();
|
||||||
void drawPaper( const libglabels::Distance& pw, const libglabels::Distance& ph );
|
void drawPaper( const glabels::Distance& pw, const glabels::Distance& ph );
|
||||||
void drawLabels();
|
void drawLabels();
|
||||||
void drawLabel( const libglabels::Distance& x,
|
void drawLabel( const glabels::Distance& x,
|
||||||
const libglabels::Distance& y,
|
const glabels::Distance& y,
|
||||||
const QPainterPath& path );
|
const QPainterPath& path );
|
||||||
void drawArrow();
|
void drawArrow();
|
||||||
|
|
||||||
@@ -80,13 +77,12 @@ namespace glabels
|
|||||||
// Private Data
|
// Private Data
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
const libglabels::Template *mTmplate;
|
const glabels::Template *mTmplate;
|
||||||
bool mRotateFlag;
|
bool mRotateFlag;
|
||||||
|
|
||||||
QGraphicsScene *mScene;
|
QGraphicsScene *mScene;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_SimplePreview_h
|
#endif // SimplePreview_h
|
||||||
|
|||||||
@@ -25,9 +25,6 @@
|
|||||||
#include "TemplatePickerItem.h"
|
#include "TemplatePickerItem.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
@@ -38,16 +35,16 @@ namespace glabels
|
|||||||
setSpacing( 24 );
|
setSpacing( 24 );
|
||||||
setWordWrap( true );
|
setWordWrap( true );
|
||||||
setUniformItemSizes( true );
|
setUniformItemSizes( true );
|
||||||
setIconSize( QSize(libglabels::TEMPLATE_PREVIEW_SIZE, libglabels::TEMPLATE_PREVIEW_SIZE) );
|
setIconSize( QSize(glabels::TEMPLATE_PREVIEW_SIZE, glabels::TEMPLATE_PREVIEW_SIZE) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Set List of Templates to Pick From
|
/// Set List of Templates to Pick From
|
||||||
///
|
///
|
||||||
void TemplatePicker::setTemplates( const QList <libglabels::Template*> &tmplates )
|
void TemplatePicker::setTemplates( const QList <glabels::Template*> &tmplates )
|
||||||
{
|
{
|
||||||
foreach (libglabels::Template *tmplate, tmplates)
|
foreach (glabels::Template *tmplate, tmplates)
|
||||||
{
|
{
|
||||||
TemplatePickerItem *item = new TemplatePickerItem( tmplate, this );
|
TemplatePickerItem *item = new TemplatePickerItem( tmplate, this );
|
||||||
}
|
}
|
||||||
@@ -85,7 +82,7 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Get Currently Selected Template
|
/// Get Currently Selected Template
|
||||||
///
|
///
|
||||||
const libglabels::Template *TemplatePicker::selectedTemplate()
|
const glabels::Template *TemplatePicker::selectedTemplate()
|
||||||
{
|
{
|
||||||
QList<QListWidgetItem *> items = selectedItems();
|
QList<QListWidgetItem *> items = selectedItems();
|
||||||
if ( items.isEmpty() )
|
if ( items.isEmpty() )
|
||||||
@@ -98,6 +95,3 @@ namespace glabels
|
|||||||
return tItem->tmplate();
|
return tItem->tmplate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_TemplatePicker_h
|
#ifndef TemplatePicker_h
|
||||||
#define glabels_TemplatePicker_h
|
#define TemplatePicker_h
|
||||||
|
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
|
|
||||||
@@ -28,9 +28,6 @@
|
|||||||
#include "libglabels/Template.h"
|
#include "libglabels/Template.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Template Picker Widget
|
/// Template Picker Widget
|
||||||
///
|
///
|
||||||
@@ -50,7 +47,7 @@ namespace glabels
|
|||||||
// Properties
|
// Properties
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
void setTemplates( const QList <libglabels::Template*> &tmplates );
|
void setTemplates( const QList <glabels::Template*> &tmplates );
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
@@ -58,10 +55,9 @@ namespace glabels
|
|||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
void applyFilter( const QString &searchString, bool isoMask, bool usMask, bool otherMask );
|
void applyFilter( const QString &searchString, bool isoMask, bool usMask, bool otherMask );
|
||||||
|
|
||||||
const libglabels::Template *selectedTemplate();
|
const glabels::Template *selectedTemplate();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_TemplatePicker_h
|
#endif // TemplatePicker_h
|
||||||
|
|||||||
@@ -25,13 +25,10 @@
|
|||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
TemplatePickerItem::TemplatePickerItem( libglabels::Template *tmplate,
|
TemplatePickerItem::TemplatePickerItem( glabels::Template *tmplate,
|
||||||
QListWidget *parent )
|
QListWidget *parent )
|
||||||
: QListWidgetItem(parent)
|
: QListWidgetItem(parent)
|
||||||
{
|
{
|
||||||
@@ -47,10 +44,8 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
/// Template Property Getter
|
/// Template Property Getter
|
||||||
///
|
///
|
||||||
const libglabels::Template *TemplatePickerItem::tmplate() const
|
const glabels::Template *TemplatePickerItem::tmplate() const
|
||||||
{
|
{
|
||||||
return mTmplate;
|
return mTmplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_TemplatePickerItem_h
|
#ifndef TemplatePickerItem_h
|
||||||
#define glabels_TemplatePickerItem_h
|
#define TemplatePickerItem_h
|
||||||
|
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
|
|
||||||
@@ -28,9 +28,6 @@
|
|||||||
#include "libglabels/Template.h"
|
#include "libglabels/Template.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Template Picker Item Widget
|
/// Template Picker Item Widget
|
||||||
///
|
///
|
||||||
@@ -41,24 +38,23 @@ namespace glabels
|
|||||||
// Life Cycle
|
// Life Cycle
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
TemplatePickerItem( libglabels::Template *tmplate, QListWidget *parent = 0 );
|
TemplatePickerItem( glabels::Template *tmplate, QListWidget *parent = 0 );
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// Properties
|
// Properties
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
public:
|
public:
|
||||||
const libglabels::Template *tmplate() const;
|
const glabels::Template *tmplate() const;
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// Private Data
|
// Private Data
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
private:
|
private:
|
||||||
libglabels::Template *mTmplate;
|
glabels::Template *mTmplate;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_TemplatePickerItem_h
|
#endif // TemplatePickerItem_h
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Default Constructor
|
/// Default Constructor
|
||||||
///
|
///
|
||||||
@@ -285,6 +282,3 @@ namespace glabels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -18,15 +18,12 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_TextNode_h
|
#ifndef TextNode_h
|
||||||
#define glabels_TextNode_h
|
#define TextNode_h
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Text Node Type
|
/// Text Node Type
|
||||||
///
|
///
|
||||||
@@ -88,6 +85,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_TextNode_h
|
#endif // TextNode_h
|
||||||
|
|||||||
+71
-55
@@ -59,7 +59,7 @@ namespace
|
|||||||
|
|
||||||
const QColor gridLineColor( 192, 192, 192 );
|
const QColor gridLineColor( 192, 192, 192 );
|
||||||
const double gridLineWidthPixels = 1;
|
const double gridLineWidthPixels = 1;
|
||||||
const libglabels::Distance gridSpacing = libglabels::Distance::pt(9); // TODO: determine from locale.
|
const glabels::Distance gridSpacing = glabels::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;
|
||||||
@@ -74,7 +74,7 @@ namespace
|
|||||||
///
|
///
|
||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
glabels::View::View( QScrollArea* scrollArea, QWidget* parent )
|
View::View( QScrollArea* scrollArea, QWidget* parent )
|
||||||
: QWidget(parent), mScrollArea(scrollArea)
|
: QWidget(parent), mScrollArea(scrollArea)
|
||||||
{
|
{
|
||||||
mState = IdleState;
|
mState = IdleState;
|
||||||
@@ -92,7 +92,7 @@ glabels::View::View( QScrollArea* scrollArea, QWidget* parent )
|
|||||||
/// Zoom property
|
/// Zoom property
|
||||||
///
|
///
|
||||||
double
|
double
|
||||||
glabels::View::zoom() const
|
View::zoom() const
|
||||||
{
|
{
|
||||||
return mZoom;
|
return mZoom;
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ glabels::View::zoom() const
|
|||||||
/// Markup visible? property
|
/// Markup visible? property
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
glabels::View::markupVisible() const
|
View::markupVisible() const
|
||||||
{
|
{
|
||||||
return mMarkupVisible;
|
return mMarkupVisible;
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ glabels::View::markupVisible() const
|
|||||||
/// Grid visible? property
|
/// Grid visible? property
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
glabels::View::qridVisible() const
|
View::qridVisible() const
|
||||||
{
|
{
|
||||||
return mGridVisible;
|
return mGridVisible;
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ glabels::View::qridVisible() const
|
|||||||
/// Model Parameter Setter
|
/// Model Parameter Setter
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::setModel( LabelModel* model )
|
View::setModel( LabelModel* model )
|
||||||
{
|
{
|
||||||
mModel = model;
|
mModel = model;
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ glabels::View::setModel( LabelModel* model )
|
|||||||
/// Grid Visibility Parameter Setter
|
/// Grid Visibility Parameter Setter
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::setGridVisible( bool visibleFlag )
|
View::setGridVisible( bool visibleFlag )
|
||||||
{
|
{
|
||||||
mGridVisible = visibleFlag;
|
mGridVisible = visibleFlag;
|
||||||
update();
|
update();
|
||||||
@@ -154,7 +154,7 @@ glabels::View::setGridVisible( bool visibleFlag )
|
|||||||
/// Markup Visibility Parameter Setter
|
/// Markup Visibility Parameter Setter
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::setMarkupVisible( bool visibleFlag )
|
View::setMarkupVisible( bool visibleFlag )
|
||||||
{
|
{
|
||||||
mMarkupVisible = visibleFlag;
|
mMarkupVisible = visibleFlag;
|
||||||
update();
|
update();
|
||||||
@@ -165,7 +165,7 @@ glabels::View::setMarkupVisible( bool visibleFlag )
|
|||||||
/// Zoom In "One Notch"
|
/// Zoom In "One Notch"
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::zoomIn()
|
View::zoomIn()
|
||||||
{
|
{
|
||||||
// Find closest standard zoom level to our current zoom
|
// Find closest standard zoom level to our current zoom
|
||||||
// Start with 2nd largest scale
|
// Start with 2nd largest scale
|
||||||
@@ -191,7 +191,7 @@ glabels::View::zoomIn()
|
|||||||
/// Zoom Out "One Notch"
|
/// Zoom Out "One Notch"
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::zoomOut()
|
View::zoomOut()
|
||||||
{
|
{
|
||||||
// Find closest standard zoom level to our current zoom
|
// Find closest standard zoom level to our current zoom
|
||||||
// Start with largest scale, end on 2nd smallest
|
// Start with largest scale, end on 2nd smallest
|
||||||
@@ -217,7 +217,7 @@ glabels::View::zoomOut()
|
|||||||
/// Zoom To 1:1 Scale
|
/// Zoom To 1:1 Scale
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::zoom1To1()
|
View::zoom1To1()
|
||||||
{
|
{
|
||||||
setZoomReal( 1.0, false );
|
setZoomReal( 1.0, false );
|
||||||
}
|
}
|
||||||
@@ -227,7 +227,7 @@ glabels::View::zoom1To1()
|
|||||||
/// Zoom To Fit
|
/// Zoom To Fit
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::zoomToFit()
|
View::zoomToFit()
|
||||||
{
|
{
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
@@ -251,7 +251,7 @@ glabels::View::zoomToFit()
|
|||||||
/// Is Zoom at Maximum?
|
/// Is Zoom at Maximum?
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
glabels::View::isZoomMax() const
|
View::isZoomMax() const
|
||||||
{
|
{
|
||||||
return ( mZoom >= zoomLevels[0] );
|
return ( mZoom >= zoomLevels[0] );
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ glabels::View::isZoomMax() const
|
|||||||
/// Is Zoom at Minimum?
|
/// Is Zoom at Minimum?
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
glabels::View::isZoomMin() const
|
View::isZoomMin() const
|
||||||
{
|
{
|
||||||
return ( mZoom <= zoomLevels[nZoomLevels-1] );
|
return ( mZoom <= zoomLevels[nZoomLevels-1] );
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,7 @@ glabels::View::isZoomMin() const
|
|||||||
/// Set Zoom to Value
|
/// Set Zoom to Value
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::setZoomReal( double zoom, bool zoomToFitFlag )
|
View::setZoomReal( double zoom, bool zoomToFitFlag )
|
||||||
{
|
{
|
||||||
mZoom = zoom;
|
mZoom = zoom;
|
||||||
mZoomToFitFlag = zoomToFitFlag;
|
mZoomToFitFlag = zoomToFitFlag;
|
||||||
@@ -296,7 +296,7 @@ glabels::View::setZoomReal( double zoom, bool zoomToFitFlag )
|
|||||||
/// Arrow mode (normal mode)
|
/// Arrow mode (normal mode)
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::arrowMode()
|
View::arrowMode()
|
||||||
{
|
{
|
||||||
setCursor( Qt::ArrowCursor );
|
setCursor( Qt::ArrowCursor );
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ glabels::View::arrowMode()
|
|||||||
/// Create box mode
|
/// Create box mode
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::createBoxMode()
|
View::createBoxMode()
|
||||||
{
|
{
|
||||||
setCursor( Cursors::Box() );
|
setCursor( Cursors::Box() );
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ glabels::View::createBoxMode()
|
|||||||
/// Resize Event Handler
|
/// Resize Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::resizeEvent( QResizeEvent *event )
|
View::resizeEvent( QResizeEvent *event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -345,7 +345,7 @@ glabels::View::resizeEvent( QResizeEvent *event )
|
|||||||
/// Mouse Button Press Event Handler
|
/// Mouse Button Press Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::mousePressEvent( QMouseEvent* event )
|
View::mousePressEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -358,8 +358,8 @@ glabels::View::mousePressEvent( QMouseEvent* event )
|
|||||||
transform.translate( mX0.pt(), mY0.pt() );
|
transform.translate( mX0.pt(), mY0.pt() );
|
||||||
|
|
||||||
QPointF pWorld = transform.inverted().map( event->posF() );
|
QPointF pWorld = transform.inverted().map( event->posF() );
|
||||||
libglabels::Distance xWorld = libglabels::Distance::pt( pWorld.x() );
|
glabels::Distance xWorld = glabels::Distance::pt( pWorld.x() );
|
||||||
libglabels::Distance yWorld = libglabels::Distance::pt( pWorld.y() );
|
glabels::Distance yWorld = glabels::Distance::pt( pWorld.y() );
|
||||||
|
|
||||||
|
|
||||||
if ( event->button() & Qt::LeftButton )
|
if ( event->button() & Qt::LeftButton )
|
||||||
@@ -511,7 +511,7 @@ glabels::View::mousePressEvent( QMouseEvent* event )
|
|||||||
/// Mouse Movement Event Handler
|
/// Mouse Movement Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::mouseMoveEvent( QMouseEvent* event )
|
View::mouseMoveEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
@@ -527,8 +527,8 @@ glabels::View::mouseMoveEvent( QMouseEvent* event )
|
|||||||
transform.translate( mX0.pt(), mY0.pt() );
|
transform.translate( mX0.pt(), mY0.pt() );
|
||||||
|
|
||||||
QPointF pWorld = transform.inverted().map( event->posF() );
|
QPointF pWorld = transform.inverted().map( event->posF() );
|
||||||
libglabels::Distance xWorld = libglabels::Distance::pt( pWorld.x() );
|
glabels::Distance xWorld = glabels::Distance::pt( pWorld.x() );
|
||||||
libglabels::Distance yWorld = libglabels::Distance::pt( pWorld.y() );
|
glabels::Distance yWorld = glabels::Distance::pt( pWorld.y() );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -615,7 +615,7 @@ glabels::View::mouseMoveEvent( QMouseEvent* event )
|
|||||||
/// Mouse Button Release Event Handler
|
/// Mouse Button Release Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::mouseReleaseEvent( QMouseEvent* event )
|
View::mouseReleaseEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -628,8 +628,8 @@ glabels::View::mouseReleaseEvent( QMouseEvent* event )
|
|||||||
transform.translate( mX0.pt(), mY0.pt() );
|
transform.translate( mX0.pt(), mY0.pt() );
|
||||||
|
|
||||||
QPointF pWorld = transform.inverted().map( event->posF() );
|
QPointF pWorld = transform.inverted().map( event->posF() );
|
||||||
libglabels::Distance xWorld = libglabels::Distance::pt( pWorld.x() );
|
glabels::Distance xWorld = glabels::Distance::pt( pWorld.x() );
|
||||||
libglabels::Distance yWorld = libglabels::Distance::pt( pWorld.y() );
|
glabels::Distance yWorld = glabels::Distance::pt( pWorld.y() );
|
||||||
|
|
||||||
|
|
||||||
if ( event->button() & Qt::LeftButton )
|
if ( event->button() & Qt::LeftButton )
|
||||||
@@ -691,7 +691,7 @@ glabels::View::mouseReleaseEvent( QMouseEvent* event )
|
|||||||
/// Leave Event Handler
|
/// Leave Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::leaveEvent( QEvent* event )
|
View::leaveEvent( QEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -704,8 +704,8 @@ glabels::View::leaveEvent( QEvent* event )
|
|||||||
/// Handle resize motion
|
/// Handle resize motion
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::handleResizeMotion( const libglabels::Distance& xWorld,
|
View::handleResizeMotion( const glabels::Distance& xWorld,
|
||||||
const libglabels::Distance& yWorld )
|
const glabels::Distance& yWorld )
|
||||||
{
|
{
|
||||||
QPointF p( xWorld.pt(), yWorld.pt() );
|
QPointF p( xWorld.pt(), yWorld.pt() );
|
||||||
Handle::Location location = mResizeHandle->location();
|
Handle::Location location = mResizeHandle->location();
|
||||||
@@ -795,22 +795,22 @@ glabels::View::handleResizeMotion( const libglabels::Distance& xWorld,
|
|||||||
{
|
{
|
||||||
case Handle::E:
|
case Handle::E:
|
||||||
case Handle::W:
|
case Handle::W:
|
||||||
mResizeObject->setWHonorAspect( libglabels::Distance::pt(w) );
|
mResizeObject->setWHonorAspect( glabels::Distance::pt(w) );
|
||||||
break;
|
break;
|
||||||
case Handle::N:
|
case Handle::N:
|
||||||
case Handle::S:
|
case Handle::S:
|
||||||
mResizeObject->setHHonorAspect( libglabels::Distance::pt(h) );
|
mResizeObject->setHHonorAspect( glabels::Distance::pt(h) );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mResizeObject->setSizeHonorAspect( libglabels::Distance::pt(w),
|
mResizeObject->setSizeHonorAspect( glabels::Distance::pt(w),
|
||||||
libglabels::Distance::pt(h) );
|
glabels::Distance::pt(h) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mResizeObject->setSize( libglabels::Distance::pt(w),
|
mResizeObject->setSize( glabels::Distance::pt(w),
|
||||||
libglabels::Distance::pt(h) );
|
glabels::Distance::pt(h) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -836,8 +836,8 @@ glabels::View::handleResizeMotion( const libglabels::Distance& xWorld,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mResizeObject->setSize( libglabels::Distance::pt(w),
|
mResizeObject->setSize( glabels::Distance::pt(w),
|
||||||
libglabels::Distance::pt(h) );
|
glabels::Distance::pt(h) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -846,8 +846,8 @@ glabels::View::handleResizeMotion( const libglabels::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( libglabels::Distance::pt(p0.x()),
|
mResizeObject->setPosition( glabels::Distance::pt(p0.x()),
|
||||||
libglabels::Distance::pt(p0.y()) );
|
glabels::Distance::pt(p0.y()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -855,7 +855,7 @@ glabels::View::handleResizeMotion( const libglabels::Distance& xWorld,
|
|||||||
/// Paint Event Handler
|
/// Paint Event Handler
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::paintEvent( QPaintEvent* event )
|
View::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
if ( mModel )
|
if ( mModel )
|
||||||
{
|
{
|
||||||
@@ -890,7 +890,7 @@ glabels::View::paintEvent( QPaintEvent* event )
|
|||||||
/// Draw Background Layer
|
/// Draw Background Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::drawBgLayer( QPainter* painter )
|
View::drawBgLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Draw shadow
|
* Draw shadow
|
||||||
@@ -935,15 +935,15 @@ glabels::View::drawBgLayer( QPainter* painter )
|
|||||||
/// Draw Grid Layer
|
/// Draw Grid Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::drawGridLayer( QPainter* painter )
|
View::drawGridLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
if ( mGridVisible )
|
if ( mGridVisible )
|
||||||
{
|
{
|
||||||
libglabels::Distance w = mModel->frame()->w();
|
glabels::Distance w = mModel->frame()->w();
|
||||||
libglabels::Distance h = mModel->frame()->h();
|
glabels::Distance h = mModel->frame()->h();
|
||||||
|
|
||||||
libglabels::Distance x0, y0;
|
glabels::Distance x0, y0;
|
||||||
if ( dynamic_cast<const libglabels::FrameRect*>( mModel->frame() ) )
|
if ( dynamic_cast<const glabels::FrameRect*>( mModel->frame() ) )
|
||||||
{
|
{
|
||||||
x0 = gridSpacing;
|
x0 = gridSpacing;
|
||||||
y0 = gridSpacing;
|
y0 = gridSpacing;
|
||||||
@@ -968,12 +968,12 @@ glabels::View::drawGridLayer( QPainter* painter )
|
|||||||
pen.setCosmetic( true );
|
pen.setCosmetic( true );
|
||||||
painter->setPen( pen );
|
painter->setPen( pen );
|
||||||
|
|
||||||
for ( libglabels::Distance x = x0; x < w; x += gridSpacing )
|
for ( glabels::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 ( libglabels::Distance y = y0; y < h; y += gridSpacing )
|
for ( glabels::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() );
|
||||||
}
|
}
|
||||||
@@ -987,7 +987,7 @@ glabels::View::drawGridLayer( QPainter* painter )
|
|||||||
/// Draw Markup Layer
|
/// Draw Markup Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::drawMarkupLayer( QPainter* painter )
|
View::drawMarkupLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
if ( mMarkupVisible )
|
if ( mMarkupVisible )
|
||||||
{
|
{
|
||||||
@@ -1002,7 +1002,7 @@ glabels::View::drawMarkupLayer( QPainter* painter )
|
|||||||
painter->translate( -mModel->frame()->w().pt(), 0 );
|
painter->translate( -mModel->frame()->w().pt(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach( libglabels::Markup* markup, mModel->frame()->markups() )
|
foreach( glabels::Markup* markup, mModel->frame()->markups() )
|
||||||
{
|
{
|
||||||
painter->drawPath( markup->path() );
|
painter->drawPath( markup->path() );
|
||||||
}
|
}
|
||||||
@@ -1016,7 +1016,7 @@ glabels::View::drawMarkupLayer( QPainter* painter )
|
|||||||
/// Draw Objects Layer
|
/// Draw Objects Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::drawObjectsLayer( QPainter* painter )
|
View::drawObjectsLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
mModel->draw( painter );
|
mModel->draw( painter );
|
||||||
}
|
}
|
||||||
@@ -1026,7 +1026,7 @@ glabels::View::drawObjectsLayer( QPainter* painter )
|
|||||||
/// Draw Foreground Layer
|
/// Draw Foreground Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::drawFgLayer( QPainter* painter )
|
View::drawFgLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Draw label outline
|
* Draw label outline
|
||||||
@@ -1053,7 +1053,7 @@ glabels::View::drawFgLayer( QPainter* painter )
|
|||||||
/// Draw Highlight Layer
|
/// Draw Highlight Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::drawHighlightLayer( QPainter* painter )
|
View::drawHighlightLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
@@ -1073,7 +1073,7 @@ glabels::View::drawHighlightLayer( QPainter* painter )
|
|||||||
/// Draw Select Region Layer
|
/// Draw Select Region Layer
|
||||||
///
|
///
|
||||||
void
|
void
|
||||||
glabels::View::drawSelectRegionLayer( QPainter* painter )
|
View::drawSelectRegionLayer( QPainter* painter )
|
||||||
{
|
{
|
||||||
if ( mSelectRegionVisible )
|
if ( mSelectRegionVisible )
|
||||||
{
|
{
|
||||||
@@ -1090,3 +1090,19 @@ glabels::View::drawSelectRegionLayer( QPainter* painter )
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Model changed handler
|
||||||
|
///
|
||||||
|
void View::onModelChanged()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Model size changed handler
|
||||||
|
///
|
||||||
|
void View::onModelSizeChanged()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|||||||
+13
-19
@@ -18,8 +18,8 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_View_h
|
#ifndef View_h
|
||||||
#define glabels_View_h
|
#define View_h
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
@@ -28,8 +28,6 @@
|
|||||||
#include "LabelRegion.h"
|
#include "LabelRegion.h"
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
// Forward References
|
// Forward References
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
@@ -56,7 +54,7 @@ namespace glabels
|
|||||||
signals:
|
signals:
|
||||||
void contextMenuActivate();
|
void contextMenuActivate();
|
||||||
void zoomChanged();
|
void zoomChanged();
|
||||||
void pointerMoved( const libglabels::Distance& x, const libglabels::Distance& y );
|
void pointerMoved( const glabels::Distance& x, const glabels::Distance& y );
|
||||||
void pointerExited();
|
void pointerExited();
|
||||||
void modeChanged();
|
void modeChanged();
|
||||||
|
|
||||||
@@ -128,8 +126,8 @@ namespace glabels
|
|||||||
// Private methods
|
// Private methods
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
private:
|
private:
|
||||||
void handleResizeMotion( const libglabels::Distance& xWorld,
|
void handleResizeMotion( const glabels::Distance& xWorld,
|
||||||
const libglabels::Distance& yWorld );
|
const glabels::Distance& yWorld );
|
||||||
|
|
||||||
void drawBgLayer( QPainter* painter );
|
void drawBgLayer( QPainter* painter );
|
||||||
void drawGridLayer( QPainter* painter );
|
void drawGridLayer( QPainter* painter );
|
||||||
@@ -143,7 +141,7 @@ namespace glabels
|
|||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
// Private slots
|
// Private slots
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
private:
|
private slots:
|
||||||
void onModelChanged();
|
void onModelChanged();
|
||||||
void onModelSizeChanged();
|
void onModelSizeChanged();
|
||||||
|
|
||||||
@@ -175,8 +173,8 @@ namespace glabels
|
|||||||
double mZoom;
|
double mZoom;
|
||||||
bool mZoomToFitFlag;
|
bool mZoomToFitFlag;
|
||||||
double mScale;
|
double mScale;
|
||||||
libglabels::Distance mX0;
|
glabels::Distance mX0;
|
||||||
libglabels::Distance mY0;
|
glabels::Distance mY0;
|
||||||
|
|
||||||
bool mMarkupVisible;
|
bool mMarkupVisible;
|
||||||
bool mGridVisible;
|
bool mGridVisible;
|
||||||
@@ -192,8 +190,8 @@ namespace glabels
|
|||||||
LabelRegion mSelectRegion;
|
LabelRegion mSelectRegion;
|
||||||
|
|
||||||
/* ArrowMove state */
|
/* ArrowMove state */
|
||||||
libglabels::Distance mMoveLastX;
|
glabels::Distance mMoveLastX;
|
||||||
libglabels::Distance mMoveLastY;
|
glabels::Distance mMoveLastY;
|
||||||
|
|
||||||
/* ArrowResize state */
|
/* ArrowResize state */
|
||||||
LabelModelObject* mResizeObject;
|
LabelModelObject* mResizeObject;
|
||||||
@@ -203,15 +201,11 @@ namespace glabels
|
|||||||
/* CreateDrag state */
|
/* CreateDrag state */
|
||||||
CreateType mCreateObjectType;
|
CreateType mCreateObjectType;
|
||||||
LabelModelObject* mCreateObject;
|
LabelModelObject* mCreateObject;
|
||||||
libglabels::Distance mCreateX0;
|
glabels::Distance mCreateX0;
|
||||||
libglabels::Distance mCreateY0;
|
glabels::Distance mCreateY0;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
#endif // View_h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // glabels_View_h
|
|
||||||
|
|||||||
+41
-41
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::writeFile( const LabelModel* label, const QString& fileName )
|
XmlLabelCreator::writeFile( const LabelModel* label, const QString& fileName )
|
||||||
{
|
{
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ glabels::XmlLabelCreator::writeFile( const LabelModel* label, const QString& fil
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::writeBuffer( const LabelModel* label, QString& buffer )
|
XmlLabelCreator::writeBuffer( const LabelModel* label, QString& buffer )
|
||||||
{
|
{
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ glabels::XmlLabelCreator::writeBuffer( const LabelModel* label, QString& buffer
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createDoc( QDomDocument& doc, const LabelModel* label )
|
XmlLabelCreator::createDoc( QDomDocument& doc, const LabelModel* label )
|
||||||
{
|
{
|
||||||
QDomNode xmlNode( doc.createProcessingInstruction( "xml", "version=\"1.0\"" ) );
|
QDomNode xmlNode( doc.createProcessingInstruction( "xml", "version=\"1.0\"" ) );
|
||||||
doc.appendChild( xmlNode );
|
doc.appendChild( xmlNode );
|
||||||
@@ -74,7 +74,7 @@ glabels::XmlLabelCreator::createDoc( QDomDocument& doc, const LabelModel* label
|
|||||||
QDomElement root = doc.createElement( "Glabels-document" );
|
QDomElement root = doc.createElement( "Glabels-document" );
|
||||||
doc.appendChild( root );
|
doc.appendChild( root );
|
||||||
|
|
||||||
libglabels::XmlTemplateCreator().createTemplateNode( root, label->tmplate() );
|
glabels::XmlTemplateCreator().createTemplateNode( root, label->tmplate() );
|
||||||
|
|
||||||
createObjectsNode( root, label );
|
createObjectsNode( root, label );
|
||||||
|
|
||||||
@@ -85,14 +85,14 @@ glabels::XmlLabelCreator::createDoc( QDomDocument& doc, const LabelModel* label
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectsNode( QDomElement &parent, const LabelModel* label )
|
XmlLabelCreator::createObjectsNode( QDomElement &parent, const LabelModel* label )
|
||||||
{
|
{
|
||||||
QDomDocument doc = parent.ownerDocument();
|
QDomDocument doc = parent.ownerDocument();
|
||||||
QDomElement node = doc.createElement( "Objects" );
|
QDomElement node = doc.createElement( "Objects" );
|
||||||
parent.appendChild( node );
|
parent.appendChild( node );
|
||||||
|
|
||||||
libglabels::XmlUtil::setStringAttr( node, "id", "0" );
|
glabels::XmlUtil::setStringAttr( node, "id", "0" );
|
||||||
libglabels::XmlUtil::setBoolAttr( node, "rotate", label->rotate() );
|
glabels::XmlUtil::setBoolAttr( node, "rotate", label->rotate() );
|
||||||
|
|
||||||
foreach ( LabelModelObject* object, label->objectList() )
|
foreach ( LabelModelObject* object, label->objectList() )
|
||||||
{
|
{
|
||||||
@@ -110,39 +110,39 @@ glabels::XmlLabelCreator::createObjectsNode( QDomElement &parent, const LabelMod
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectBoxNode( QDomElement &parent, const LabelModelBoxObject* object )
|
XmlLabelCreator::createObjectBoxNode( QDomElement &parent, const LabelModelBoxObject* object )
|
||||||
{
|
{
|
||||||
QDomDocument doc = parent.ownerDocument();
|
QDomDocument doc = parent.ownerDocument();
|
||||||
QDomElement node = doc.createElement( "Object-box" );
|
QDomElement node = doc.createElement( "Object-box" );
|
||||||
parent.appendChild( node );
|
parent.appendChild( node );
|
||||||
|
|
||||||
/* position attrs */
|
/* position attrs */
|
||||||
libglabels::XmlUtil::setLengthAttr( node, "x", object->x0() );
|
glabels::XmlUtil::setLengthAttr( node, "x", object->x0() );
|
||||||
libglabels::XmlUtil::setLengthAttr( node, "y", object->y0() );
|
glabels::XmlUtil::setLengthAttr( node, "y", object->y0() );
|
||||||
|
|
||||||
/* size attrs */
|
/* size attrs */
|
||||||
libglabels::XmlUtil::setLengthAttr( node, "w", object->w() );
|
glabels::XmlUtil::setLengthAttr( node, "w", object->w() );
|
||||||
libglabels::XmlUtil::setLengthAttr( node, "h", object->h() );
|
glabels::XmlUtil::setLengthAttr( node, "h", object->h() );
|
||||||
|
|
||||||
/* line attrs */
|
/* line attrs */
|
||||||
libglabels::XmlUtil::setLengthAttr( node, "line_width", object->lineWidth() );
|
glabels::XmlUtil::setLengthAttr( node, "line_width", object->lineWidth() );
|
||||||
if ( object->lineColorNode().fieldFlag() )
|
if ( object->lineColorNode().fieldFlag() )
|
||||||
{
|
{
|
||||||
libglabels::XmlUtil::setStringAttr( node, "line_color_field", object->lineColorNode().key() );
|
glabels::XmlUtil::setStringAttr( node, "line_color_field", object->lineColorNode().key() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
libglabels::XmlUtil::setUIntAttr( node, "line_color", object->lineColorNode().rgba() );
|
glabels::XmlUtil::setUIntAttr( node, "line_color", object->lineColorNode().rgba() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill attrs */
|
/* fill attrs */
|
||||||
if ( object->fillColorNode().fieldFlag() )
|
if ( object->fillColorNode().fieldFlag() )
|
||||||
{
|
{
|
||||||
libglabels::XmlUtil::setStringAttr( node, "fill_color_field", object->fillColorNode().key() );
|
glabels::XmlUtil::setStringAttr( node, "fill_color_field", object->fillColorNode().key() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
libglabels::XmlUtil::setUIntAttr( node, "fill_color", object->fillColorNode().rgba() );
|
glabels::XmlUtil::setUIntAttr( node, "fill_color", object->fillColorNode().rgba() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* affine attrs */
|
/* affine attrs */
|
||||||
@@ -154,108 +154,108 @@ glabels::XmlLabelCreator::createObjectBoxNode( QDomElement &parent, const LabelM
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectEllipseNode( QDomElement &parent, const LabelModelEllipseObject* object )
|
XmlLabelCreator::createObjectEllipseNode( QDomElement &parent, const LabelModelEllipseObject* object )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectLineNode( QDomElement &parent, const LabelModelLineObject* object )
|
XmlLabelCreator::createObjectLineNode( QDomElement &parent, const LabelModelLineObject* object )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectImageNode( QDomElement &parent, const LabelModelImageObject* object )
|
XmlLabelCreator::createObjectImageNode( QDomElement &parent, const LabelModelImageObject* object )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectBarcodeNode( QDomElement &parent, const LabelModelBarcodeObject* object )
|
XmlLabelCreator::createObjectBarcodeNode( QDomElement &parent, const LabelModelBarcodeObject* object )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectTextNode( QDomElement &parent, const LabelModelTextObject* object )
|
XmlLabelCreator::createObjectTextNode( QDomElement &parent, const LabelModelTextObject* object )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createObjectTopLevelSpanNode( QDomElement &parent, const LabelModelTextObject* object )
|
XmlLabelCreator::createObjectTopLevelSpanNode( QDomElement &parent, const LabelModelTextObject* object )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createAffineAttrs( QDomElement &node, const LabelModelObject* object )
|
XmlLabelCreator::createAffineAttrs( QDomElement &node, const LabelModelObject* object )
|
||||||
{
|
{
|
||||||
QMatrix a = object->matrix();
|
QMatrix a = object->matrix();
|
||||||
|
|
||||||
libglabels::XmlUtil::setDoubleAttr( node, "a0", a.m11() );
|
glabels::XmlUtil::setDoubleAttr( node, "a0", a.m11() );
|
||||||
libglabels::XmlUtil::setDoubleAttr( node, "a1", a.m12() );
|
glabels::XmlUtil::setDoubleAttr( node, "a1", a.m12() );
|
||||||
libglabels::XmlUtil::setDoubleAttr( node, "a2", a.m21() );
|
glabels::XmlUtil::setDoubleAttr( node, "a2", a.m21() );
|
||||||
libglabels::XmlUtil::setDoubleAttr( node, "a3", a.m22() );
|
glabels::XmlUtil::setDoubleAttr( node, "a3", a.m22() );
|
||||||
libglabels::XmlUtil::setDoubleAttr( node, "a4", a.dx() );
|
glabels::XmlUtil::setDoubleAttr( node, "a4", a.dx() );
|
||||||
libglabels::XmlUtil::setDoubleAttr( node, "a5", a.dy() );
|
glabels::XmlUtil::setDoubleAttr( node, "a5", a.dy() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createShadowAttrs( QDomElement &node, const LabelModelObject* object )
|
XmlLabelCreator::createShadowAttrs( QDomElement &node, const LabelModelObject* object )
|
||||||
{
|
{
|
||||||
if ( object->shadow() )
|
if ( object->shadow() )
|
||||||
{
|
{
|
||||||
libglabels::XmlUtil::setBoolAttr( node, "shadow", object->shadow() );
|
glabels::XmlUtil::setBoolAttr( node, "shadow", object->shadow() );
|
||||||
|
|
||||||
libglabels::XmlUtil::setLengthAttr( node, "shadow_x", object->shadowX() );
|
glabels::XmlUtil::setLengthAttr( node, "shadow_x", object->shadowX() );
|
||||||
libglabels::XmlUtil::setLengthAttr( node, "shadow_y", object->shadowY() );
|
glabels::XmlUtil::setLengthAttr( node, "shadow_y", object->shadowY() );
|
||||||
|
|
||||||
if ( object->fillColorNode().fieldFlag() )
|
if ( object->fillColorNode().fieldFlag() )
|
||||||
{
|
{
|
||||||
libglabels::XmlUtil::setStringAttr( node, "shadow_color_field", object->shadowColorNode().key() );
|
glabels::XmlUtil::setStringAttr( node, "shadow_color_field", object->shadowColorNode().key() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
libglabels::XmlUtil::setUIntAttr( node, "shadow_color", object->shadowColorNode().rgba() );
|
glabels::XmlUtil::setUIntAttr( node, "shadow_color", object->shadowColorNode().rgba() );
|
||||||
}
|
}
|
||||||
|
|
||||||
libglabels::XmlUtil::setDoubleAttr( node, "shadow_opacity", object->shadowOpacity() );
|
glabels::XmlUtil::setDoubleAttr( node, "shadow_opacity", object->shadowOpacity() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createMergeNode( QDomElement &parent, const LabelModel* label )
|
XmlLabelCreator::createMergeNode( QDomElement &parent, const LabelModel* label )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createDataNode( QDomElement &parent, const LabelModel* label )
|
XmlLabelCreator::createDataNode( QDomElement &parent, const LabelModel* label )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createPixdataNode( QDomElement &parent, const LabelModel* label, const QString& name )
|
XmlLabelCreator::createPixdataNode( QDomElement &parent, const LabelModel* label, const QString& name )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelCreator::createSvgFileNode( QDomElement &parent, const LabelModel* label, const QString& name )
|
XmlLabelCreator::createSvgFileNode( QDomElement &parent, const LabelModel* label, const QString& name )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,16 +18,14 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_XmlLabelCreator_h
|
#ifndef XmlLabelCreator_h
|
||||||
#define glabels_XmlLabelCreator_h
|
#define XmlLabelCreator_h
|
||||||
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
class LabelModelBoxObject;
|
class LabelModelBoxObject;
|
||||||
@@ -69,6 +67,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_XmlLabelCreator_h
|
#endif // XmlLabelCreator_h
|
||||||
|
|||||||
+25
-25
@@ -36,8 +36,8 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
|
||||||
glabels::LabelModel*
|
LabelModel*
|
||||||
glabels::XmlLabelParser::readFile( const QString& fileName )
|
XmlLabelParser::readFile( const QString& fileName )
|
||||||
{
|
{
|
||||||
QFile file( fileName );
|
QFile file( fileName );
|
||||||
|
|
||||||
@@ -88,8 +88,8 @@ glabels::XmlLabelParser::readFile( const QString& fileName )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glabels::LabelModel*
|
LabelModel*
|
||||||
glabels::XmlLabelParser::readBuffer( const QString& buffer )
|
XmlLabelParser::readBuffer( const QString& buffer )
|
||||||
{
|
{
|
||||||
QDomDocument doc;
|
QDomDocument doc;
|
||||||
QString errorString;
|
QString errorString;
|
||||||
@@ -116,7 +116,7 @@ glabels::XmlLabelParser::readBuffer( const QString& buffer )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::gunzip( const QByteArray& data, QByteArray& result )
|
XmlLabelParser::gunzip( const QByteArray& data, QByteArray& result )
|
||||||
{
|
{
|
||||||
result.clear();
|
result.clear();
|
||||||
|
|
||||||
@@ -165,10 +165,10 @@ glabels::XmlLabelParser::gunzip( const QByteArray& data, QByteArray& result )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
glabels::LabelModel*
|
LabelModel*
|
||||||
glabels::XmlLabelParser::parseRootNode( const QDomElement &node )
|
XmlLabelParser::parseRootNode( const QDomElement &node )
|
||||||
{
|
{
|
||||||
using namespace libglabels;
|
using namespace glabels;
|
||||||
|
|
||||||
LabelModel* label = new LabelModel();
|
LabelModel* label = new LabelModel();
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ glabels::XmlLabelParser::parseRootNode( const QDomElement &node )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseObjectsNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseObjectsNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
for ( QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling() )
|
for ( QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling() )
|
||||||
{
|
{
|
||||||
@@ -259,9 +259,9 @@ glabels::XmlLabelParser::parseObjectsNode( const QDomElement &node, LabelModel*
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseObjectBoxNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseObjectBoxNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
using namespace libglabels;
|
using namespace glabels;
|
||||||
|
|
||||||
LabelModelBoxObject* object = new LabelModelBoxObject();
|
LabelModelBoxObject* object = new LabelModelBoxObject();
|
||||||
label->addObject( object );
|
label->addObject( object );
|
||||||
@@ -303,45 +303,45 @@ glabels::XmlLabelParser::parseObjectBoxNode( const QDomElement &node, LabelModel
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseObjectEllipseNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseObjectEllipseNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseObjectLineNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseObjectLineNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseObjectImageNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseObjectImageNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseObjectBarcodeNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseObjectBarcodeNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseObjectTextNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseObjectTextNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseTopLevelSpanNode( const QDomElement &node, LabelModelTextObject* object )
|
XmlLabelParser::parseTopLevelSpanNode( const QDomElement &node, LabelModelTextObject* object )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseAffineAttrs( const QDomElement &node, LabelModelObject* object )
|
XmlLabelParser::parseAffineAttrs( const QDomElement &node, LabelModelObject* object )
|
||||||
{
|
{
|
||||||
using namespace libglabels;
|
using namespace glabels;
|
||||||
|
|
||||||
double a[6];
|
double a[6];
|
||||||
|
|
||||||
@@ -357,9 +357,9 @@ glabels::XmlLabelParser::parseAffineAttrs( const QDomElement &node, LabelModelOb
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseShadowAttrs( const QDomElement &node, LabelModelObject* object )
|
XmlLabelParser::parseShadowAttrs( const QDomElement &node, LabelModelObject* object )
|
||||||
{
|
{
|
||||||
using namespace libglabels;
|
using namespace glabels;
|
||||||
|
|
||||||
object->setShadow( XmlUtil::getBoolAttr( node, "shadow", false ) );
|
object->setShadow( XmlUtil::getBoolAttr( node, "shadow", false ) );
|
||||||
|
|
||||||
@@ -380,25 +380,25 @@ glabels::XmlLabelParser::parseShadowAttrs( const QDomElement &node, LabelModelOb
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseMergeNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseMergeNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseDataNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseDataNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parsePixdataNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parsePixdataNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
glabels::XmlLabelParser::parseFileNode( const QDomElement &node, LabelModel* label )
|
XmlLabelParser::parseFileNode( const QDomElement &node, LabelModel* label )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,14 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef glabels_XmlLabelParser_h
|
#ifndef XmlLabelParser_h
|
||||||
#define glabels_XmlLabelParser_h
|
#define XmlLabelParser_h
|
||||||
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
|
|
||||||
|
|
||||||
namespace glabels
|
|
||||||
{
|
|
||||||
class LabelModel;
|
class LabelModel;
|
||||||
class LabelModelObject;
|
class LabelModelObject;
|
||||||
class LabelModelBoxObject;
|
class LabelModelBoxObject;
|
||||||
@@ -69,6 +67,5 @@ namespace glabels
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // glabels_XmlLabelParser_h
|
#endif // XmlLabelParser_h
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "libglabels/Db.h"
|
#include "libglabels/Db.h"
|
||||||
|
|
||||||
using namespace glabels;
|
|
||||||
using namespace libglabels;
|
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char **argv )
|
int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
@@ -36,13 +33,13 @@ int main( int argc, char **argv )
|
|||||||
QCoreApplication::setOrganizationDomain( "glabels.org" );
|
QCoreApplication::setOrganizationDomain( "glabels.org" );
|
||||||
QCoreApplication::setApplicationName( "glabels-qt" );
|
QCoreApplication::setApplicationName( "glabels-qt" );
|
||||||
|
|
||||||
Db::init();
|
glabels::Db::init();
|
||||||
////// TEMPORARY TESTING ////////
|
////// TEMPORARY TESTING ////////
|
||||||
#if 0
|
#if 0
|
||||||
Db::printKnownPapers();
|
glabels::Db::printKnownPapers();
|
||||||
Db::printKnownCategories();
|
glabels::Db::printKnownCategories();
|
||||||
Db::printKnownVendors();
|
glabels::Db::printKnownVendors();
|
||||||
Db::printKnownTemplates();
|
glabels::Db::printKnownTemplates();
|
||||||
#endif
|
#endif
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -372,7 +372,7 @@
|
|||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_23">
|
<layout class="QHBoxLayout" name="horizontalLayout_23">
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::ColorButton" name="textColorButton">
|
<widget class="ColorButton" name="textColorButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -451,7 +451,7 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::FieldButton" name="textInsertFieldButton">
|
<widget class="FieldButton" name="textInsertFieldButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -539,7 +539,7 @@
|
|||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_22">
|
<layout class="QHBoxLayout" name="horizontalLayout_22">
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::ColorButton" name="barcodeColorButton">
|
<widget class="ColorButton" name="barcodeColorButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -679,7 +679,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
<layout class="QHBoxLayout" name="horizontalLayout_16">
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::FieldButton" name="barcodeFieldButton">
|
<widget class="FieldButton" name="barcodeFieldButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -802,7 +802,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="glabels::FieldButton" name="imageFieldButton">
|
<widget class="FieldButton" name="imageFieldButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -889,7 +889,7 @@
|
|||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_21">
|
<layout class="QHBoxLayout" name="horizontalLayout_21">
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::ColorButton" name="lineColorButton">
|
<widget class="ColorButton" name="lineColorButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -950,7 +950,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="glabels::ColorButton" name="fillColorButton">
|
<widget class="ColorButton" name="fillColorButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -1373,7 +1373,7 @@
|
|||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_24">
|
<layout class="QHBoxLayout" name="horizontalLayout_24">
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::ColorButton" name="shadowColorButton">
|
<widget class="ColorButton" name="shadowColorButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
@@ -1433,7 +1433,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>glabels::ColorButton</class>
|
<class>ColorButton</class>
|
||||||
<extends>QPushButton</extends>
|
<extends>QPushButton</extends>
|
||||||
<header>ColorButton.h</header>
|
<header>ColorButton.h</header>
|
||||||
<slots>
|
<slots>
|
||||||
@@ -1441,7 +1441,7 @@
|
|||||||
</slots>
|
</slots>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>glabels::FieldButton</class>
|
<class>FieldButton</class>
|
||||||
<extends>QPushButton</extends>
|
<extends>QPushButton</extends>
|
||||||
<header>FieldButton.h</header>
|
<header>FieldButton.h</header>
|
||||||
<slots>
|
<slots>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
<enum>QLayout::SetDefaultConstraint</enum>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::Preview" name="preview" native="true">
|
<widget class="Preview" name="preview" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -453,7 +453,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>glabels::Preview</class>
|
<class>Preview</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>Preview.h</header>
|
<header>Preview.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<item row="0" column="4">
|
<item row="0" column="4">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::SimplePreview" name="preview">
|
<widget class="SimplePreview" name="preview">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -356,7 +356,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>glabels::SimplePreview</class>
|
<class>SimplePreview</class>
|
||||||
<extends>QGraphicsView</extends>
|
<extends>QGraphicsView</extends>
|
||||||
<header>SimplePreview.h</header>
|
<header>SimplePreview.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
|
|||||||
@@ -134,7 +134,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="glabels::TemplatePicker" name="templatePicker">
|
<widget class="TemplatePicker" name="templatePicker">
|
||||||
<property name="showDropIndicator" stdset="0">
|
<property name="showDropIndicator" stdset="0">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>glabels::TemplatePicker</class>
|
<class>TemplatePicker</class>
|
||||||
<extends>QListWidget</extends>
|
<extends>QListWidget</extends>
|
||||||
<header>TemplatePicker.h</header>
|
<header>TemplatePicker.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Category.cpp
|
/* Category.cpp
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
* This file is part of gLabels-qt.
|
* This file is part of gLabels-qt.
|
||||||
*
|
*
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "Category.h"
|
#include "Category.h"
|
||||||
|
|
||||||
|
|
||||||
namespace libglabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
Category::Category( const QString &id, const QString &name )
|
Category::Category( const QString &id, const QString &name )
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Category.h
|
/* Category.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
* This file is part of gLabels-qt.
|
* This file is part of gLabels-qt.
|
||||||
*
|
*
|
||||||
@@ -18,14 +18,14 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef libglabels_Category_h
|
#ifndef glabels_Category_h
|
||||||
#define libglabels_Category_h
|
#define glabels_Category_h
|
||||||
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
namespace libglabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
class Category
|
class Category
|
||||||
@@ -50,4 +50,4 @@ namespace libglabels
|
|||||||
#include "Category.inl"
|
#include "Category.inl"
|
||||||
|
|
||||||
|
|
||||||
#endif // libglabels_Category_h
|
#endif // glabels_Category_h
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Category.inl
|
/* Category.inl
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
* This file is part of gLabels-qt.
|
* This file is part of gLabels-qt.
|
||||||
*
|
*
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace libglabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
inline const QString& Category::id() const
|
inline const QString& Category::id() const
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Config.h
|
/* Config.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
* Copyright (C) 2013-2016 Jim Evins <evins@snaught.com>
|
||||||
*
|
*
|
||||||
* This file is part of gLabels-qt.
|
* This file is part of gLabels-qt.
|
||||||
*
|
*
|
||||||
@@ -18,11 +18,11 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef libglabels_Config_h
|
#ifndef glabels_Config_h
|
||||||
#define libglabels_Config_h
|
#define glabels_Config_h
|
||||||
|
|
||||||
|
|
||||||
namespace libglabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace Config
|
namespace Config
|
||||||
@@ -33,4 +33,4 @@ namespace libglabels
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // libglabels_Config_h
|
#endif // glabels_Config_h
|
||||||
|
|||||||
@@ -18,11 +18,11 @@
|
|||||||
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef libglabels_Constants_h
|
#ifndef glabels_Constants_h
|
||||||
#define libglabels_Constants_h
|
#define glabels_Constants_h
|
||||||
|
|
||||||
|
|
||||||
namespace libglabels
|
namespace glabels
|
||||||
{
|
{
|
||||||
|
|
||||||
const double PTS_PER_PT = 1.0;
|
const double PTS_PER_PT = 1.0;
|
||||||
@@ -33,4 +33,4 @@ namespace libglabels
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // libglabels_Constants_h
|
#endif // glabels_Constants_h
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user