Skip to main content

PaginatedTableModel

PaginatedTableModel

Table model that uses mini selectors to efficiently display large tables. More…

#include <PaginatedTableModel.hpp>

Inherits from QAbstractTableModel

Public Functions

Name
PaginatedTableModel(QObject * parent =[nullptr])
~PaginatedTableModel() override
void setSourceTable(std::unique_ptr< IRowSelector > row_selector, std::vector< ColumnInfo > column_infos, std::shared_ptr< DataManager > data_manager, QString row_source =QString())
Set the source table configuration for pagination.
void setTableView(std::shared_ptr< TableView > table_view)
Set a complete TableView (for cases where we already have one built).
void clearTable()
Clear the current table.
void setPageSize(size_t page_size)
Set the page size for mini table windows.
int rowCount(QModelIndex const & parent) const override
int columnCount(QModelIndex const & parent) const override
QVariant data(QModelIndex const & index, int role) const override
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
size_t getMaterializedPageCount() const
Get the count of mini pages materialized during model lifetime.

Detailed Description

class PaginatedTableModel;

Table model that uses mini selectors to efficiently display large tables.

This model creates small TableView windows on-the-fly rather than materializing the entire table, allowing efficient scrolling through very large datasets.

Public Functions Documentation

function PaginatedTableModel

explicit PaginatedTableModel(
    QObject * parent =nullptr
)

function ~PaginatedTableModel

~PaginatedTableModel() override

function setSourceTable

void setSourceTable(
    std::unique_ptr< IRowSelector > row_selector,
    std::vector< ColumnInfo > column_infos,
    std::shared_ptr< DataManager > data_manager,
    QString row_source =QString()
)

Set the source table configuration for pagination.

Parameters:

  • row_selector The row selector defining all rows
  • column_infos Column definitions for the table
  • data_manager Data manager for building mini tables
  • row_source The row source string for recreating the row selector

function setTableView

void setTableView(
    std::shared_ptr< TableView > table_view
)

Set a complete TableView (for cases where we already have one built).

Parameters:

  • table_view Pre-built table view

function clearTable

void clearTable()

Clear the current table.

function setPageSize

void setPageSize(
    size_t page_size
)

Set the page size for mini table windows.

Parameters:

  • page_size Number of rows per page (default: 1000)

function rowCount

int rowCount(
    QModelIndex const & parent
) const override

function columnCount

int columnCount(
    QModelIndex const & parent
) const override

function data

QVariant data(
    QModelIndex const & index,
    int role
) const override

function headerData

QVariant headerData(
    int section,
    Qt::Orientation orientation,
    int role
) const override

function getMaterializedPageCount

inline size_t getMaterializedPageCount() const

Get the count of mini pages materialized during model lifetime.

Return: Number of pages created and cached at least once

Precondition: None

Postcondition: No side-effects


Updated on 2026-11-13 at 20:25:40 +0000