software development with qt

31
13 April, 2010 Andreas Jakl Senior Technical Consultant Forum Nokia Software Development with Qt

Upload: nokiaappforumbulgaria

Post on 12-May-2015

33.176 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Software development with qt

13 April, 2010

Andreas JaklSenior Technical ConsultantForum Nokia

Software Development with Qt

Page 2: Software development with qt

13.04.2010 2© 2010 Nokia

Qt in a NutshellQt is a class library for platform independent development of graphical user interfaces based on C++.

The framework also includes XML, databases, multithreading,network, internationalization, 3D, WebKit, multimedia, etc.

Page 3: Software development with qt

© 2010 Nokia

Short History of QtFocus on mobile platforms (Symbian, Maemo, MeeGo), dedicated mobility APIs

Nokia purchases Trolltech, name changes to Qt Development Frameworks APIs

Qt 4.0 – compatibility break, leads to new KDE 4 desktop

Qtopia – platform for mobile phones & PDAs

First public release through newsgroups (Qt 0.90)

• Dual licensing: commercial & free for open source

Decided to go into business

• “Q” looked beautiful in Emacs font. “t” for toolkit

• Company : Quasar Technologies (later: Trolltech)

Development started

• Cross platform GUI toolkit was needed

13.04.2010 3

Eirik Chambe-Eng Nord

Haavard

Page 4: Software development with qt

13.04.2010 4© 2010 Nokia

Some Well-Known Customers

… and many, many more!

Page 5: Software development with qt

© 2010 Nokia

Qt Licensing• LGPL license

• Qt is completely free!

– Unlike GPL, the LGPL:

• Allows using Qt for free in commercial, closed source apps

– Complete development source code of Qt available

• Commercial version

– Code changes to Qt source code don’t have to be shared

– Included support options

13.04.2010 5

Page 6: Software development with qt

13.04.2010 6© 2010 Nokia

Platforms WindowsMac OSLinux / X11Embedded LinuxWindows CEMaemo / MeeGoSymbian (S60)

C++

JavaPython

AdaPascal

PerlPHP

Maintained byQt open source community.

Not officially supported by Qt Development Frameworks.

Page 7: Software development with qt

13.04.2010 7© 2010 Nokia

Mobile Development

Java ME

Page 8: Software development with qt

© 2010 Nokia

Symbian and Qt• Qt for Symbian:

– Compatible to S60 3rd. Edition, FP1+ (Nokia N95, E71)

– Install SDK for your device, or lowest denominator for devices you want

to support with your product

• Info about system version of Nokia S60 devices:

http://www.forum.nokia.com/devices/

13.04.2010 10

Series 601st Ed.

Series 602nd Ed.

(+ 3 FPs)

S603rd Ed.

S603rd Ed.

FP1

S603rd Ed.

FP2

S605th Ed.

= Symbian^1

Symbian^2 Symbian^3 Symbian^4

Qt Compatibility

Page 9: Software development with qt

© 2010 Nokia

Symbian and Qt• Symbian^3 – Ready for Qt

– Qt Pre-installed on devices

– Ensures forward- and backward

compatibility

Page 10: Software development with qt

© 2010 Nokia

Symbian and Qt• Symbian^4: replaces S60 with Qt-based UI

• Components:

– Uiemo (UI Extensions for Mobile, Orbit):

extension library for Qt, 50+ UI elements

tailored for mobile

– Direct UI: new app framework based on Uiemo

• Availability:

– End of 2010

Symbian^4 Concept Video

12

Page 11: Software development with qt

© 2010 Nokia

Maemo / MeeGo and Qt• Maemo 5

– GTK+ based UI

– Qt pre-installed

– Final Qt support: H1 2010 (4.6.2)

• MeeGo 1.0 N (formerly: Maemo 6)

– Qt replaces GTK+

– Multi-touch, gestures support

– GTK and Clutter will stay in MeeGo

13

Page 12: Software development with qt

© 2010 Nokia

MeeGo and Qt• Moblin (Intel) and Maemo (Nokia) merge to

– New Linux distribution (Linux Foundation)

– MeeGo UI toolkit based on Qt

– GTK and Clutter included for application compatibility

14

Page 13: Software development with qt

© 2010 Nokia

Qt Architecture• Qt uses native styles to draw UI

– UI elements have original

look & feel

– Can be adapted by the developer

• Built on low level APIs of platform

– No runtime!

• Cross-platform

– Single source for multiple platforms

– Only requires recompilation

15

Page 14: Software development with qt

© 2010 Nokia

Getting StartedInstall Qt SDK from qt.nokia.com

Start Qt Creator UI

16

Page 15: Software development with qt

13.04.2010 17© 2010 Nokia

Hello World Project

#include <QApplication>

#include <QPushButton>

int main(int argc, char *argv[])

