diff --git a/src/app/tape/dialogs/dialognewmeasurements.cpp b/src/app/tape/dialogs/dialognewmeasurements.cpp new file mode 100644 index 000000000..dd4ba875e --- /dev/null +++ b/src/app/tape/dialogs/dialognewmeasurements.cpp @@ -0,0 +1,172 @@ +/************************************************************************ + ** + ** @file dialognewmeasurements.cpp + ** @author Roman Telezhynskyi + ** @date 12 7, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "dialognewmeasurements.h" +#include "ui_dialognewmeasurements.h" + +#include "../vpatterndb/variables/vmeasurement.h" + +//--------------------------------------------------------------------------------------------------------------------- +DialogNewMeasurements::DialogNewMeasurements(QWidget *parent) + :QDialog(parent), + ui(new Ui::DialogNewMeasurements) +{ + ui->setupUi(this); + + InitMTypes(); + InitUnits(MeasurementsType::Individual); + InitStandards(); + InitHeightsList(); + InitSizesList(); + + connect(ui->comboBoxMType, static_cast(&QComboBox::currentIndexChanged), this, + &DialogNewMeasurements::CurrentTypeChanged); + + connect(ui->comboBoxUnit, static_cast(&QComboBox::currentIndexChanged), this, + &DialogNewMeasurements::CurrentUnitChanged); + + adjustSize(); + setMaximumSize(size()); + setMinimumSize(size()); +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogNewMeasurements::~DialogNewMeasurements() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +MeasurementsType DialogNewMeasurements::Type() const +{ + return static_cast(ui->comboBoxMType->currentData().toInt()); +} + +//--------------------------------------------------------------------------------------------------------------------- +Unit DialogNewMeasurements::MUnit() const +{ + return static_cast(ui->comboBoxUnit->currentData().toInt()); +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogNewMeasurements::BaseSize() const +{ + return ui->comboBoxBaseSize->currentData().toInt(); +} + +//--------------------------------------------------------------------------------------------------------------------- +int DialogNewMeasurements::BaseHeight() const +{ + return ui->comboBoxBaseHeight->currentData().toInt(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::CurrentTypeChanged(int index) +{ + const MeasurementsType type = static_cast(ui->comboBoxMType->itemData(index).toInt()); + if (type == MeasurementsType::Standard) + { + ui->comboBoxBaseSize->setEnabled(true); + ui->comboBoxBaseHeight->setEnabled(true); + } + else + { + ui->comboBoxBaseSize->setEnabled(false); + ui->comboBoxBaseHeight->setEnabled(false); + } + InitUnits(type); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::CurrentUnitChanged(int index) +{ + Q_UNUSED(index); + InitHeightsList(); + InitSizesList(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::InitMTypes() +{ + ui->comboBoxMType->blockSignals(true); + ui->comboBoxMType->clear(); + ui->comboBoxMType->addItem(tr("Individual"), static_cast(MeasurementsType::Individual)); + ui->comboBoxMType->addItem(tr("Standard"), static_cast(MeasurementsType::Standard)); + ui->comboBoxMType->blockSignals(false); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::InitStandards() +{ + ui->comboBoxStandard->blockSignals(true); + ui->comboBoxStandard->clear(); + ui->comboBoxStandard->addItem(tr("Regular")); + ui->comboBoxStandard->blockSignals(false); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::InitHeightsList() +{ + const QStringList list = VMeasurement::WholeListHeights(MUnit()); + ui->comboBoxBaseHeight->clear(); + ui->comboBoxBaseHeight->addItems(list); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::InitSizesList() +{ + const QStringList list = VMeasurement::WholeListSizes(MUnit()); + ui->comboBoxBaseSize->clear(); + ui->comboBoxBaseSize->addItems(list); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogNewMeasurements::InitUnits(const MeasurementsType &type) +{ + int val; + if (ui->comboBoxMType->currentIndex() != -1) + { + val = ui->comboBoxMType->currentData().toInt(); + } + + ui->comboBoxMType->blockSignals(true); + ui->comboBoxUnit->clear(); + ui->comboBoxUnit->addItem(tr("Centimeters"), static_cast(Unit::Cm)); + ui->comboBoxUnit->addItem(tr("Millimiters"), static_cast(Unit::Mm)); + if (type == MeasurementsType::Individual) + { + ui->comboBoxUnit->addItem(tr("Inches"), static_cast(Unit::Inch)); + } + ui->comboBoxMType->blockSignals(false); + + int index = ui->comboBoxUnit->findData(val); + if (index != -1) + { + ui->comboBoxUnit->setCurrentIndex(index); + } +} diff --git a/src/app/tape/dialogs/dialognewmeasurements.h b/src/app/tape/dialogs/dialognewmeasurements.h new file mode 100644 index 000000000..0477cda80 --- /dev/null +++ b/src/app/tape/dialogs/dialognewmeasurements.h @@ -0,0 +1,69 @@ +/************************************************************************ + ** + ** @file dialognewmeasurements.h + ** @author Roman Telezhynskyi + ** @date 12 7, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGNEWMEASUREMENTS_H +#define DIALOGNEWMEASUREMENTS_H + +#include + +#include "../vmisc/def.h" + +namespace Ui +{ + class DialogNewMeasurements; +} + +class DialogNewMeasurements : public QDialog +{ + Q_OBJECT + +public: + explicit DialogNewMeasurements(QWidget *parent = 0); + ~DialogNewMeasurements(); + + MeasurementsType Type() const; + Unit MUnit() const; + int BaseSize() const; + int BaseHeight() const; + +private slots: + void CurrentTypeChanged(int index); + void CurrentUnitChanged(int index); + +private: + Q_DISABLE_COPY(DialogNewMeasurements) + Ui::DialogNewMeasurements *ui; + + void InitMTypes(); + void InitStandards(); + void InitHeightsList(); + void InitSizesList(); + void InitUnits(const MeasurementsType &type); +}; + +#endif // DIALOGNEWMEASUREMENTS_H diff --git a/src/app/tape/dialogs/dialognewmeasurements.ui b/src/app/tape/dialogs/dialognewmeasurements.ui new file mode 100644 index 000000000..66358e6b3 --- /dev/null +++ b/src/app/tape/dialogs/dialognewmeasurements.ui @@ -0,0 +1,132 @@ + + + DialogNewMeasurements + + + + 0 + 0 + 244 + 212 + + + + New measurement file + + + + :/tapeicon/64x64/logo.png:/tapeicon/64x64/logo.png + + + + + + + + Measurement type: + + + + + + + + + + Unit: + + + + + + + + + + Base size: + + + + + + + false + + + + + + + Base height: + + + + + + + false + + + + + + + Standard: + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + DialogNewMeasurements + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogNewMeasurements + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/app/tape/share/resources/tapeicon.qrc b/src/app/tape/share/resources/tapeicon.qrc index ea7379b8a..24fdeb957 100644 --- a/src/app/tape/share/resources/tapeicon.qrc +++ b/src/app/tape/share/resources/tapeicon.qrc @@ -4,5 +4,6 @@ tapeicon/16x16/info.png tapeicon/16x16/measurement.png tapeicon/24x24/equal.png + tapeicon/24x24/fx.png diff --git a/src/app/tape/share/resources/tapeicon/24x24/fx.png b/src/app/tape/share/resources/tapeicon/24x24/fx.png new file mode 100644 index 000000000..ffe25095e Binary files /dev/null and b/src/app/tape/share/resources/tapeicon/24x24/fx.png differ diff --git a/src/app/tape/tape.pri b/src/app/tape/tape.pri index 20416b462..6f8b1f39b 100644 --- a/src/app/tape/tape.pri +++ b/src/app/tape/tape.pri @@ -6,14 +6,17 @@ SOURCES += \ $$PWD/tmainwindow.cpp \ $$PWD/stable.cpp \ $$PWD/mapplication.cpp \ - dialogs/dialogabouttape.cpp + dialogs/dialogabouttape.cpp \ + dialogs/dialognewmeasurements.cpp HEADERS += \ $$PWD/tmainwindow.h \ $$PWD/stable.h \ $$PWD/mapplication.h \ - dialogs/dialogabouttape.h + dialogs/dialogabouttape.h \ + dialogs/dialognewmeasurements.h FORMS += \ $$PWD/tmainwindow.ui \ - dialogs/dialogabouttape.ui + dialogs/dialogabouttape.ui \ + dialogs/dialognewmeasurements.ui diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index 62644b194..ea720f7f3 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -141,6 +141,24 @@ CONFIG(debug, debug|release){ # Path to recource file. win32:RC_FILE = share/resources/tape.rc +#VWidgets static library +unix|win32: LIBS += -L$$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/ -lvwidgets + +INCLUDEPATH += $$PWD/../../libs/vwidgets +DEPENDPATH += $$PWD/../../libs/vwidgets + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/vwidgets.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/libvwidgets.a + +#VPatternDB static library (depend on vgeometry, vmisc) +unix|win32: LIBS += -L$$OUT_PWD/../../libs/vpatterndb/$${DESTDIR} -lvpatterndb + +INCLUDEPATH += $$PWD/../../libs/vpatterndb +DEPENDPATH += $$PWD/../../libs/vpatterndb + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a + #VMisc static library unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc @@ -150,14 +168,23 @@ DEPENDPATH += $$PWD/../../libs/vmisc win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a -#VWidgets static library -unix|win32: LIBS += -L$$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/ -lvwidgets +# VGeometry static library (depend on ifc) +unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry -INCLUDEPATH += $$PWD/../../libs/vwidgets -DEPENDPATH += $$PWD/../../libs/vwidgets +INCLUDEPATH += $$PWD/../../libs/vgeometry +DEPENDPATH += $$PWD/../../libs/vgeometry -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/vwidgets.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/libvwidgets.a +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a + +# IFC static library +unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc + +INCLUDEPATH += $$PWD/../../libs/ifc +DEPENDPATH += $$PWD/../../libs/ifc + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/ifc.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/libifc.a noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols # do nothing diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index d52f42290..69334e438 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -30,6 +30,7 @@ #include "ui_tmainwindow.h" #include "mapplication.h" #include "dialogs/dialogabouttape.h" +#include "dialogs/dialognewmeasurements.h" //--------------------------------------------------------------------------------------------------------------------- TMainWindow::TMainWindow(QWidget *parent) @@ -55,6 +56,18 @@ void TMainWindow::LoadFile(const QString &path) ui->tabWidget->setVisible(true); } +//--------------------------------------------------------------------------------------------------------------------- +void TMainWindow::FileNew() +{ + DialogNewMeasurements measurements(this); + if (measurements.exec() == QDialog::Rejected) + { + return; + } + + InitNew(measurements.Type()); +} + //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::FileOpen() { @@ -118,14 +131,17 @@ void TMainWindow::AboutApplication() void TMainWindow::SetupMenu() { // File + connect(ui->actionNew, &QAction::triggered, this, &TMainWindow::FileNew); + ui->actionNew->setShortcuts(QKeySequence::New); + connect(ui->actionOpen, &QAction::triggered, this, &TMainWindow::FileOpen); ui->actionOpen->setShortcuts(QKeySequence::Open); connect(ui->actionSave, &QAction::triggered, this, &TMainWindow::FileSave); - ui->actionOpen->setShortcuts(QKeySequence::Save); + ui->actionSave->setShortcuts(QKeySequence::Save); connect(ui->actionSaveAs, &QAction::triggered, this, &TMainWindow::FileSaveAs); - ui->actionOpen->setShortcuts(QKeySequence::SaveAs); + ui->actionSaveAs->setShortcuts(QKeySequence::SaveAs); QAction *separatorAct = new QAction(this); separatorAct->setSeparator(true); @@ -146,3 +162,62 @@ void TMainWindow::SetupMenu() connect(ui->actionAboutQt, &QAction::triggered, qApp, &QApplication::aboutQt); connect(ui->actionAboutTape, &QAction::triggered, this, &TMainWindow::AboutApplication); } + +//--------------------------------------------------------------------------------------------------------------------- +void TMainWindow::InitNew(MeasurementsType type) +{ + ui->labelToolTip->setVisible(false); + ui->tabWidget->setVisible(true); + + if (type == MeasurementsType::Standard) + { + // Tab Measurements + delete ui->labelValue; + delete ui->horizontalLayoutValue; + + // Tab Information + delete ui->labelGivenName; + delete ui->lineEditGivenName; + delete ui->labelFamilyName; + delete ui->lineEditFamilyName; + delete ui->labelBirthDate; + delete ui->dateEditBirthDate; + delete ui->labelSex; + delete ui->comboBoxSex; + delete ui->labelEmail; + delete ui->lineEditEmail; + } + else + { + // Tab Measurements + delete ui->labelBaseValue; + delete ui->doubleSpinBoxBaseValue; + delete ui->labelInSizes; + delete ui->doubleSpinBoxInSizes; + delete ui->labelInHeights; + delete ui->doubleSpinBoxInHeights; + + // Tab Information + delete ui->labelBaseSize; + delete ui->labelBaseSizeValue; + delete ui->labelBaseHeight; + delete ui->labelBaseHeightValue; + } + + InitTable(type); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TMainWindow::InitTable(MeasurementsType type) +{ + if (type == MeasurementsType::Standard) + { + ui->tableWidget->setColumnHidden( 1, true );// value + } + else + { + ui->tableWidget->setColumnHidden( 2, true );// base value + ui->tableWidget->setColumnHidden( 3, true );// in sizes + ui->tableWidget->setColumnHidden( 4, true );// in heights + } +} diff --git a/src/app/tape/tmainwindow.h b/src/app/tape/tmainwindow.h index 323d876b7..00b8fbee5 100644 --- a/src/app/tape/tmainwindow.h +++ b/src/app/tape/tmainwindow.h @@ -31,6 +31,8 @@ #include +#include "../vmisc/def.h" + namespace Ui { class TMainWindow; @@ -48,6 +50,7 @@ public slots: void LoadFile(const QString &path); private slots: + void FileNew(); void FileOpen(); void FileSave(); void FileSaveAs(); @@ -60,6 +63,8 @@ private: Ui::TMainWindow *ui; void SetupMenu(); + void InitNew(MeasurementsType type); + void InitTable(MeasurementsType type); }; #endif // TMAINWINDOW_H diff --git a/src/app/tape/tmainwindow.ui b/src/app/tape/tmainwindow.ui index 473521efd..5e4b3423a 100644 --- a/src/app/tape/tmainwindow.ui +++ b/src/app/tape/tmainwindow.ui @@ -7,7 +7,7 @@ 0 0 599 - 703 + 569 @@ -43,7 +43,10 @@ - + + + false + Hide empty @@ -57,7 +60,11 @@ - + + + false + + @@ -69,6 +76,37 @@ 2 + + true + + + true + + + + Name + + + + + Value + + + + + Base value + + + + + In sizes + + + + + In heights + + @@ -91,19 +129,26 @@ - + + + false + + - + Value: - + + + false + 0 @@ -123,6 +168,9 @@ + + false + 18 @@ -157,7 +205,27 @@ - + + + false + + + ... + + + + :/tapeicon/24x24/fx.png:/tapeicon/24x24/fx.png + + + + 24 + 24 + + + + + + @@ -193,35 +261,47 @@ - - - - In sizes: - - - - - - - In heights: - - - - - - - - - - + Base value: - + + + false + + + + + + + In sizes: + + + + + + + false + + + + + + + In heights: + + + + + + + false + + @@ -232,10 +312,13 @@ + + false + 0 - 0 + 1 @@ -254,115 +337,6 @@ Information - - QFormLayout::AllNonFixedFieldsGrow - - - - - Path: - - - - - - - Path to file - - - - - - - Base size: - - - - - - - Base size value - - - - - - - Base height: - - - - - - - Base height value - - - - - - - Given name: - - - - - - - - - - Family name: - - - - - - - - - - Birth date: - - - - - - - yyyy-MM-dd - - - - - - - Sex: - - - - - - - Email: - - - - - - - Notes: - - - - - - - - - - - - @@ -377,6 +351,133 @@ + + + + Path: + + + + + + + + + Path to file + + + true + + + + + + + Show in folder + + + + + + + + + Base size: + + + + + + + Base size value + + + + + + + Base height: + + + + + + + Base height value + + + + + + + Given name: + + + + + + + + + + Family name: + + + + + + + + + + Birth date: + + + + + + + yyyy-MM-dd + + + + + + + Sex: + + + + + + + + + + Email: + + + + + + + + + + Notes: + + + + + + + + 0 + 1 + + + + diff --git a/src/app/valentina/valentina.pro b/src/app/valentina/valentina.pro index 093d29756..1cca82a1b 100644 --- a/src/app/valentina/valentina.pro +++ b/src/app/valentina/valentina.pro @@ -558,15 +558,6 @@ DEPENDPATH += $$PWD/../../libs/vtools win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vtools/$${DESTDIR}/vtools.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vtools/$${DESTDIR}/libvtools.a -#VMisc static library -unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc - -INCLUDEPATH += $$PWD/../../libs/vmisc -DEPENDPATH += $$PWD/../../libs/vmisc - -win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib -else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a - #VWidgets static library unix|win32: LIBS += -L$$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/ -lvwidgets @@ -576,7 +567,7 @@ DEPENDPATH += $$PWD/../../libs/vwidgets win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/vwidgets.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/libvwidgets.a -#VPatternDB static library (depend on vgeometry) +#VPatternDB static library (depend on vgeometry, vmisc) unix|win32: LIBS += -L$$OUT_PWD/../../libs/vpatterndb/$${DESTDIR} -lvpatterndb INCLUDEPATH += $$PWD/../../libs/vpatterndb @@ -585,6 +576,15 @@ DEPENDPATH += $$PWD/../../libs/vpatterndb win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a +#VMisc static library +unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc + +INCLUDEPATH += $$PWD/../../libs/vmisc +DEPENDPATH += $$PWD/../../libs/vmisc + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a + # VGeometry static library (depend on ifc) unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry diff --git a/src/libs/vpatterndb/variables/vmeasurement.cpp b/src/libs/vpatterndb/variables/vmeasurement.cpp index ff6266214..eb9d62f99 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.cpp +++ b/src/libs/vpatterndb/variables/vmeasurement.cpp @@ -117,10 +117,7 @@ QStringList VMeasurement::ListHeights(QMap heights, Unit pattern if (list.isEmpty()) { // from 92 cm to 194 cm - for (int i = 92; i<= 194; i = i+6) - { - ListValue(list, i, patternUnit); - } + list = VMeasurement::WholeListHeights(patternUnit); } return list; } @@ -148,19 +145,53 @@ QStringList VMeasurement::ListSizes(QMap sizes, Unit patternUnit) if (list.isEmpty()) { // from 22 cm to 56 cm - for (int i = 22; i<= 56; i = i+2) - { - ListValue(list, i, patternUnit); - } + list = VMeasurement::WholeListSizes(patternUnit); } return list; } +//--------------------------------------------------------------------------------------------------------------------- +QStringList VMeasurement::WholeListHeights(Unit patternUnit) +{ + QStringList list; + if (patternUnit == Unit::Inch) + { + qWarning()<<"Standard table doesn't support inches."; + return list; + } + // from 92 cm to 194 cm + for (int i = 92; i<= 194; i = i+6) + { + ListValue(list, i, patternUnit); + } + + return list; +} + +//--------------------------------------------------------------------------------------------------------------------- +QStringList VMeasurement::WholeListSizes(Unit patternUnit) +{ + QStringList list; + if (patternUnit == Unit::Inch) + { + qWarning()<<"Standard table doesn't support inches."; + return list; + } + + // from 22 cm to 56 cm + for (int i = 22; i<= 56; i = i+2) + { + ListValue(list, i, patternUnit); + } + + return list; +} + //--------------------------------------------------------------------------------------------------------------------- void VMeasurement::ListValue(QStringList &list, qreal value, Unit patternUnit) { - qreal val = UnitConvertor(value, Unit::Cm, patternUnit); - QString strVal = QString("%1").arg(val); + const qreal val = UnitConvertor(value, Unit::Cm, patternUnit); + const QString strVal = QString("%1").arg(val); list.append(strVal); } diff --git a/src/libs/vpatterndb/variables/vmeasurement.h b/src/libs/vpatterndb/variables/vmeasurement.h index 6df0a6287..13291514f 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.h +++ b/src/libs/vpatterndb/variables/vmeasurement.h @@ -57,6 +57,8 @@ public: void setTagName(const QString &TagName); static QStringList ListHeights(QMap heights, Unit patternUnit); static QStringList ListSizes(QMap sizes, Unit patternUnit); + static QStringList WholeListHeights(Unit patternUnit); + static QStringList WholeListSizes(Unit patternUnit); private: QSharedDataPointer d; diff --git a/src/libs/vtools/dialogs/tools/dialogalongline.ui b/src/libs/vtools/dialogs/tools/dialogalongline.ui index 06cc73444..a4c69605e 100644 --- a/src/libs/vtools/dialogs/tools/dialogalongline.ui +++ b/src/libs/vtools/dialogs/tools/dialogalongline.ui @@ -14,7 +14,7 @@ Point at distance along line - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png @@ -92,7 +92,7 @@ ... - + :/icon/24x24/fx.png:/icon/24x24/fx.png @@ -109,7 +109,7 @@ - :/icon/24x24/equal.png + :/icon/24x24/equal.png @@ -320,7 +320,7 @@ buttonBox - +