Skip to content
Snippets Groups Projects
Commit 9667519b authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

Generate project skeleton

parents
No related branches found
No related tags found
No related merge requests found
*.orig
*.rej
*~
CMakeLists.txt.user
CMakeLists.txt.user.*
cmake_minimum_required(VERSION 3.5)
project(quick-custom-cursor LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 COMPONENTS Core Quick REQUIRED)
add_executable(quick-custom-cursor
main.cpp
qml.qrc
)
target_compile_definitions(quick-custom-cursor
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(quick-custom-cursor
PRIVATE Qt5::Core Qt5::Quick)
main.cpp 0 → 100644
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
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();
}
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
}
<RCC>
<qresource prefix="/">
<file>main.qml</file>
</qresource>
</RCC>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment