-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
699 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
TEMPLATE = app | ||
|
||
QT += gui quick qml quickcontrols2 | ||
|
||
SOURCES += main.cpp | ||
|
||
RESOURCES += Res.qrc | ||
|
||
include(../../src/TaoQuick/TaoQuick.pri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>main.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <QQuickView> | ||
#include <QQmlEngine> | ||
#include <QQmlContext> | ||
#include <QGuiApplication> | ||
int main(int argc, char **argv) | ||
{ | ||
QGuiApplication app(argc, argv); | ||
QQuickView view; | ||
view.engine()->addImportPath(TaoQuickImportPath); | ||
view.rootContext()->setContextProperty("taoQuickImagePath", TaoQuickImagePath); | ||
|
||
view.setSource(QUrl("qrc:/main.qml")); | ||
view.show(); | ||
|
||
return app.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import QtQml 2.0 | ||
import QtQuick 2.9 | ||
|
||
import QtQuick.Controls 2.0 | ||
|
||
import TaoQuick 1.0 | ||
|
||
Rectangle { | ||
color: "lightblue" | ||
width: 640 | ||
height: 480 | ||
CusButton_Blue { | ||
width: 120 | ||
height: 36 | ||
anchors.centerIn: parent | ||
text: "Hello" | ||
onClicked: { | ||
console.log("hello TaoQuick") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
|
||
project(HelloTaoQuick2 LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
include(taoQuick.cmake) | ||
|
||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick REQUIRED) | ||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick REQUIRED) | ||
|
||
if(ANDROID) | ||
add_library(HelloTaoQuick2 SHARED | ||
main.cpp | ||
qml.qrc | ||
) | ||
else() | ||
add_executable(HelloTaoQuick2 | ||
main.cpp | ||
qml.qrc | ||
${TaoQuickRes} | ||
) | ||
endif() | ||
|
||
target_compile_definitions(HelloTaoQuick2 | ||
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>) | ||
target_link_libraries(HelloTaoQuick2 | ||
PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <QGuiApplication> | ||
#include <QQmlApplicationEngine> | ||
#include <QQmlContext> | ||
int main(int argc, char *argv[]) | ||
{ | ||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); | ||
|
||
QGuiApplication app(argc, argv); | ||
|
||
QQmlApplicationEngine engine; | ||
engine.addImportPath(TaoQuickImportPath); | ||
engine.rootContext()->setContextProperty("taoQuickImagePath", TaoQuickImagePath); | ||
const QUrl url(QStringLiteral("qrc:/main.qml")); | ||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, | ||
&app, [url](QObject *obj, const QUrl &objUrl) { | ||
if (!obj && url == objUrl) | ||
QCoreApplication::exit(-1); | ||
}, Qt::QueuedConnection); | ||
engine.load(url); | ||
|
||
return app.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import QtQuick 2.12 | ||
import QtQuick.Window 2.12 | ||
import QtQuick 2.9 | ||
import TaoQuick 1.0 | ||
Window { | ||
width: 640 | ||
height: 480 | ||
visible: true | ||
title: qsTr("Hello World") | ||
CusButton_Blue { | ||
width: 120 | ||
height: 36 | ||
anchors.centerIn: parent | ||
text: "Hello" | ||
onClicked: { | ||
console.log("hello TaoQuick") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>main.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
set(TaoQuickPath ${CMAKE_SOURCE_DIR}/../../src/TaoQuick/imports) | ||
|
||
if (CMAKE_BUILD_TYPE MATCHES "Release") | ||
set(TaoQuickRes ${TaoQuickPath}/TaoQuick/TaoQuick.qrc CACHE STRING "tao quick res path") | ||
set(TaoQuickImportPath "qrc:///" CACHE STRING "tao quick import path") | ||
set(TaoQuickImagePath "qrc:/TaoQuick/Images/" CACHE STRING "tao quick image path") | ||
|
||
else() | ||
set(TaoQuickImportPath "file:///${TaoQuickPath}" CACHE STRING "tao quick import path") | ||
set(TaoQuickImagePath "file:///${TaoQuickPath}/TaoQuick/Images/" CACHE STRING "tao quick image path") | ||
endif() | ||
add_compile_definitions(TaoQuickImportPath="${TaoQuickImportPath}") | ||
add_compile_definitions(TaoQuickImagePath="${TaoQuickImagePath}") | ||
|
||
add_compile_definitions(QML_IMPORT_PATH="${TaoQuickPath}") | ||
add_compile_definitions(QML2_IMPORT_PATH="${TaoQuickPath}") | ||
add_compile_definitions(QML_DESIGNER_IMPORT_PATH="${TaoQuickPath}") | ||
|
||
|
Oops, something went wrong.