2019-04-02 09:07:09 +02:00
|
|
|
CONFIG += qskexample
|
2017-07-25 07:24:27 +02:00
|
|
|
|
|
|
|
HEADERS += \
|
2017-07-26 17:54:25 +02:00
|
|
|
ButtonBar.h \
|
2017-07-25 07:24:27 +02:00
|
|
|
SoundControl.h \
|
2017-07-25 21:34:27 +02:00
|
|
|
SkinFactory.h \
|
2017-07-25 07:24:27 +02:00
|
|
|
DefaultSkin.h \
|
2017-07-26 17:54:25 +02:00
|
|
|
OtherSkin.h \
|
2018-04-05 11:23:38 +02:00
|
|
|
MainWindow.h \
|
|
|
|
Speedometer.h \
|
|
|
|
SpeedometerSkinlet.h \
|
|
|
|
SpeedometerDisplay.h
|
2017-07-25 07:24:27 +02:00
|
|
|
|
|
|
|
SOURCES += \
|
2017-07-26 17:54:25 +02:00
|
|
|
ButtonBar.cpp \
|
2017-07-25 07:24:27 +02:00
|
|
|
SoundControl.cpp \
|
2017-07-25 21:34:27 +02:00
|
|
|
SkinFactory.cpp \
|
2017-07-25 07:24:27 +02:00
|
|
|
DefaultSkin.cpp \
|
2017-07-26 17:54:25 +02:00
|
|
|
OtherSkin.cpp \
|
|
|
|
MainWindow.cpp \
|
2018-04-05 11:23:38 +02:00
|
|
|
main.cpp \
|
|
|
|
Speedometer.cpp \
|
|
|
|
SpeedometerSkinlet.cpp \
|
|
|
|
SpeedometerDisplay.cpp
|
2017-07-25 21:34:27 +02:00
|
|
|
|
|
|
|
QRCFILES += \
|
|
|
|
images.qrc
|
|
|
|
|
2017-09-05 08:01:28 +02:00
|
|
|
IMGSOURCES = \
|
|
|
|
images/background.jpg
|
2017-07-25 21:34:27 +02:00
|
|
|
|
2017-09-05 08:01:28 +02:00
|
|
|
SVGSOURCES = \
|
|
|
|
images/car.svg \
|
2017-07-25 21:34:27 +02:00
|
|
|
images/left.svg \
|
|
|
|
images/down.svg \
|
|
|
|
images/right.svg \
|
2017-09-05 08:01:28 +02:00
|
|
|
images/up.svg \
|
2017-07-25 21:34:27 +02:00
|
|
|
images/bluetooth.svg \
|
|
|
|
images/bookmark.svg \
|
|
|
|
images/bus.svg \
|
|
|
|
images/cloud.svg \
|
|
|
|
images/compass.svg \
|
|
|
|
images/location.svg \
|
|
|
|
images/man.svg \
|
|
|
|
images/menu.svg \
|
|
|
|
images/phone.svg \
|
|
|
|
images/plane.svg \
|
|
|
|
images/train.svg \
|
2017-09-05 08:01:28 +02:00
|
|
|
images/user.svg
|
2017-07-25 21:34:27 +02:00
|
|
|
|
|
|
|
###########
|
|
|
|
# The rcc file includes the precompiled SVGs and so we need to build
|
|
|
|
# rules for running svg2qvg, when a SVG has changed into the Makefile
|
|
|
|
# before running rccgen.
|
|
|
|
# While this would be an easy one in Makefile syntax it is a nightmare
|
|
|
|
# with qmake.
|
|
|
|
|
|
|
|
# TODO: we should at least offer some sort of *.pri file to help with
|
|
|
|
# writing application project files.
|
|
|
|
###########
|
|
|
|
|
2019-09-12 11:13:20 +02:00
|
|
|
# Convert path to shell path, otherwise it fails on Windows.
|
|
|
|
SVG2QVG=$$shell_path($${QSK_OUT_ROOT}/tools/bin/svg2qvg)
|
2017-07-25 21:34:27 +02:00
|
|
|
|
|
|
|
svg2qvg.name = SVG compiler
|
|
|
|
svg2qvg.input = SVGSOURCES
|
|
|
|
svg2qvg.output = qvg/${QMAKE_FILE_BASE}.qvg
|
|
|
|
svg2qvg.variable_out =
|
2019-09-12 11:13:20 +02:00
|
|
|
svg2qvg.commands += ($$sprintf($${QMAKE_MKDIR_CMD}, qvg)) && $${SVG2QVG} ${QMAKE_FILE_IN} $${svg2qvg.output}
|
2017-07-25 21:34:27 +02:00
|
|
|
|
2017-09-05 08:01:28 +02:00
|
|
|
imgcpy.name = Image copy
|
|
|
|
imgcpy.input = IMGSOURCES
|
|
|
|
imgcpy.output = images/${QMAKE_FILE_BASE}.jpg
|
|
|
|
imgcpy.variable_out =
|
2019-09-12 11:13:20 +02:00
|
|
|
imgcpy.commands += ($$sprintf( $${QMAKE_MKDIR_CMD}, images)) && $${QMAKE_COPY} ${QMAKE_FILE_IN} $${imgcpy.output}
|
2017-09-05 08:01:28 +02:00
|
|
|
|
2017-07-25 21:34:27 +02:00
|
|
|
rccgen.name = RCC compiler
|
|
|
|
rccgen.input = QRCFILES
|
|
|
|
rccgen.output = $${RCC_DIR}/qrc_${QMAKE_FILE_BASE}.cpp
|
|
|
|
rccgen.variable_out = SOURCES
|
2019-09-12 11:13:20 +02:00
|
|
|
rccgen.commands += ($$sprintf($${QMAKE_MKDIR_CMD}, $${RCC_DIR}))
|
2017-07-25 21:34:27 +02:00
|
|
|
|
|
|
|
!equals( OUT_PWD, $${PWD} ) {
|
|
|
|
|
|
|
|
# Paths inside a qrc file are always relative to the path of the
|
|
|
|
# qrc file itself. So in case of shadow builds we need to copy the
|
|
|
|
# qrc file into the shadow directory as the included qvg files
|
|
|
|
# are generated locally.
|
|
|
|
|
2019-09-12 11:13:20 +02:00
|
|
|
QRC_SHADOW_CLONE = $$shell_path($${OUT_PWD}/${QMAKE_FILE_BASE}_shadow.qrc)
|
2017-07-25 21:34:27 +02:00
|
|
|
|
|
|
|
rccgen.commands += && $${QMAKE_COPY} ${QMAKE_FILE_IN} $${QRC_SHADOW_CLONE}
|
2019-09-12 11:13:20 +02:00
|
|
|
# Use shell_path again to prevent from path error under Windows
|
|
|
|
rccgen.commands += && $$shell_path($$dirname(QMAKE_QMAKE)/rcc) $${QRC_SHADOW_CLONE} -o ${QMAKE_FILE_OUT}
|
2017-07-25 21:34:27 +02:00
|
|
|
rccgen.commands += && $${QMAKE_DEL_FILE} $${QRC_SHADOW_CLONE}
|
2017-09-05 08:01:28 +02:00
|
|
|
|
|
|
|
rccgen.depends += $${IMGSOURCES}
|
|
|
|
QMAKE_EXTRA_COMPILERS += imgcpy
|
2017-07-25 21:34:27 +02:00
|
|
|
}
|
|
|
|
else {
|
2017-07-26 04:18:01 -07:00
|
|
|
rccgen.commands += && $$dirname(QMAKE_QMAKE)/rcc ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
|
2017-07-25 21:34:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# We would like to define a dependency for "svg2qvg.variable_out" -
|
|
|
|
# but how to do this ? As long as we don't have a solution we have to use
|
|
|
|
# the workaround below.
|
|
|
|
|
|
|
|
defineReplace(qvgfiles) {
|
|
|
|
svgfiles = $$1
|
|
|
|
|
|
|
|
myfiles=
|
|
|
|
for(svgfile, svgfiles) myfiles += $$replace(svgfile, svg, qvg)
|
|
|
|
|
|
|
|
myfiles2=
|
|
|
|
for(myfile, myfiles) myfiles2 += $$replace(myfile, images, qvg)
|
|
|
|
|
|
|
|
return($$myfiles2)
|
|
|
|
}
|
2017-09-05 08:01:28 +02:00
|
|
|
|
2017-07-25 21:34:27 +02:00
|
|
|
rccgen.depends += $$qvgfiles( $${SVGSOURCES} )
|
|
|
|
|
|
|
|
QMAKE_EXTRA_COMPILERS += svg2qvg rccgen
|