Seamly2D
Code documentation
GroupsWidget Class Reference

#include <groups_widget.h>

Inheritance diagram for GroupsWidget:
Collaboration diagram for GroupsWidget:

Public Slots

void updateGroups ()
 
void showGroups (QMap< quint32, QString > groups)
 
void showAllGroups ()
 
void hideAllGroups ()
 
void lockAllGroups ()
 
void unlockAllGroups ()
 
void addGroupToList ()
 
void deleteGroupFromList ()
 
void editGroup ()
 
quint32 getGroupId ()
 
QString getCurrentGroupName ()
 
void setAddGroupEnabled (bool value)
 
void clear ()
 

Public Member Functions

 GroupsWidget (VContainer *data, VAbstractPattern *doc, QWidget *parent=nullptr)
 
virtual ~GroupsWidget ()
 

Private Slots

void groupVisibilityChanged (int row, int column)
 
void groupLockChanged (int row, int column)
 
void renameGroup (int row, int column)
 
void groupContextMenu (const QPoint &pos)
 
void draftBlockHasGroups (bool value)
 

Private Member Functions

void fillTable (const QMap< quint32, GroupAttributes > &groups)
 
void fillGroupItemList ()
 
void addGroupItem (const quint32 &toolId, const quint32 &objId, const Tool &tooltype)
 addGroupItem Add group item with description in listwidget. More...
 
void groupItemContextMenu (const QPoint &pos)
 ContextMenu show context menu for group objects. More...
 
void itemDoubleClicked (QListWidgetItem *item)
 Handle double clicking of list item. More...
 
void zoomToObject (QSharedPointer< VPointF > point)
 zoomToObject zoom to selected (point) object. More...
 
void setGroupVisibility (QTableWidgetItem *item, const quint32 &groupId, const bool &visible)
 
QString getPointName (quint32 pointId)
 getPointName get the name of the point by tool id. More...
 
quint32 attrUInt (const QDomElement &domElement, const QString &name)
 attrUInt get unsigned integer attribute. More...
 
QString getObjName (quint32 id)
 getObjName get the name of the graphics object. More...
 
void splitterMoved (int pos, int index)
 splitterMoved Save splitter state whenever it's moved. More...
 
void headerClicked (int index)
 headerClicked Sort state whenever header section clicked. More...
 

Private Attributes

Ui::GroupsWidget * ui
 
VAbstractPatternm_doc
 
VContainerm_data
 
bool m_patternHasGroups
 
quint32 m_currentGroupId
 

Detailed Description

Definition at line 72 of file groups_widget.h.

Constructor & Destructor Documentation

◆ GroupsWidget()

◆ ~GroupsWidget()

GroupsWidget::~GroupsWidget ( )
virtual

Definition at line 148 of file groups_widget.cpp.

References ui.

Member Function Documentation

◆ addGroupItem()

◆ addGroupToList

◆ attrUInt()

quint32 GroupsWidget::attrUInt ( const QDomElement &  domElement,
const QString &  name 
)
private

attrUInt get unsigned integer attribute.

Parameters
domElementDom Element.
nameName of Attribute.
Returns
unsigned interger.

Definition at line 1079 of file groups_widget.cpp.

References VDomDocument::GetParametrUInt(), and m_doc.

Referenced by itemDoubleClicked().

◆ clear

void GroupsWidget::clear ( )
slot

Definition at line 685 of file groups_widget.cpp.

References ui.

Referenced by MainWindow::CleanLayout().

◆ deleteGroupFromList

void GroupsWidget::deleteGroupFromList ( )
slot

◆ draftBlockHasGroups

void GroupsWidget::draftBlockHasGroups ( bool  value)
privateslot

Definition at line 667 of file groups_widget.cpp.

References m_patternHasGroups, and ui.

Referenced by GroupsWidget().

◆ editGroup

◆ fillGroupItemList()

◆ fillTable()

void GroupsWidget::fillTable ( const QMap< quint32, GroupAttributes > &  groups)
private

◆ getCurrentGroupName

QString GroupsWidget::getCurrentGroupName ( )
slot

Definition at line 705 of file groups_widget.cpp.

References ui.

Referenced by fillGroupItemList().

◆ getGroupId

quint32 GroupsWidget::getGroupId ( )
slot

Definition at line 692 of file groups_widget.cpp.

References ui.

Referenced by deleteGroupFromList(), groupItemContextMenu(), and zoomToObject().

◆ getObjName()

QString GroupsWidget::getObjName ( quint32  toolId)
private

getObjName get the name of the graphics object.

Parameters
toolIdId of the tool the object belongs to.
Returns
name of object.

