18#ifndef QetGraphicsTableItem_H
19#define QetGraphicsTableItem_H
21#include "../../QetGraphicsItemModeler/qetgraphicshandleritem.h"
22#include "../../qetapp.h"
23#include "../../qetgraphicsitem/qetgraphicsitem.h"
27class QAbstractItemModel;
52 QMargins margins = QMargins(20,20,20,0));
59 enum {
Type = UserType + 1300 };
63 QAbstractItemModel *
model()
const;
68 const QStyleOptionGraphicsItem *option,
69 QWidget *widget)
override;
84 QPointer<QetGraphicsTableItem>
nextTable()
const;
90 QDomElement
toXml(QDomDocument &dom_document)
const;
91 void fromXml(
const QDomElement &dom_element);
92 static QString
xmlTagName() {
return QString(
"graphics_table");}
93 virtual bool toDXF (
const QString &filepath);
97 QGraphicsSceneHoverEvent *event)
override;
99 QGraphicsSceneHoverEvent *event)
override;
101 QGraphicsItem *watched,
102 QEvent *event)
override;
104 GraphicsItemChange change,
105 const QVariant &value)
override;
118 const QModelIndex &topLeft,
119 const QModelIndex &bottomRight,
120 const QVector<int> &roles);
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition qetgraphicshandleritem.h:37
Definition qetgraphicsitem.h:28
virtual QString name() const
Definition qetgraphicsitem.h:48
The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbst...
Definition qetgraphicstableitem.h:43
static void checkInsufficientRowsCount(QetGraphicsTableItem *first_table)
QetGraphicsTableItem::checkInsufficientRowsCount Check if the number of rows of table + linked table ...
Definition qetgraphicstableitem.cpp:79
QetGraphicsHeaderItem * headerItem() const
Definition qetgraphicstableitem.h:70
void setNextTable(QetGraphicsTableItem *table=nullptr)
QetGraphicsTableItem::setNextTable Set the next table to table nullptr will remove an existing next t...
Definition qetgraphicstableitem.cpp:464
QPointer< QetGraphicsTableItem > nextTable() const
Definition qetgraphicstableitem.cpp:536
void setModel(QAbstractItemModel *model=nullptr)
QetGraphicsTableItem::setModel Set the model presented by this item. Since QetGraphicsTableItem don't...
Definition qetgraphicstableitem.cpp:178
QVector< int > m_minimum_column_width
Definition qetgraphicstableitem.h:128
void initLink()
Definition qetgraphicstableitem.cpp:553
void adjustSize()
QetGraphicsTableItem::adjustSize If needed, this function resize the current height and width of tabl...
Definition qetgraphicstableitem.cpp:1054
@ Type
Definition qetgraphicstableitem.h:59
void fromXml(const QDomElement &dom_element)
QetGraphicsTableItem::fromXml Restore the table from xml. Make this item is already in a diagram to.
Definition qetgraphicstableitem.cpp:621
int m_minimum_row_height
Definition qetgraphicstableitem.h:130
virtual QRectF boundingRect() const override
QetGraphicsTableItem::boundingRect Reimplemented from QGraphicsObject.
Definition qetgraphicstableitem.cpp:221
int minimumRowHeight() const
QetGraphicsTableItem::minimumRowHeight.
Definition qetgraphicstableitem.cpp:570
void modelReseted()
QetGraphicsTableItem::modelReseted.
Definition qetgraphicstableitem.cpp:847
void setDisplayNRow(const int &number)
QetGraphicsTableItem::setDisplayNRow Limit the number of row to display.
Definition qetgraphicstableitem.cpp:400
void previousTableDisplayRowChanged()
Definition qetgraphicstableitem.cpp:1082
QAbstractItemModel * model() const
QetGraphicsTableItem::model.
Definition qetgraphicstableitem.cpp:211
void setSize(const QSize &size)
QetGraphicsTableItem::setSize Set the current size of the table to size.
Definition qetgraphicstableitem.cpp:331
QPointer< QAbstractItemModel > m_model
Definition qetgraphicstableitem.h:126
void setUpBoundingRect()
QetGraphicsTableItem::setUpBoundingRect.
Definition qetgraphicstableitem.cpp:899
int displayNRow
Definition qetgraphicstableitem.h:47
QetGraphicsHeaderItem * m_header_item
Definition qetgraphicstableitem.h:142
QSize size
Definition qetgraphicstableitem.h:46
QPointer< QetGraphicsTableItem > m_next_table
Definition qetgraphicstableitem.h:145
void setUpColumnAndRowMinimumSize()
QetGraphicsTableItem::setUpColumnAndRowMinimumSize Calcule the minimum row height and the minimum col...
Definition qetgraphicstableitem.cpp:864
void setTableName(const QString &name)
Definition qetgraphicstableitem.cpp:485
static void adjustTableToFolio(QetGraphicsTableItem *table, QMargins margins=QMargins(20, 20, 20, 0))
QetGraphicsTableItem::adjustTableToFolio Adjust the table to fit at best the folio.
Definition qetgraphicstableitem.cpp:44
QString tableName() const
Definition qetgraphicstableitem.cpp:490
void handlerMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Definition qetgraphicstableitem.cpp:958
QSize m_pending_size
Definition qetgraphicstableitem.h:137
int m_br_margin
Definition qetgraphicstableitem.h:132
QSize m_old_size
Definition qetgraphicstableitem.h:136
void handlerMousePressEvent(QGraphicsSceneMouseEvent *event)
Definition qetgraphicstableitem.cpp:932
int type() const override
Definition qetgraphicstableitem.h:60
QString m_name
Definition qetgraphicstableitem.h:147
QSize minimumSize() const
QetGraphicsTableItem::minimumSize.
Definition qetgraphicstableitem.cpp:366
int displayNRowOffset() const
QetGraphicsTableItem::displayNRowOffset.
Definition qetgraphicstableitem.cpp:500
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
QetGraphicsTableItem::paint Draw the table.
Definition qetgraphicstableitem.cpp:233
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
Definition qetgraphicstableitem.cpp:1035
int m_number_of_row_to_display
Definition qetgraphicstableitem.h:131
QUuid uuid() const
Definition qetgraphicstableitem.h:87
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
QetGraphicsTableItem::hoverEnterEvent Reimplemented from QetGraphicsItem.
Definition qetgraphicstableitem.cpp:767
void handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition qetgraphicstableitem.cpp:941
QUuid m_uuid
Definition qetgraphicstableitem.h:149
void adjustColumnsWidth()
QetGraphicsTableItem::adjustColumnsWidth Adjust the size of each column according to the current tabl...
Definition qetgraphicstableitem.cpp:976
void removeUselessNextTable(bool recursive=true)
QetGraphicsTableItem::removeUselessNextTable Remove next table if useless, an useless table with 0 ro...
Definition qetgraphicstableitem.cpp:1096
QRectF m_bounding_rect
Definition qetgraphicstableitem.h:139
int displayedRowCount() const
QetGraphicsTableItem::displayedRowCount.
Definition qetgraphicstableitem.cpp:513
void setToMinimumHeight()
QetGraphicsTableItem::setToMinimumHeight Set the height to the the minimum. The width stay unchanged.
Definition qetgraphicstableitem.cpp:546
static QString xmlTagName()
Definition qetgraphicstableitem.h:92
QSize m_current_size
Definition qetgraphicstableitem.h:135
void headerSectionResized()
void adjustHandlerPos()
QetGraphicsTableItem::adjustHandlerPos Adjust the pos of the handler item.
Definition qetgraphicstableitem.cpp:918
QDomElement toXml(QDomDocument &dom_document) const
QetGraphicsTableItem::toXml Save the table to xml.
Definition qetgraphicstableitem.cpp:581
QPointer< QetGraphicsTableItem > previousTable() const
Definition qetgraphicstableitem.cpp:531
void setPreviousTable(QetGraphicsTableItem *table=nullptr)
QetGraphicsTableItem::setPreviousTable Set the previous table to table. If this table already have a ...
Definition qetgraphicstableitem.cpp:433
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
QetGraphicsTableItem::sceneEventFilter Reimplemented from QetGraphicsItem.
Definition qetgraphicstableitem.cpp:801
void setUpHandler()
QetGraphicsTableItem::setUpHandler.
Definition qetgraphicstableitem.cpp:926
QUuid m_pending_previous_table_uuid
Definition qetgraphicstableitem.h:150
QetGraphicsHandlerItem m_handler_item
Definition qetgraphicstableitem.h:141
virtual bool toDXF(const QString &filepath)
QetGraphicsTableItem::toDXF Draw this table to the dxf document.
Definition qetgraphicstableitem.cpp:683
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
QetGraphicsTableItem::hoverLeaveEvent Reimplemented from QetGraphicsItem.
Definition qetgraphicstableitem.cpp:784
QPointer< QetGraphicsTableItem > m_previous_table
Definition qetgraphicstableitem.h:144
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
QetGraphicsTableItem::itemChange.
Definition qetgraphicstableitem.cpp:831