The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbstractItemModel The table have a few parameters to edit her visual aspect. Margins, to edit the margin between the cell and the text. Text font. Text alignment in the cell These three parameters are not settable directly with the table but trough the model to be displayed by the table. The table search these parameters only in the index(0,0) for all the table. By consequence, set data in other index than 0,0 is useless also these parameter can't be set individually for each cell. The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString.
More...
#include <qetgraphicstableitem.h>
|
enum | { Type = UserType + 1300
} |
|
|
| QetGraphicsTableItem (QGraphicsItem *parent=nullptr) |
| QetGraphicsTableItem::QetGraphicsTableItem Default constructor. More...
|
|
virtual | ~QetGraphicsTableItem () override |
|
int | type () const override |
|
void | setModel (QAbstractItemModel *model=nullptr) |
| QetGraphicsTableItem::setModel Set the model presented by this item. Since QetGraphicsTableItem don't take ownership of model, if item already have a model, it's your responsibility to delete it. More...
|
|
QAbstractItemModel * | model () const |
| QetGraphicsTableItem::model. More...
|
|
virtual QRectF | boundingRect () const override |
| QetGraphicsTableItem::boundingRect Reimplemented from QGraphicsObject. More...
|
|
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
| QetGraphicsTableItem::paint Draw the table. More...
|
|
QetGraphicsHeaderItem * | headerItem () const |
|
void | setSize (const QSize &size) |
| QetGraphicsTableItem::setSize Set the current size of the table to size. More...
|
|
QSize | size () const |
| QetGraphicsTableItem::size. More...
|
|
QSize | minimumSize () const |
| QetGraphicsTableItem::minimumSize. More...
|
|
void | setDisplayNRow (const int &number) |
| QetGraphicsTableItem::setDisplayNRow Limit the number of row to display. More...
|
|
int | displayNRow () const |
| QetGraphicsTableItem::displayNRow. More...
|
|
void | setPreviousTable (QetGraphicsTableItem *table=nullptr) |
| QetGraphicsTableItem::setPreviousTable Set the previous table to table. If this table already have a previous table, the previous table will be replaced. Set new table to nullptr to remove an existing previous table. The table uses the model of the new previous table. Since the table does not take ownership of the model, it is your responsibility to manage the old model. Linked tables (table with next and/or previous table) share the same model, a table always take the model of the previous table. When remove a previous table (set to nullptr) from a table, the model is also removed, you need to set a new model. More...
|
|
void | setNextTable (QetGraphicsTableItem *table=nullptr) |
| QetGraphicsTableItem::setNextTable Set the next table to table nullptr will remove an existing next table. More...
|
|
void | setTableName (const QString &name) |
|
QString | tableName () const |
|
int | displayNRowOffset () const |
| QetGraphicsTableItem::displayNRowOffset. More...
|
|
QetGraphicsTableItem * | previousTable () const |
|
QetGraphicsTableItem * | nextTable () const |
|
void | setToMinimumHeight () |
| QetGraphicsTableItem::setToMinimumHeight Set the height to the the minimum. The width stay unchanged. More...
|
|
void | initLink () |
|
QUuid | uuid () const |
|
int | minimumRowHeigth () const |
| QetGraphicsTableItem::minimumRowHeigth. More...
|
|
QDomElement | toXml (QDomDocument &dom_document) const |
| QetGraphicsTableItem::toXml Save the table to xml. More...
|
|
void | fromXml (const QDomElement &dom_element) |
| QetGraphicsTableItem::fromXml Restore the table from xml. Make this item is already in a diagram to. More...
|
|
| QetGraphicsItem (QGraphicsItem *parent=nullptr) |
| QetGraphicsItem::QetGraphicsItem Default constructor. More...
|
|
| ~QetGraphicsItem () override=0 |
|
Diagram * | diagram () const |
|
virtual void | setPos (const QPointF &p) |
|
virtual void | setPos (qreal x, qreal y) |
|
virtual bool | isMovable () const |
|
virtual void | setMovable (bool movable) |
|
virtual void | editProperty () |
|
virtual QString | name () const |
|
QET::GraphicsItemState | state () const |
| QetGraphicsItem::state. More...
|
|
The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbstractItemModel The table have a few parameters to edit her visual aspect. Margins, to edit the margin between the cell and the text. Text font. Text alignment in the cell These three parameters are not settable directly with the table but trough the model to be displayed by the table. The table search these parameters only in the index(0,0) for all the table. By consequence, set data in other index than 0,0 is useless also these parameter can't be set individually for each cell. The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString.
◆ anonymous enum
◆ QetGraphicsTableItem()
QetGraphicsTableItem::QetGraphicsTableItem |
( |
QGraphicsItem * |
parent = nullptr | ) |
|
◆ ~QetGraphicsTableItem()
QetGraphicsTableItem::~QetGraphicsTableItem |
( |
| ) |
|
|
overridevirtual |
◆ adjustColumnsWidth()
void QetGraphicsTableItem::adjustColumnsWidth |
( |
| ) |
|
|
private |
◆ adjustHandlerPos()
void QetGraphicsTableItem::adjustHandlerPos |
( |
| ) |
|
|
private |
◆ adjustSize()
void QetGraphicsTableItem::adjustSize |
( |
| ) |
|
|
private |
◆ adjustTableToFolio()
void QetGraphicsTableItem::adjustTableToFolio |
( |
QetGraphicsTableItem * |
table, |
|
|
QMargins |
margins = QMargins(20,20,20,0) |
|
) |
| |
|
static |
◆ boundingRect()
QRectF QetGraphicsTableItem::boundingRect |
( |
| ) |
const |
|
overridevirtual |
◆ checkInsufficientRowsCount()
◆ dataChanged()
void QetGraphicsTableItem::dataChanged |
( |
const QModelIndex & |
topLeft, |
|
|
const QModelIndex & |
bottomRight, |
|
|
const QVector< int > & |
roles |
|
) |
| |
|
private |
◆ displayNRow()
int QetGraphicsTableItem::displayNRow |
( |
| ) |
const |
◆ displayNRowOffset()
int QetGraphicsTableItem::displayNRowOffset |
( |
| ) |
const |
◆ fromXml()
void QetGraphicsTableItem::fromXml |
( |
const QDomElement & |
dom_element | ) |
|
◆ handlerMouseMoveEvent()
void QetGraphicsTableItem::handlerMouseMoveEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
private |
◆ handlerMousePressEvent()
void QetGraphicsTableItem::handlerMousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
private |
◆ handlerMouseReleaseEvent()
void QetGraphicsTableItem::handlerMouseReleaseEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
private |
◆ headerItem()
◆ headerSectionResized()
void QetGraphicsTableItem::headerSectionResized |
( |
| ) |
|
|
private |
◆ hoverEnterEvent()
void QetGraphicsTableItem::hoverEnterEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
overrideprotectedvirtual |
◆ hoverLeaveEvent()
void QetGraphicsTableItem::hoverLeaveEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
overrideprotectedvirtual |
◆ initLink()
void QetGraphicsTableItem::initLink |
( |
| ) |
|
◆ itemChange()
QVariant QetGraphicsTableItem::itemChange |
( |
GraphicsItemChange |
change, |
|
|
const QVariant & |
value |
|
) |
| |
|
overrideprotectedvirtual |
◆ minimumRowHeigth()
int QetGraphicsTableItem::minimumRowHeigth |
( |
| ) |
const |
◆ minimumSize()
QSize QetGraphicsTableItem::minimumSize |
( |
| ) |
const |
QetGraphicsTableItem::minimumSize.
- Returns
- the minimum size the table can be The returned size take care of the table's minimum width, but also the header item's minimum width
◆ model()
QAbstractItemModel * QetGraphicsTableItem::model |
( |
| ) |
const |
◆ modelReseted()
void QetGraphicsTableItem::modelReseted |
( |
| ) |
|
|
private |
◆ nextTable()
◆ paint()
void QetGraphicsTableItem::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget |
|
) |
| |
|
overridevirtual |
◆ previousTable()
◆ previousTableDisplayRowChanged()
void QetGraphicsTableItem::previousTableDisplayRowChanged |
( |
| ) |
|
|
private |
◆ sceneEventFilter()
bool QetGraphicsTableItem::sceneEventFilter |
( |
QGraphicsItem * |
watched, |
|
|
QEvent * |
event |
|
) |
| |
|
overrideprotectedvirtual |
◆ setDisplayNRow()
void QetGraphicsTableItem::setDisplayNRow |
( |
const int & |
number | ) |
|
◆ setModel()
void QetGraphicsTableItem::setModel |
( |
QAbstractItemModel * |
model = nullptr | ) |
|
◆ setNextTable()
◆ setPreviousTable()
QetGraphicsTableItem::setPreviousTable Set the previous table to table. If this table already have a previous table, the previous table will be replaced. Set new table to nullptr to remove an existing previous table. The table uses the model of the new previous table. Since the table does not take ownership of the model, it is your responsibility to manage the old model. Linked tables (table with next and/or previous table) share the same model, a table always take the model of the previous table. When remove a previous table (set to nullptr) from a table, the model is also removed, you need to set a new model.
- Parameters
-
◆ setSize()
void QetGraphicsTableItem::setSize |
( |
const QSize & |
size | ) |
|
◆ setTableName()
void QetGraphicsTableItem::setTableName |
( |
const QString & |
name | ) |
|
◆ setToMinimumHeight()
void QetGraphicsTableItem::setToMinimumHeight |
( |
| ) |
|
◆ setUpBoundingRect()
void QetGraphicsTableItem::setUpBoundingRect |
( |
| ) |
|
|
private |
◆ setUpColumnAndRowMinimumSize()
void QetGraphicsTableItem::setUpColumnAndRowMinimumSize |
( |
| ) |
|
|
private |
◆ setUpHandler()
void QetGraphicsTableItem::setUpHandler |
( |
| ) |
|
|
private |
◆ size()
QSize QetGraphicsTableItem::size |
( |
| ) |
const |
◆ tableName()
QString QetGraphicsTableItem::tableName |
( |
| ) |
const |
◆ toXml()
QDomElement QetGraphicsTableItem::toXml |
( |
QDomDocument & |
dom_document | ) |
const |
QetGraphicsTableItem::toXml Save the table to xml.
- Parameters
-
dom_document | : parent document |
- Returns
- the dom_element that describe the table
◆ type()
int QetGraphicsTableItem::type |
( |
| ) |
const |
|
inlineoverride |
◆ uuid()
QUuid QetGraphicsTableItem::uuid |
( |
| ) |
const |
|
inline |
◆ xmlTagName()
static QString QetGraphicsTableItem::xmlTagName |
( |
| ) |
|
|
inlinestatic |
◆ m_bounding_rect
QRectF QetGraphicsTableItem::m_bounding_rect |
|
private |
◆ m_br_margin
int QetGraphicsTableItem::m_br_margin = 10 |
|
private |
◆ m_current_size
QSize QetGraphicsTableItem::m_current_size |
|
private |
◆ m_handler_item
◆ m_header_item
◆ m_minimum_column_width
QVector<int> QetGraphicsTableItem::m_minimum_column_width |
|
private |
◆ m_minimum_row_height
int QetGraphicsTableItem::m_minimum_row_height |
|
private |
◆ m_model
QAbstractItemModel* QetGraphicsTableItem::m_model = nullptr |
|
private |
◆ m_name
QString QetGraphicsTableItem::m_name |
|
private |
◆ m_next_table
◆ m_number_of_displayed_row
int QetGraphicsTableItem::m_number_of_displayed_row = 0 |
|
private |
◆ m_old_size
QSize QetGraphicsTableItem::m_old_size |
|
private |
◆ m_pending_previous_table_uuid
QUuid QetGraphicsTableItem::m_pending_previous_table_uuid |
|
private |
◆ m_pending_size
QSize QetGraphicsTableItem::m_pending_size |
|
private |
◆ m_previous_table
◆ m_uuid
QUuid QetGraphicsTableItem::m_uuid = QUuid::createUuid() |
|
private |
◆ displayNRow
int QetGraphicsTableItem::displayNRow |
|
readwrite |
◆ size
QSize QetGraphicsTableItem::size |
|
readwrite |
The documentation for this class was generated from the following files: