Skip to content

Commit

Permalink
copy qaterial helloworld
Browse files Browse the repository at this point in the history
  • Loading branch information
Oriane Chagnon committed Oct 19, 2020
1 parent 769b4e6 commit e9657ac
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.14)

project(Test LANGUAGES CXX)

include(FetchContent)
FetchContent_Declare(
Qaterial
GIT_REPOSITORY https://github.com/OlivierLDff/Qaterial.git
GIT_TAG master
GIT_SHALLOW 1
)
FetchContent_MakeAvailable(Qaterial)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
Expand Down
5 changes: 5 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <Qaterial/Qaterial.hpp>
#include <QGuiApplication>
#include <QQmlApplicationEngine>

Expand All @@ -14,6 +15,10 @@ int main(int argc, char *argv[])
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);

qaterial::loadQmlResources();
qaterial::registerQmlTypes();

engine.load(url);

return app.exec();
Expand Down
19 changes: 12 additions & 7 deletions main.qml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import QtQuick 2.10
import QtQuick.Window 2.10
import Qaterial 1.0 as Qaterial

Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
Qaterial.ApplicationWindow
{
width: 400
height: 200
visible: true

Qaterial.Label
{
text: 'Hello World'
anchors.centerIn: parent
}
}

0 comments on commit e9657ac

Please sign in to comment.