10#include <QAbstractItemModel>
11#include <QApplication>
17int main(
int argc,
char *argv[])
24numbers <<
"One" <<
"Two" <<
"Three" <<
"Four" <<
"Five";
30view->setWindowTitle(
"View onto a string list model");
virtual Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the data in row and column with parent.
The QApplication class manages the GUI application's control flow and main settings.
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
The QListView class provides a list or icon view onto a model.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void show()
Shows the window.
GLenum GLenum GLsizei void * row
QSqlQueryModel * model
[16]
QApplication app(argc, argv)
[0]