4#ifndef QITEMSELECTIONMODEL_H
5#define QITEMSELECTIONMODEL_H
7#include <QtCore/qglobal.h>
9#include <QtCore/qabstractitemmodel.h>
10#include <QtCore/qlist.h>
11#include <QtCore/qset.h>
31 inline int top()
const {
return tl.row(); }
32 inline int left()
const {
return tl.column(); }
33 inline int bottom()
const {
return br.row(); }
34 inline int right()
const {
return br.column(); }
35 inline int width()
const {
return br.column() - tl.column() + 1; }
36 inline int height()
const {
return br.row() - tl.row() + 1; }
46 && tl.row() <=
index.row() && tl.column() <=
index.column()
47 && br.row() >=
index.row() && br.column() >=
index.column());
52 return (
parent() == parentIndex
54 && br.row() >=
row && br.column() >=
column);
68 return (tl.isValid() && br.isValid() && tl.parent() == br.parent()
88 BINDABLE bindableModel)
96 STORED
false DESIGNABLE
false)
111 SelectCurrent =
Select | Current,
112 ToggleCurrent = Toggle | Current,
113 ClearAndSelect = Clear |
Select
146 virtual void setCurrentIndex(
const QModelIndex &
index, QItemSelectionModel::SelectionFlags command);
149 virtual void clear();
150 virtual void reset();
152 void clearSelection();
153 virtual void clearCurrentIndex();
192 Q_CORE_EXPORT
void merge(
const QItemSelection &
other, QItemSelectionModel::SelectionFlags command);
199#ifndef QT_NO_DEBUG_STREAM
LayoutChangeHint
This enum describes the way the model changes layout.
SelectionFlag
This enum describes the way the selection model will be updated.
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
This signal is emitted whenever the selection changes.
QAbstractItemModel * model()
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
This signal is emitted whenever the current item changes.
void modelChanged(QAbstractItemModel *model)
void currentColumnChanged(const QModelIndex ¤t, const QModelIndex &previous)
This signal is emitted if the current item changes and its column is different to the column of the p...
void currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous)
This signal is emitted if the current item changes and its row is different to the row of the previou...
bool contains(int row, int column, const QModelIndex &parentIndex) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool operator!=(const QItemSelectionRange &other) const
Returns true if the selection range differs from the other range given; otherwise returns false.
bool contains(const QModelIndex &index) const
Returns true if the model item specified by the index lies within the range of selected items; otherw...
int bottom() const
Returns the row index corresponding to the lowermost selected row in the selection range.
QItemSelectionRange(const QModelIndex &index)
Constructs a new selection range containing only the model item specified by the model index index.
const QPersistentModelIndex & topLeft() const
Returns the index for the item located at the top-left corner of the selection range.
QItemSelectionRange(const QModelIndex &topL, const QModelIndex &bottomR)
Constructs a new selection range containing only the index specified by the topLeft and the index bot...
int top() const
Returns the row index corresponding to the uppermost selected row in the selection range.
QItemSelectionRange()=default
Constructs an empty selection range.
void swap(QItemSelectionRange &other) noexcept
const QPersistentModelIndex & bottomRight() const
Returns the index for the item located at the bottom-right corner of the selection range.
int right() const
Returns the column index corresponding to the rightmost selected column in the selection range.
int height() const
Returns the number of selected rows in the selection range.
const QAbstractItemModel * model() const
Returns the model that the items in the selection range belong to.
int width() const
Returns the number of selected columns in the selection range.
bool operator==(const QItemSelectionRange &other) const
Returns true if the selection range is exactly the same as the other range given; otherwise returns f...
QModelIndex parent() const
Returns the parent model item index of the items in the selection range.
int left() const
Returns the column index corresponding to the leftmost selected column in the selection range.
bool isValid() const
Returns true if the selection range is valid; otherwise returns false.
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
static bool hasSelection()
Q_CORE_EXPORT QDebug operator<<(QDebug, const QItemSelectionRange &)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static void split(QT_FT_Vector *b)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define QT_REQUIRE_CONFIG(feature)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
view setModel(model)
[17] //! [18]
QSqlQueryModel * model
[16]
QItemSelection * selection
[0]
selection select(topLeft, bottomRight)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
virtual HRESULT STDMETHODCALLTYPE Select()=0