Merged develop into feature

--HG--
branch : feature
This commit is contained in:
Bojan Kverh 2016-10-23 15:28:40 +02:00
commit 01c068ddd0
41 changed files with 795 additions and 69 deletions

View File

@ -41,6 +41,8 @@
- [#560] Flipped pattern pieces in Layout.
- [#138] New tool: 'Mirror Point' or 'Symmetric Point'.
- [#573] New tool: 'Move Point'.
- [#577] 10 new colors added for the lines
- [#570] Tiled PDF : Margin values correctly taken into account
# Version 0.4.5 October 15, 2016
- [#435] Valentina doesn't change the cursor.

View File

@ -33,7 +33,7 @@ CDEPEND="
dev-qt/qtprintsupport:5
dev-qt/qtnetwork:5
app-text/poppler"
RDEPEND="${CDEPEND}
RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND}
app-arch/unzip"

View File

@ -35,7 +35,7 @@ CDEPEND="
dev-qt/qtprintsupport:5
dev-qt/qtnetwork:5
app-text/poppler"
RDEPEND="${CDEPEND}
RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND}
dev-util/ccache"

View File

@ -168,7 +168,7 @@ void DialogMDataBase::RetranslateGroups()
QString DialogMDataBase::ImgTag(const QString &number)
{
QString imgUrl("<img src=\"wrong.png\" align=\"center\"/>"); // In case of error
const QString filePath = QString("://diagrams/%1.svg").arg(MapDiagrams(number));
const QString filePath = QString("://diagrams/%1.svg").arg(MapDiagrams(qApp->TrVars(), number));
if (QFileInfo(filePath).exists())
{
// Load your SVG

View File

@ -33,6 +33,7 @@
#include "../vformat/vmeasurements.h"
#include "../vmisc/commandoptions.h"
#include "../vmisc/vsettings.h"
#include <QDebug>
VCommandLinePtr VCommandLine::instance = nullptr;

View File

@ -33,6 +33,8 @@
#include <QKeyEvent>
#include <QApplication>
#include <QColorDialog>
#include <QDebug>
#include <QRegularExpression>
#include "../vpropertyexplorer/vproperty.h"
#include "../vtools/dialogs/support/dialogeditwrongformula.h"

View File

@ -40,6 +40,8 @@
#include <QDockWidget>
#include <QHBoxLayout>
#include <QDebug>
#include <QRegularExpression>
using namespace VPE;

View File

@ -39,6 +39,7 @@
#include "../vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h"
#include "../xml/vpattern.h"
#include "../vmisc/diagnostic.h"
#include <QDebug>
//---------------------------------------------------------------------------------------------------------------------
/**

View File

@ -38,6 +38,7 @@
#include <QMessageBox>
#include <QProcess>
#include <QtDebug>
#include <QRegularExpression>
const QString baseFilenameRegExp = QStringLiteral("^[\\w\\-. ]+$");

View File

@ -384,7 +384,27 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer)
// Render
QRectF source;
isTiled ? source = poster->at(index).rect : source = paper->rect();
QRectF target(0, 0, source.width() * scale, source.height() * scale);
qreal x,y;
if(printer->fullPage())
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
QMarginsF printerMargins = printer->pageLayout().margins();
x = qFloor(ToPixel(printerMargins.left(),Unit::Mm));
y = qFloor(ToPixel(printerMargins.top(),Unit::Mm));
#else
qreal left = 0, top = 0, right = 0, bottom = 0;
printer->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter);
x = qFloor(ToPixel(left,Unit::Mm));
y = qFloor(ToPixel(top,Unit::Mm));
#endif
}
else
{
x = 0; y = 0;
}
QRectF target(x * scale, y * scale, source.width() * scale, source.height() * scale);
scenes.at(paperIndex)->render(&painter, target, source, Qt::IgnoreAspectRatio);

View File

@ -56,6 +56,8 @@
#include <QMessageBox>
#include <QUndoStack>
#include <QtNumeric>
#include <QDebug>
#include <QFileInfo>
const QString VPattern::AttrReadOnly = QStringLiteral("readOnly");

View File

@ -151,6 +151,16 @@ const QString ColorDarkRed = QStringLiteral("darkRed");
const QString ColorDarkGreen = QStringLiteral("darkGreen");
const QString ColorDarkBlue = QStringLiteral("darkBlue");
const QString ColorYellow = QStringLiteral("yellow");
const QString ColorLightSalmon = QStringLiteral("lightsalmon");
const QString ColorGoldenRod = QStringLiteral("goldenrod");
const QString ColorOrange = QStringLiteral("orange");
const QString ColorDeepPink = QStringLiteral("deeppink");
const QString ColorViolet = QStringLiteral("violet");
const QString ColorDarkViolet = QStringLiteral("darkviolet");
const QString ColorMediumSeaGreen = QStringLiteral("mediumseagreen");
const QString ColorLime = QStringLiteral("lime");
const QString ColorDeepSkyBlue = QStringLiteral("deepskyblue");
const QString ColorCornFlowerBlue = QStringLiteral("cornflowerblue");
//variables
const QString line_ = QStringLiteral("Line_");

View File

@ -152,6 +152,17 @@ extern const QString ColorDarkRed;
extern const QString ColorDarkGreen;
extern const QString ColorDarkBlue;
extern const QString ColorYellow;
extern const QString ColorLightSalmon;
extern const QString ColorGoldenRod;
extern const QString ColorOrange;
extern const QString ColorDeepPink;
extern const QString ColorViolet;
extern const QString ColorDarkViolet;
extern const QString ColorMediumSeaGreen;
extern const QString ColorLime;
extern const QString ColorDeepSkyBlue;
extern const QString ColorCornFlowerBlue;
// variables name
// Hacks for avoiding the linker error "undefined reference to"

View File

@ -20,6 +20,7 @@
<file>schema/pattern/v0.3.4.xsd</file>
<file>schema/pattern/v0.3.5.xsd</file>
<file>schema/pattern/v0.3.6.xsd</file>
<file>schema/pattern/v0.3.7.xsd</file>
<file>schema/standard_measurements/v0.3.0.xsd</file>
<file>schema/standard_measurements/v0.4.0.xsd</file>
<file>schema/standard_measurements/v0.4.1.xsd</file>

View File

@ -0,0 +1,592 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- XML Schema Generated from XML Document-->
<xs:element name="pattern">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="version" type="formatVersion"></xs:element>
<xs:element name="unit" type="units"></xs:element>
<xs:element name="image" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="extension" type="imageExtension"></xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="notes" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="gradation" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="heights">
<xs:complexType>
<xs:attribute name="all" type="xs:boolean" use="required"></xs:attribute>
<xs:attribute name="h92" type="xs:boolean"></xs:attribute>
<xs:attribute name="h98" type="xs:boolean"></xs:attribute>
<xs:attribute name="h104" type="xs:boolean"></xs:attribute>
<xs:attribute name="h110" type="xs:boolean"></xs:attribute>
<xs:attribute name="h116" type="xs:boolean"></xs:attribute>
<xs:attribute name="h122" type="xs:boolean"></xs:attribute>
<xs:attribute name="h128" type="xs:boolean"></xs:attribute>
<xs:attribute name="h134" type="xs:boolean"></xs:attribute>
<xs:attribute name="h140" type="xs:boolean"></xs:attribute>
<xs:attribute name="h146" type="xs:boolean"></xs:attribute>
<xs:attribute name="h152" type="xs:boolean"></xs:attribute>
<xs:attribute name="h158" type="xs:boolean"></xs:attribute>
<xs:attribute name="h164" type="xs:boolean"></xs:attribute>
<xs:attribute name="h170" type="xs:boolean"></xs:attribute>
<xs:attribute name="h176" type="xs:boolean"></xs:attribute>
<xs:attribute name="h182" type="xs:boolean"></xs:attribute>
<xs:attribute name="h188" type="xs:boolean"></xs:attribute>
<xs:attribute name="h194" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="sizes">
<xs:complexType>
<xs:attribute name="all" type="xs:boolean" use="required"></xs:attribute>
<xs:attribute name="s22" type="xs:boolean"></xs:attribute>
<xs:attribute name="s24" type="xs:boolean"></xs:attribute>
<xs:attribute name="s26" type="xs:boolean"></xs:attribute>
<xs:attribute name="s28" type="xs:boolean"></xs:attribute>
<xs:attribute name="s30" type="xs:boolean"></xs:attribute>
<xs:attribute name="s32" type="xs:boolean"></xs:attribute>
<xs:attribute name="s34" type="xs:boolean"></xs:attribute>
<xs:attribute name="s36" type="xs:boolean"></xs:attribute>
<xs:attribute name="s38" type="xs:boolean"></xs:attribute>
<xs:attribute name="s40" type="xs:boolean"></xs:attribute>
<xs:attribute name="s42" type="xs:boolean"></xs:attribute>
<xs:attribute name="s44" type="xs:boolean"></xs:attribute>
<xs:attribute name="s46" type="xs:boolean"></xs:attribute>
<xs:attribute name="s48" type="xs:boolean"></xs:attribute>
<xs:attribute name="s50" type="xs:boolean"></xs:attribute>
<xs:attribute name="s52" type="xs:boolean"></xs:attribute>
<xs:attribute name="s54" type="xs:boolean"></xs:attribute>
<xs:attribute name="s56" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="custom" type="xs:boolean"></xs:attribute>
<xs:attribute name="defHeight" type="baseHeight"></xs:attribute>
<xs:attribute name="defSize" type="baseSize"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="patternName" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="patternNumber" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="company" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="customer" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="size" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="showDate" type="xs:boolean" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="showMeasurements" type="xs:boolean" minOccurs="0" maxOccurs="1"></xs:element>
<xs:element name="measurements" type="xs:string"></xs:element>
<xs:element name="increments" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="increment" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="description" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="name" type="shortName" use="required"></xs:attribute>
<xs:attribute name="formula" type="xs:string" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="incrementName">
<xs:selector xpath="increment"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<xs:element name="draw" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="calculation" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="point" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="x" type="xs:double"></xs:attribute>
<xs:attribute name="y" type="xs:double"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="name" type="shortName"></xs:attribute>
<xs:attribute name="firstPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="secondPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="thirdPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="basePoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="pShoulder" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p1Line" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p2Line" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="length" type="xs:string"></xs:attribute>
<xs:attribute name="angle" type="xs:string"></xs:attribute>
<xs:attribute name="typeLine" type="xs:string"></xs:attribute>
<xs:attribute name="splinePath" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="spline" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p1Line1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p1Line2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p2Line1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p2Line2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="center" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="radius" type="xs:string"></xs:attribute>
<xs:attribute name="axisP1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="axisP2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="arc" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="curve" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="curve1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="curve2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="lineColor" type="colors"></xs:attribute>
<xs:attribute name="color" type="colors"></xs:attribute>
<xs:attribute name="firstArc" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="secondArc" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="crossPoint" type="crossType"></xs:attribute>
<xs:attribute name="vCrossPoint" type="crossType"></xs:attribute>
<xs:attribute name="hCrossPoint" type="crossType"></xs:attribute>
<xs:attribute name="c1Center" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="c2Center" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="c1Radius" type="xs:string"></xs:attribute>
<xs:attribute name="c2Radius" type="xs:string"></xs:attribute>
<xs:attribute name="cRadius" type="xs:string"></xs:attribute>
<xs:attribute name="tangent" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="cCenter" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="name1" type="shortName"></xs:attribute>
<xs:attribute name="mx1" type="xs:double"></xs:attribute>
<xs:attribute name="my1" type="xs:double"></xs:attribute>
<xs:attribute name="name2" type="shortName"></xs:attribute>
<xs:attribute name="mx2" type="xs:double"></xs:attribute>
<xs:attribute name="my2" type="xs:double"></xs:attribute>
<xs:attribute name="point1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="point2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="dartP1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="dartP2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="dartP3" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="baseLineP1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="baseLineP2" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="line" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="firstPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="secondPoint" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeLine" type="xs:string"></xs:attribute>
<xs:attribute name="lineColor" type="colors"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="operation" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="source" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="destination" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="idObject" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="center" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="angle" type="xs:string"></xs:attribute>
<xs:attribute name="length" type="xs:string"></xs:attribute>
<xs:attribute name="suffix" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="p1Line" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="p2Line" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="axisType" type="axisType"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="arc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="angle1" type="xs:string"></xs:attribute>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="angle2" type="xs:string"></xs:attribute>
<xs:attribute name="radius" type="xs:string"></xs:attribute>
<xs:attribute name="center" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="color" type="colors"></xs:attribute>
<xs:attribute name="length" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="spline" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="pathPoint" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="kAsm2" type="xs:string"></xs:attribute>
<xs:attribute name="pSpline" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="angle" type="xs:string"></xs:attribute>
<xs:attribute name="angle1" type="xs:string"></xs:attribute>
<xs:attribute name="angle2" type="xs:string"></xs:attribute>
<xs:attribute name="length1" type="xs:string"></xs:attribute>
<xs:attribute name="length2" type="xs:string"></xs:attribute>
<xs:attribute name="kAsm1" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="kCurve" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="kAsm1" type="xs:double"></xs:attribute>
<xs:attribute name="kAsm2" type="xs:double"></xs:attribute>
<xs:attribute name="angle1" type="xs:string"></xs:attribute>
<xs:attribute name="angle2" type="xs:string"></xs:attribute>
<xs:attribute name="length1" type="xs:string"></xs:attribute>
<xs:attribute name="length2" type="xs:string"></xs:attribute>
<xs:attribute name="point1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="point2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="point3" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="point4" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="color" type="colors"></xs:attribute>
<xs:attribute name="duplicate" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="modeling" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="point" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inUse" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="arc" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inUse" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="spline" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="typeObject" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="idTool" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inUse" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="tools" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="det" minOccurs="2" maxOccurs="2">
<xs:complexType>
<xs:sequence>
<xs:element name="node" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="nodeType" type="xs:string"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="reverse" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="children" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="child" type="xs:unsignedInt" minOccurs="1" maxOccurs="unbounded"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="indexD1" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="indexD2" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inUse" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="details" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="detail" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="data" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="mcp" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="cutNumber" type="xs:unsignedInt"/>
<xs:attribute name="userDef" type="xs:string"/>
<xs:attribute name="material" type="materialType"/>
<xs:attribute name="placement" type="placementType"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="letter" type="xs:string"></xs:attribute>
<xs:attribute name="visible" type="xs:boolean"></xs:attribute>
<xs:attribute name="fontSize" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="width" type="xs:double"></xs:attribute>
<xs:attribute name="height" type="xs:double"></xs:attribute>
<xs:attribute name="rotation" type="xs:double"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="patternInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="visible" type="xs:boolean"></xs:attribute>
<xs:attribute name="fontSize" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="width" type="xs:double"></xs:attribute>
<xs:attribute name="height" type="xs:double"></xs:attribute>
<xs:attribute name="rotation" type="xs:double"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="node" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="nodeType" type="xs:string"></xs:attribute>
<xs:attribute name="idObject" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="reverse" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="supplement" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="mx" type="xs:double"></xs:attribute>
<xs:attribute name="my" type="xs:double"></xs:attribute>
<xs:attribute name="width" type="xs:double"></xs:attribute>
<xs:attribute name="name" type="xs:string"></xs:attribute>
<xs:attribute name="closed" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="forbidFlipping" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="inLayout" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="groups" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="group" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="item" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="object" type="xs:unsignedInt"></xs:attribute>
<xs:attribute name="tool" type="xs:unsignedInt"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedInt" use="required"></xs:attribute>
<xs:attribute name="name" type="xs:string"></xs:attribute>
<xs:attribute name="visible" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="readOnly" type="xs:boolean"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:simpleType name="shortName">
<xs:restriction base="xs:string">
<xs:pattern value="^([^0-9*/^+\-=\s()?%:;!.,`'\&quot;]){1,1}([^*/^+\-=\s()?%:;!.,`'\&quot;]){0,}$"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="units">
<xs:restriction base="xs:string">
<xs:enumeration value="mm"/>
<xs:enumeration value="cm"/>
<xs:enumeration value="inch"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="measurementsTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="standard"/>
<xs:enumeration value="individual"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="formatVersion">
<xs:restriction base="xs:string">
<xs:pattern value="^(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))\.(0|([1-9][0-9]*))$"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="imageExtension">
<xs:restriction base="xs:string">
<xs:enumeration value="PNG"/>
<xs:enumeration value="JPG"/>
<xs:enumeration value="BMP"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="colors">
<xs:restriction base="xs:string">
<xs:enumeration value="black"/>
<xs:enumeration value="green"/>
<xs:enumeration value="blue"/>
<xs:enumeration value="darkRed"/>
<xs:enumeration value="darkGreen"/>
<xs:enumeration value="darkBlue"/>
<xs:enumeration value="yellow"/>
<xs:enumeration value="lightsalmon"/>
<xs:enumeration value="goldenrod"/>
<xs:enumeration value="orange"/>
<xs:enumeration value="deeppink"/>
<xs:enumeration value="violet"/>
<xs:enumeration value="darkviolet"/>
<xs:enumeration value="mediumseagreen"/>
<xs:enumeration value="lime"/>
<xs:enumeration value="deepskyblue"/>
<xs:enumeration value="cornflowerblue"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="baseHeight">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="92"/>
<xs:enumeration value="98"/>
<xs:enumeration value="104"/>
<xs:enumeration value="110"/>
<xs:enumeration value="116"/>
<xs:enumeration value="122"/>
<xs:enumeration value="128"/>
<xs:enumeration value="134"/>
<xs:enumeration value="140"/>
<xs:enumeration value="146"/>
<xs:enumeration value="152"/>
<xs:enumeration value="158"/>
<xs:enumeration value="164"/>
<xs:enumeration value="170"/>
<xs:enumeration value="176"/>
<xs:enumeration value="182"/>
<xs:enumeration value="188"/>
<xs:enumeration value="194"/>
<xs:enumeration value="920"/>
<xs:enumeration value="980"/>
<xs:enumeration value="1040"/>
<xs:enumeration value="1100"/>
<xs:enumeration value="1160"/>
<xs:enumeration value="1220"/>
<xs:enumeration value="1280"/>
<xs:enumeration value="1340"/>
<xs:enumeration value="1400"/>
<xs:enumeration value="1460"/>
<xs:enumeration value="1520"/>
<xs:enumeration value="1580"/>
<xs:enumeration value="1640"/>
<xs:enumeration value="1700"/>
<xs:enumeration value="1760"/>
<xs:enumeration value="1820"/>
<xs:enumeration value="1880"/>
<xs:enumeration value="1940"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="baseSize">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="22"/>
<xs:enumeration value="24"/>
<xs:enumeration value="26"/>
<xs:enumeration value="28"/>
<xs:enumeration value="30"/>
<xs:enumeration value="32"/>
<xs:enumeration value="34"/>
<xs:enumeration value="36"/>
<xs:enumeration value="38"/>
<xs:enumeration value="40"/>
<xs:enumeration value="42"/>
<xs:enumeration value="44"/>
<xs:enumeration value="46"/>
<xs:enumeration value="48"/>
<xs:enumeration value="50"/>
<xs:enumeration value="52"/>
<xs:enumeration value="54"/>
<xs:enumeration value="56"/>
<xs:enumeration value="220"/>
<xs:enumeration value="240"/>
<xs:enumeration value="260"/>
<xs:enumeration value="280"/>
<xs:enumeration value="300"/>
<xs:enumeration value="320"/>
<xs:enumeration value="340"/>
<xs:enumeration value="360"/>
<xs:enumeration value="380"/>
<xs:enumeration value="400"/>
<xs:enumeration value="420"/>
<xs:enumeration value="440"/>
<xs:enumeration value="460"/>
<xs:enumeration value="480"/>
<xs:enumeration value="500"/>
<xs:enumeration value="520"/>
<xs:enumeration value="540"/>
<xs:enumeration value="560"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="crossType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="1"/>
<xs:enumeration value="2"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="axisType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="1"/>
<xs:enumeration value="2"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="materialType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="0"/><!--Fabric-->
<xs:enumeration value="1"/><!--Lining-->
<xs:enumeration value="2"/><!--Interfacing-->
<xs:enumeration value="3"/><!--Interlining-->
<xs:enumeration value="4"/><!--UserDefined-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="placementType">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="0"/><!--No placement-->
<xs:enumeration value="1"/><!--Cut on Fold-->
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -40,6 +40,7 @@
#include <QStringData>
#include <QStringDataPtr>
#include <QtGlobal>
#include <QLocale>
#include "../ifc/ifcdef.h"
#include "../vmisc/def.h"

View File

@ -58,8 +58,8 @@ class QDomElement;
*/
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0");
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.3.6");
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.3.6.xsd");
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.3.7");
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.3.7.xsd");
//VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
//VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
@ -171,6 +171,8 @@ QString VPatternConverter::XSDSchema(int ver) const
case (0x000305):
return QStringLiteral("://schema/pattern/v0.3.5.xsd");
case (0x000306):
return QStringLiteral("://schema/pattern/v0.3.6.xsd");
case (0x000307):
return CurrentSchema;
default:
InvalidVersion(ver);
@ -262,6 +264,10 @@ void VPatternConverter::ApplyPatches()
ValidateXML(XSDSchema(0x000306), fileName);
V_FALLTHROUGH
case (0x000306):
ToV0_3_7();
ValidateXML(XSDSchema(0x000307), fileName);
V_FALLTHROUGH
case (0x000307):
break;
default:
break;
@ -436,6 +442,13 @@ void VPatternConverter::ToV0_3_6()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_3_7()
{
SetVersion(QStringLiteral("0.3.7"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::TagUnitToV0_2_0()
{

View File

@ -55,10 +55,10 @@ public:
// GCC 4.6 doesn't allow constexpr and const together
#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) <= 406
static Q_DECL_CONSTEXPR int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 6);
static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 7);
#else
static Q_DECL_CONSTEXPR const int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0);
static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 6);
static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 3, 7);
#endif
protected:
@ -95,6 +95,7 @@ private:
void ToV0_3_4();
void ToV0_3_5();
void ToV0_3_6();
void ToV0_3_7();
void TagUnitToV0_2_0();
void TagIncrementToV0_2_0();

View File

@ -267,8 +267,28 @@ QRect VPoster::PageRect() const
// we can't use method pageRect(QPrinter::Point). Our dpi value can be different.
// We convert value yourself to pixels.
const QRectF rect = printer->pageRect(QPrinter::Millimeter);
if(printer->fullPage())
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
QMarginsF pMargins = printer->pageLayout().margins();
QRectF newRect = rect.marginsRemoved(pMargins);
const QRect pageRectFP(0, 0, qFloor(ToPixel(newRect.width())), qFloor(ToPixel(newRect.height())));
return pageRectFP;
#else
qreal left = 0 , top = 0, right = 0, bottom = 0;
printer->getPageMargins(&left, &top, &right, &bottom, QPrinter::Millimeter);
qreal newWidth = rect.width()-left-right;
qreal newHeight = rect.height()-top-bottom;
const QRect pageRectFP(0, 0, qFloor(ToPixel(newWidth)), qFloor(ToPixel(newHeight)));
return pageRectFP;
#endif
}
else
{
const QRect pageRect(0, 0, qFloor(ToPixel(rect.width())), qFloor(ToPixel(rect.height())));
return pageRect;
}
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -1147,20 +1147,22 @@ QStringList ListPMSystems()
}
//---------------------------------------------------------------------------------------------------------------------
QStringList ListNumbers(const QStringList &listMeasurements)
QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList &listMeasurements)
{
SCASSERT(trM != nullptr);
QStringList numbers;
for (int i=0; i < listMeasurements.size(); ++i)
{
numbers.append(qApp->TrVars()->MNumber(listMeasurements.at(i)));
numbers.append(trM->MNumber(listMeasurements.at(i)));
}
return numbers;
}
//---------------------------------------------------------------------------------------------------------------------
QString MapDiagrams(const QString &number)
QString MapDiagrams(const VTranslateMeasurements *trM, const QString &number)
{
switch (ListNumbers(ListGroupA()).indexOf(number))
switch (ListNumbers(trM, ListGroupA()).indexOf(number))
{
// A
case 0: // A01
@ -1213,7 +1215,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupB()).indexOf(number))
switch (ListNumbers(trM, ListGroupB()).indexOf(number))
{
// B
case 0: // B01
@ -1230,7 +1232,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupC()).indexOf(number))
switch (ListNumbers(trM, ListGroupC()).indexOf(number))
{
// C
case 0: // C01
@ -1243,7 +1245,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupD()).indexOf(number))
switch (ListNumbers(trM, ListGroupD()).indexOf(number))
{
// D
case 0: // D01
@ -1260,7 +1262,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupE()).indexOf(number))
switch (ListNumbers(trM, ListGroupE()).indexOf(number))
{
// E
case 0: // E01
@ -1275,7 +1277,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupF()).indexOf(number))
switch (ListNumbers(trM, ListGroupF()).indexOf(number))
{
// F
case 0: // F01
@ -1294,7 +1296,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupG()).indexOf(number))
switch (ListNumbers(trM, ListGroupG()).indexOf(number))
{
// G
case 0: // G01
@ -1393,7 +1395,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupH()).indexOf(number))
switch (ListNumbers(trM, ListGroupH()).indexOf(number))
{
// H
case 0: // H01
@ -1484,7 +1486,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupI()).indexOf(number))
switch (ListNumbers(trM, ListGroupI()).indexOf(number))
{
// I
case 0: // I01
@ -1519,7 +1521,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupJ()).indexOf(number))
switch (ListNumbers(trM, ListGroupJ()).indexOf(number))
{
// J
case 0: // J01
@ -1546,7 +1548,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupK()).indexOf(number))
switch (ListNumbers(trM, ListGroupK()).indexOf(number))
{
// K
case 0: // K01
@ -1579,7 +1581,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupL()).indexOf(number))
switch (ListNumbers(trM, ListGroupL()).indexOf(number))
{
// L
case 0: // L01
@ -1630,7 +1632,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupM()).indexOf(number))
switch (ListNumbers(trM, ListGroupM()).indexOf(number))
{
// M
case 0: // M01
@ -1665,7 +1667,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupN()).indexOf(number))
switch (ListNumbers(trM, ListGroupN()).indexOf(number))
{
// N
case 0: // N01
@ -1688,7 +1690,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupO()).indexOf(number))
switch (ListNumbers(trM, ListGroupO()).indexOf(number))
{
// O
case 0: // O01
@ -1723,7 +1725,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupP()).indexOf(number))
switch (ListNumbers(trM, ListGroupP()).indexOf(number))
{
// P
case 0: // P01
@ -1754,7 +1756,7 @@ QString MapDiagrams(const QString &number)
break;
}
switch (ListNumbers(ListGroupQ()).indexOf(number))
switch (ListNumbers(trM, ListGroupQ()).indexOf(number))
{
// Q
case 0: // Q01

View File

@ -51,6 +51,7 @@ template <class T> class QSharedPointer;
class QComboBox;
class QMarginsF;
class VTranslateMeasurements;
#define SceneSize 50000
#define DefPointRadius 1.5//mm
@ -499,8 +500,8 @@ QStringList ListGroupO();
QStringList ListGroupP();
QStringList ListGroupQ();
QStringList ListNumbers(const QStringList & listMeasurements);
QString MapDiagrams(const QString &number);
QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList & listMeasurements);
QString MapDiagrams(const VTranslateMeasurements *trM, const QString &number);
// pattern making systems codes
extern const QString p0_S;