Definition at line 1090 of file groups_widget.cpp.

References VException::DetailedInformation(), VExceptionBadId::ErrorMessage(), VContainer::GetGObject(), and m_data.

◆ getPointName()

QT_WARNING_POP QString GroupsWidget::getPointName ( quint32  toolId)
private

getPointName get the name of the point by tool id.

Parameters
toolIdId of the tool the object belongs to.
Returns
name of point.

Definition at line 1067 of file groups_widget.cpp.

References VContainer::GeometricObject(), and m_data.

◆ groupContextMenu

◆ groupItemContextMenu()

void GroupsWidget::groupItemContextMenu ( const QPoint &  pos)
private

◆ groupLockChanged

void GroupsWidget::groupLockChanged ( int  row,
int  column 
)
privateslot

Definition at line 169 of file groups_widget.cpp.

References VAbstractPattern::getGroupLock(), m_doc, VAbstractPattern::setGroupLock(), and ui.

Referenced by GroupsWidget().

◆ groupVisibilityChanged

void GroupsWidget::groupVisibilityChanged ( int  row,
int  column 
)
privateslot

◆ headerClicked()

void GroupsWidget::headerClicked ( int  index)
private

headerClicked Sort state whenever header section clicked.

Parameters
index

Definition at line 1371 of file groups_widget.cpp.

Referenced by GroupsWidget().

◆ hideAllGroups

void GroupsWidget::hideAllGroups ( )
slot

◆ itemDoubleClicked()

void GroupsWidget::itemDoubleClicked ( QListWidgetItem *  item)
private

◆ lockAllGroups

void GroupsWidget::lockAllGroups ( )
slot

Definition at line 271 of file groups_widget.cpp.

References m_doc, VAbstractPattern::setGroupLock(), and ui.

Referenced by GroupsWidget(), and MainWindow::lockAllGroups().

◆ renameGroup

void GroupsWidget::renameGroup ( int  row,
int  column 
)
privateslot

◆ setAddGroupEnabled

void GroupsWidget::setAddGroupEnabled ( bool  value)
slot

Definition at line 680 of file groups_widget.cpp.

References ui.

Referenced by MainWindow::SetEnableWidgets().

◆ setGroupVisibility()

void GroupsWidget::setGroupVisibility ( QTableWidgetItem *  item,
const quint32 &  groupId,
const bool &  visible 
)
private

◆ showAllGroups

void GroupsWidget::showAllGroups ( )
slot

◆ showGroups

void GroupsWidget::showGroups ( QMap< quint32, QString >  groups)
slot

Definition at line 208 of file groups_widget.cpp.

References setGroupVisibility(), ui, and updateGroups().

Referenced by zoomToObject(), and MainWindow::zoomToPoint().

◆ splitterMoved()

void GroupsWidget::splitterMoved ( int  pos,
int  index 
)
private

splitterMoved Save splitter state whenever it's moved.

Parameters
pos
index

Definition at line 1357 of file groups_widget.cpp.

References ui.

Referenced by GroupsWidget().

◆ unlockAllGroups

void GroupsWidget::unlockAllGroups ( )
slot

Definition at line 287 of file groups_widget.cpp.

References m_doc, VAbstractPattern::setGroupLock(), and ui.

Referenced by GroupsWidget(), and MainWindow::unlockAllGroups().

◆ updateGroups

◆ zoomToObject()

void GroupsWidget::zoomToObject ( QSharedPointer< VPointF point)
private

zoomToObject zoom to selected (point) object.

Parameters
pointIf selected list item is a point use the item's toolId. if the list item is a curve or line then use the tool's first point.

Definition at line 1304 of file groups_widget.cpp.

References getGroupId(), VAbstractPattern::getGroupsContainingItem(), VAbstractPattern::getTool(), m_doc, NULL_ID, qApp, SCASSERT, setGroupVisibility(), showGroups(), ui, and VMainGraphicsView::zoomByScale().

Referenced by itemDoubleClicked().

Member Data Documentation

◆ m_currentGroupId

quint32 GroupsWidget::m_currentGroupId
private

Definition at line 108 of file groups_widget.h.

◆ m_data

VContainer* GroupsWidget::m_data
private

Definition at line 106 of file groups_widget.h.

Referenced by getObjName(), getPointName(), and itemDoubleClicked().

◆ m_doc

◆ m_patternHasGroups

bool GroupsWidget::m_patternHasGroups
private

Definition at line 107 of file groups_widget.h.

Referenced by draftBlockHasGroups().

◆ ui


The documentation for this class was generated from the following files: