diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..de6e2077462d73e1ef7d8823964fd8d7581d1848 --- /dev/null +++ b/.gitignore @@ -0,0 +1,54 @@ +# C++ objects and libs +*.slo +*.lo +*.o +*.a +*.la +*.lai +*.so +*.so.* +*.dll +*.dylib + +# Qt-es +object_script.*.Release +object_script.*.Debug +*_plugin_import.cpp +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc +moc_*.cpp +moc_*.h +qrc_*.cpp +ui_*.h +*.qmlc +*.jsc +Makefile* +*build-* +*.qm +*.prl + +# Qt unit tests +target_wrapper.* + +# QtCreator +*.autosave + +# QtCreator Qml +*.qmlproject.user +*.qmlproject.user.* + +# QtCreator CMake +CMakeLists.txt.user* + +# QtCreator 4.8< compilation database +compile_commands.json + +# QtCreator local machine specific files for imported projects +*creator.user* + +*_qmlcache.qrc \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abe8cb4523eb92427f24aa10c18f24858f448586 --- /dev/null +++ b/main.cpp @@ -0,0 +1,22 @@ +#include <QGuiApplication> +#include <QQmlApplicationEngine> + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/tutoGitQt/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(); +} diff --git a/main.qml b/main.qml new file mode 100644 index 0000000000000000000000000000000000000000..a1a2c7003bad79f0fe496599ced837473f922837 --- /dev/null +++ b/main.qml @@ -0,0 +1,31 @@ +import QtQuick + +Window { + id: window + width: 640 + height: 480 + visible: true + title: qsTr("Hello World") + + Rectangle { + id: rectangle + width: 300 + height: 200 + color: "#ffffff" + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + + TextInput { + id: textInput + width: 80 + height: 20 + text: qsTr("Text Input") + anchors.verticalCenter: parent.verticalCenter + font.pixelSize: 12 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.bold: true + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/tutoGitQt.pro b/tutoGitQt.pro new file mode 100644 index 0000000000000000000000000000000000000000..4d6fa73bb403387e0d7a85b766d80f475f896009 --- /dev/null +++ b/tutoGitQt.pro @@ -0,0 +1,19 @@ +QT += quick + +SOURCES += \ + main.cpp + +resources.files = main.qml +resources.prefix = /$${TARGET} +RESOURCES += resources + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Additional import path used to resolve QML modules just for Qt Quick Designer +QML_DESIGNER_IMPORT_PATH = + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target