View File

@ -332,7 +332,7 @@ void DialogAlongLine::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogAlongLine::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -359,7 +359,7 @@ void DialogAlongLine::SetPointName(const QString &value)
*/
QString DialogAlongLine::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -164,7 +164,7 @@ void DialogArc::SetF2(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArc::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -192,7 +192,7 @@ void DialogArcWithLength::SetLength(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArcWithLength::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -313,7 +313,7 @@ void DialogBisector::SetThirdPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogBisector::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -355,7 +355,7 @@ void DialogBisector::closeEvent(QCloseEvent *event)
*/
QString DialogBisector::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -110,7 +110,7 @@ void DialogCubicBezier::SetSpline(const VCubicBezier &spline)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezier::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -117,7 +117,7 @@ void DialogCubicBezierPath::SetPath(const VCubicBezierPath &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezierPath::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -108,7 +108,7 @@ void DialogCurveIntersectAxis::SetPointName(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
@ -178,7 +178,7 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -281,7 +281,7 @@ void DialogEndLine::SetBasePointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogEndLine::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -375,7 +375,7 @@ DialogEndLine::~DialogEndLine()
*/
QString DialogEndLine::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -164,7 +164,7 @@ void DialogHeight::SetP2LineId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogHeight::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -295,7 +295,7 @@ void DialogHeight::ShowVisualization()
*/
QString DialogHeight::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -110,7 +110,7 @@ void DialogLine::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLine::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -247,5 +247,5 @@ quint32 DialogLine::GetSecondPoint() const
*/
QString DialogLine::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}

View File

@ -121,7 +121,7 @@ void DialogLineIntersectAxis::SetPointName(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
@ -207,7 +207,7 @@ void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -242,7 +242,7 @@ void DialogNormal::SetSecondPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogNormal::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -331,7 +331,7 @@ void DialogNormal::SetPointName(const QString &value)
*/
QString DialogNormal::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -267,7 +267,7 @@ void DialogShoulderPoint::SetP3(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogShoulderPoint::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -354,7 +354,7 @@ void DialogShoulderPoint::SetPointName(const QString &value)
*/
QString DialogShoulderPoint::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -614,7 +614,7 @@ void DialogSpline::SetSpline(const VSpline &spline)
//---------------------------------------------------------------------------------------------------------------------
QString DialogSpline::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -172,7 +172,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogSplinePath::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -302,7 +302,7 @@ void DialogTool::FillComboBoxHCrossCurvesPoint(QComboBox *box) const
}
//---------------------------------------------------------------------------------------------------------------------
QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
QString DialogTool::GetComboBoxCurrentData(const QComboBox *box, const QString &def) const
{
SCASSERT(box != nullptr)
QString value;
@ -313,7 +313,7 @@ QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
#endif
if (value.isEmpty())
{
value = TypeLineLine;
value = def;
}
return value;
}

View File

@ -224,7 +224,7 @@ protected:
void FillComboBoxHCrossCurvesPoint(QComboBox *box) const;
virtual void CheckState();
QString GetComboBoxCurrentData(const QComboBox *box)const;
QString GetComboBoxCurrentData(const QComboBox *box, const QString &def)const;
void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer, const QString &postfix = QString());
void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer,

View File

@ -224,8 +224,11 @@ QMap<QString, QIcon> VAbstractTool::LineStylesPics()
const QStringList VAbstractTool::Colors()
{
const QStringList colors = QStringList() << ColorBlack << ColorGreen << ColorBlue
<< ColorDarkRed << ColorDarkGreen
<< ColorDarkBlue << ColorYellow;
<< ColorDarkRed << ColorDarkGreen << ColorDarkBlue
<< ColorYellow << ColorLightSalmon << ColorGoldenRod
<< ColorOrange << ColorDeepPink << ColorViolet
<< ColorDarkViolet << ColorMediumSeaGreen << ColorLime
<< ColorDeepSkyBlue << ColorCornFlowerBlue;
return colors;
}
@ -261,6 +264,36 @@ QMap<QString, QString> VAbstractTool::ColorsList()
case 6: // ColorYellow
name = tr("yellow");
break;
case 7: // ColorLightSalmon
name = tr("light salmon");
break;
case 8: // ColorGoldenRod
name = tr("golden rod");
break;
case 9: // ColorOrange
name = tr("orange");
break;
case 10: // ColorDeepPink
name = tr("deep pink");
break;
case 11: // ColorViolet
name = tr("violet");
break;
case 12: // ColorDarkViolet
name = tr("dark violet");
break;
case 13: // ColorMediumSeaGreen
name = tr("medium sea green");
break;
case 14: // ColorLime
name = tr("lime");
break;
case 15: // ColorDeepSkyBlue
name = tr("deep sky blue");
break;
case 16: // ColorCornFlowerBlue
name = tr("corn flower blue");
break;
default:
name = tr("black");
break;

View File

@ -31,6 +31,7 @@
#include <QDomElement>
#include <QPointF>
#include <QUndoCommand>
#include <QDebug>
#include "../ifc/xml/vabstractpattern.h"
#include "../ifc/ifcdef.h"

View File

@ -50,6 +50,15 @@ void TST_VPoster::BigPoster()
printer.setFullPage(true);
// We need to set full page because otherwise QPrinter->pageRect returns different values in Windows and Linux
//sets the margins to 0 to perform the test.
const qreal left = 0, top = 0, right = 0, bottom = 0;
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
printer.setPageMargins(QMarginsF(left, top, right, bottom), QPageLayout::Millimeter);
#else
printer.setPageMargins(left, top, right, bottom, QPrinter::Millimeter);
#endif //QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
const QRect image(0, 0, 2622, 3178); // Little bit bigger than A1
VPoster posterazor(&printer);
const QVector<PosterData> poster = posterazor.Calc(image, 0);