forked from zhengtianzuo/QtQuickExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
24 lines (22 loc) · 702 Bytes
/
Copy pathmain.cpp
File metadata and controls
24 lines (22 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*!
*@file main.cpp
*@brief 程序主文件
*@version 1.0
*@section LICENSE Copyright (C) 2003-2103 CamelSoft Corporation
*@author zhengtianzuo
*/
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "QmlTableView.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
QmlTableViewModel model;
model.Add(QStringLiteral("初始化"), QStringLiteral("999"), QStringLiteral("888"));
engine.rootContext()->setContextProperty("theModel", &model);
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
return app.exec();
}