Skip to main content

PreviewTableModel

PreviewTableModel

Read-only table model that renders a small-window TableView preview. More…

#include <PreviewTableModel.hpp>

Inherits from QAbstractTableModel

Public Functions

Name
PreviewTableModel(QObject * parent =[nullptr])
~PreviewTableModel() override =default
void setPreview(std::shared_ptr< TableView > view)
Replace the current preview with a new TableView.
void clearPreview()
Clear any existing preview.
int rowCount(QModelIndex const & parent =QModelIndex()) const override
int columnCount(QModelIndex const & parent =QModelIndex()) const override
QVariant data(QModelIndex const & index, int role =Qt::DisplayRole) const override
QVariant headerData(int section, Qt::Orientation orientation, int role =Qt::DisplayRole) const override

Detailed Description

class PreviewTableModel;

Read-only table model that renders a small-window TableView preview.

Renders scalar columns directly and joins vector elements using commas (e.g., 1,2,3) per the user’s preference.

Public Functions Documentation

function PreviewTableModel

explicit PreviewTableModel(
    QObject * parent =nullptr
)

function ~PreviewTableModel

~PreviewTableModel() override =default

function setPreview

void setPreview(
    std::shared_ptr< TableView > view
)

Replace the current preview with a new TableView.

Parameters:

function clearPreview

void clearPreview()

Clear any existing preview.

function rowCount

int rowCount(
    QModelIndex const & parent =QModelIndex()
) const override

function columnCount

int columnCount(
    QModelIndex const & parent =QModelIndex()
) const override

function data

QVariant data(
    QModelIndex const & index,
    int role =Qt::DisplayRole
) const override

function headerData

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

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