summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAntti Hölttä <AHoelttae@luxoft.com>2018-04-26 13:02:59 +0200
committerDominik Holland <dominik.holland@pelagicore.com>2018-05-03 13:08:02 +0000
commit753c35e2003b96175ccb40b9dfb709d20b620c72 (patch)
treed81830611ee1087854ab0395b2f7bea982da92a1 /examples
parent6e95e95bce698ad1844099c5bc4b5822e56ecb06 (diff)
downloadqtivi-753c35e2003b96175ccb40b9dfb709d20b620c72.tar.gz
Change the example walkthroughs to include code from files
Use qdoc \snippet instead of hard coded snippets in the QtIvi core example walkthroughs Task-number: AUTOSUITE-278 Change-Id: Icd966aeb53805d7b0009db490d5c462c22d75bf8 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/ivicore/qface-ivi-climate/backend_simulator/backend_simulator.pro18
-rw-r--r--examples/ivicore/qface-ivi-climate/demo/main.qml3
-rw-r--r--examples/ivicore/qface-ivi-climate/frontend/frontend.pro10
-rw-r--r--examples/ivicore/qface-ivi-remote/backend_qtro/backend_qtro.pro18
-rw-r--r--examples/ivicore/qface-ivi-remote/demo/main.qml7
-rw-r--r--examples/ivicore/qface-ivi-remote/example-ivi-remote.qface5
-rw-r--r--examples/ivicore/qface-ivi-remote/frontend/frontend.pro10
-rw-r--r--examples/ivicore/qface-ivi-remote/server_qtro/main.cpp3
-rw-r--r--examples/ivicore/qface-ivi-remote/server_qtro/processingservice.cpp3
-rw-r--r--examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h4
-rw-r--r--examples/ivicore/qface-ivi-remote/server_qtro/server_qtro.pro7
11 files changed, 53 insertions, 35 deletions
diff --git a/examples/ivicore/qface-ivi-climate/backend_simulator/backend_simulator.pro b/examples/ivicore/qface-ivi-climate/backend_simulator/backend_simulator.pro
index 4f13532..53dd135 100644
--- a/examples/ivicore/qface-ivi-climate/backend_simulator/backend_simulator.pro
+++ b/examples/ivicore/qface-ivi-climate/backend_simulator/backend_simulator.pro
@@ -1,25 +1,27 @@
TEMPLATE=lib
TARGET = $$qtLibraryTarget(example_ivi_climate)
-CONFIG += ivigenerator plugin
macos: CONFIG += debug_and_release build_all
QT_FOR_CONFIG += ivicore
!qtConfig(ivigenerator): error("No ivigenerator available")
LIBS += -L$$OUT_PWD/../ -l$$qtLibraryTarget(QtIviClimateExample)
+#! [0]
DESTDIR = ../qtivi
-
+#! [0]
CONFIG += warn_off
+#! [1]
INCLUDEPATH += $$OUT_PWD/../frontend
-PLUGIN_TYPE = qtivi
-PLUGIN_EXTENDS = qtivi
-PLUGIN_CLASS_NAME = ClimatePlugin
-
+#! [1]
QT += core ivicore
-
+#! [2]
+CONFIG += ivigenerator plugin
QFACE_FORMAT = backend_simulator
QFACE_SOURCES = ../example-ivi-climate.qface
-
+PLUGIN_TYPE = qtivi
+PLUGIN_EXTENDS = qtivi
+PLUGIN_CLASS_NAME = ClimatePlugin
+#! [2]
CONFIG += install_ok # Do not cargo-cult this!
target.path = $$[QT_INSTALL_EXAMPLES]/ivicore/qface-ivi-climate/qtivi/
INSTALLS += target
diff --git a/examples/ivicore/qface-ivi-climate/demo/main.qml b/examples/ivicore/qface-ivi-climate/demo/main.qml
index 6d6b543..6dab041 100644
--- a/examples/ivicore/qface-ivi-climate/demo/main.qml
+++ b/examples/ivicore/qface-ivi-climate/demo/main.qml
@@ -52,9 +52,11 @@
import QtQuick 2.7
import QtQuick.Window 2.2
+//! [0]
import IviClimate 1.0
Window {
+
visible: true
width: 640
height: 480
@@ -71,6 +73,7 @@ Window {
Text {
text: "Air Conditioning: " + climateCtrl.airConditioning
}
+//! [0]
Text {
text: "Heater: " + climateCtrl.heater
}
diff --git a/examples/ivicore/qface-ivi-climate/frontend/frontend.pro b/examples/ivicore/qface-ivi-climate/frontend/frontend.pro
index 7ebda2f..fb07a8a 100644
--- a/examples/ivicore/qface-ivi-climate/frontend/frontend.pro
+++ b/examples/ivicore/qface-ivi-climate/frontend/frontend.pro
@@ -1,18 +1,18 @@
TARGET = $$qtLibraryTarget(QtIviClimateExample)
TEMPLATE = lib
-CONFIG += ivigenerator
DESTDIR = ..
macos: CONFIG += debug_and_release build_all
-
+#! [0]
QT_FOR_CONFIG += ivicore
!qtConfig(ivigenerator): error("No ivigenerator available")
-
+#! [0]
QT += ivicore ivicore-private qml quick
DEFINES += QT_BUILD_CLIMATE_LIB
-
+#! [1]
+CONFIG += ivigenerator
QFACE_SOURCES = ../example-ivi-climate.qface
-
+#! [1]
CONFIG += install_ok # Do not cargo-cult this!
target.path = $$[QT_INSTALL_EXAMPLES]/ivicore/qface-ivi-climate
INSTALLS += target
diff --git a/examples/ivicore/qface-ivi-remote/backend_qtro/backend_qtro.pro b/examples/ivicore/qface-ivi-remote/backend_qtro/backend_qtro.pro
index 6b7f191..5d790d6 100644
--- a/examples/ivicore/qface-ivi-remote/backend_qtro/backend_qtro.pro
+++ b/examples/ivicore/qface-ivi-remote/backend_qtro/backend_qtro.pro
@@ -1,25 +1,27 @@
TEMPLATE=lib
TARGET = $$qtLibraryTarget(example_ivi_remote)
-CONFIG += ivigenerator plugin
macos: CONFIG += debug_and_release build_all
QT_FOR_CONFIG += ivicore
!qtConfig(ivigenerator): error("No ivigenerator available")
LIBS += -L$$OUT_PWD/../ -l$$qtLibraryTarget(QtIviRemoteExample)
+#! [0]
DESTDIR = ../qtivi
-
+#! [0]
CONFIG += warn_off
+#! [1]
INCLUDEPATH += $$OUT_PWD/../frontend
-PLUGIN_TYPE = qtivi
-PLUGIN_EXTENDS = qtivi
-PLUGIN_CLASS_NAME = RemoteClientPlugin
-
+#! [1]
QT += core ivicore
-
+#! [2]
+CONFIG += ivigenerator plugin
QFACE_FORMAT = backend_qtro
QFACE_SOURCES = ../example-ivi-remote.qface
-
+PLUGIN_TYPE = qtivi
+PLUGIN_EXTENDS = qtivi
+PLUGIN_CLASS_NAME = RemoteClientPlugin
+#! [2]
CONFIG += install_ok # Do not cargo-cult this!
target.path = $$[QT_INSTALL_EXAMPLES]/ivicore/qface-ivi-remote/qtivi/
INSTALLS += target
diff --git a/examples/ivicore/qface-ivi-remote/demo/main.qml b/examples/ivicore/qface-ivi-remote/demo/main.qml
index a5c6c80..e19f26f 100644
--- a/examples/ivicore/qface-ivi-remote/demo/main.qml
+++ b/examples/ivicore/qface-ivi-remote/demo/main.qml
@@ -53,6 +53,7 @@
import QtQuick 2.7
import QtQuick.Controls 2.3
import QtQuick.Window 2.2
+//! [0]
import IviRemote 1.0
Window {
@@ -64,12 +65,14 @@ Window {
UiProcessingService {
id: processingService
}
+//! [0]
Column {
anchors.fill: parent
anchors.margins: 10
Row {
+ //! [1]
Button {
text: "Process"
@@ -81,6 +84,7 @@ Window {
resultLabel.text = "failed"
} )
}
+ //! [1]
TextField {
placeholderText: "text to process"
id: inputField
@@ -91,7 +95,7 @@ Window {
Text { text: "Processing result: " }
Text { id: resultLabel }
}
-
+ //! [2]
Row {
Text { text: "Last message: " }
Text {
@@ -99,5 +103,6 @@ Window {
text: processingService.lastMessage
}
}
+ //! [2]
}
}
diff --git a/examples/ivicore/qface-ivi-remote/example-ivi-remote.qface b/examples/ivicore/qface-ivi-remote/example-ivi-remote.qface
index 444163e..af45423 100644
--- a/examples/ivicore/qface-ivi-remote/example-ivi-remote.qface
+++ b/examples/ivicore/qface-ivi-remote/example-ivi-remote.qface
@@ -1,12 +1,14 @@
/**
* Test module
*/
+//! [0]
module Example.IVI.Remote 1.0;
-
+//! [0]
/**
* The ProcessingService provides a QML interface to a service doing
* all sorts of heavy processing
*/
+//! [1]
@config: { id: "example.qtivi.ProcessingService/1.0", qml_type: "UiProcessingService" }
interface ProcessingService {
@@ -14,3 +16,4 @@ interface ProcessingService {
int process(string data);
}
+//! [1]
diff --git a/examples/ivicore/qface-ivi-remote/frontend/frontend.pro b/examples/ivicore/qface-ivi-remote/frontend/frontend.pro
index 9259b86..20e5207 100644
--- a/examples/ivicore/qface-ivi-remote/frontend/frontend.pro
+++ b/examples/ivicore/qface-ivi-remote/frontend/frontend.pro
@@ -1,18 +1,18 @@
TARGET = $$qtLibraryTarget(QtIviRemoteExample)
TEMPLATE = lib
-CONFIG += ivigenerator
DESTDIR = ..
macos: CONFIG += debug_and_release build_all
-
+#! [0]
QT_FOR_CONFIG += ivicore
!qtConfig(ivigenerator): error("No ivigenerator available")
-
+#! [0]
QT += ivicore ivicore-private qml quick
DEFINES += QT_BUILD_REMOTE_LIB
-
+#! [1]
+CONFIG += ivigenerator
QFACE_SOURCES = ../example-ivi-remote.qface
-
+#! [1]
CONFIG += install_ok # Do not cargo-cult this!
target.path = $$[QT_INSTALL_EXAMPLES]/ivicore/qface-ivi-remote
INSTALLS += target
diff --git a/examples/ivicore/qface-ivi-remote/server_qtro/main.cpp b/examples/ivicore/qface-ivi-remote/server_qtro/main.cpp
index 9eb73d4..2c917ab 100644
--- a/examples/ivicore/qface-ivi-remote/server_qtro/main.cpp
+++ b/examples/ivicore/qface-ivi-remote/server_qtro/main.cpp
@@ -49,7 +49,7 @@
** SPDX-License-Identifier: BSD-3-Clause
**
****************************************************************************/
-
+//! [0]
#include <QCoreApplication>
#include "processingservice.h"
@@ -64,3 +64,4 @@ int main(int argc, char *argv[])
return app.exec();
}
+//! [0]
diff --git a/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.cpp b/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.cpp
index a3f154c..e554ef8 100644
--- a/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.cpp
+++ b/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.cpp
@@ -51,7 +51,7 @@
****************************************************************************/
#include "processingservice.h"
-
+//! [0]
ProcessingService::ProcessingService()
{
setLastMessage("Service online.");
@@ -62,3 +62,4 @@ int ProcessingService::process(const QString & data)
setLastMessage(QStringLiteral("Processed data \'%1\'").arg(data));
return data.length();
}
+//! [0]
diff --git a/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h b/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h
index c7ef6b8..8c7f6b2 100644
--- a/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h
+++ b/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h
@@ -52,7 +52,7 @@
#ifndef PROCESSINGSERVICE_H
#define PROCESSINGSERVICE_H
-
+//! [0]
#include "rep_processingservice_source.h"
class ProcessingService : public ProcessingServiceSimpleSource
@@ -62,5 +62,5 @@ public:
int process(const QString & data) override;
};
-
+//! [0]
#endif // PROCESSINGSERVICE_H
diff --git a/examples/ivicore/qface-ivi-remote/server_qtro/server_qtro.pro b/examples/ivicore/qface-ivi-remote/server_qtro/server_qtro.pro
index 145872e..69b7e62 100644
--- a/examples/ivicore/qface-ivi-remote/server_qtro/server_qtro.pro
+++ b/examples/ivicore/qface-ivi-remote/server_qtro/server_qtro.pro
@@ -1,8 +1,9 @@
TARGET = qface-ivi-remote-server
+#! [0]
TEMPLATE = app
-
QT -= gui
CONFIG += c++11 ivigenerator
+#! [0]
CONFIG -= app_bundle
DESTDIR = ../
@@ -13,10 +14,10 @@ SOURCES += main.cpp \
processingservice.cpp
QMAKE_RPATHDIR += $ORIGIN
-
+#! [1]
QFACE_FORMAT = server_qtro
QFACE_SOURCES = ../example-ivi-remote.qface
-
+#! [1]
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =