|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef QetGraphicsTableItem_H
19 #define QetGraphicsTableItem_H
27 class QAbstractItemModel;
57 enum {
Type = UserType + 1300 };
61 QAbstractItemModel *
model()
const;
64 virtual void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget)
override;
83 QDomElement
toXml(QDomDocument &dom_document)
const;
84 void fromXml(
const QDomElement &dom_element);
85 static QString
xmlTagName() {
return QString(
"graphics_table");}
90 virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
override;
91 virtual QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
103 void dataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QVector<int> &roles);
132 #endif // QetGraphicsTableItem_H
QetGraphicsHeaderItem * m_header_item
Definition: qetgraphicstableitem.h:122
virtual QRectF boundingRect() const override
QetGraphicsTableItem::boundingRect Reimplemented from QGraphicsObject.
Definition: qetgraphicstableitem.cpp:196
QetGraphicsTableItem * m_previous_table
Definition: qetgraphicstableitem.h:124
static QString xmlTagName()
Definition: projectdbmodel.h:73
QVector< int > m_minimum_column_width
Definition: qetgraphicstableitem.h:111
Definition: qetgraphicsitem.h:27
void initLink()
Definition: qetgraphicstableitem.cpp:483
QRectF m_bounding_rect
Definition: qetgraphicstableitem.h:119
QSize m_old_size
Definition: qetgraphicstableitem.h:115
void setSize(const QSize &size)
QetGraphicsTableItem::setSize Set the current size of the table to size.
Definition: qetgraphicstableitem.cpp:295
void handlerMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Definition: qetgraphicstableitem.cpp:754
QetGraphicsHandlerItem m_handler_item
Definition: qetgraphicstableitem.h:121
Definition: elementprovider.h:37
The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbst...
Definition: qetgraphicstableitem.h:43
void setNextTable(QetGraphicsTableItem *table=nullptr)
QetGraphicsTableItem::setNextTable Set the next table to table nullptr will remove an existing next t...
Definition: qetgraphicstableitem.cpp:420
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
QAbstractItemModel * m_model
Definition: qetgraphicstableitem.h:109
int m_minimum_row_height
Definition: qetgraphicstableitem.h:112
void headerSectionResized()
QetGraphicsTableItem::headerSectionResized Connected to the header signal QetGraphicsTableItem sectio...
Definition: qetgraphicstableitem.cpp:832
int m_number_of_displayed_row
Definition: qetgraphicstableitem.h:113
void adjustHandlerPos()
QetGraphicsTableItem::adjustHandlerPos Adjust the pos of the handler item.
Definition: qetgraphicstableitem.cpp:716
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:550
QetGraphicsTableItem * previousTable() const
Definition: qetgraphicstableitem.cpp:463
QDomElement toXml(QDomDocument &dom_document) const
QetGraphicsTableItem::toXml Save the table to xml.
Definition: qetgraphicstableitem.cpp:510
virtual QString name() const
Definition: qetgraphicsitem.h:44
The ProjectDBModel class This model is intended to be use with the class projectDataBase and is desig...
Definition: projectdbmodel.h:44
void modelReseted()
Definition: qetgraphicstableitem.cpp:660
QSize m_current_size
Definition: qetgraphicstableitem.h:114
QString tableName() const
Definition: qetgraphicstableitem.cpp:445
void setUpColumnAndRowMinimumSize()
QetGraphicsTableItem::setUpColumnAndRowMinimumSize Calcule the minimum row height and the minimum col...
Definition: qetgraphicstableitem.cpp:674
QetGraphicsTableItem * m_next_table
Definition: qetgraphicstableitem.h:125
QetGraphicsTableItem(QGraphicsItem *parent=nullptr)
QetGraphicsTableItem::QetGraphicsTableItem Default constructor.
Definition: qetgraphicstableitem.cpp:124
int minimumRowHeigth() const
QetGraphicsTableItem::minimumRowHeigth.
Definition: qetgraphicstableitem.cpp:500
void setUpHandler()
QetGraphicsTableItem::setUpHandler.
Definition: qetgraphicstableitem.cpp:723
BorderTitleBlock border_and_titleblock
Diagram dimensions and title block.
Definition: diagram.h:83
QRectF insideBorderRect() const
BorderTitleBlock::insideBorderRect.
Definition: bordertitleblock.cpp:185
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
QetGraphicsTableItem::itemChange.
Definition: qetgraphicstableitem.cpp:648
QUuid uuid() const
Definition: qetgraphicstableitem.h:80
void adjustColumnsWidth()
QetGraphicsTableItem::adjustColumnsWidth Adjust the size of each column according to the current tabl...
Definition: qetgraphicstableitem.cpp:772
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
QetGraphicsTableItem::paint Draw the table.
Definition: qetgraphicstableitem.cpp:207
@ Type
Definition: qetgraphicstableitem.h:57
void adjustSize()
QetGraphicsTableItem::adjustSize If needed, this function resize the current height and width of tabl...
Definition: qetgraphicstableitem.cpp:848
void setToMinimumHeight()
QetGraphicsTableItem::setToMinimumHeight Set the height to the the minimum. The width stay unchanged.
Definition: qetgraphicstableitem.cpp:476
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:42
QMessageBox::StandardButton information(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:38
QUuid m_pending_previous_table_uuid
Definition: qetgraphicstableitem.h:129
int displayNRowOffset() const
QetGraphicsTableItem::displayNRowOffset.
Definition: qetgraphicstableitem.cpp:454
void handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: qetgraphicstableitem.cpp:739
void handlerMousePressEvent(QGraphicsSceneMouseEvent *event)
Definition: qetgraphicstableitem.cpp:729
QUuid m_uuid
Definition: qetgraphicstableitem.h:128
void setTableName(const QString &name)
Definition: qetgraphicstableitem.cpp:441
QUndoStack & undoStack()
Diagram::undoStack.
Definition: diagram.h:397
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition: qetgraphicshandleritem.h:37
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
QetGraphicsTableItem::hoverLeaveEvent Reimplemented from QetGraphicsItem.
Definition: qetgraphicstableitem.cpp:603
static void checkInsufficientRowsCount(QetGraphicsTableItem *first_table)
QetGraphicsTableItem::checkInsufficientRowsCount Check if the number of rows of table + linked table ...
Definition: qetgraphicstableitem.cpp:72
QVector< QDomElement > directChild(const QDomElement &element, const QString &tag_name)
QETXML::directChild.
Definition: qetxml.cpp:313
int m_br_margin
Definition: qetgraphicstableitem.h:118
void setModel(QAbstractItemModel *model=nullptr)
QetGraphicsTableItem::setModel Set the model presented by this item. Since QetGraphicsTableItem don't...
Definition: qetgraphicstableitem.cpp:158
int type() const override
Definition: qetgraphicstableitem.h:58
QetGraphicsHeaderItem * headerItem() const
Definition: qetgraphicstableitem.h:65
void setPreviousTable(QetGraphicsTableItem *table=nullptr)
QetGraphicsTableItem::setPreviousTable Set the previous table to table. If this table already have a ...
Definition: qetgraphicstableitem.cpp:389
QMargins marginsFromString(const QString &string)
QETUtils::marginsFromString.
Definition: qetutils.cpp:46
void setColor(QColor color)
QetGraphicsHandlerItem::setColor.
Definition: qetgraphicshandleritem.cpp:48
QSize minimumSize() const
QetGraphicsTableItem::minimumSize.
Definition: qetgraphicstableitem.cpp:329
QAbstractItemModel * model() const
QetGraphicsTableItem::model.
Definition: qetgraphicstableitem.cpp:187
int displayNRow
Definition: qetgraphicstableitem.h:47
static QPointF snapToGrid(const QPointF &p)
Diagram::snapToGrid Return a nearest snap point of p.
Definition: diagram.cpp:2240
void setDisplayNRow(const int &number)
QetGraphicsTableItem::setDisplayNRow Limit the number of row to display.
Definition: qetgraphicstableitem.cpp:358
QetGraphicsTableItem * nextTable() const
Definition: qetgraphicstableitem.cpp:467
QSize m_pending_size
Definition: qetgraphicstableitem.h:116
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
QetGraphicsTableItem::hoverEnterEvent Reimplemented from QetGraphicsItem.
Definition: qetgraphicstableitem.cpp:587
void setUpBoundingRect()
QetGraphicsTableItem::setUpBoundingRect.
Definition: qetgraphicstableitem.cpp:705
virtual void setPos(const QPointF &p)
Definition: qetgraphicsitem.cpp:49
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
QSize size
Definition: qetgraphicstableitem.h:46
static QString xmlTagName()
Definition: qetgraphicstableitem.h:85
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
Definition: qetgraphicstableitem.cpp:817
QString m_name
Definition: qetgraphicstableitem.h:127
QIcon tr
Definition: qeticons.cpp:206
QetGraphicsTableItem * tableFromUuid(const QUuid &uuid)
ElementProvider::tableFromUuid.
Definition: elementprovider.cpp:172
virtual ~QetGraphicsTableItem() override
Definition: qetgraphicstableitem.cpp:148
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
QetGraphicsTableItem::sceneEventFilter Reimplemented from QetGraphicsItem.
Definition: qetgraphicstableitem.cpp:618
void previousTableDisplayRowChanged()
Definition: qetgraphicstableitem.cpp:876