Skip to end of metadata
Go to start of metadata

Introduction

This document is an Application Development Tutorial for the Yocto GENIVI Demo Platform (GDP-ivi7).

Setup Qt Creator

Please refer to Qt5 SDK and QtCreator for detail.

QTCreator reconizes OE_QMAKE_ variables, therefore some exports should be added.
export OE_QMAKE_CC="$CC"<br>
export OE_QMAKE_CXX="$CXX"<br>
export OE_QMAKE_CFLAGS="$CFLAGS"<br>
export OE_QMAKE_CXXFLAGS="$CXXFLAGS"<br>
export OE_QMAKE_LINK="$CXX"<br>
export OE_QMAKE_LDFLAGS="$LDFLAGS"<br>
export OE_QMAKE_AR="$AR"<br>
export OE_QMAKE_STRIP="$STRIP"<br>
Concerning the binary deploy from QtCreator (avoid the issue "Qt Creator Embedded Debugging Setup exit code 127")

1. sftp should be present in the board.
You may need to copy using scp to /usr/bin target directory.
2. Change is needed in /etc/ssh/sshd_config target file.
Replace:
Subsystem	sftp	/usr/lib/openssh/sftp-server
by
Subsystem	sftp	internal-sftp

Setup Sample Project

Make Sample Project

Start the Qt Creator

Koelsch Board

If you want to use Qt Creator with the Renesas Koelsch board, use this command to execute Qt Creator.

  $ cd $HOME/gdp-sdk/koelsch                                              # toolchain path can be changed if you are install another path.
  $ source ./environment-setup-cortexa15hf-vfp-neon-poky-linux-gnueabi    # filename can be changed according to build-environment.
  $ cd $HOME/gdp-sdk/qtcreator-3.2.2/bin
  $ ./qtcreator

QEMU

If you want to use Qt Creator with QEMU virtual machine, use this command to execute Qt Creator.

  $ cd $HOME/gdp-sdk/qemux86-64                                           # toolchain path can be changed if you are install another path.
  $ source ./environment-setup-core2-64-poky-linux                        # filename can be changed according to build-environment.
  $ cd $HOME/gdp-sdk/qtcreator-3.2.2/bin
  $ ./qtcreator

Create a new Qt Application Project

  1. Click File - New File or Project or Press Ctrl+N
  2. Select Application (left-hand side) and Qt Quick Application (right-hand side)
  3. Click Choose
  4. Insert Project name in Name field
  5. Select Project path in Create in field
  6. Click Next
  7. Select Qt Quick Component Set(Qt Quick 2.3 is recommended.) and click Next button.
  8. Select "QEMU" or "Koelsch" Kit respectively and click next.
  9. If you want to use version control system select and config it.
  10. Click Finish

Build Environment

  • There are not to do anything.

Run Environment

  1. Click Projects icon left-hand side.
  2. Click Run button top side in right window.
  3. Add "-platform=wayland" arguments in Arguments field.
  4. Click Fetch Device Environment button bottom of Run Environment.
  5. Add environment below:
Variable : XDG_RUNTIME_DIR
Value : /run/user/0

Variable : LD_PRELOAD
Value : /usr/lib/libEGL.so

This environment must be same as your target board's environment. If you got a error message of XDG_RUNTIME_DIR, please check your target board environment like below :

root@koelsch:~# env | grep XDG_RUNTIME_DIR                                                                                                                                                                                                                                      
XDG_RUNTIME_DIR=/run/user/0

Compile Sample Application

 

Debugging

QML Debugging

Prepare to QML Debugging
To QML debugging, build application by use appropriate parameters.

  • This parameters can be added in the .pro file:
    • Qt Quick 1 : CONFIG+=declarative_debug
    • Qt Quick 2 : CONFIG+=qml_debug


And select the Enable QML in the Debugger Settings section in the project Run Settings.

Console class can be used to print debugging information. This class can be use in QML file.

  • console.log()

log() function can just print out the message what you want.

  • console.assert()

assert() function can excute if expression is true, it will write an optional message to the console.

  • console.time()

time() and timeEnd() function is useful to check out function(or code-block) running time.


If you want to find out more information for console, please refer to Debugging QML Applications for more details.

C++ Debugging

To debugging your application, select the Enable C++ in the Debugger Settings section in the project Run Settings.

The QtCreator does support GDB.

If you want to know more information about QtCreator Debugging, please refer to the Qt Creator Debugging Manual for details.
And if you want to know debugging techniques for Qt, please refer to Qt5 Debugging Techniques.

Starting Debugging

To start application, choose Debug > Start Debugging > Start Debugging or just press F5 key or click Start Debugging button left hand side bottom. (Button shape is green triangle with bug)

Show Debugger Log

Choose Window > Views > Debugger Log. You can see the gdb command line and log window top of the QtCreater IDE.

Show QML/JS Console

Choose Window > Out panes > QML/JS Console or just press ALT + 5 key after starting debugging.

Links