Upload
nokia
View
1.607
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Public webinar in Dec 2008 about Qt for S60 - by Eero Penttinen and Pekka Kosonen
Citation preview
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials
Company Confidential1
Qt on S60 WebinarIntroduction to Qt – Eero Penttinen
Qt on S60 – Eero Penttinen
Hands-on Session with Qt on S60 – Pekka Kosonen
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials
Company Confidential2
Qt in Depth
A technical look at the Qt cross-platform application framework
Eero Penttinen
Qt on S60 Program Manager
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials3
1. Introducing Qt
2. The Qt Library
3. Qt Development Tools
4. How to Get Started?
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials4
Cross-platform application framework
• Qt is a cross platform application framework.
• It includes:• Intuitive C++ class library
• Integrated development tools
• Support for C++ and Java™ development
• Support for desktop and embedded development
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials5
1. Introducing Qt
2. The Qt Library
3. Qt Development Tools
4. How to Get Started?
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials6
C++ Application Framework
• Qt includes an intuitive API and an intuitive C++ class library with a rich set of application build blocks for C++ development. Qt goes beyond C++ in the areas of inter-object communication and flexibility for advanced GUI development.
• The standard C++ object model provides very efficient runtime support for the object paradigm, however its static nature is inflexible in some respects. By combining the speed of C++ with the flexibility of the Qt Object Model, Qt provides both runtime efficiency and a high level of flexibility for GUI programming. Qt goes beyond C++ to add the following features:
• A very powerful mechanism for seamless object communication called signals and slots• Queryable and designable object properties• Powerful events and event filters• Contextual string translation for internationalization• Sophisticated interval driven timers that make it possible to elegantly integrate many
tasks in an event-driven GUI• Hierarchical and queryable object trees that organize object ownership in a natural way• Guarded pointers (QPointer) that are automatically set to 0 when the referenced object
is destroyed• A dynamic cast that works across library boundaries
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials7
Overview
• The Qt class library encompasses all the functions needed to build robust, high-end applications
• Separated into several modules, Qt’s intuitive API includes• Core Classes• GUI Classes• SQL Database Classes• XML Classes• Networking Classes• OpenGL® Classes• Qt WebKit Integration• Multimedia classes• And more
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials8
Qt Core Classes
• Qt core modules and utility classes• Qt kernel: Object model, event handling• Basic input / output: File, IO, Streams• Threading
• Signals and slots support, atomic reference counting, per-thread event loops
• Container classes• For storing, sorting and retrieving groups of data• Robust, easy to use, low memory overhead, highly optimized• Alternative to STL (but Qt and STL work well together)
• Fast XML stream reader and writer• IPC classes
• shared memory, local domain sockets, memory mapped files
• Supporting tools: qmake, rcc, configure, moc
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials9
Concurrency Framework in Core Module
• Provides an abstraction on top of multithreading
• Write multithreaded programs without using basic synchronization primitives such as mutexes and wait conditions
• Reduces the programmer’s need to deal with thread management
• Provides approximation of required threads for the available hardware
• Software scales without recompilation
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials10
Signals and Slots in Core Module
• Unique inter-object communicationmechanism provides
• Type-safe callback between objects
• Facilitates loose coupling /encapsulation
• Sender and receiver does not “know about” each other
• 1-to-many, many-to-1 communication between objects
• Works across threads
• Fully object-oriented
• A signal is emitted when a particular event occurs. A slot is a function that is called in response to a particular signal.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials11
Qt GUI Classes
• Provides rich set of GUI componentsand supporting functionality
• User interface components• Simple to complex widgets and
controls, dialogs
• Model-View-Controller (MVC) Itemviews
• Styles – ensuring native or custom lookand feel on target platform(s)
• Font-aware layout system
• Accessibility classes
• Canvas component with Widget support
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials12
Qt Database Classes
• Provide platform and database-independent access functionality
• Driver Layer• Low-level bridge between
specific databases and the SQLAPI layer
• SQL API Layer• Provide access to databases
• User Interface Layer• Link data from a database to
data-aware widgets
• Supports most major database drivers• DB2, IBASE, MySQL, OCI, ODBC, PSQL, SQLITE, TDS
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials13
Qt Networking Classes
• Provides TCP/IP networking functionality
• TCP sockets for clients and for servers
• Encapsulates TCP and UDP APIs
• SSL support
• HTTP 1.1 compliant asynchronous API
• FTP, DNS implementation
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials14
• Allows you to build your user interface in Qt, display and manipulate 3D model in OpenGL®
• Integrates OpenGL canvas with Qt
• Provides frame buffer and pixel buffer abstraction
• Supports accelerating 2D painting with OpenGL
• Mix 2D painting and 3D scenes
Qt OpenGL Classes
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials15
Qt XML Classes
• Core Module• Simple XML stream reader and writer
• XML Module• A well-formed XML parser using the SAX2 (Simple API for XML)
interface
• Implementation of the DOM Level 2 (Document Object Model)
• XmlPatterns module• An implementation of the XQuery standard
• Enable users to query XML files similar to SQL
• Semantics for value assignment, filtering, and simple operations
• Fully controllable output formatting
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials16
Qt WebKit Integration
• An open source HTML rendering component integrated with Qt
• Web standards compliant
• support for HTML, XHTML, XML, stylesheets, JavaScript, HTML editing, HTML canvas, AJAX, XSLT, XPath, some SVG.
• Deployable wherever Qt is: cross-platform/cross-version/cross-device
• Interact with Web environment, expose native objects
• NPAPI (Flash) support coming in Qt 4.5
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials17
Phonon Multimedia Framework
• Single, easy to use API (”Phonon”) for playback
• Provides possibility to play/synchronize multiple sound/video streams
• Will use native back-end format support• DirectShow on Windows
• GStreamer on X11
• QuickTime on Mac
• Plan to add more video and authoring support in the future
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials18
1. Introducing Qt
2. The Qt Library
3. Qt Development Tools
4. How to Get Started?
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials19
• Qt Designer: GUI layout and forms builder
• Qt Linguist: Internationalization toolset
• Qt Assistant: Customizable documentation reader
• qmake: Cross-platform build tool
• Integration with Visual Studio® and Eclipse® IDEs
Development Tools: Overview
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials20
Qt Designer
• Qt Designer is a powerful, drag-and-drop GUI layout and forms builder
• Features• Supports forms and dialog creation with instant
preview• Integrates with Qt layout system• Extensive collection of standard widgets• Support for custom widgets and dialogs• Seamless integration with Microsoft® Visual
Studio .NET and Eclipse• Benefits
• Greatly speeds the interface design process• Enables native look and feel across all supported
platforms• Developers work within the environment of their
choice, leveraging existing skills
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials21
• Qt Linguist is a set of tools that smooth the internationalization workflow
• Features• Collects all UI text and presents it to a human translator
in a simple window• Support for all languages, including CJK• Simultaneous support for multiple languages
and writing systems from within a single application binary
• Benefits• Greatly speeds the translation/localization
process• Works with Qt’s language-aware layout
engine for clean, consistent interface no matter the language
• Easily target international markets
Qt Linguist
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials22
Qt Assistant
• Qt Assistant is a fully customizable, redistributablehelp file/documentation browser
• Features• Simple, web-browser-like navigation, bookmarking and
linking of documentation files• Support for rich text and HTML• Full text and keyword lookup• Can be customized and shipped with
Qt applications
• Benefits• No longer have to build a help system
from scratch• Leverage existing HTML skills• Deliver documentation in an easily searchable and
navigable format to your end users
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials23
qmake
• A cross-platform application build tool
• Features• Reads project source, generates dependency tree, generates
platform specific project and makefiles
• Integrates with Visual Studio and Xcode
• Benefits• Takes the pain out of cross-platform builds
• Eliminates the need for makefile generation
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials24
IDE Integrations
• Integration for Microsoft Visual Studio 2003, 2005 and 2008
• Integration for Eclipse
• Provides Qt API integration, Qt Designer and Qt Documentation
• Class Wizard
• Project Wizard
• Import and Export to Qt .pro files
• Qt version management
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials25
1. Introducing Qt
2. The Qt Library
3. Qt Development Tools
4. How to Get Started?
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials26
How to Get Started?
• The best place to get started with Qt development is Qt SW units web page www.trolltech.com
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials
Company Confidential27
Qt on S60
A technical look in Qt on S60
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials28
Disclaimer
Note that Qt on S60 is not ready yet!
What is released is an early technical pre-release with limited functionality for early adopters.
Some of the presented functionality may change in the final release.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials29
1. Introducing Qt on S60
2. Build Process
3. Symbian Concepts
4. Carbide.c++ support
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials30
Qt on S60
• Qt Software announced in October the porting of Qt to S60 on Symbian OS(TM), the world's leading, open smartphone platform.
• An early technical preview of Qt for S60 is available for download from Qt Software current website www.trolltech.com. This is in line with Qt Software's usual approach of developing Qt openly and working with the community to incorporate feedback throughout the entire development process. Qt on S60 will work with S60 3rd Edition Feature Pack 1 and later releases. The first production release of Qt for S60 will be available in the second quarter of 2009.
• With the inclusion of the S60 platform, developers have an additional 80 million target devices that they can support with their Qt-based applications.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials31
Qt on S60 Total Offering
• Qt on S60 port – Qt 4.5 ported to S60 3rd Edition FP 1 and FP 2, 5th edition and also coming S60 platform editions.
• Currently, the Qt on S60 pre-release is based on Qt 4.4, but final release will be based on Qt 4.5.
• Carbide.c++ 2.0 supporting Qt/S60 development.• Fully integrated form editor (Qt Designer)
• Wizards for creating new Qt projects and classes
• Integrated .pro file editor
• Automated build setup for moc, uic, and rcc
• Examples and additional documentation available in Forum Nokia
• And more to come…
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials32
Licensing
• There have been lot of speculation and concerns of used licensing model.
• The current release is under Commercial Tech Preview license which allows evaluating and testing only.
• We intend to make Qt available for the Symbian platform free of charge. Details to be announced.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials33
Current Release
• The release is called Temple with following functionality• QtCore,
• QtGui (full-screen only, no S60 UI integration nor support for inputs),
• QtNetwork,
• QtScript,
• QtSvg,
• QtXml
• qmake enhancements allowing integration with Symbian tool chain
• The next release, Garden, will provide the rest of the QtGui module, including a new S60 style and input methods.
• Where to get it: http://pepper.troll.no/s60prereleases/
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials34
1. Introducing Qt on S60
2. Build Process
3. Symbian Concepts
4. Carbide.c++ support
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials35
Build Process
• The contents of a project are described in a project file that is the master file of the project. Generally it lists the source and header files, configuration information, and application-specific details (such as libraries and include paths).
• A default project file can be generated from known extension (.h, .cpp, .ui etc) using the command
• qmake -project
• Qt’s .pro files are the master files used in Qt/S60. Symbian build files are generated by the qmake command and should never be manually edited.
• Building a Qt application on the S60 platform differs from building an S60 application only at the beginning of the toolchain. We intend to provide a wrapper makefile as well as part of coming releases.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials36
Build Process
• qmake generates Symbian specific bld.inf, mmp files, default registration file, extension makefiles and package files based on the project file.
• Extension makefiles are used to integrate Qt-specific tools like moc, uic and rcc to the Symbian toolchain.
3 (Optional )
Project Information Files
*.pri / *.pro
QMAKE
USER
2
QMAKE -PROJECT
1
Makefile
MAKE
Symbian specific build files
Symbian Toolchain
(abld , bldmake , makmake ..)
Source Files Data
BinariesEXE / DLL / LIB /
RCC
fgToolchain
(UIC / RCC, MOC, Compiler, Linker)
3
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials37
Symbian Extensions to Project Files
• A Qt application on S60, is a Symbian application written in Qt running on S60 devices. Some Symbian specific settings are needed in .pro files.
• Target type is specified using TEMPLATE and CONFIG variables in the .pro file.
• TEMPLATE = app value maps to target type EXE in MMP file,• TEMPLATE = lib, CONFIG variable is used to distinguish between lib and dll
target types.
• Name of application executable – use TARGET statement in .pro file (maps to TARGET in MMP file)
• Symbian specific definitions in the project file should be separated from other definitions using a Symbian keyword. Example:
symbian: {
TARGET.UID2 = 0x100039CE
TARGET.UID3 = 0xA000017F
}
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials38
Symbian Extensions to Project Files
• Some other examples of Symbian specific keywords:• TARGET.SID = 0xA000017F• TARGET.VID = 0x70000001 • TARGET.EPOCSTACKSIZE = 0x5000 // 20kb• TARGET.EPOCHEAPSIZE = “0x20000 0x1000000 // Min 128kb, Max 16Mb”• TARGET.CAPABILITY = NetworkServices
• If other platform-specific libraries need to be added to the project, this can be done by adding the LIBS variable to the project file with the appropriate library name preceded with a ‘–l’ prefix:
LIBS += -lbitgdi –lfbscli
• QMAKE_CXXFLAGS can be used for setting compiler-specific options. The keyword is followed by the specific compiler:
QMAKE_CXXFLAGS.CW += -O2
QMAKE_CXXFLAGS.ARMCC += -O0
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials39
Symbian Extensions to Project Files
• The DEFINES keyword can be used to add MACRO statements to the mmp file.
• The DEPLOYMENT keyword is used to specify additional files that need to be deployed.
symbian: {
addFiles.sources = helloworld_fi.qm helloworld_en.qm
addFiles.path = .
DEPLOYMENT += addFiles
}
• Lot of other keywords are supported, see the Qt/S60 documentation for more details.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials40
1. Introducing Qt on S60
2. Build Process
3. Symbian Concepts
4. Carbide.c++ support
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials41
Platform Security
• All platform security rules also apply for Qt applications in the S60 environment. Because Qt is mainly ported on top of Open C, the required capabilities are also derived from those APIs. Platform security requires that needed capabilities be defined in the project file. The Qt application may require, for example, the following capabilities:
• AllFiles, when using file operations and accessing protected folders
• NetworkServices should be enough in most cases when using the QtNetwork module, but there might be certain API calls that also require NetworkControl.
• When using Symbian APIs the capabilities needed are, of course, the ones that the APIs define.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials42
Memory Management
• Qt applications are implemented in such a way that the cleanup stack is not needed for them. If there is not enough memory when running the Qt application, the application will simply be closed.
• When implementing an application with Qt in the S60 environment, the cleanup stack should be used with Symbian code.
• Qt stores objects into an object tree when they are created. The object tree enables automatic deletion of child objects that have a parent.
• For example, when a widget is created with another object as a parent, it is added to the parent’s child list and deleted automatically when the parent is deleted.
• If an object with a parent is created with new on the heap, the deletion of the object removes it automatically from the parent.
• If the deleted object has children, they are automatically deleted when the object is deleted. The same behaviour applies to objects created on the stack.
• The only objects that have to be explicitly deleted are the objects created with new and that have no parent.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials43
How to Mix Qt and Symbian C++ code
• We will document in future releases what’s the best way of developing hybrid applications having both Qt and Symbian code
• Traps/leaves and error management
• How to hide Symbian code from Qt code
• How to make conversions between Qt and Symbian types (like QString to descriptors)
• Some guidance exists already in the Qt on S60 developer library
• Also, we are investigating how to improve the OOM capabilities in Qt to better suit the needs of embedded devices
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials44
1. Introducing Qt on S60
2. Build Process
3. Symbian Concepts
4. Carbide.c++ support
Contents
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials45
Qt Support in Carbide.c++ 2.0
• Support for Qt development
• Carbide works with Qt projects
• .PRO editor for easy project configuration
• Package /deploy projects to phone
• Qt plug-ins are included in Carbide
• Qt project Wizard
• Support for Qt UI design tool
• Oh yeah, since Qt on S60 is a Symbian application, you can use same tools for debugging, profiling etc.
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials46
Additional Qt support in Carbide
Qt Template Wizard .PRO Project Editor