Refactored project directories. \r\n Working hello world application in cm-ui

master
androiddrew 7 years ago
parent 2dadfe4c52
commit 76523fc28a

@ -0,0 +1,3 @@
# CM QT Application
This is a sample QT application from the Learn QT 5 book. It follows the Model, View, Controller pattern and utilizes the Unit Testing.

@ -4,11 +4,22 @@
#
#-------------------------------------------------
# Its a lib so we can exclud gui module
QT -= gui
# the name we want to give our binary output. so cm-lib.dll in this case
# if we don't provide a TARGET it will default to the project name, which is exactly,
# what we have here. So we are being explicit
TARGET = cm-lib
# Not an app. It's a lib so that is our template
TEMPLATE = lib
# We want to add the c++14 features to our project so that is what we are going with
CONFIG += c++14
# we use this flag to trigger the export of the cm-lib_global.h which is a file with
# preprocessor boilerplate we can use to export our shared library symbols.
DEFINES += CMLIB_LIBRARY
# The following define makes your compiler emit warnings if you use
@ -22,12 +33,14 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
client.cpp
# Adding our source folder so that the path is searched when we use #include statements
INCLUDEPATH += source
SOURCES += source\models\client.cpp
#unix style SOURCES += source/models/client.cpp
HEADERS += \
client.h \
cm-lib_global.h
HEADERS += source\cm-lib_global.h source\models\client.h
#unix style HEADERS += source/cm-lib_global.h source/modeles/client.h
unix {
target.path = /usr/lib

@ -4,11 +4,14 @@
#
#-------------------------------------------------
# gives us access to the Qt Test features
QT += testlib
QT -= gui
TARGET = client-tests
CONFIG += c++14
CONFIG += console
CONFIG -= app_bundle
@ -25,6 +28,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
INCLUDEPATH += source
SOURCES += \
client-tests.cpp
SOURCES += source\models\client-tests.cpp
#unix style SOURCES += sources/models/client-tests.cpp

@ -1,5 +1,8 @@
QT += quick
CONFIG += c++11
# Since out UI is written in QML we need both the QML and Quick modules
QT += qml quick
TEMPLATE = app
CONFIG += c++14
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
@ -12,13 +15,15 @@ DEFINES += QT_DEPRECATED_WARNINGS
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp
INCLUDEPATH += source
SOURCES += source/main.cpp
#unix style SOURCES += source/main.cpp
RESOURCES += qml.qrc
RESOURCES += views.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
QML_IMPORT_PATH = $$PWD
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

@ -8,7 +8,7 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
engine.load(QUrl(QStringLiteral("qrc:/views/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;

@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>views/main.qml</file>
</qresource>
</RCC>
Loading…
Cancel
Save