Using Qt 4.7

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

This page is work in progress and subject to change.

Contents

About

This page discusses the specific aspects of using Qt 4.7 Embedded SDK on TI platforms.

Qt 4.7 introduces a new feature for dynamic creation and update of UI elements. The UI creation kit called as QtQuick mainly consists of the following technologies:

Useful Links

Building Qt 4.7

  1. Download Qt Embedded SDK 4.7.1 from the link given above
  2. Extract the Qt SDK to the required location - for example /home/user/qt-everywhere-opensource-src-4.7.1
  3. Refer to this page for building and installing Qt with SGX hardware accelerated OpenGL ES2 support
  4. Refer to this page if SGX support is not required

At the end of the above steps, the Qt should be successfully cross compiled for the target configuration. The Qt SDK should have been installed successfully in the target file system specified through --prefix during configure.

Creating a "Hello World" QtQuick application

Developing a QtQuick application involves two steps:

  1. Writing a QML specification describing the UI
  2. Writing a C++ application to interface with this QML specification

This tarball provides the required files for the QtQuick Hello World application.

helloworld.qml

This file specifies the UI elements, interactions and their behavior. This example just declares a rectangle with a specific width, height and color parameters. The rectangle also contains a text item for showing the famous "Hello World!"

main.cpp

This file invokes the glue logic to translate the QML spec into Qt graphics elements. This is done through a new Qt class QtDeclarativeView introduced in Qt 4.7. This example just sets the source for this view to point to helloworld.qml. The path should be specified from the perspective of target file system.

Building the application

 $(QT_DIR)/bin/qmake -project
 LIBS += -lQtDeclarative
 $(QT_DIR)/bin/qmake -spec $(QT_DIR)/mkspecs/qws/linux-TIarmv7-g++

Running the application

 ./helloworld -qws




Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox