Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qitemselectionmodel_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QITEMSELECTIONMODEL_P_H
5#define QITEMSELECTIONMODEL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qitemselectionmodel.h"
19#include "private/qobject_p.h"
20#include "private/qproperty_p.h"
21
23
25
27{
28 Q_DECLARE_PUBLIC(QItemSelectionModel)
29public:
33
35 QItemSelectionModel::SelectionFlags command) const;
36
38
39 void _q_rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
45 void _q_modelDestroyed();
46
48 {
50 for (; it != r.constEnd(); ++it)
51 ranges.removeAll(*it);
52 }
53
54 inline void finalize()
55 {
56 ranges.merge(currentSelection, currentCommand);
57 if (!currentSelection.isEmpty()) // ### perhaps this should be in QList
59 }
60
61 void setModel(QAbstractItemModel *mod) { q_func()->setModel(mod); }
62 void modelChanged(QAbstractItemModel *mod) { q_func()->modelChanged(mod); }
66
67 QItemSelection ranges;
75 // optimization when all indexes are selected
79};
80
82
83#endif // QITEMSELECTIONMODEL_P_H
LayoutChangeHint
This enum describes the way the model changes layout.
QPersistentModelIndex tableParent
void _q_rowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void _q_columnsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void _q_layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
void setModel(QAbstractItemModel *mod)
QList< QPair< QPersistentModelIndex, uint > > savedPersistentRowLengths
QList< QPair< QPersistentModelIndex, uint > > savedPersistentCurrentRowLengths
QItemSelectionModel::SelectionFlags currentCommand
void _q_columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
QPersistentModelIndex currentIndex
Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QItemSelectionModelPrivate, QAbstractItemModel *, model, &QItemSelectionModelPrivate::setModel, &QItemSelectionModelPrivate::modelChanged, nullptr) QItemSelection ranges
QList< QPersistentModelIndex > savedPersistentCurrentIndexes
void initModel(QAbstractItemModel *model)
void _q_rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
void remove(QList< QItemSelectionRange > &r)
QList< QPersistentModelIndex > savedPersistentIndexes
void modelChanged(QAbstractItemModel *mod)
QItemSelection expandSelection(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command) const
void _q_layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
\inmodule QtCore
Definition qlist.h:74
bool isEmpty() const noexcept
Definition qlist.h:390
void clear()
Definition qlist.h:417
\inmodule QtCore
QObject * parent
Definition qobject.h:61
const_iterator constBegin() const noexcept
Definition qset.h:139
const_iterator constEnd() const noexcept
Definition qset.h:143
QSet< QString >::iterator it
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
GLboolean r
[2]
GLuint GLuint end
GLuint start
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define QT_REQUIRE_CONFIG(feature)
unsigned int uint
Definition qtypes.h:29
QSqlQueryModel * model
[16]
QItemSelection * selection
[0]