Button to call Label editor.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-09 19:32:14 +03:00
parent 80f6a5a7d1
commit 7b13020e4e
5 changed files with 37 additions and 11 deletions

View File

@ -36,6 +36,7 @@
#include "../xml/vpattern.h"
#include "../vpatterndb/vcontainer.h"
#include "../core/vapplication.h"
#include "../vtools/dialogs/support/dialogeditlabel.h"
// calc how many combinations we have
static const int heightsCount = (static_cast<int>(GHeights::H200) -
@ -201,6 +202,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
connect(ui->lineEditSize, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
connect(ui->checkBoxShowDate, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged);
connect(ui->checkBoxShowMeasurements, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged);
connect(ui->pushButtonEditPatternLabel, &QPushButton::clicked, this, &DialogPatternProperties::EditLabel);
}
//---------------------------------------------------------------------------------------------------------------------
@ -849,3 +851,10 @@ void DialogPatternProperties::SaveImage()
}
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogPatternProperties::EditLabel()
{
DialogEditLabel editor;
editor.exec();
}

View File

@ -62,6 +62,7 @@ private slots:
void DescEdited();
void ChangeImage();
void SaveImage();
void EditLabel();
private:
Q_DISABLE_COPY(DialogPatternProperties)
Ui::DialogPatternProperties *ui;

View File

@ -14,14 +14,14 @@
<string>Pattern properties</string>
</property>
<property name="windowIcon">
<iconset>
<iconset resource="../../../libs/vmisc/share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -1213,7 +1213,7 @@
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>Label:</string>
<string>Label template:</string>
</property>
</widget>
</item>
@ -1223,7 +1223,7 @@
<string>Edit pattern label</string>
</property>
<property name="text">
<string>Edit label</string>
<string>Edit template</string>
</property>
</widget>
</item>
@ -1360,7 +1360,9 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>

View File

@ -3,8 +3,9 @@
#include <QDialog>
namespace Ui {
class DialogEditLabel;
namespace Ui
{
class DialogEditLabel;
}
class DialogEditLabel : public QDialog
@ -12,10 +13,11 @@ class DialogEditLabel : public QDialog
Q_OBJECT
public:
explicit DialogEditLabel(QWidget *parent = 0);
~DialogEditLabel();
explicit DialogEditLabel(QWidget *parent = nullptr);
virtual ~DialogEditLabel();
private:
Q_DISABLE_COPY(DialogEditLabel)
Ui::DialogEditLabel *ui;
};

View File

@ -2,6 +2,9 @@
<ui version="4.0">
<class>DialogEditLabel</class>
<widget class="QDialog" name="DialogEditLabel">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
@ -11,7 +14,14 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Edit label template</string>
</property>
<property name="windowIcon">
<iconset resource="../../../vmisc/share/resources/icon.qrc">
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@ -314,7 +324,9 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../../vmisc/share/resources/icon.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>