Merge with develop

--HG--
branch : feature
This commit is contained in:
dismine 2014-06-11 15:47:32 +03:00
commit 8491248f02
7 changed files with 104 additions and 25 deletions

View File

@ -49,10 +49,6 @@ public:
DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
~DialogIncrements();
public slots:
/** TODO ISSUE 79 : create real function
* @brief DialogApply apply data and emit signal about applied dialog.
*/
virtual void DialogApply(){}
void clickedToolButtonAdd();
void clickedToolButtonRemove();
void IncrementChanged ( qint32 row, qint32 column );

View File

@ -145,6 +145,8 @@ void DialogIndividualMeasurements::CheckState()
bool flagPath = false;
if (ui->radioButtonExistM->isChecked())
{
ui->labelGivenName->setEnabled(true);
ui->labelFamilyName->setEnabled(true);
ui->lineEditPathExistM->setEnabled(true);
ui->toolButtonOpenExist->setEnabled(true);
@ -163,6 +165,8 @@ void DialogIndividualMeasurements::CheckState()
ui->toolButtonOpenNew->setEnabled(true);
ui->comboBoxUnits->setEnabled(true);
ui->labelGivenName->setEnabled(false);
ui->labelFamilyName->setEnabled(false);
ui->toolButtonOpenExist->setEnabled(false);
ui->lineEditPathExistM->setEnabled(false);
@ -197,6 +201,10 @@ void DialogIndividualMeasurements::OpenTable()
e.CriticalMessageBox(tr("File error."), this);
fileName.clear();
}
VIndividualMeasurements m(data);
m.setContent(fileName);
ui->labelGivenName->setText(m.GivenName());
ui->labelFamilyName->setText(m.FamilyName());
ui->lineEditPathExistM->setText(fileName);
ui->lineEditPathExistM->setToolTip(fileName);
CheckState();

View File

@ -61,11 +61,13 @@ private:
void InitUnits();
};
//---------------------------------------------------------------------------------------------------------------------
inline QString DialogIndividualMeasurements::name() const
{
return _name;
}
//---------------------------------------------------------------------------------------------------------------------
inline QString DialogIndividualMeasurements::tablePath() const
{
return _tablePath;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>397</width>
<height>280</height>
<width>385</width>
<height>295</height>
</rect>
</property>
<property name="windowTitle">
@ -73,6 +73,93 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Given name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelGivenName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Family name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelFamilyName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>

View File

@ -39,22 +39,7 @@ const QString VToolPoint::TagName = QStringLiteral("point");
VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent):VDrawTool(doc, data, id),
QGraphicsEllipseItem(parent), radius(DefRadius), namePoint(0), lineName(0)
{
switch (qApp->patternUnit())
{
case Valentina::Mm:
radius = qApp->toPixel(DefRadius);
break;
case Valentina::Cm:
radius = qApp->toPixel(DefRadius/10.0);
break;
case Valentina::Inch:
radius = qApp->toPixel(DefRadius/25.4);
break;
default:
radius = qApp->toPixel(DefRadius);
break;
}
radius = (DefRadius/*mm*/ / 25.4) * VApplication::PrintDPI;
namePoint = new VGraphicsSimpleTextItem(this);
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::ShowContextMenu);
namePoint->setBrush(Qt::black);

View File

@ -39,9 +39,10 @@ const QString VNodePoint::ToolType = QStringLiteral("modeling");
VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent,
QGraphicsItem *parent)
:VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(qApp->toPixel(1.5)),
:VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(0),
namePoint(nullptr), lineName(nullptr)
{
radius = (1.5/*mm*/ / 25.4) * VApplication::PrintDPI;
namePoint = new VGraphicsSimpleTextItem(this);
lineName = new QGraphicsLineItem(this);
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this,

View File

@ -168,7 +168,7 @@ QString VApplication::pathToTables() const
return QApplication::applicationDirPath() + QStringLiteral("/tables/standard");
#else
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/tables/standard"));
if (dir.exist())
if (dir.exists())
{
return dir.absolutePath();
}
@ -191,7 +191,7 @@ QString VApplication::translationsPath() const
return QApplication::applicationDirPath() + QStringLiteral("/translations");
#else
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/translations"));
if (dir.exist())
if (dir.exists())
{
return dir.absolutePath();
}