KWidgetsAddons
kviewstateserializer.cpp
40 if (!m_scrollArea || !m_scrollArea->horizontalScrollBar() || !m_scrollArea->verticalScrollBar()) {
43 if (m_horizontalScrollBarValue >= 0 && m_horizontalScrollBarValue <= m_scrollArea->horizontalScrollBar()->maximum()) {
47 if (m_verticalScrollBarValue >= 0 && m_verticalScrollBarValue <= m_scrollArea->verticalScrollBar()->maximum()) {
59 return !m_pendingCurrent.isEmpty() || !m_pendingExpansions.isEmpty() || !m_pendingSelections.isEmpty();
146 m_rowsInsertedConnection = q->connect(model, &QAbstractItemModel::rowsInserted, q, [this](const QModelIndex &parent, int first, int last) {
191 QModelIndex currentIndex = q->indexFromConfigString(m_selectionModel->model(), m_pendingCurrent);
Object for saving and restoring state in QTreeViews and QItemSelectionModels.
Definition kviewstateserializer.h:169
QStringList selectionKeys() const
Returns a QStringList describing the selection in the selectionModel.
Definition kviewstateserializer.cpp:326
QPair< int, int > scrollState() const
Returns the vertical and horizontal scroll of the QAbstractScrollArea.
Definition kviewstateserializer.cpp:343
virtual QString indexToConfigString(const QModelIndex &index) const =0
Reimplement to return a unique string for the index.
void restoreSelection(const QStringList &indexStrings)
Select the indexes described by indexStrings.
Definition kviewstateserializer.cpp:287
QString currentIndexKey() const
Returns a QString describing the current index in the selection model.
Definition kviewstateserializer.cpp:307
void restoreCurrentItem(const QString &indexString)
Make the index described by indexString the currentIndex in the selectionModel.
Definition kviewstateserializer.cpp:202
void restoreExpanded(const QStringList &indexStrings)
Expand the indexes described by indexStrings in the QTreeView.
Definition kviewstateserializer.cpp:236
void restoreScrollState(int verticalScoll, int horizontalScroll)
Restores the scroll state of the QAbstractScrollArea to the verticalScoll and horizontalScroll.
Definition kviewstateserializer.cpp:255
QStringList expansionKeys() const
Returns a QStringList representing the expanded indexes in the QTreeView.
Definition kviewstateserializer.cpp:316
QAbstractItemView * view() const
The view whose state is persisted.
Definition kviewstateserializer.cpp:120
QItemSelectionModel * selectionModel() const
The QItemSelectionModel whose state is persisted.
Definition kviewstateserializer.cpp:126
void setSelectionModel(QItemSelectionModel *selectionModel)
Sets the QItemSelectionModel whose state is persisted.
Definition kviewstateserializer.cpp:132
void setView(QAbstractItemView *view)
Sets the view whose state is persisted.
Definition kviewstateserializer.cpp:106
virtual bool hasChildren(const QModelIndex &parent) const const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
void rowsInserted(const QModelIndex &parent, int first, int last)
QAbstractItemModel * model() const const
QItemSelectionModel * selectionModel() const const
void setCurrentIndex(const QModelIndex &index)
NoUpdate
QAbstractItemModel * model()
virtual void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command)
virtual void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
iterator begin()
iterator end()
bool isEmpty() const const
void reserve(qsizetype size)
bool isValid() const const
void deleteLater()
QObject * parent() const const
T qobject_cast(QObject *object)
iterator begin()
iterator end()
iterator erase(const_iterator pos)
bool isEmpty() const const
QList< T > values() const const
void clear()
bool isEmpty() const const
singleShot
void expand(const QModelIndex &index)
bool isExpanded(const QModelIndex &index) const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.