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
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#include <array>
22
24
26
28{
29 Q_DECLARE_PUBLIC(QItemSelectionModel)
30public:
34
36 QItemSelectionModel::SelectionFlags command) const;
37
39
40 void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
41 void columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
42 void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
44 void layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
46 {
48 }
49
50 void layoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint);
52 {
53 layoutChanged(QList<QPersistentModelIndex>(), QAbstractItemModel::NoLayoutChangeHint);
54 }
55
56 void modelDestroyed();
57
58 inline void remove(QList<QItemSelectionRange> &r)
59 {
61 for (; it != r.constEnd(); ++it)
62 ranges.removeAll(*it);
63 }
64
65 inline void finalize()
66 {
67 ranges.merge(currentSelection, currentCommand);
68 if (!currentSelection.isEmpty()) // ### perhaps this should be in QList
70 }
71
72 void setModel(QAbstractItemModel *mod) { q_func()->setModel(mod); }
73 void disconnectModel();
74 void modelChanged(QAbstractItemModel *mod) { emit q_func()->modelChanged(mod); }
78
79 QItemSelection ranges;
87 // optimization when all indexes are selected
92};
93
95
96#endif // QITEMSELECTIONMODEL_P_H
LayoutChangeHint
This enum describes the way the model changes layout.
QPersistentModelIndex tableParent
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void setModel(QAbstractItemModel *mod)
void columnsAboutToBeInserted(const QModelIndex &parent, int start, int end)
QItemSelectionModel::SelectionFlags currentCommand
void 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< std::pair< QPersistentModelIndex, uint > > savedPersistentCurrentRowLengths
QList< std::pair< QPersistentModelIndex, uint > > savedPersistentRowLengths
QList< QPersistentModelIndex > savedPersistentCurrentIndexes
std::array< QMetaObject::Connection, 12 > connections
void initModel(QAbstractItemModel *model)
void layoutChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
void remove(QList< QItemSelectionRange > &r)
QList< QPersistentModelIndex > savedPersistentIndexes
void modelChanged(QAbstractItemModel *mod)
QItemSelection expandSelection(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command) const
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
\inmodule QtCore
Definition qlist.h:75
bool isEmpty() const noexcept
Definition qlist.h:401
void clear()
Definition qlist.h:434
\inmodule QtCore
QObject * parent
Definition qobject.h:73
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.
GLboolean r
[2]
GLuint GLuint end
GLuint start
GLenum array
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define QT_REQUIRE_CONFIG(feature)
#define emit
unsigned int uint
Definition qtypes.h:34
QSqlQueryModel * model
[16]
QItemSelection * selection
[0]
\inmodule QtCore