Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
#
include
<
QGuiApplication
>
4
#
include
<
QFileSystemModel
>
5
#
include
<
QQmlEngine
>
6
#
include
<
QQuickView
>
7
8
//![0]
9
int
main
(
int
argc,
char
** argv)
10
{
11
QGuiApplication app(argc, argv);
12
13
QQuickView view;
14
15
QFileSystemModel model;
16
// start populating the model (doesn't change the model's root)
17
model.setRootPath(QDir::currentPath());
18
19
qmlRegisterSingletonInstance(
"FileSystemModule"
, 1, 0,
"FileSystemModel"
, &model);
20
view.setSource(QUrl::fromLocalFile(
"view.qml"
));
21
view.show();
22
23
return
app.exec();
24
}
25
//![0]
main
int main(int argc, char *argv[])
[ctor_close]
Definition
src_corelib_animation_qpropertyanimation.cpp:100
qtdeclarative
src
qmlmodels
doc
snippets
delegatemodel
delegatemodel_rootindex
main.cpp
Generated on
for Qt by
1.18.0