Qt Development Environment
Total Page:16
File Type:pdf, Size:1020Kb
QNX CAR™ Platform for Infotainment 2.1 QNX CAR™ Platform for Infotainment 2.1 Qt Development Environment ©2014, QNX Software Systems Limited, a subsidiary of BlackBerry. All rights reserved. QNX Software Systems Limited 1001 Farrar Road Ottawa, Ontario K2K 0B3 Canada Voice: +1 613 591-0931 Fax: +1 613 591-3579 Email: [email protected] Web: http://www.qnx.com/ QNX, QNX CAR, Neutrino, Momentics, Aviage, Foundry27 are trademarks of BlackBerry Limited that are registered and/or used in certain jurisdictions, and used under license by QNX Software Systems Limited. All other trademarks belong to their respective owners. Electronic edition published: Thursday, April 24, 2014 Qt Development Environment Table of Contents About This Guide .......................................................................................................................5 Typographical conventions .................................................................................................6 Technical support .............................................................................................................8 Chapter 1: QNX Qt Development Libraries ....................................................................................9 QtQnxCar2 Library ..........................................................................................................11 QPPS Library ..................................................................................................................12 QPlayer Library ...............................................................................................................14 Chapter 2: Preparing your host system for Qt development ...........................................................15 Installing QNX QDF .........................................................................................................16 Installing Qt Creator ........................................................................................................18 Configuring a QNX device in Qt Creator .............................................................................19 Configuring a toolchain in Qt Creator ................................................................................25 Chapter 3: Creating and running Qt apps in QNX CAR systems .....................................................35 Creating a project for a new Qt App ..................................................................................36 Defining the user interface ..............................................................................................38 Making a QML file into a project resource .........................................................................40 Adding code to load the UI ..............................................................................................42 Adding an image for the app icon .....................................................................................43 Writing the app descriptor file ..........................................................................................44 QNX CAR environment variables .............................................................................45 XML elements in app descriptor file ........................................................................46 Packaging the app into a BAR file from Qt Creator .............................................................59 Packaging the BAR file from the command line ........................................................62 Qt command-line options for blackberry-nativepackager ............................................63 Deploying the BAR file on the target .................................................................................66 Running the app .............................................................................................................70 Cleaning the target before redeploying a BAR file ...............................................................72 Chapter 4: QPPS API ................................................................................................................75 Changeset ......................................................................................................................76 DirWatcher .....................................................................................................................77 Public functions in DirWatcher ...............................................................................78 Signals in DirWatcher ............................................................................................80 Object ...........................................................................................................................82 Public functions in Object ......................................................................................83 Public properties of Object .....................................................................................88 Table of Contents Public slots in Object .............................................................................................89 Signals in Object ...................................................................................................90 Simulator .......................................................................................................................93 Public functions in Simulator .................................................................................94 Signals in Simulator ............................................................................................101 Variant .........................................................................................................................104 Public functions in Variant ...................................................................................105 Chapter 5: QPlayer API ...........................................................................................................115 Error and event type enumerations .................................................................................116 Error codes enum ................................................................................................116 MediaSourceEventType ........................................................................................116 TrackSessionEventType ........................................................................................117 Media command classes ................................................................................................119 BaseCommand ....................................................................................................120 BrowseCommand .................................................................................................121 CreateTrackSessionCommand ...............................................................................122 CurrentTrackCommand .........................................................................................124 CurrentTrackPositionCommand .............................................................................125 ExtendedMetadataCommand ................................................................................126 MediaSourcesCommand .......................................................................................127 MetadataCommand ..............................................................................................128 PlayerStateCommand ...........................................................................................129 SearchCommand .................................................................................................130 TrackSessionInfoCommand ...................................................................................132 TrackSessionItemsCommand ................................................................................133 Media information data types .........................................................................................135 MediaNode .........................................................................................................135 MediaSource .......................................................................................................137 Metadata ............................................................................................................141 PlayerState .........................................................................................................143 Track ..................................................................................................................145 TrackSession .......................................................................................................146 QPlayer class ................................................................................................................147 Public constants used by QPlayer ..........................................................................149 Public functions in QPlayer ..................................................................................150 Public slots in QPlayer .........................................................................................157 Signals in QPlayer ...............................................................................................163 About This Guide This document describes the Qt components shipped with the QNX CAR platform, the host system setup needed to develop Qt apps, and the Qt app packaging process. Although HTML5 is suitable for writing apps that access web services, the