Working with group widget.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-04-07 17:57:53 +03:00
parent fe3bd88c17
commit 48e411a3ce
21 changed files with 545 additions and 15 deletions

View File

@ -17,7 +17,8 @@ HEADERS += \
$$PWD/configpages/pathpage.h \
$$PWD/dialoglayoutsettings.h \
$$PWD/dialoglayoutprogress.h \
$$PWD/dialogsavelayout.h
$$PWD/dialogsavelayout.h \
$$PWD/vwidgetgroups.h
SOURCES += \
$$PWD/dialogincrements.cpp \
@ -33,7 +34,8 @@ SOURCES += \
$$PWD/configpages/pathpage.cpp \
$$PWD/dialoglayoutsettings.cpp \
$$PWD/dialoglayoutprogress.cpp \
$$PWD/dialogsavelayout.cpp
$$PWD/dialogsavelayout.cpp \
$$PWD/vwidgetgroups.cpp
FORMS += \
$$PWD/dialogincrements.ui \
@ -44,4 +46,5 @@ FORMS += \
$$PWD/dialogpatternxmledit.ui \
$$PWD/dialoglayoutsettings.ui \
$$PWD/dialoglayoutprogress.ui \
$$PWD/dialogsavelayout.ui
$$PWD/dialogsavelayout.ui \
$$PWD/vwidgetgroups.ui

View File