{

QApplication app(argc, argv);

QPushButton helloButton("Hello World");

helloButton.resize(150, 50);

helloButton.show();

return app.exec();

}

main.cpp

Page 16: Software development with qt

© 2010 Nokia

Qt and C++• Qt goes beyond C++

– Seamless object communication

(signals & slots)

– Meta object system, featuring

object properties and object trees

– Contextual string translation for internationalization

• … but still works with standard C++ compilers

on all platforms!

13.04.2010 18

Page 17: Software development with qt

© 2010 Nokia

Interactivity: Quit Hello World• Add functionality to exit the Hello World example:

– Button emits clicked() signal

– Connected to QApplication::quit()

13.04.2010 19

QObject::connect(&helloButton, SIGNAL(clicked()),

&app, SLOT(quit()));

Page 18: Software development with qt

© 2010 Nokia

Signals & Slots• Signal

– Emitted when a particular event occurs (e.g., clicked())

– Qt widgets: predefined signals

– Also create your own signals

• Slot

– Function called in response to a signal

– Qt widgets: predefined slots (e.g., quit())

– Also create your own slots

• Connection signals slots established by developer,

handled by Qt framework

13.04.2010 20

Page 19: Software development with qt

© 2010 Nokia

Deploy• Run your Qt application on all platforms!

13.04.2010 21

Windows 7 Symbian^1(S60 5th Edition)

Maemo 5

Page 20: Software development with qt

The Future of Qt

Page 21: Software development with qt

© 2010 Nokia

Qt Quick (Qt User Interface Creation Kit)• Create UIs as a designer

– Without C++ knowledge

– Using visual tools

– Module: Declarative UI

– Based on QML language

(extension to JavaScript)

– Supported in Qt 4.7

23

http://blog.qt.nokia.com/2010/02/15/meet-qt-quick/

Page 22: Software development with qt

© 2010 Nokia

QML• Describe UI by tree structure of property bindings

– Properties dynamically evaluated

– Communication through

signals & slots

– Bindings to C++ code possible

– Animate properties using states

and transitions

24

Rectangle {width: 200height: 200color: "white"Image {

source: "pics/logo.png"anchors.centerIn: parent

}}

Page 23: Software development with qt

© 2010 Nokia

UI Framework (Uiemo)• Scene graph approach to the UI

• Optimized for

– Graphics effects, 3D HW acceleration

– Gestures, multi-touch, kinetics

• Adventurous?

– It’s open source!

– Symbian: http://qt.gitorious.org/uiemo

25

Page 24: Software development with qt

13.04.2010 26© 2010 Nokia

Hybrid ApplicationsHTML App

Qt Web Technology

Qt

Page 25: Software development with qt

13.04.2010 27© 2010 Nokia

Advantages of Hybrid ApplicationsQt

C++

Full device access

Powerful libraries

Web

HTML, CSS, JavaScript

Rapid development

Broad reach

Embed Qt UI elements into HTML pageAccess Qt objects from JavaScript

Trigger JavaScript from QtShared storage

http://qt.nokia.com/forms/whitepapers/reg-whitepaper-hybrid

Page 26: Software development with qt

© 2010 Nokia

Qt Mobility• Qt: Desktop → Mobile

• Requires new APIs for

– Sensors

– Location

– Messaging

– etc.

• Qt Mobility: new cross-platform APIs for mobile use cases

– Back-end implementation on all platforms where it makes sense

13.04.2010 28

Page 28: Software development with qt

© 2010 Nokia

Qt 4.7• Qt 4.7 Tech Preview: Available now!

– Includes Qt Quick

– Integrates first parts of Qt Mobility

– Focus on performance

• http://qt.nokia.com/developer/qt-roadmap

30

Page 29: Software development with qt

13.04.2010 31© 2010 Nokia

Qt BooksC++ GUI Programming with Qt 4 (2nd edition)Jasmin Blanchette, Mark Summerfield. Prentice Hall.Official book for Qt development. Good for looking things up or for enhancing your knowledge, average for learning from scratch.Status: Qt 4.3, 2008

Foundations of Qt DevelopmentJohan Thelin. Apress.More in-depth and technically oriented explanation of Qt. Most other books are rather similar to the official documentation that you get for free with the SDK – this is different, and is therefore a good companion.Status: 2007

Page 30: Software development with qt

13.04.2010 32© 2010 Nokia

Even More InformationQt for SymbianEditors: Frank H. P. Fitzek, Tommi Mikkonen, Tony Torp. Wiley.For Qt developers wanting to get started with development on the mobile Symbian platform, or the other way round.Status: Qt 4.6, April 2010

Online: qt.nokia.com, www.forum.nokia.com, www.qtcentre.orgLots of documentation and examples installed with SDK

Page 31: Software development with qt

Thank You.