Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquicktableview.cpp File Reference

(bf0f4bab47c25a21c54be8eb1170ed2af092c84e)

#include "qquicktableview_p.h"
#include "qquicktableview_p_p.h"
#include <QtCore/qtimer.h>
#include <QtCore/qdir.h>
#include <QtQmlModels/private/qqmldelegatemodel_p.h>
#include <QtQmlModels/private/qqmldelegatemodel_p_p.h>
#include <QtQml/private/qqmlincubator_p.h>
#include <QtQmlModels/private/qqmlchangeset_p.h>
#include <QtQml/qqmlinfo.h>
#include <QtQuick/private/qquickflickable_p_p.h>
#include <QtQuick/private/qquickitemviewfxitem_p_p.h>
#include <QtQuick/private/qquicktaphandler_p.h>
#include "moc_qquicktableview_p.cpp"
#include "moc_qquicktableview_p_p.cpp"
+ Include dependency graph for qquicktableview.cpp:

Go to the source code of this file.

Macros

#define Q_TABLEVIEW_UNREACHABLE(output)   { dumpTable(); qWarning() << "output:" << output; Q_UNREACHABLE(); }
 \qmltype TableView \inqmlmodule QtQuick
 
#define Q_TABLEVIEW_ASSERT(cond, output)   Q_ASSERT((cond) || [&](){ dumpTable(); qWarning() << "output:" << output; return false;}())
 
#define TV_REBUILDSTATE(STATE)
 
#define TV_REBUILDOPTION(OPTION)
 

Functions

QDebug operator<< (QDebug dbg, QQuickTableViewPrivate::RebuildState state)
 
QDebug operator<< (QDebug dbg, QQuickTableViewPrivate::RebuildOptions options)
 

Variables

static const Qt::Edge allTableEdges [] = { Qt::LeftEdge, Qt::RightEdge, Qt::TopEdge, Qt::BottomEdge }
 
static const char * kRequiredProperties = "_qt_tableview_requiredpropertymask"
 
static const char * kRequiredProperty_selected = "selected"
 
static const char * kRequiredProperty_current = "current"
 
static const char * kRequiredProperty_editing = "editing"
 

Macro Definition Documentation

◆ Q_TABLEVIEW_ASSERT

◆ Q_TABLEVIEW_UNREACHABLE

#define Q_TABLEVIEW_UNREACHABLE ( output)    { dumpTable(); qWarning() << "output:" << output; Q_UNREACHABLE(); }

\qmltype TableView \inqmlmodule QtQuick

Since
5.12

\inherits Flickable

Provides a table view of items to display data from a model.

A TableView has a \l model that defines the data to be displayed, and a \l delegate that defines how the data should be displayed.

TableView inherits \l Flickable. This means that while the model can have any number of rows and columns, only a subsection of the table is usually visible inside the viewport. As soon as you flick, new rows and columns enter the viewport, while old ones exit and are removed from the viewport. The rows and columns that move out are reused for building the rows and columns that move into the viewport. As such, the TableView support models of any size without affecting performance.

A TableView displays data from models created from built-in QML types such as ListModel and XmlListModel, which populates the first column only in a TableView. To create models with multiple columns, either use \l TableModel or a C++ model that inherits QAbstractItemModel.

A TableView does not include headers by default. You can add headers using the \l HorizontalHeaderView and \l VerticalHeaderView from Qt Quick Controls.

Note
TableView will only \l {isRowLoaded()}{load} as many delegate items as needed to fill up the view. There is no guarantee that items outside the view will be loaded, although TableView will sometimes pre-load items for optimization reasons. Hence, a TableView with zero width or height might not load any delegate items at all.

Definition at line 1453 of file qquicktableview.cpp.

Referenced by QQuickTableViewPrivate::canUnloadTableEdge().

◆ TV_REBUILDOPTION

#define TV_REBUILDOPTION ( OPTION)
Value:
if (options & QQuickTableViewPrivate::RebuildOption::OPTION) \
dbg << QStringLiteral(#OPTION)
#define QStringLiteral(str)

◆ TV_REBUILDSTATE

#define TV_REBUILDSTATE ( STATE)
Value:
case QQuickTableViewPrivate::RebuildState::STATE: \
dbg << QStringLiteral(#STATE); break;

Function Documentation

◆ operator<<() [1/2]

QDebug operator<< ( QDebug dbg,
QQuickTableViewPrivate::RebuildOptions options )

◆ operator<<() [2/2]

Definition at line 1463 of file qquicktableview.cpp.

References state, and TV_REBUILDSTATE.

Variable Documentation

◆ allTableEdges

◆ kRequiredProperties

const char* kRequiredProperties = "_qt_tableview_requiredpropertymask"
static

Definition at line 1458 of file qquicktableview.cpp.

Referenced by QQuickTableViewPrivate::setRequiredProperty().

◆ kRequiredProperty_current

◆ kRequiredProperty_editing

const char* kRequiredProperty_editing = "editing"
static

◆ kRequiredProperty_selected