@ -0,0 +1,159 @@
/************************************************************************
**
** @file vwidgetgroups.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 6 4, 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
** <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 "vwidgetgroups.h"
#include "ui_vwidgetgroups.h"
#include "../vtools/dialogs/tools/dialoggroup.h"
#include "../vtools/undocommands/delgroup.h"
#include <QMenu>
//---------------------------------------------------------------------------------------------------------------------
VWidgetGroups::VWidgetGroups(VAbstractPattern *doc, QWidget *parent)
: QWidget(parent),
ui(new Ui::VWidgetGroups),
doc(doc)
{
ui->setupUi(this);
FillTable(doc->GetGroups());
ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->tableWidget, &QTableWidget::cellClicked, this, &VWidgetGroups::GroupVisibilityChanged);
connect(ui->tableWidget, &QTableWidget::customContextMenuRequested, this, &VWidgetGroups::CtxMenu);
}
//---------------------------------------------------------------------------------------------------------------------
VWidgetGroups::~VWidgetGroups()
{
delete ui;
}
//---------------------------------------------------------------------------------------------------------------------
void VWidgetGroups::GroupVisibilityChanged(int row, int column)
{
if (column != 0)
{
return;
}
QTableWidgetItem *item = ui->tableWidget->item(row, column);
const quint32 id = item->data(Qt::UserRole).toUInt();
const bool visible = not doc->GetGroupVisivility(id);
doc->SetGroupVisivility(id, visible);
if (visible)
{
item->setIcon(QIcon("://icon/16x16/open_eye.png"));
}
else
{
item->setIcon(QIcon("://icon/16x16/closed_eye.png"));
}
}
//---------------------------------------------------------------------------------------------------------------------
void VWidgetGroups::CtxMenu(const QPoint &pos)
{
QTableWidgetItem *item = ui->tableWidget->itemAt(pos);
if(not item)
{
return;
}
const int row = item->row();
item = ui->tableWidget->item(row, 0);
const quint32 id = item->data(Qt::UserRole).toUInt();
QMenu *menu = new QMenu;
QAction *actionRename = menu->addAction(tr("Rename"));
QAction *actionDelete = menu->addAction(tr("Delete"));
QAction *selectedAction = menu->exec(ui->tableWidget->viewport()->mapToGlobal(pos));
if (selectedAction == actionRename)
{
DialogGroup *dialog = new DialogGroup(new VContainer(qApp->TrVars(), qApp->patternUnitP()), NULL_ID, this);
dialog->SetName(doc->GetGroupName(id));
const int result = dialog->exec();
if (result == QDialog::Accepted)
{
doc->SetGroupName(id, dialog->GetName());
item = ui->tableWidget->item(row, 1);
item->setText(dialog->GetName());
}
delete dialog;
}
else if (selectedAction == actionDelete)
{
DelGroup *delGroup = new DelGroup(doc, id);
connect(delGroup, &DelGroup::UpdateGroups, this, &VWidgetGroups::UpdateGroups);
qApp->getUndoStack()->push(delGroup);
}
}
//---------------------------------------------------------------------------------------------------------------------
void VWidgetGroups::UpdateGroups()
{
FillTable(doc->GetGroups());
}
//---------------------------------------------------------------------------------------------------------------------
void VWidgetGroups::FillTable(const QMap<quint32, QPair<QString, bool> > &groups)
{
ui->tableWidget->clear();
ui->tableWidget->setColumnCount(2);
ui->tableWidget->setRowCount(groups.size());
qint32 currentRow = -1;
auto i = groups.constBegin();
while (i != groups.constEnd())
{
++currentRow;
const QPair<QString, bool> data = i.value();
QTableWidgetItem *item = new QTableWidgetItem();
item->setTextAlignment(Qt::AlignHCenter);
if (data.second)
{
item->setIcon(QIcon("://icon/16x16/open_eye.png"));
}
else
{
item->setIcon(QIcon("://icon/16x16/closed_eye.png"));
}
item->setData(Qt::UserRole, i.key());
ui->tableWidget->setItem(currentRow, 0, item);
item = new QTableWidgetItem(data.first);
item->setTextAlignment(Qt::AlignLeft);
ui->tableWidget->setItem(currentRow, 1, item);
++i;
}
ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->resizeRowsToContents();
}

View File

@ -0,0 +1,62 @@
/************************************************************************
**
** @file vwidgetgroups.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 6 4, 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
** <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 VWIDGETGROUPS_H
#define VWIDGETGROUPS_H
#include <QWidget>
#include "../ifc/xml/vabstractpattern.h"
namespace Ui
{
class VWidgetGroups;
}
class VWidgetGroups : public QWidget
{
Q_OBJECT
public:
explicit VWidgetGroups(VAbstractPattern *doc, QWidget *parent = nullptr);
virtual ~VWidgetGroups();
public slots:
void UpdateGroups();
private slots:
void GroupVisibilityChanged(int row, int column);
void CtxMenu(const QPoint &pos);
private:
Q_DISABLE_COPY(VWidgetGroups)
Ui::VWidgetGroups *ui;
VAbstractPattern *doc;
void FillTable(const QMap<quint32, QPair<QString, bool> > &groups);
};
#endif // VWIDGETGROUPS_H

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>VWidgetGroups</class>
<widget class="QWidget" name="VWidgetGroups">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>371</width>
<height>279</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableWidget" name="tableWidget">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>16</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>10</number>
</attribute>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -54,6 +54,7 @@
#include "tools/vtooldetail.h"
#include "tools/vtooluniondetails.h"
#include "dialogs/dialogs.h"
#include "dialogs/vwidgetgroups.h"
#include "../vtools/undocommands/addgroup.h"
#include <QInputDialog>
@ -119,7 +120,9 @@ MainWindow::MainWindow(QWidget *parent)
separatorAct(nullptr),
leftGoToStage(nullptr), rightGoToStage(nullptr), autoSaveTimer(nullptr), guiEnabled(true),
gradationHeights(nullptr), gradationSizes(nullptr), gradationHeightsLabel(nullptr), gradationSizesLabel(nullptr),
toolOptions(nullptr), lock(nullptr)
toolOptions(nullptr),
groupsWidget(nullptr),
lock(nullptr)
{
for (int i = 0; i < MaxRecentFiles; ++i)
{
@ -154,7 +157,7 @@ MainWindow::MainWindow(QWidget *parent)
ui->toolBox->setCurrentIndex(0);
ReadSettings();
PropertyBrowser();
InitDocksContain();
setCurrentFile("");
WindowsLocale();
@ -1001,6 +1004,7 @@ void MainWindow::ClosedDialogUnionDetails(int result)
void MainWindow::ToolGroup(bool checked)
{
ToolSelectGroupObjects();
currentScene->clearSelection();
SetToolButton<DialogGroup>(checked, Tool::Group, ":/cursor/group_plus_cursor.png",
tr("Select objects, <b>Enter</b> - finish creation"), &MainWindow::ClosedDialogGroup);
}
@ -1020,6 +1024,7 @@ void MainWindow::ClosedDialogGroup(int result)
if (not group.isNull())
{
AddGroup *addGroup = new AddGroup(group, doc);
connect(addGroup, &AddGroup::UpdateGroups, groupsWidget, &VWidgetGroups::UpdateGroups);
qApp->getUndoStack()->push(addGroup);
}
}
@ -1733,7 +1738,7 @@ void MainWindow::InitToolButtons()
connect(ui->toolButtonPointFromArcAndTangent, &QToolButton::clicked, this, &MainWindow::ToolPointFromArcAndTangent);
connect(ui->toolButtonArcWithLength, &QToolButton::clicked, this, &MainWindow::ToolArcWithLength);
connect(ui->toolButtonTrueDarts, &QToolButton::clicked, this, &MainWindow::ToolTrueDarts);
connect(ui->toolButtonGroup, &QToolButton::clicked, this, &MainWindow::ToolGroup);
}
//---------------------------------------------------------------------------------------------------------------------
@ -3551,13 +3556,17 @@ void MainWindow::AddDocks()
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::PropertyBrowser()
void MainWindow::InitDocksContain()
{
qCDebug(vMainWindow, "Initialization property browser.");
toolOptions = new VToolOptionsPropertyBrowser(ui->dockWidgetToolOptions);
connect(ui->view, &VMainGraphicsView::itemClicked, toolOptions, &VToolOptionsPropertyBrowser::itemClicked);
connect(doc, &VPattern::FullUpdateFromFile, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions);
qCDebug(vMainWindow, "Initialization groups dock.");
groupsWidget = new VWidgetGroups(doc, this);
ui->dockWidgetGroups->setWidget(groupsWidget);
}
//---------------------------------------------------------------------------------------------------------------------
@ -4140,6 +4149,7 @@ void MainWindow::ChangePP(int index, bool zoomBestFit)
}
}
toolOptions->itemClicked(nullptr);//hide options for tool in previous pattern piece
groupsWidget->UpdateGroups();
}
}
@ -4724,7 +4734,7 @@ void MainWindow::ToolSelectGroupObjects() const
emit ItemsSelection(SelectionType::ByMouseRelease);
ui->view->AllowRubberBand(false);
ui->view->AllowRubberBand(true);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -48,6 +48,7 @@ class QLabel;
class DialogIncrements;
class DialogTool;
class DialogHistory;
class VWidgetGroups;
/**
* @brief The MainWindow class main windows.
@ -276,6 +277,7 @@ private:
QPointer<QLabel> gradationHeightsLabel;
QPointer<QLabel> gradationSizesLabel;
VToolOptionsPropertyBrowser *toolOptions;
VWidgetGroups *groupsWidget;
std::shared_ptr<VLockGuard<char>> lock;
void SetDefaultHeight();
@ -333,7 +335,7 @@ private:
void UpdateSizesList(const QStringList &list);
void AddDocks();
void PropertyBrowser();
void InitDocksContain();
bool OpenNewValentina(const QString &fileName = QString())const;
void FileClosedCorrect();
QStringList GetUnlokedRestoreFileList()const;

View File

@ -323,8 +323,9 @@ void VAbstractPattern::ParseGroups(const QDomElement &domElement)
itemTool.insert(i.key(), i.value());
}
const bool previous = itemVisibility.value(i.key(), true);
const bool previous = itemVisibility.value(i.key(), false);
itemVisibility.insert(i.key(), previous || groupData.first);
++i;
}
}
}
@ -340,6 +341,7 @@ void VAbstractPattern::ParseGroups(const QDomElement &domElement)
VDataTool* tool = tools.value(i.value());
tool->GroupVisibility(i.key(), itemVisibility.value(i.key(), true));
}
++i;
}
}
@ -1478,9 +1480,9 @@ QDomElement VAbstractPattern::CreateGroup(quint32 id, const QString &name, const
}
QDomElement group = createElement(TagGroup);
group.setAttribute(AttrId, id);
group.setAttribute(AttrName, name);
group.setAttribute(AttrVisible, trueStr);
SetAttribute(group, AttrId, id);
SetAttribute(group, AttrName, name);
SetAttribute(group, AttrVisible, true);
auto i = groupData.constBegin();
while (i != groupData.constEnd())
@ -1495,6 +1497,38 @@ QDomElement VAbstractPattern::CreateGroup(quint32 id, const QString &name, const
return group;
}
//---------------------------------------------------------------------------------------------------------------------
QString VAbstractPattern::GetGroupName(quint32 id)
{
QString name = tr("New group");
QDomElement groups = CreateGroups();
if (not groups.isNull())
{
QDomElement group = elementById(id);
if (group.isElement())
{
name = GetParametrString(group, AttrName, name);
return name;
}
else
{
if (groups.childNodes().isEmpty())
{
QDomNode parent = groups.parentNode();
parent.removeChild(groups);
}
qDebug("Can't get group by id = %u.", id);
return name;
}
}
else
{
qDebug("Can't get tag Groups.");
return name;
}
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::SetGroupName(quint32 id, const QString &name)
{
@ -1526,3 +1560,78 @@ void VAbstractPattern::SetGroupName(quint32 id, const QString &name)
return;
}
}
//---------------------------------------------------------------------------------------------------------------------
QMap<quint32, QPair<QString, bool> > VAbstractPattern::GetGroups()
{
QMap<quint32, QPair<QString, bool> > data;
QDomElement groups = CreateGroups();
if (not groups.isNull())
{
QDomNode domNode = groups.firstChild();
while (domNode.isNull() == false)
{
if (domNode.isElement())
{
const QDomElement group = domNode.toElement();
if (group.isNull() == false)
{
if (group.tagName() == TagGroup)
{
const quint32 id = GetParametrUInt(group, AttrId, "0");
const bool visible = GetParametrBool(group, AttrVisible, trueStr);
const QString name = GetParametrString(group, AttrName, tr("New group"));
data.insert(id, qMakePair(name, visible));
}
}
}
domNode = domNode.nextSibling();
}
}
else
{
qDebug("Can't get tag Groups.");
}
return data;
}
//---------------------------------------------------------------------------------------------------------------------
bool VAbstractPattern::GetGroupVisivility(quint32 id)
{
QDomElement group = elementById(id);
if (group.isElement())
{
return GetParametrBool(group, AttrVisible, trueStr);
}
else
{
qDebug("Can't get group by id = %u.", id);
return true;
}
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::SetGroupVisivility(quint32 id, bool visible)
{
QDomElement group = elementById(id);
if (group.isElement())
{
SetAttribute(group, AttrVisible, visible);
modified = true;
emit patternChanged(false);
QDomElement groups = CreateGroups();
if (not groups.isNull())
{
ParseGroups(groups);
}
}
else
{
qDebug("Can't get group by id = %u.", id);
return;
}
}

View File

@ -67,8 +67,6 @@ public:
bool GetActivDrawElement(QDomElement &element) const;
bool GetActivNodeElement(const QString& name, QDomElement& element) const;
void ParseGroups(const QDomElement &domElement);
quint32 getCursor() const;
void setCursor(const quint32 &value);
@ -116,9 +114,14 @@ public:
QDomElement GetDraw(const QString &name) const;
void ParseGroups(const QDomElement &domElement);
QDomElement CreateGroups();
QDomElement CreateGroup(quint32 id, const QString &name, const QMap<quint32, quint32> &groupData);
QString GetGroupName(quint32 id);
void SetGroupName(quint32 id, const QString &name);
QMap<quint32, QPair<QString, bool> > GetGroups();
bool GetGroupVisivility(quint32 id);
void SetGroupVisivility(quint32 id, bool visible);
static const QString TagPattern;
static const QString TagCalculation;

View File

@ -57,5 +57,9 @@
<file>icon/16x16/toolsectionpoint@2x.png</file>
<file>icon/16x16/operations.png</file>
<file>icon/16x16/operations@2x.png</file>
<file>icon/16x16/closed_eye.png</file>
<file>icon/16x16/closed_eye@2x.png</file>
<file>icon/16x16/open_eye.png</file>
<file>icon/16x16/open_eye@2x.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 32 32"
version="1.1"
x="0px"
y="0px"
id="svg2"
inkscape:version="0.91 r"
sodipodi:docname="closed_eye.svg"
width="32"
height="32"
inkscape:export-filename="/home/dismine/CAD/Valentina_groups/Valentina/src/libs/vmisc/share/resources/icon/svg/closed_eye.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45">
<metadata
id="metadata32">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Closed Eye</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs30" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1436"
inkscape:window-height="885"
id="namedview28"
showgrid="false"
inkscape:zoom="15.733333"
inkscape:cx="23.672261"
inkscape:cy="17.880242"
inkscape:window-x="75"
inkscape:window-y="34"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<title
id="title4">Closed Eye</title>
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
<g
id="g6"
style="fill:#000000;fill-rule:evenodd"
transform="matrix(1.9803301,0,0,2.3359228,0,3.0481403)">
<g
id="g8">
<g
id="g10"
style="fill:#000000">
<path
d="m 8.0719097,8.5 c 4.4579933,0 8.0719093,-4 8.0719093,-4 0,0 -3.613916,-4 -8.0719093,-4 C 3.6139169,0.5 0,4.5 0,4.5 c 0,0 3.6139169,4 8.0719097,4 z m 0,0"
id="path12"
inkscape:connector-curvature="0" />
<path
d="m 0.9330127,7.2059403 0,2 1,0 0,-2 -1,0 z m 0,0"
transform="matrix(0.81915204,0.57357644,-0.57357644,0.81915204,4.9658913,0.66208498)"
id="path14"
inkscape:connector-curvature="0" />
<path
d="m 13.933013,7.2059403 0,2 1,0 0,-2 -1,0 z m 0,0"
transform="matrix(0.81915204,-0.57357644,0.57357644,0.81915204,-2.0965529,9.7624636)"
id="path16"
inkscape:connector-curvature="0" />
<path
d="m 7.5,9.3 0,2 1,0 0,-2 -1,0 z m 0,0"
id="path18"
inkscape:connector-curvature="0" />
<path
d="m 10.998327,8.7083027 0,2.0000003 1,0 0,-2.0000003 -1,0 z m 0,0"
transform="matrix(0.94551858,-0.32556815,0.32556815,0.94551858,-2.5342691,4.2724113)"
id="path20"
inkscape:connector-curvature="0" />
<path
d="m 4.1436217,8.7146863 0,1.9999997 1,0 0,-1.9999997 -1,0 z m 0,0"
transform="matrix(0.94551858,0.32556815,-0.32556815,0.94551858,3.4157835,-0.98254551)"
id="path22"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32">
<path d="M16 6c-6.979 0-13.028 4.064-16 10 2.972 5.936 9.021 10 16 10s13.027-4.064 16-10c-2.972-5.936-9.021-10-16-10zM23.889 11.303c1.88 1.199 3.473 2.805 4.67 4.697-1.197 1.891-2.79 3.498-4.67 4.697-2.362 1.507-5.090 2.303-7.889 2.303s-5.527-0.796-7.889-2.303c-1.88-1.199-3.473-2.805-4.67-4.697 1.197-1.891 2.79-3.498 4.67-4.697 0.122-0.078 0.246-0.154 0.371-0.228-0.311 0.854-0.482 1.776-0.482 2.737 0 4.418 3.582 8 8 8s8-3.582 8-8c0-0.962-0.17-1.883-0.482-2.737 0.124 0.074 0.248 0.15 0.371 0.228v0zM16 13c0 1.657-1.343 3-3 3s-3-1.343-3-3 1.343-3 3-3 3 1.343 3 3z" fill="#444444"></path>
</svg>

After

Width:  |  Height:  |  Size: 877 B

View File

@ -66,6 +66,7 @@ VToolSinglePoint::VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quin
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolSinglePoint::contextMenuEvent);
connect(namePoint, &VGraphicsSimpleTextItem::DeleteTool, this, &VToolSinglePoint::DeleteFromLabel);
connect(namePoint, &VGraphicsSimpleTextItem::PointChoosed, this, &VToolSinglePoint::PointChoosed);
connect(namePoint, &VGraphicsSimpleTextItem::PointSelected, this, &VToolSinglePoint::PointSelected);
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolSinglePoint::NameChangePosition);
lineName = new QGraphicsLineItem(this);
this->setBrush(QBrush(Qt::NoBrush));
@ -174,6 +175,12 @@ void VToolSinglePoint::PointChoosed()
emit ChoosedTool(id, SceneObject::Point);
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSinglePoint::PointSelected(bool selected)
{
setSelected(selected);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief FullUpdateFromFile update tool data form file.

View File

@ -60,6 +60,7 @@ public slots:
virtual void Disable(bool disable, const QString &namePP) Q_DECL_OVERRIDE;
virtual void EnableToolMove(bool move) Q_DECL_OVERRIDE;
void PointChoosed();
void PointSelected(bool selected);
virtual void FullUpdateFromFile() Q_DECL_OVERRIDE;
virtual void DoChangePosition(quint32 id, qreal mx, qreal my) Q_DECL_OVERRIDE;
virtual void AllowHover(bool enabled) Q_DECL_OVERRIDE;

View File

@ -64,6 +64,7 @@ void AddGroup::undo()
qCDebug(vUndo, "Can't delete group.");
return;
}
emit UpdateGroups();
}
else
{
@ -99,6 +100,7 @@ void AddGroup::redo()
{
groups.appendChild(xml);
doc->ParseGroups(groups);
emit UpdateGroups();
}
else
{

View File

@ -39,6 +39,8 @@ public:
virtual ~AddGroup();
virtual void undo() Q_DECL_OVERRIDE;
virtual void redo() Q_DECL_OVERRIDE;
signals:
void UpdateGroups();
private:
Q_DISABLE_COPY(AddGroup)
const QString nameActivDraw;

View File

@ -57,6 +57,7 @@ void DelGroup::undo()
{
groups.appendChild(xml);
doc->ParseGroups(groups);
emit UpdateGroups();
}
else
{
@ -87,6 +88,7 @@ void DelGroup::redo()
qCDebug(vUndo, "Can't delete group.");
return;
}
emit UpdateGroups();
if (groups.childNodes().isEmpty())
{

View File

@ -39,6 +39,8 @@ public:
virtual ~DelGroup();
virtual void undo() Q_DECL_OVERRIDE;
virtual void redo() Q_DECL_OVERRIDE;
signals:
void UpdateGroups();
private:
Q_DISABLE_COPY(DelGroup)
const QString nameActivDraw;