table item : remove a table remove also all linked tables

This commit is contained in:
Claveau Joshua
2020-06-05 20:00:13 +02:00
parent ae9ef3cf21
commit 9085c6fcda
2 changed files with 28 additions and 40 deletions

View File

@@ -25,15 +25,10 @@ class Diagram;
class ElementTextItemGroup;
class Terminal;
class QetGraphicsTableItem;
class QGraphicsScene;
class DeleteQGraphicsItemCommand : public QUndoCommand
{
private :
struct tableStatus {
QetGraphicsTableItem *previous = nullptr;
QetGraphicsTableItem *next = nullptr;
};
public:
DeleteQGraphicsItemCommand(Diagram *diagram, const DiagramContent &content, QUndoCommand * parent = nullptr);
~DeleteQGraphicsItemCommand() override;
@@ -56,7 +51,8 @@ class DeleteQGraphicsItemCommand : public QUndoCommand
QHash <DynamicElementTextItem *, Element *> m_elmt_text_hash; /// Keep the parent element of each deleted dynamic element text item
QHash <DynamicElementTextItem *, ElementTextItemGroup *> m_grp_texts_hash; ///Keep the parent group of each deleted element text item
QList <QPair<Terminal *, Terminal *>> m_connected_terminals;
QHash <QetGraphicsTableItem *, tableStatus> m_tables_status;
QHash <QetGraphicsTableItem *, QPointer<QGraphicsScene>> m_table_scene_hash;
bool m_remove_linked_table = false;
};
#endif // DELETEQGRAPHICSITEMCOMMAND_H