C

Running Examples on INTEGRITY

See Building for INTEGRITY for instructions on how to build the examples for INTEGRITY. The instructions provide high-level steps that are required for building Qt Safe Renderer for INTEGRITY.

However, you should note that the steps assume you already have experience of working with the INTEGRITY environment. If you need more detailed information about how to build Qt Safe Renderer for INTEGRITY, you can contact Qt Consulting Services.

Workaround for Running Qt Cluster Example

The Qt Cluster example in INTEGRITY has a known error QTAUTO-1003. The error is described in the release note section 1.6. You find the release note under <Qt Safe Renderer installation directory>/Docs/Qt-SafeRenderer-<version>. The following code changes provide a workaround for the error until the proper fix is available.

To include the required files for INTEGRITY, update <Qt Safe Renderer installation directory>/Examples/Qt-SafeRenderer-<version>/qtcluster/main.cpp as follows:

#include "etcprovider.h"
#include "crasher.h"

#ifdef Q_OS_INTEGRITY
#include <mqueue.h>
#include <unistd.h>
#define ATTACH_POINT "saferenderer"
#endif

To add the actual workaround functionality, update <Qt Safe Renderer installation directory>/Examples/Qt-SafeRenderer-<version>/qtcluster/main.cpp as follows:

qputenv("QT_QPA_WM_DISP_ID", "0");
qputenv("QT_QPA_WM_LAYER", "3");

#ifdef Q_OS_INTEGRITY
sleep(10);
mqd_t mqdes;

if ((mqdes = mq_open(ATTACH_POINT, O_WRONLY)) != MQ_FAILED) {
    qWarning() << "Dummy op success";
    mq_close(mqdes);
} else {
    qFatal("Failed to open connection to safe renderer. Dummy.");
}
#endif

QGuiApplication app(argc, argv);

The following code provides all the required updates in a .patch file format:

diff --git a/examples/qtcluster/main.cpp b/examples/qtcluster/main.cpp
index 0c7e836..4fbd3e9 100644
--- a/examples/qtcluster/main.cpp
+++ b/examples/qtcluster/main.cpp
@@ -65,6 +65,11 @@

 #include "etcprovider.h"
 #include "crasher.h"
+#ifdef Q_OS_INTEGRITY
+#include <mqueue.h>
+#include <unistd.h>
+#define ATTACH_POINT "saferenderer"
+#endif

 int main(int argc, char **argv)
 {
@@ -78,6 +83,18 @@ int main(int argc, char **argv)
     qputenv("QT_QPA_WM_DISP_ID", "0");
     qputenv("QT_QPA_WM_LAYER", "3");

+    #ifdef Q_OS_INTEGRITY
+    sleep(10);
+    mqd_t mqdes;
+
+    if ((mqdes = mq_open(ATTACH_POINT, O_WRONLY)) != MQ_FAILED) {
+        qWarning() << "Dummy op success";
+        mq_close(mqdes);
+    } else {
+        qFatal("Failed to open connection to safe renderer. Dummy.");
+    }
+    #endif
+
     QGuiApplication app(argc, argv);

     //Find the ip address to the environment variable

Available under certain Qt licenses.
Find out more.