From f741e1387c3ff143abf048f75061cbdc7933fe87 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 22 Nov 2016 13:04:34 +0200 Subject: [PATCH] Added DialogPiecePath class. Not finished. --HG-- branch : feature --- src/libs/vtools/dialogs/dialogs.pri | 9 +- .../vtools/dialogs/tools/dialogpiecepath.cpp | 289 ++++++++++++++++++ .../vtools/dialogs/tools/dialogpiecepath.h | 77 +++++ .../vtools/dialogs/tools/dialogpiecepath.ui | 128 ++++++++ .../dialogs/tools/dialogseamallowance.cpp | 108 +------ .../dialogs/tools/dialogseamallowance.h | 3 - .../dialogs/tools/dialogseamallowance.ui | 10 +- src/libs/vtools/dialogs/tools/dialogtool.cpp | 110 +++++++ src/libs/vtools/dialogs/tools/dialogtool.h | 8 + 9 files changed, 629 insertions(+), 113 deletions(-) create mode 100644 src/libs/vtools/dialogs/tools/dialogpiecepath.cpp create mode 100644 src/libs/vtools/dialogs/tools/dialogpiecepath.h create mode 100644 src/libs/vtools/dialogs/tools/dialogpiecepath.ui diff --git a/src/libs/vtools/dialogs/dialogs.pri b/src/libs/vtools/dialogs/dialogs.pri index 3c1543155..9767ea030 100644 --- a/src/libs/vtools/dialogs/dialogs.pri +++ b/src/libs/vtools/dialogs/dialogs.pri @@ -42,7 +42,8 @@ HEADERS += \ $$PWD/tools/dialogflippingbyline.h \ $$PWD/tools/dialogflippingbyaxis.h \ $$PWD/tools/dialogmove.h \ - $$PWD/tools/dialogseamallowance.h + $$PWD/tools/dialogseamallowance.h \ + $$PWD/tools/dialogpiecepath.h SOURCES += \ $$PWD/tools/dialogalongline.cpp \ @@ -84,7 +85,8 @@ SOURCES += \ $$PWD/tools/dialogflippingbyline.cpp \ $$PWD/tools/dialogflippingbyaxis.cpp \ $$PWD/tools/dialogmove.cpp \ - $$PWD/tools/dialogseamallowance.cpp + $$PWD/tools/dialogseamallowance.cpp \ + $$PWD/tools/dialogpiecepath.cpp FORMS += \ $$PWD/tools/dialogalongline.ui \ @@ -125,4 +127,5 @@ FORMS += \ $$PWD/tools/dialogflippingbyline.ui \ $$PWD/tools/dialogflippingbyaxis.ui \ $$PWD/tools/dialogmove.ui \ - $$PWD/tools/dialogseamallowance.ui + $$PWD/tools/dialogseamallowance.ui \ + $$PWD/tools/dialogpiecepath.ui diff --git a/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp new file mode 100644 index 000000000..d863f15c6 --- /dev/null +++ b/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp @@ -0,0 +1,289 @@ +/************************************************************************ + ** + ** @file dialogpiecepath.cpp + ** @author Roman Telezhynskyi + ** @date 22 11, 2016 + ** + ** @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) 2016 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 "dialogpiecepath.h" +#include "ui_dialogpiecepath.h" +#include "../vpatterndb/vpiecenode.h" + +#include + +//--------------------------------------------------------------------------------------------------------------------- +DialogPiecePath::DialogPiecePath(const VContainer *data, quint32 toolId, QWidget *parent) + : DialogTool(data, toolId, parent), + ui(new Ui::DialogPiecePath), + m_showMode(true) +{ + ui->setupUi(this); + InitOkCancel(ui); + + flagName = true;//We have default name of piece. + flagError = PathIsValid(); + CheckState(); + + connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogPiecePath::NameChanged); + + if (not m_showMode) + { + //vis = new VisToolPiecePath(data); + } + else + { + ui->comboBoxType->setDisabled(true); + ui->comboBoxPiece->setDisabled(true); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +DialogPiecePath::~DialogPiecePath() +{ + delete ui; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::DisableShowMode(bool disable) +{ + m_showMode = disable; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::ChosenObject(quint32 id, const SceneObject &type) +{ + if (not prepare) + { + bool reverse = false; + if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) + { + reverse = true; + } + switch (type) + { + case SceneObject::Arc: + NewItem(VPieceNode(id, Tool::NodeArc, reverse)); + break; + case SceneObject::Point: + NewItem(VPieceNode(id, Tool::NodePoint)); + break; + case SceneObject::Spline: + NewItem(VPieceNode(id, Tool::NodeSpline, reverse)); + break; + case SceneObject::SplinePath: + NewItem(VPieceNode(id, Tool::NodeSplinePath, reverse)); + break; + case (SceneObject::Line): + case (SceneObject::Detail): + case (SceneObject::Unknown): + default: + qDebug() << "Got wrong scene object. Ignore."; + break; + } + + ValidObjects(PathIsValid()); + + if (not m_showMode) + { +// auto visPath = qobject_cast(vis); +// SCASSERT(visPath != nullptr); +// const VPiecePath p = CreatePath(); +// visPath->SetPath(p); + +// if (p.CountNodes() == 1) +// { +// emit ToolTip(tr("Select main path objects, Shift - reverse direction curve, " +// "Enter - finish creation")); + +// visPath->VisualMode(NULL_ID); +// } +// else +// { +// visPath->RefreshGeometry(); +// } + } + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::ShowDialog(bool click) +{ + if (click == false) + { + emit ToolTip(""); + prepare = true; + + if (not m_showMode) + { +// auto visPath = qobject_cast(vis); +// SCASSERT(visPath != nullptr); +// visPath->SetMode(Mode::Show); +// visPath->RefreshGeometry(); + } + setModal(true); + show(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::SaveData() +{} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::CheckState() +{ + SCASSERT(bOk != nullptr); + bOk->setEnabled(flagName && flagError && ui->comboBoxPiece->count() > 0); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::ShowContextMenu(const QPoint &pos) +{ + const int row = ui->listWidget->currentRow(); + if (ui->listWidget->count() == 0 || row == -1 || row >= ui->listWidget->count()) + { + return; + } + + QMenu *menu = new QMenu(this); + QAction *actionDelete = menu->addAction(QIcon::fromTheme("edit-delete"), tr("Delete")); + actionDelete->setEnabled(m_showMode);//Because we can't undo this operation when creating a piece. + + QListWidgetItem *rowItem = ui->listWidget->item(row); + SCASSERT(rowItem != nullptr); + VPieceNode rowNode = qvariant_cast(rowItem->data(Qt::UserRole)); + + QAction *actionReverse = nullptr; + if (rowNode.GetTypeTool() != Tool::NodePoint) + { + actionReverse = menu->addAction(tr("Reverse")); + actionReverse->setCheckable(true); + actionReverse->setChecked(rowNode.GetReverse()); + } + + QAction *selectedAction = menu->exec(ui->listWidget->viewport()->mapToGlobal(pos)); + if (selectedAction == actionDelete) + { + delete ui->listWidget->item(row); + ValidObjects(PathIsValid()); + } + else if (selectedAction == actionReverse) + { + rowNode.SetReverse(not rowNode.GetReverse()); + rowItem->setData(Qt::UserRole, QVariant::fromValue(rowNode)); + rowItem->setText(GetNodeName(rowNode)); + ValidObjects(PathIsValid()); + } + + ListChanged(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::ListChanged() +{ + if (not m_showMode) + { +// auto visPath = qobject_cast(vis); +// SCASSERT(visPath != nullptr); +// visPath->SetPiece(CreatePath()); +// visPath->RefreshGeometry(); + } +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::NameChanged() +{ + if (ui->lineEditName->text().isEmpty()) + { + flagName = false; + ChangeColor(ui->labelName, Qt::red); + } + else + { + flagName = true; + ChangeColor(ui->labelName, okColor); + } + CheckState(); +} + +//--------------------------------------------------------------------------------------------------------------------- +//VPiecePath DialogPiecePath::GetPiecePath() const +//{ + +//} + +//--------------------------------------------------------------------------------------------------------------------- +//void DialogPiecePath::SetPiecePath(const VPiecePath &path) +//{ + +//} + +//--------------------------------------------------------------------------------------------------------------------- +//VPiecePath DialogPiecePath::CreatePath() const +//{ + +//} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogPiecePath::PathIsValid() const +{ +// QString url = DialogWarningIcon(); + +// if(CreatePath().Points(data).count() < 2) +// { +// url += tr("You need more points!"); +// ui->helpLabel->setText(url); +// return false; +// } +// else +// { +// if (FirstPointEqualLast(ui->listWidget)) +// { +// url += tr("First point cannot be equal to the last point!"); +// ui->helpLabel->setText(url); +// return false; +// } +// else if (DoublePoints(ui->listWidget)) +// { +// url += tr("You have double points!"); +// ui->helpLabel->setText(url); +// return false; +// } +// } + ui->helpLabel->setText(tr("Ready!")); + return true; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::ValidObjects(bool value) +{ + flagError = value; + CheckState(); +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogPiecePath::NewItem(const VPieceNode &node) +{ + NewNodeItem(ui->listWidget, node); +} diff --git a/src/libs/vtools/dialogs/tools/dialogpiecepath.h b/src/libs/vtools/dialogs/tools/dialogpiecepath.h new file mode 100644 index 000000000..f1d10f965 --- /dev/null +++ b/src/libs/vtools/dialogs/tools/dialogpiecepath.h @@ -0,0 +1,77 @@ +/************************************************************************ + ** + ** @file dialogpiecepath.h + ** @author Roman Telezhynskyi + ** @date 22 11, 2016 + ** + ** @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) 2016 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 DIALOGPIECEPATH_H +#define DIALOGPIECEPATH_H + +#include "dialogtool.h" + +namespace Ui +{ + class DialogPiecePath; +} + +class DialogPiecePath : public DialogTool +{ + Q_OBJECT +public: + explicit DialogPiecePath(const VContainer *data, quint32 toolId, QWidget *parent = nullptr); + virtual ~DialogPiecePath(); + + void DisableShowMode(bool disable); + +// VPiecePath GetPiecePath() const; +// void SetPiecePath(const VPiecePath &path); + +public slots: + virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE; + virtual void ShowDialog(bool click) Q_DECL_OVERRIDE; + +protected: + /** @brief SaveData Put dialog data in local variables */ + virtual void SaveData() Q_DECL_OVERRIDE; + virtual void CheckState() Q_DECL_OVERRIDE; + +private slots: + void ShowContextMenu(const QPoint &pos); + void ListChanged(); + void NameChanged(); + +private: + Q_DISABLE_COPY(DialogPiecePath) + Ui::DialogPiecePath *ui; + bool m_showMode; + +// VPiecePath CreatePath() const; + + bool PathIsValid() const; + void ValidObjects(bool value); + void NewItem(const VPieceNode &node); +}; + +#endif // DIALOGPIECEPATH_H diff --git a/src/libs/vtools/dialogs/tools/dialogpiecepath.ui b/src/libs/vtools/dialogs/tools/dialogpiecepath.ui new file mode 100644 index 000000000..6ae015961 --- /dev/null +++ b/src/libs/vtools/dialogs/tools/dialogpiecepath.ui @@ -0,0 +1,128 @@ + + + DialogPiecePath + + + + 0 + 0 + 365 + 337 + + + + Dialog + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + Name: + + + + + + + Unnamed path + + + Create name for your path + + + + + + + Type: + + + + + + + + + + Piece: + + + + + + + + + + + + QAbstractItemView::InternalMove + + + + + + + Ready! + + + Qt::RichText + + + false + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + DialogPiecePath + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + DialogPiecePath + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/libs/vtools/dialogs/tools/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/dialogseamallowance.cpp index f263e5a15..870061ff1 100644 --- a/src/libs/vtools/dialogs/tools/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/dialogseamallowance.cpp @@ -31,7 +31,6 @@ #include "../vpatterndb/vpiecenode.h" #include "visualization/path/vistoolpiece.h" -#include #include //--------------------------------------------------------------------------------------------------------------------- @@ -453,69 +452,13 @@ VPiece DialogSeamAllowance::CreatePiece() const //--------------------------------------------------------------------------------------------------------------------- void DialogSeamAllowance::NewItem(const VPieceNode &node) { - SCASSERT(node.GetId() > NULL_ID); - QString name; - switch (node.GetTypeTool()) - { - case (Tool::NodePoint): - case (Tool::NodeArc): - case (Tool::NodeSpline): - case (Tool::NodeSplinePath): - { - name = GetNodeName(node); - break; - } - default: - qDebug()<<"Got wrong tools. Ignore."; - return; - } - - - - bool canAddNewPoint = false; - - if(ui->listWidget->count() == 0) - { - canAddNewPoint = true; - } - else - { - if(RowId(ui->listWidget->count()-1) != node.GetId()) - { - canAddNewPoint = true; - } - } - - if(canAddNewPoint) - { - QListWidgetItem *item = new QListWidgetItem(name); - item->setFont(QFont("Times", 12, QFont::Bold)); - item->setData(Qt::UserRole, QVariant::fromValue(node)); - ui->listWidget->addItem(item); - ui->listWidget->setCurrentRow(ui->listWidget->count()-1); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -quint32 DialogSeamAllowance::RowId(int i) const -{ - const QListWidgetItem *rowItem = ui->listWidget->item(i); - SCASSERT(rowItem != nullptr); - const VPieceNode rowNode = qvariant_cast(rowItem->data(Qt::UserRole)); - return rowNode.GetId(); + NewNodeItem(ui->listWidget, node); } //--------------------------------------------------------------------------------------------------------------------- bool DialogSeamAllowance::MainPathIsValid() const { - const QIcon icon = QIcon::fromTheme("dialog-warning", - QIcon(":/icons/win.icon.theme/16x16/status/dialog-warning.png")); - - const QPixmap pixmap = icon.pixmap(QSize(16, 16)); - QByteArray byteArray; - QBuffer buffer(&byteArray); - pixmap.save(&buffer, "PNG"); - QString url = QString(" "); + QString url = DialogWarningIcon(); if(CreatePiece().MainPathPoints(data).count() < 3) { @@ -531,23 +474,17 @@ bool DialogSeamAllowance::MainPathIsValid() const ui->helpLabel->setText(url); return false; } - if (FirstPointEqualLast()) + if (FirstPointEqualLast(ui->listWidget)) { url += tr("First point cannot be equal to the last point!"); ui->helpLabel->setText(url); return false; } - else + else if (DoublePoints(ui->listWidget)) { - for (int i=0, sz = ui->listWidget->count()-1; ihelpLabel->setText(url); - return false; - } - } + url += tr("You have double points!"); + ui->helpLabel->setText(url); + return false; } } ui->helpLabel->setText(tr("Ready!")); @@ -561,23 +498,6 @@ void DialogSeamAllowance::ValidObjects(bool value) CheckState(); } -//--------------------------------------------------------------------------------------------------------------------- -bool DialogSeamAllowance::FirstPointEqualLast() const -{ - if (ui->listWidget->count() > 1) - { - if (RowId(0) == RowId(ui->listWidget->count()-1)) - { - return true; - } - else - { - return false; - } - } - return false; -} - //--------------------------------------------------------------------------------------------------------------------- bool DialogSeamAllowance::MainPathIsClockwise() const { @@ -596,20 +516,6 @@ bool DialogSeamAllowance::MainPathIsClockwise() const return false; } -//--------------------------------------------------------------------------------------------------------------------- -QString DialogSeamAllowance::GetNodeName(const VPieceNode &node) const -{ - const QSharedPointer obj = data->GeometricObject(node.GetId()); - QString name = obj->name(); - - if (node.GetTypeTool() != Tool::NodePoint && node.GetReverse()) - { - name = QLatin1String("- ") + name; - } - - return name; -} - //--------------------------------------------------------------------------------------------------------------------- void DialogSeamAllowance::InitNodesList() { diff --git a/src/libs/vtools/dialogs/tools/dialogseamallowance.h b/src/libs/vtools/dialogs/tools/dialogseamallowance.h index 35e903df1..114967881 100644 --- a/src/libs/vtools/dialogs/tools/dialogseamallowance.h +++ b/src/libs/vtools/dialogs/tools/dialogseamallowance.h @@ -81,12 +81,9 @@ private: VPiece CreatePiece() const; void NewItem(const VPieceNode &node); - quint32 RowId(int i) const; bool MainPathIsValid() const; void ValidObjects(bool value); - bool FirstPointEqualLast() const; bool MainPathIsClockwise() const; - QString GetNodeName(const VPieceNode &node) const; void InitNodesList(); void InitNodeAngles(); diff --git a/src/libs/vtools/dialogs/tools/dialogseamallowance.ui b/src/libs/vtools/dialogs/tools/dialogseamallowance.ui index bb48c8e31..6af522a18 100644 --- a/src/libs/vtools/dialogs/tools/dialogseamallowance.ui +++ b/src/libs/vtools/dialogs/tools/dialogseamallowance.ui @@ -14,14 +14,14 @@ Dialog - + :/icon/64x64/icon64x64.png:/icon/64x64/icon64x64.png - 1 + 0 @@ -42,7 +42,7 @@ - :/icon/32x32/clockwise.png + :/icon/32x32/clockwise.png @@ -301,9 +301,7 @@ - - - + buttonBox diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 4e6a92039..11f9d808f 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include "../ifc/xml/vdomdocument.h" #include "../qmuparser/qmudef.h" @@ -66,6 +67,7 @@ #include "../vpatterndb/calculator.h" #include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vtranslatevars.h" +#include "../vpatterndb/vpiecenode.h" #include "../../tools/vabstracttool.h" #include "../ifc/xml/vabstractpattern.h" #include "../vgeometry/vabstractcurve.h" @@ -392,6 +394,114 @@ quint32 DialogTool::DNumber(const QString &baseName) const return num; } +//--------------------------------------------------------------------------------------------------------------------- +quint32 DialogTool::RowId(QListWidget *listWidget, int i) +{ + SCASSERT(listWidget != nullptr); + const QListWidgetItem *rowItem = listWidget->item(i); + SCASSERT(rowItem != nullptr); + const VPieceNode rowNode = qvariant_cast(rowItem->data(Qt::UserRole)); + return rowNode.GetId(); +} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogTool::FirstPointEqualLast(QListWidget *listWidget) +{ + SCASSERT(listWidget != nullptr); + if (listWidget->count() > 1) + { + return RowId(listWidget, 0) == RowId(listWidget, listWidget->count()-1); + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool DialogTool::DoublePoints(QListWidget *listWidget) +{ + SCASSERT(listWidget != nullptr); + for (int i=0, sz = listWidget->count()-1; i "); + return url; +} + +//--------------------------------------------------------------------------------------------------------------------- +QString DialogTool::GetNodeName(const VPieceNode &node) const +{ + const QSharedPointer obj = data->GeometricObject(node.GetId()); + QString name = obj->name(); + + if (node.GetTypeTool() != Tool::NodePoint && node.GetReverse()) + { + name = QLatin1String("- ") + name; + } + + return name; +} + +//--------------------------------------------------------------------------------------------------------------------- +void DialogTool::NewNodeItem(QListWidget *listWidget, const VPieceNode &node) +{ + SCASSERT(listWidget != nullptr); + SCASSERT(node.GetId() > NULL_ID); + QString name; + switch (node.GetTypeTool()) + { + case (Tool::NodePoint): + case (Tool::NodeArc): + case (Tool::NodeSpline): + case (Tool::NodeSplinePath): + { + name = GetNodeName(node); + break; + } + default: + qDebug()<<"Got wrong tools. Ignore."; + return; + } + + bool canAddNewPoint = false; + + if(listWidget->count() == 0) + { + canAddNewPoint = true; + } + else + { + if(RowId(listWidget, listWidget->count()-1) != node.GetId()) + { + canAddNewPoint = true; + } + } + + if(canAddNewPoint) + { + QListWidgetItem *item = new QListWidgetItem(name); + item->setFont(QFont("Times", 12, QFont::Bold)); + item->setData(Qt::UserRole, QVariant::fromValue(node)); + listWidget->addItem(item); + listWidget->setCurrentRow(listWidget->count()-1); + } +} + //--------------------------------------------------------------------------------------------------------------------- bool DialogTool::IsSplinePath(const QSharedPointer &obj) const { diff --git a/src/libs/vtools/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h index cc5d29af8..313f45c34 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.h +++ b/src/libs/vtools/dialogs/tools/dialogtool.h @@ -274,6 +274,14 @@ protected: void MoveCursorToEnd(QPlainTextEdit *plainTextEdit); virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE; quint32 DNumber(const QString &baseName) const; + + static quint32 RowId(QListWidget *listWidget, int i); + static bool FirstPointEqualLast(QListWidget *listWidget); + static bool DoublePoints(QListWidget *listWidget); + static QString DialogWarningIcon(); + + QString GetNodeName(const VPieceNode &node) const; + void NewNodeItem(QListWidget *listWidget, const VPieceNode &node); private: void FillList(QComboBox *box, const QMap &list)const;