summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-23 10:49:37 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-23 10:49:37 +0100
commit5d4cbf4094c9b290626aab89e4bd92edd29ce49f (patch)
treeeac893652c724f057fba493688b16e212fd844dd /examples
parent13cf5f02ce788f19a73e5d5c3da76e57291761a5 (diff)
parent07cde200e55ee03bf9e2f9af89c20f91072deccc (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/qml/jsruntime/qv4object_p.h Change-Id: Iff4d3aba7710a999b8befdc493cbe959e1ce02f9
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/demos/stocqt/content/StockListModel.qml66
-rw-r--r--examples/quick/demos/stocqt/content/StockListView.qml60
-rw-r--r--examples/quick/positioners/positioners-attachedproperties.qml18
-rw-r--r--examples/quick/positioners/positioners-transitions.qml94
-rw-r--r--examples/quick/scenegraph/rendernode/d3d12renderer.cpp30
-rw-r--r--examples/quick/scenegraph/rendernode/rendernode.pro16
-rw-r--r--examples/quick/scenegraph/rendernode/rendernode.qrc2
-rw-r--r--examples/quick/scenegraph/rendernode/shader_frag.csobin0 -> 908 bytes
-rw-r--r--examples/quick/scenegraph/rendernode/shader_vert.csobin0 -> 1720 bytes
-rw-r--r--examples/quick/scenegraph/rendernode/softwarerenderer.cpp2
-rw-r--r--examples/quick/shared/shared.h1
11 files changed, 148 insertions, 141 deletions
diff --git a/examples/quick/demos/stocqt/content/StockListModel.qml b/examples/quick/demos/stocqt/content/StockListModel.qml
index be00e7bb1c..9b48124bda 100644
--- a/examples/quick/demos/stocqt/content/StockListModel.qml
+++ b/examples/quick/demos/stocqt/content/StockListModel.qml
@@ -42,6 +42,72 @@ import QtQuick 2.0
ListModel {
id: stocks
+
+ // pre-fetch data for all entries
+ Component.onCompleted: {
+ for (var idx = 0; idx < count; ++idx) {
+ getCloseValue(idx)
+ }
+ }
+
+ function requestUrl(stockId) {
+ var endDate = new Date(""); // today
+ var startDate = new Date()
+ startDate.setDate(startDate.getDate() - 5);
+
+ var request = "http://ichart.finance.yahoo.com/table.csv?";
+ request += "s=" + stockId;
+ request += "&g=d";
+ request += "&a=" + startDate.getMonth();
+ request += "&b=" + startDate.getDate();
+ request += "&c=" + startDate.getFullYear();
+ request += "&d=" + endDate.getMonth();
+ request += "&e=" + endDate.getDate();
+ request += "&f=" + endDate.getFullYear();
+ request += "&g=d";
+ request += "&ignore=.csv";
+ return request;
+ }
+
+ function getCloseValue(index) {
+ var req = requestUrl(get(index).stockId);
+
+ if (!req)
+ return;
+
+ var xhr = new XMLHttpRequest;
+
+ xhr.open("GET", req, true);
+
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === XMLHttpRequest.LOADING || xhr.readyState === XMLHttpRequest.DONE) {
+ var records = xhr.responseText.split('\n');
+ if (records.length > 0 && xhr.status == 200) {
+ var r = records[1].split(',');
+ var today = parseFloat(r[4]);
+ setProperty(index, "value", today.toFixed(2));
+
+ r = records[2].split(',');
+ var yesterday = parseFloat(r[4]);
+ var change = today - yesterday;
+ if (change >= 0.0)
+ setProperty(index, "change", "+" + change.toFixed(2));
+ else
+ setProperty(index, "change", change.toFixed(2));
+
+ var changePercentage = (change / yesterday) * 100.0;
+ if (changePercentage >= 0.0)
+ setProperty(index, "changePercentage", "+" + changePercentage.toFixed(2) + "%");
+ else
+ setProperty(index, "changePercentage", changePercentage.toFixed(2) + "%");
+ } else {
+ var unknown = "n/a";
+ set(index, {"value": unknown, "change": unknown, "changePercentage": unknown});
+ }
+ }
+ }
+ xhr.send()
+ }
// Uncomment to test invalid entries
// ListElement {name: "The Qt Company"; stockId: "TQTC"; value: "999.0"; change: "0.0"; changePercentage: "0.0"}
diff --git a/examples/quick/demos/stocqt/content/StockListView.qml b/examples/quick/demos/stocqt/content/StockListView.qml
index 59f36b42cc..d2bd52a69d 100644
--- a/examples/quick/demos/stocqt/content/StockListView.qml
+++ b/examples/quick/demos/stocqt/content/StockListView.qml
@@ -64,65 +64,6 @@ Rectangle {
model: StockListModel{}
currentIndex: -1 // Don't pre-select any item
- function requestUrl(stockId) {
- var endDate = new Date(""); //today
- var startDate = new Date()
- startDate.setDate(startDate.getDate() - 5);
-
- var request = "http://ichart.finance.yahoo.com/table.csv?";
- request += "s=" + stockId;
- request += "&g=d";
- request += "&a=" + startDate.getMonth();
- request += "&b=" + startDate.getDate();
- request += "&c=" + startDate.getFullYear();
- request += "&d=" + endDate.getMonth();
- request += "&e=" + endDate.getDate();
- request += "&f=" + endDate.getFullYear();
- request += "&g=d";
- request += "&ignore=.csv";
- return request;
- }
-
- function getCloseValue(index) {
- var req = requestUrl(model.get(index).stockId);
-
- if (!req)
- return;
-
- var xhr = new XMLHttpRequest;
-
- xhr.open("GET", req, true);
-
- xhr.onreadystatechange = function() {
- if (xhr.readyState === XMLHttpRequest.LOADING || xhr.readyState === XMLHttpRequest.DONE) {
- var records = xhr.responseText.split('\n');
- if (records.length > 0 && xhr.status == 200) {
- var r = records[1].split(',');
- var today = parseFloat(r[4]);
- model.setProperty(index, "value", today.toFixed(2));
-
- r = records[2].split(',');
- var yesterday = parseFloat(r[4]);
- var change = today - yesterday;
- if (change >= 0.0)
- model.setProperty(index, "change", "+" + change.toFixed(2));
- else
- model.setProperty(index, "change", change.toFixed(2));
-
- var changePercentage = (change / yesterday) * 100.0;
- if (changePercentage >= 0.0)
- model.setProperty(index, "changePercentage", "+" + changePercentage.toFixed(2) + "%");
- else
- model.setProperty(index, "changePercentage", changePercentage.toFixed(2) + "%");
- } else {
- var unknown = "n/a";
- model.set(index, {"value": unknown, "change": unknown, "changePercentage": unknown});
- }
- }
- }
- xhr.send()
- }
-
onCurrentIndexChanged: {
if (currentItem) {
root.currentStockId = model.get(currentIndex).stockId;
@@ -175,7 +116,6 @@ Rectangle {
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: value
- Component.onCompleted: view.getCloseValue(index);
}
Text {
diff --git a/examples/quick/positioners/positioners-attachedproperties.qml b/examples/quick/positioners/positioners-attachedproperties.qml
index ac2c76db47..e7fa59bb9a 100644
--- a/examples/quick/positioners/positioners-attachedproperties.qml
+++ b/examples/quick/positioners/positioners-attachedproperties.qml
@@ -66,14 +66,14 @@ Rectangle {
anchors.left: parent.left
anchors.leftMargin: page.width / 32
anchors.topMargin: page.height / 48
- spacing: elementSpacing
+ spacing: page.elementSpacing
//! [0]
Rectangle {
id: green
color: "#80c342"
- width: 100 * ratio
- height: 100 * ratio
+ width: 100 * page.ratio
+ height: 100 * page.ratio
Text {
anchors.left: parent.right
@@ -95,8 +95,8 @@ Rectangle {
Rectangle {
id: blue
color: "#14aaff"
- width: 100 * ratio
- height: 100 * ratio
+ width: 100 * page.ratio
+ height: 100 * page.ratio
Text {
anchors.left: parent.right
@@ -117,8 +117,8 @@ Rectangle {
Rectangle {
id: purple
color: "#6400aa"
- width: 100 * ratio
- height: 100 * ratio
+ width: 100 * page.ratio
+ height: 100 * page.ratio
Text {
anchors.left: parent.right
@@ -140,8 +140,8 @@ Rectangle {
Rectangle {
id: hidingRect
color: "#006325"
- width: 100 * ratio
- height: 100 * ratio
+ width: 100 * page.ratio
+ height: 100 * page.ratio
visible: false
Text {
diff --git a/examples/quick/positioners/positioners-transitions.qml b/examples/quick/positioners/positioners-transitions.qml
index 0d283f7301..17fe41a7e2 100644
--- a/examples/quick/positioners/positioners-transitions.qml
+++ b/examples/quick/positioners/positioners-transitions.qml
@@ -55,7 +55,7 @@ Item {
interval: 2000
running: true
repeat: true
- onTriggered: effectiveOpacity = (effectiveOpacity == 1.0 ? 0.0 : 1.0);
+ onTriggered: page.effectiveOpacity = (page.effectiveOpacity == 1.0 ? 0.0 : 1.0);
}
Column {
@@ -65,7 +65,7 @@ Item {
top: parent.top
topMargin: page.height / 48
}
- spacing: elementSpacing
+ spacing: page.elementSpacing
populate: Transition {
NumberAnimation { properties: "x,y"; from: 200; duration: 100; easing.type: Easing.OutBounce }
@@ -77,32 +77,32 @@ Item {
NumberAnimation { properties: "y"; easing.type: Easing.OutBounce }
}
- Rectangle { color: "#80c342"; width: bigSize; height: smallSize }
+ Rectangle { color: "#80c342"; width: page.bigSize; height: page.smallSize }
Rectangle {
id: greenV1
visible: opacity != 0
- width: bigSize; height: smallSize
+ width: page.bigSize; height: page.smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#14aaff"; width: bigSize; height: smallSize }
+ Rectangle { color: "#14aaff"; width: page.bigSize; height: page.smallSize }
Rectangle {
id: greenV2
visible: opacity != 0
- width: bigSize; height: smallSize
+ width: page.bigSize; height: page.smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#6400aa"; width: bigSize; height: smallSize }
- Rectangle { color: "#80c342"; width: bigSize; height: smallSize }
+ Rectangle { color: "#6400aa"; width: page.bigSize; height: page.smallSize }
+ Rectangle { color: "#80c342"; width: page.bigSize; height: page.smallSize }
}
Row {
@@ -112,7 +112,7 @@ Item {
bottom: page.bottom
bottomMargin: page.height / 48
}
- spacing: elementSpacing
+ spacing: page.elementSpacing
populate: Transition {
NumberAnimation { properties: "x,y"; from: 200; duration: 100; easing.type: Easing.OutBounce }
@@ -124,40 +124,40 @@ Item {
NumberAnimation { properties: "x"; easing.type: Easing.OutBounce }
}
- Rectangle { color: "#80c342"; width: smallSize; height: bigSize }
+ Rectangle { color: "#80c342"; width: page.smallSize; height: page.bigSize }
Rectangle {
id: blueH1
visible: opacity != 0
- width: smallSize; height: bigSize
+ width: page.smallSize; height: page.bigSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#14aaff"; width: smallSize; height: bigSize }
+ Rectangle { color: "#14aaff"; width: page.smallSize; height: page.bigSize }
Rectangle {
id: greenH2
visible: opacity != 0
- width: smallSize; height: bigSize
+ width: page.smallSize; height: page.bigSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#6400aa"; width: smallSize; height: bigSize }
- Rectangle { color: "#80c342"; width: smallSize; height: bigSize }
+ Rectangle { color: "#6400aa"; width: page.smallSize; height: page.bigSize }
+ Rectangle { color: "#80c342"; width: page.smallSize; height: page.bigSize }
}
Grid {
anchors.top: parent.top
anchors.topMargin: page.height / 48
- anchors.left: flow.left
+ anchors.left: flowItem.left
columns: 3
- spacing: elementSpacing
+ spacing: page.elementSpacing
populate: Transition {
NumberAnimation { properties: "x,y"; from: 200; duration: 100; easing.type: Easing.OutBounce }
@@ -169,55 +169,55 @@ Item {
NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }
}
- Rectangle { color: "#80c342"; width: smallSize; height: smallSize }
+ Rectangle { color: "#80c342"; width: page.smallSize; height: page.smallSize }
Rectangle {
id: greenG1
visible: opacity != 0
- width: smallSize; height: smallSize
+ width: page.smallSize; height: page.smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#14aaff"; width: smallSize; height: smallSize }
+ Rectangle { color: "#14aaff"; width: page.smallSize; height: page.smallSize }
Rectangle {
id: greenG2
visible: opacity != 0
- width: smallSize; height: smallSize
+ width: page.smallSize; height:page. smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#6400aa"; width: smallSize; height: smallSize }
+ Rectangle { color: "#6400aa"; width: page.smallSize; height: page.smallSize }
Rectangle {
id: greenG3
visible: opacity != 0
- width: smallSize; height: smallSize
+ width: page.smallSize; height: page.smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#80c342"; width: smallSize; height: smallSize }
- Rectangle { color: "#14aaff"; width: smallSize; height: smallSize }
- Rectangle { color: "#6400aa"; width: smallSize; height: smallSize }
+ Rectangle { color: "#80c342"; width:page. smallSize; height: page.smallSize }
+ Rectangle { color: "#14aaff"; width: smallSize; height: page.smallSize }
+ Rectangle { color: "#6400aa"; width: page.page.smallSize; height: page.smallSize }
}
Flow {
- id: flow
+ id: flowItem
anchors.right: page.right
anchors.rightMargin: page.width / 32
- y: 2 * bigSize
- width: 1.8 * bigSize
- spacing: elementSpacing
+ y: 2 * page.bigSize
+ width: 1.8 * page.bigSize
+ spacing: page.elementSpacing
//! [move]
move: Transition {
@@ -237,42 +237,42 @@ Item {
}
//! [populate]
- Rectangle { color: "#80c342"; width: smallSize; height: smallSize }
+ Rectangle { color: "#80c342"; width: page.smallSize; height: page.smallSize }
Rectangle {
id: greenF1
visible: opacity != 0
- width: 0.6 * bigSize; height: smallSize
+ width: 0.6 * page.bigSize; height: page.smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#14aaff"; width: 0.3 * bigSize; height: smallSize }
+ Rectangle { color: "#14aaff"; width: 0.3 * page.bigSize; height: page.smallSize }
Rectangle {
id: greenF2
visible: opacity != 0
- width: 0.6 * bigSize; height: smallSize
+ width: 0.6 * page.bigSize; height: page.smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#6400aa"; width: smallSize; height: smallSize }
+ Rectangle { color: "#6400aa"; width: page.smallSize; height: page.smallSize }
Rectangle {
id: greenF3
visible: opacity != 0
- width: 0.4 * bigSize; height: smallSize
+ width: 0.4 * page.bigSize; height: page.smallSize
color: "#006325"
border.color: "transparent"
Behavior on opacity { NumberAnimation {} }
- opacity: effectiveOpacity
+ opacity: page.effectiveOpacity
}
- Rectangle { color: "#80c342"; width: 0.8 * bigSize; height: smallSize }
+ Rectangle { color: "#80c342"; width: 0.8 * page.bigSize; height: page.smallSize }
}
}
diff --git a/examples/quick/scenegraph/rendernode/d3d12renderer.cpp b/examples/quick/scenegraph/rendernode/d3d12renderer.cpp
index 3b377f1cb1..9916769241 100644
--- a/examples/quick/scenegraph/rendernode/d3d12renderer.cpp
+++ b/examples/quick/scenegraph/rendernode/d3d12renderer.cpp
@@ -42,12 +42,10 @@
#include <QQuickItem>
#include <QQuickWindow>
#include <QSGRendererInterface>
+#include <QFile>
#if QT_CONFIG(d3d12)
-#include "vs_shader.hlslh"
-#include "ps_shader.hlslh"
-
D3D12RenderNode::D3D12RenderNode(QQuickItem *item)
: m_item(item)
{
@@ -78,7 +76,7 @@ void D3D12RenderNode::releaseResources()
void D3D12RenderNode::init()
{
QSGRendererInterface *rif = m_item->window()->rendererInterface();
- m_device = static_cast<ID3D12Device *>(rif->getResource(m_item->window(), QSGRendererInterface::Device));
+ m_device = static_cast<ID3D12Device *>(rif->getResource(m_item->window(), QSGRendererInterface::DeviceResource));
Q_ASSERT(m_device);
D3D12_ROOT_PARAMETER rootParameter;
@@ -111,12 +109,25 @@ void D3D12RenderNode::init()
{ "COLOR", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 8, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }
};
+ QFile f(QStringLiteral(":/scenegraph/rendernode/shader_vert.cso"));
+ if (!f.open(QIODevice::ReadOnly)) {
+ qWarning("Failed to open file with vertex shader bytecode");
+ return;
+ }
+ QByteArray vshader_cso = f.readAll();
+ f.close();
+ f.setFileName(QStringLiteral(":/scenegraph/rendernode/shader_frag.cso"));
+ if (!f.open(QIODevice::ReadOnly)) {
+ qWarning("Failed to open file with fragment shader bytecode");
+ return;
+ }
+ QByteArray fshader_cso = f.readAll();
D3D12_SHADER_BYTECODE vshader;
- vshader.pShaderBytecode = g_VS_Simple;
- vshader.BytecodeLength = sizeof(g_VS_Simple);
+ vshader.pShaderBytecode = vshader_cso.constData();
+ vshader.BytecodeLength = vshader_cso.size();
D3D12_SHADER_BYTECODE pshader;
- pshader.pShaderBytecode = g_PS_Simple;
- pshader.BytecodeLength = sizeof(g_PS_Simple);
+ pshader.pShaderBytecode = fshader_cso.constData();
+ pshader.BytecodeLength = fshader_cso.size();
D3D12_RASTERIZER_DESC rastDesc = {};
rastDesc.FillMode = D3D12_FILL_MODE_SOLID;
@@ -235,7 +246,8 @@ void D3D12RenderNode::render(const RenderState *state)
init();
QSGRendererInterface *rif = m_item->window()->rendererInterface();
- ID3D12GraphicsCommandList *commandList = static_cast<ID3D12GraphicsCommandList *>(rif->getResource(m_item->window(), QSGRendererInterface::CommandList));
+ ID3D12GraphicsCommandList *commandList = static_cast<ID3D12GraphicsCommandList *>(
+ rif->getResource(m_item->window(), QSGRendererInterface::CommandListResource));
Q_ASSERT(commandList);
const int msize = 16 * sizeof(float);
diff --git a/examples/quick/scenegraph/rendernode/rendernode.pro b/examples/quick/scenegraph/rendernode/rendernode.pro
index 968902a5be..76e498042b 100644
--- a/examples/quick/scenegraph/rendernode/rendernode.pro
+++ b/examples/quick/scenegraph/rendernode/rendernode.pro
@@ -15,24 +15,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/quick/scenegraph/rendernode
INSTALLS += target
OTHER_FILES += \
- main.qml \
- shader.hlsl
+ main.qml
qtConfig(d3d12) {
HEADERS += d3d12renderer.h
SOURCES += d3d12renderer.cpp
LIBS += -ld3d12
-
- VSPS = shader.hlsl
- vshader.input = VSPS
- vshader.header = vs_shader.hlslh
- vshader.entry = VS_Simple
- vshader.type = vs_5_0
- pshader.input = VSPS
- pshader.header = ps_shader.hlslh
- pshader.entry = PS_Simple
- pshader.type = ps_5_0
-
- HLSL_SHADERS = vshader pshader
- load(hlsl_bytecode_header)
}
diff --git a/examples/quick/scenegraph/rendernode/rendernode.qrc b/examples/quick/scenegraph/rendernode/rendernode.qrc
index 3674baccd8..049adcf8a6 100644
--- a/examples/quick/scenegraph/rendernode/rendernode.qrc
+++ b/examples/quick/scenegraph/rendernode/rendernode.qrc
@@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/scenegraph/rendernode">
<file>main.qml</file>
+ <file>shader_vert.cso</file>
+ <file>shader_frag.cso</file>
</qresource>
</RCC>
diff --git a/examples/quick/scenegraph/rendernode/shader_frag.cso b/examples/quick/scenegraph/rendernode/shader_frag.cso
new file mode 100644
index 0000000000..686c6af3fc
--- /dev/null
+++ b/examples/quick/scenegraph/rendernode/shader_frag.cso
Binary files differ
diff --git a/examples/quick/scenegraph/rendernode/shader_vert.cso b/examples/quick/scenegraph/rendernode/shader_vert.cso
new file mode 100644
index 0000000000..fa13be5160
--- /dev/null
+++ b/examples/quick/scenegraph/rendernode/shader_vert.cso
Binary files differ
diff --git a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp
index 06e406874a..d303b9ef13 100644
--- a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp
+++ b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp
@@ -61,7 +61,7 @@ void SoftwareRenderNode::releaseResources()
void SoftwareRenderNode::render(const RenderState *renderState)
{
QSGRendererInterface *rif = m_item->window()->rendererInterface();
- QPainter *p = static_cast<QPainter *>(rif->getResource(m_item->window(), QSGRendererInterface::Painter));
+ QPainter *p = static_cast<QPainter *>(rif->getResource(m_item->window(), QSGRendererInterface::PainterResource));
Q_ASSERT(p);
p->setTransform(matrix()->toTransform());
diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h
index d8fb80b97e..0eed618d9d 100644
--- a/examples/quick/shared/shared.h
+++ b/examples/quick/shared/shared.h
@@ -44,6 +44,7 @@
#include <QQuickView> //Not using QQmlApplicationEngine because many examples don't have a Window{}
#define DECLARATIVE_EXAMPLE_MAIN(NAME) int main(int argc, char* argv[]) \
{\
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);\
QGuiApplication app(argc,argv);\
app.setOrganizationName("QtProject");\
app.setOrganizationDomain("qt-project.org");\