KWidgetsAddons
kviewstateserializer.cpp
2 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
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);
virtual QString indexToConfigString(const QModelIndex &index) const =0
Reimplement to return a unique string for the index.
QSet::iterator erase(QSet::iterator pos)
singleShot
QItemSelectionModel * selectionModel() const const
QStringList expansionKeys() const
Returns a QStringList representing the expanded indexes in the QTreeView.
Definition: kviewstateserializer.cpp:316
Object for saving and restoring state in QTreeViews and QItemSelectionModels.
Definition: kviewstateserializer.h:168
QAbstractItemView * view() const
The view whose state is persisted.
Definition: kviewstateserializer.cpp:120
void reserve(int alloc)
NoUpdate
void deleteLater()
void restoreScrollState(int verticalScoll, int horizontalScroll)
Restores the scroll state of the QAbstractScrollArea to the verticalScoll and horizontalScroll.
Definition: kviewstateserializer.cpp:255
bool isEmpty() const const
QString currentIndexKey() const
Returns a QString describing the current index in the selection model.
Definition: kviewstateserializer.cpp:307
QItemSelectionModel * selectionModel() const
The QItemSelectionModel whose state is persisted.
Definition: kviewstateserializer.cpp:126
void restoreExpanded(const QStringList &indexStrings)
Expand the indexes described by indexStrings in the QTreeView.
Definition: kviewstateserializer.cpp:236
bool isEmpty() const const
QSet::iterator begin()
bool isValid() const const
void restoreSelection(const QStringList &indexStrings)
Select the indexes described by indexStrings.
Definition: kviewstateserializer.cpp:287
QPair< int, int > scrollState() const
Returns the vertical and horizontal scroll of the QAbstractScrollArea.
Definition: kviewstateserializer.cpp:343
QStringList selectionKeys() const
Returns a QStringList describing the selection in the selectionModel.
Definition: kviewstateserializer.cpp:326
void rowsInserted(const QModelIndex &parent, int first, int last)
QSet::iterator end()
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
QList::iterator begin()
QList::iterator end()
void setView(QAbstractItemView *view)
Sets the view whose state is persisted.
Definition: kviewstateserializer.cpp:106
void restoreCurrentItem(const QString &indexString)
Make the index described by indexString the currentIndex in the selectionModel.
Definition: kviewstateserializer.cpp:202
QObject * parent() const const
const QAbstractItemModel * model() const const
void setSelectionModel(QItemSelectionModel *selectionModel)
Sets the QItemSelectionModel whose state is persisted.
Definition: kviewstateserializer.cpp:132
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 03:59:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 03:59:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.