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
model.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#ifndef MODEL_H
5#define MODEL_H
6
7#include <QAbstractListModel>
8#include <QObject>
9#include <QStringList>
10
13{
15
16public:
19
20 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
21 QVariant data(const QModelIndex &index, int role) const override;
22 QVariant headerData(int section, Qt::Orientation orientation,
24 int role = Qt::DisplayRole) const override;
26
28 Qt::ItemFlags flags(const QModelIndex &index) const override;
29 bool setData(const QModelIndex &index, const QVariant &value,
31 int role = Qt::EditRole) override;
33
35 bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
36 bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
38
40private:
41 QStringList stringList;
42};
44
45#endif
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
\inmodule QtCore
Definition qvariant.h:65
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex()) override
[3]
Definition model.cpp:142
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
[3]
Definition model.cpp:123
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of items in the string list as the number of rows in the model.
Definition model.cpp:18
StringListModel(const QStringList &strings, QObject *parent=nullptr)
Definition model.h:17
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
[1]
Definition model.cpp:83
bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex()) override
[7]
Definition model.cpp:161
Orientation
Definition qnamespace.h:98
@ EditRole
@ DisplayRole
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint index
[2]
GLsizei const GLchar ** strings
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLbitfield flags
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_OBJECT