How To Use Qt Creator with a Timesys Cross-Toolchain
The following document describes the method for using a Timesys Factory-built cross-toolchain with Qt Creator. This will allow you to build applications for your target hardware directly from Qt Creator.
Prerequisites
- Linux host system with the following installed:
- Timesys SDK with Qt for target platform
- Qt Creator
- Click the version of Qt you are targeting, then click the Qt Creator breadcrumb for download links.
Setup
- Open Qt Creator.
- Select Tools -> Options... from the menu bar.
- In the Options dialog, select Build & Run on the left pane.
- Click the Compilers tab. Set up the following:
- Click the Add button on the right, and select GCC.
- Provide a Name for the compiler. This may be any arbitrary name, such as Timesys Cross Toolchain.
- For the Compiler Path, provide the full path of the GCC cross-compiler built by Factory. (e.g. /home/user/timesys/vybrid/toolchain/bin/armv7l-timesys-linux-gnueabi-gcc). The other options may be left as their defaults.
- Click the Qt Versions tab.
- Click the Add button on the right.
- Select the qmake executable in your Timesys cross-toolchain (e.g. /home/user/timesys/vybrid/toolchain/bin/qmake).
- Click the Kits tab.
- Click the Add button on the right to create a new kit.
- Specify a name for your kit.
- Choose the Compiler and Qt Version previously specified. All other options may be left as their defaults.
- Exit the Options dialog, saving your changes.
Using the toolchain with a new project
- Create a new project in Qt Creator by choosing File > New File or Project....
- Select the application type, and press the Choose... button.
- Select a name and location for the Qt application and press Next.
- Select the Kit previously defined, and press Next until finished. The new project is now created.
- Develop your application.
- Build the application.
- Right click on the project name and chose Run qmake.
- Right click on the project name and click Build.
- Copy the resulting binary to your target's RFS and boot the target.
- Run the application from the target terminal.
- For Qt4, run ./appname -qws
- For Qt5 (with eglfs), run ./appname --platform eglfs on the target terminal to run the Qt application.