diff --git a/launchers/qt/CMakeLists.txt b/launchers/qt/CMakeLists.txt index 1db62859e6..46adde6763 100644 --- a/launchers/qt/CMakeLists.txt +++ b/launchers/qt/CMakeLists.txt @@ -20,7 +20,7 @@ endforeach() set(src_files src/main.cpp) -add_executable(${PROJECT_NAME} ${src_file}) +add_executable(${PROJECT_NAME} ${src_files}) target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core diff --git a/launchers/qt/src/main.cpp b/launchers/qt/src/main.cpp index 7ac9d7c330..1cfa444aa3 100644 --- a/launchers/qt/src/main.cpp +++ b/launchers/qt/src/main.cpp @@ -1,7 +1,26 @@ -//main.cpp -//#include +#include +#include +#include +#include +#include +/*Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); +Q_IMPORT_PLUGIN(QtQuick2Plugin); +Q_IMPORT_PLUGIN(QtQuickControls2Plugin); +Q_IMPORT_PLUGIN(QtQuickTemplates2Plugin);*/ +int main(int argc, char *argv[]) +{ + QString name { "QtExamples" }; + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setOrganizationName(name); -int main(int argc, char *argv[]) { - //std::cout << "Hello World \n"; - return 0; + QGuiApplication app(argc, argv); + + QQuickView view; + view.setFlags(Qt::FramelessWindowHint); + view.setSource(QUrl("/Users/danteruiz/github/test/qml/root.qml")); + if (view.status() == QQuickView::Error) + return -1; + view.setResizeMode(QQuickView::SizeRootObjectToView); + view.show(); + return app.exec(); }