10#include <QApplication>
15#include <QFileSystemModel>
27int main(
int argc,
char *argv[])
64 window.setWindowTitle(
"A simple model example");
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...
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment.
static QString currentPath()
Returns the absolute path of the application's current directory.
The QFileSystemModel class provides a data model for the local filesystem.
void directoryLoaded(const QString &path)
The QLabel widget provides a text or image display.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QVariant data(const QModelIndex &item, int role=Qt::DisplayRole) const override
Returns the value for the specified item and role.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QVBoxLayout class lines up widgets vertically.
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
GLuint GLsizei const GLchar * label
[43]
GLenum GLenum GLsizei void * row
QSqlQueryModel * model
[16]
QApplication app(argc, argv)
[0]