Show new empty table.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-07-13 13:48:29 +03:00
parent 47c5a2dc99
commit 11ef76d0ae
14 changed files with 792 additions and 174 deletions

View File

@ -0,0 +1,172 @@
/************************************************************************
**
** @file dialognewmeasurements.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @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
** <https://bitbucket.org/dismine/valentina> 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 <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#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<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogNewMeasurements::CurrentTypeChanged);
connect(ui->comboBoxUnit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&DialogNewMeasurements::CurrentUnitChanged);
adjustSize();
setMaximumSize(size());
setMinimumSize(size());
}
//---------------------------------------------------------------------------------------------------------------------
DialogNewMeasurements::~DialogNewMeasurements()
{
delete ui;
}
//---------------------------------------------------------------------------------------------------------------------
MeasurementsType DialogNewMeasurements::Type() const
{
return static_cast<MeasurementsType>(ui->comboBoxMType->currentData().toInt());
}
//---------------------------------------------------------------------------------------------------------------------
Unit DialogNewMeasurements::MUnit() const
{
return static_cast<Unit>(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<MeasurementsType>(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<int>(MeasurementsType::Individual));
ui->comboBoxMType->addItem(tr("Standard"), static_cast<int>(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<int>(Unit::Cm));
ui->comboBoxUnit->addItem(tr("Millimiters"), static_cast<int>(Unit::Mm));
if (type == MeasurementsType::Individual)
{
ui->comboBoxUnit->addItem(tr("Inches"), static_cast<int>(Unit::Inch));
}
ui->comboBoxMType->blockSignals(false);
int index = ui->comboBoxUnit->findData(val);
if (index != -1)
{
ui->comboBoxUnit->setCurrentIndex(index);
}
}

View File

@ -0,0 +1,69 @@
/************************************************************************
**
** @file dialognewmeasurements.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @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
** <https://bitbucket.org/dismine/valentina> 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 <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef DIALOGNEWMEASUREMENTS_H
#define DIALOGNEWMEASUREMENTS_H
#include <QDialog>
#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

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogNewMeasurements</class>
<widget class="QDialog" name="DialogNewMeasurements">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>244</width>
<height>212</height>
</rect>
</property>
<property name="windowTitle">
<string>New measurement file</string>
</property>
<property name="windowIcon">
<iconset resource="../share/resources/tapeicon.qrc">
<normaloff>:/tapeicon/64x64/logo.png</normaloff>:/tapeicon/64x64/logo.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Measurement type:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxMType"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Unit:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxUnit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Base size:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxBaseSize">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Base height:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxBaseHeight">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Standard:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxStandard"/>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../share/resources/tapeicon.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogNewMeasurements</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogNewMeasurements</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -4,5 +4,6 @@
<file>tapeicon/16x16/info.png</file> <file>tapeicon/16x16/info.png</file>
<file>tapeicon/16x16/measurement.png</file> <file>tapeicon/16x16/measurement.png</file>
<file>tapeicon/24x24/equal.png</file> <file>tapeicon/24x24/equal.png</file>
<file>tapeicon/24x24/fx.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

View File

@ -6,14 +6,17 @@ SOURCES += \
$$PWD/tmainwindow.cpp \ $$PWD/tmainwindow.cpp \
$$PWD/stable.cpp \ $$PWD/stable.cpp \
$$PWD/mapplication.cpp \ $$PWD/mapplication.cpp \
dialogs/dialogabouttape.cpp dialogs/dialogabouttape.cpp \
dialogs/dialognewmeasurements.cpp
HEADERS += \ HEADERS += \
$$PWD/tmainwindow.h \ $$PWD/tmainwindow.h \
$$PWD/stable.h \ $$PWD/stable.h \
$$PWD/mapplication.h \ $$PWD/mapplication.h \
dialogs/dialogabouttape.h dialogs/dialogabouttape.h \
dialogs/dialognewmeasurements.h
FORMS += \ FORMS += \
$$PWD/tmainwindow.ui \ $$PWD/tmainwindow.ui \
dialogs/dialogabouttape.ui dialogs/dialogabouttape.ui \
dialogs/dialognewmeasurements.ui

View File

@ -141,6 +141,24 @@ CONFIG(debug, debug|release){
# Path to recource file. # Path to recource file.
win32:RC_FILE = share/resources/tape.rc 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 #VMisc static library
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc 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 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 else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a
#VWidgets static library # VGeometry static library (depend on ifc)
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/ -lvwidgets unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry
INCLUDEPATH += $$PWD/../../libs/vwidgets INCLUDEPATH += $$PWD/../../libs/vgeometry
DEPENDPATH += $$PWD/../../libs/vwidgets DEPENDPATH += $$PWD/../../libs/vgeometry
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/vwidgets.lib win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/libvwidgets.a 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 noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing # do nothing

View File

@ -30,6 +30,7 @@
#include "ui_tmainwindow.h" #include "ui_tmainwindow.h"
#include "mapplication.h" #include "mapplication.h"
#include "dialogs/dialogabouttape.h" #include "dialogs/dialogabouttape.h"
#include "dialogs/dialognewmeasurements.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
TMainWindow::TMainWindow(QWidget *parent) TMainWindow::TMainWindow(QWidget *parent)
@ -55,6 +56,18 @@ void TMainWindow::LoadFile(const QString &path)
ui->tabWidget->setVisible(true); ui->tabWidget->setVisible(true);
} }
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::FileNew()
{
DialogNewMeasurements measurements(this);
if (measurements.exec() == QDialog::Rejected)
{
return;
}
InitNew(measurements.Type());
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TMainWindow::FileOpen() void TMainWindow::FileOpen()
{ {
@ -118,14 +131,17 @@ void TMainWindow::AboutApplication()
void TMainWindow::SetupMenu() void TMainWindow::SetupMenu()
{ {
// File // File
connect(ui->actionNew, &QAction::triggered, this, &TMainWindow::FileNew);
ui->actionNew->setShortcuts(QKeySequence::New);
connect(ui->actionOpen, &QAction::triggered, this, &TMainWindow::FileOpen); connect(ui->actionOpen, &QAction::triggered, this, &TMainWindow::FileOpen);
ui->actionOpen->setShortcuts(QKeySequence::Open); ui->actionOpen->setShortcuts(QKeySequence::Open);
connect(ui->actionSave, &QAction::triggered, this, &TMainWindow::FileSave); 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); connect(ui->actionSaveAs, &QAction::triggered, this, &TMainWindow::FileSaveAs);
ui->actionOpen->setShortcuts(QKeySequence::SaveAs); ui->actionSaveAs->setShortcuts(QKeySequence::SaveAs);
QAction *separatorAct = new QAction(this); QAction *separatorAct = new QAction(this);
separatorAct->setSeparator(true); separatorAct->setSeparator(true);
@ -146,3 +162,62 @@ void TMainWindow::SetupMenu()
connect(ui->actionAboutQt, &QAction::triggered, qApp, &QApplication::aboutQt); connect(ui->actionAboutQt, &QAction::triggered, qApp, &QApplication::aboutQt);
connect(ui->actionAboutTape, &QAction::triggered, this, &TMainWindow::AboutApplication); 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
}
}

View File

@ -31,6 +31,8 @@
#include <QMainWindow> #include <QMainWindow>
#include "../vmisc/def.h"
namespace Ui namespace Ui
{ {
class TMainWindow; class TMainWindow;
@ -48,6 +50,7 @@ public slots:
void LoadFile(const QString &path); void LoadFile(const QString &path);
private slots: private slots:
void FileNew();
void FileOpen(); void FileOpen();
void FileSave(); void FileSave();
void FileSaveAs(); void FileSaveAs();
@ -60,6 +63,8 @@ private:
Ui::TMainWindow *ui; Ui::TMainWindow *ui;
void SetupMenu(); void SetupMenu();
void InitNew(MeasurementsType type);
void InitTable(MeasurementsType type);
}; };
#endif // TMAINWINDOW_H #endif // TMAINWINDOW_H

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>599</width> <width>599</width>
<height>703</height> <height>569</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -43,7 +43,10 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QCheckBox" name="checkBox"> <widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Hide empty</string> <string>Hide empty</string>
</property> </property>
@ -57,7 +60,11 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit_2"/> <widget class="QLineEdit" name="lineEditSearch">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
@ -69,6 +76,37 @@
<verstretch>2</verstretch> <verstretch>2</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Value</string>
</property>
</column>
<column>
<property name="text">
<string>Base value</string>
</property>
</column>
<column>
<property name="text">
<string>In sizes</string>
</property>
</column>
<column>
<property name="text">
<string>In heights</string>
</property>
</column>
</widget> </widget>
</item> </item>
<item> <item>
@ -91,19 +129,26 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/> <widget class="QLineEdit" name="lineEdit">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="labelValue">
<property name="text"> <property name="text">
<string>Value:</string> <string>Value:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayoutValue">
<item> <item>
<widget class="QPlainTextEdit" name="plainTextEditFormula"> <widget class="QPlainTextEdit" name="plainTextEditFormula">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -123,6 +168,9 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButtonGrowLength"> <widget class="QPushButton" name="pushButtonGrowLength">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>18</width> <width>18</width>
@ -157,7 +205,27 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QToolButton" name="toolButtonExprLength">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset resource="share/resources/tapeicon.qrc">
<normaloff>:/tapeicon/24x24/fx.png</normaloff>:/tapeicon/24x24/fx.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelEqual">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@ -193,35 +261,47 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>In sizes:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>In heights:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox"/>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_2"/>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="labelBaseValue">
<property name="text"> <property name="text">
<string>Base value:</string> <string>Base value:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_3"/> <widget class="QDoubleSpinBox" name="doubleSpinBoxBaseValue">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelInSizes">
<property name="text">
<string>In sizes:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxInSizes">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelInHeights">
<property name="text">
<string>In heights:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxInHeights">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
@ -232,10 +312,13 @@
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QPlainTextEdit" name="plainTextEdit"> <widget class="QPlainTextEdit" name="plainTextEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
@ -254,115 +337,6 @@
<string>Information</string> <string>Information</string>
</attribute> </attribute>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Path:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Path to file</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Base size:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Base size value</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Base height:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Base height value</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Given name:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_3"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Family name:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_4"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Birth date:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDateEdit" name="dateEdit">
<property name="displayFormat">
<string>yyyy-MM-dd</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Sex:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Email:</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Notes:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="comboBox"/>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="lineEdit_5"/>
</item>
<item row="9" column="1">
<widget class="QPlainTextEdit" name="plainTextEdit_2"/>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_21"> <widget class="QLabel" name="label_21">
<property name="text"> <property name="text">
@ -377,6 +351,133 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Path:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayoutPath">
<item>
<widget class="QLabel" name="label_18">
<property name="text">
<string>Path to file</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="pushButtonShowInFolder">
<property name="text">
<string>Show in folder</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelBaseSize">
<property name="text">
<string>Base size:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="labelBaseSizeValue">
<property name="text">
<string>Base size value</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelBaseHeight">
<property name="text">
<string>Base height:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="labelBaseHeightValue">
<property name="text">
<string>Base height value</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelGivenName">
<property name="text">
<string>Given name:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEditGivenName"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelFamilyName">
<property name="text">
<string>Family name:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEditFamilyName"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="labelBirthDate">
<property name="text">
<string>Birth date:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QDateEdit" name="dateEditBirthDate">
<property name="displayFormat">
<string>yyyy-MM-dd</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="labelSex">
<property name="text">
<string>Sex:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="comboBoxSex"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="labelEmail">
<property name="text">
<string>Email:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="lineEditEmail"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="labelNotes">
<property name="text">
<string>Notes:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QPlainTextEdit" name="plainTextEditNotes">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View File

@ -558,15 +558,6 @@ DEPENDPATH += $$PWD/../../libs/vtools
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vtools/$${DESTDIR}/vtools.lib 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 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 #VWidgets static library
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/ -lvwidgets 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 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 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 unix|win32: LIBS += -L$$OUT_PWD/../../libs/vpatterndb/$${DESTDIR} -lvpatterndb
INCLUDEPATH += $$PWD/../../libs/vpatterndb INCLUDEPATH += $$PWD/../../libs/vpatterndb
@ -585,6 +576,15 @@ DEPENDPATH += $$PWD/../../libs/vpatterndb
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib 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 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) # VGeometry static library (depend on ifc)
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry

View File

@ -117,10 +117,7 @@ QStringList VMeasurement::ListHeights(QMap<GHeights, bool> heights, Unit pattern
if (list.isEmpty()) if (list.isEmpty())
{ {
// from 92 cm to 194 cm // from 92 cm to 194 cm
for (int i = 92; i<= 194; i = i+6) list = VMeasurement::WholeListHeights(patternUnit);
{
ListValue(list, i, patternUnit);
}
} }
return list; return list;
} }
@ -147,20 +144,54 @@ QStringList VMeasurement::ListSizes(QMap<GSizes, bool> sizes, Unit patternUnit)
if (list.isEmpty()) if (list.isEmpty())
{ {
// from 22 cm to 56 cm
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 // from 22 cm to 56 cm
for (int i = 22; i<= 56; i = i+2) for (int i = 22; i<= 56; i = i+2)
{ {
ListValue(list, i, patternUnit); ListValue(list, i, patternUnit);
} }
}
return list; return list;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VMeasurement::ListValue(QStringList &list, qreal value, Unit patternUnit) void VMeasurement::ListValue(QStringList &list, qreal value, Unit patternUnit)
{ {
qreal val = UnitConvertor(value, Unit::Cm, patternUnit); const qreal val = UnitConvertor(value, Unit::Cm, patternUnit);
QString strVal = QString("%1").arg(val); const QString strVal = QString("%1").arg(val);
list.append(strVal); list.append(strVal);
} }

View File

@ -57,6 +57,8 @@ public:
void setTagName(const QString &TagName); void setTagName(const QString &TagName);
static QStringList ListHeights(QMap<GHeights, bool> heights, Unit patternUnit); static QStringList ListHeights(QMap<GHeights, bool> heights, Unit patternUnit);
static QStringList ListSizes(QMap<GSizes, bool> sizes, Unit patternUnit); static QStringList ListSizes(QMap<GSizes, bool> sizes, Unit patternUnit);
static QStringList WholeListHeights(Unit patternUnit);
static QStringList WholeListSizes(Unit patternUnit);
private: private:
QSharedDataPointer<VMeasurementData> d; QSharedDataPointer<VMeasurementData> d;

View File

@ -14,7 +14,7 @@
<string>Point at distance along line</string> <string>Point at distance along line</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../../../../app/share/resources/icon.qrc"> <iconset resource="../../../../app/valentina/share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<property name="locale"> <property name="locale">
@ -92,7 +92,7 @@
<string notr="true">...</string> <string notr="true">...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../app/share/resources/icon.qrc"> <iconset resource="../../../../app/valentina/share/resources/icon.qrc">
<normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset> <normaloff>:/icon/24x24/fx.png</normaloff>:/icon/24x24/fx.png</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -109,7 +109,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../../../../app/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap> <pixmap resource="../../../../app/valentina/share/resources/icon.qrc">:/icon/24x24/equal.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
@ -320,7 +320,7 @@
<tabstop>buttonBox</tabstop> <tabstop>buttonBox</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../../../../app/share/resources/icon.qrc"/> <include location="../../../../app/valentina/share/resources/icon.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>