Remove table useless qetgraphicstableitem when model is reseted

When the model of a qetgraphicstableitem is reseted (for exemple when
the sql query is modified) we check if there is useless tables (table
with 0 row displayed) and remove it.
This commit is contained in:
joshua
2021-06-24 19:46:18 +02:00
parent 13041720df
commit 39cff98649
2 changed files with 59 additions and 13 deletions

View File

@@ -79,6 +79,7 @@ class QetGraphicsTableItem : public QetGraphicsItem
void setTableName(const QString &name);
QString tableName() const;
int displayNRowOffset() const;
int displayedRowCount() const;
QetGraphicsTableItem *previousTable() const;
QetGraphicsTableItem *nextTable() const;
void setToMinimumHeight();
@@ -120,13 +121,14 @@ class QetGraphicsTableItem : public QetGraphicsItem
void headerSectionResized();
void adjustSize();
void previousTableDisplayRowChanged();
void removeUselessNextTable(bool recursive = true);
QAbstractItemModel *m_model= nullptr;
QVector<int> m_minimum_column_width;
int
m_minimum_row_height,
m_number_of_displayed_row = 0,
m_number_of_row_to_display = 0,
m_br_margin = 10;
QSize