lamad symbian qt 17.3.2013. symbian os one of the first modern mobile operating systems most popular...
TRANSCRIPT
![Page 1: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/1.jpg)
LAMADSymbian Qt17.3.2013
![Page 2: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/2.jpg)
Symbian OS
![Page 3: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/3.jpg)
Symbian OS
One of the first modern mobile operating systems
Most popular smartphone OS until the end of 2010
Main Nokia OS until 2011
Maintained by Accenture
Nokia 808 PureView is the last ever Symbian smartphone
![Page 4: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/4.jpg)
Symbian OS
+ True multi-tasking operating system
+ Wide range of available phones (from cheap keypad-based to large touchscreen smartphones)
+ Still has a big user base, especially in developing countries
- More suited for non-touch keypad devices
- Slow and outdated
- Declining user base
Initial partners of Symbian OS
![Page 5: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/5.jpg)
S60 3rd edition
For keypad-only devices
Nokia E72Nokia C5 Nokia N95 Nokia E52
![Page 6: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/6.jpg)
S60 5th edition
Touch and touch&type devices
Nokia N97 Nokia C5-03 Nokia E5 Nokia 5800
![Page 7: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/7.jpg)
Symbian^3For touchscreen devices
Multiple home screens
Better hardware
Nokia C7 Nokia E7 Nokia N8 Nokia 808
![Page 8: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/8.jpg)
Market share 2012
Smartphones 4Q ’11 4Q ’12 4Q 4Q ’11 4Q ’12(mil. phones) Sales Sales Growth Share Share
Android 77.1 144.7 88% 51% 70%iOS 35.5 43.5 23% 24% 21%
Blackberry 13.2 7.3 (44)% 9% 4%Microsoft 2.8 6.2 124% 2% 3%
Bada 3.1 2.7 (14)% 2% 1%Symbian 17.5 2.6 (85)% 12% 1%Others 1.2 0.7 (39)% 1% 0%
Total 150.2 207.7 38% 100% 100%
![Page 9: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/9.jpg)
Developing for Symbian
3 options available
![Page 10: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/10.jpg)
Java ME
+ Easy memory management
+ Easy to develop
+ Application can be ported to S40 Asha (Nokia’s feature-phone OS)
- Lack of APIs(maps, navigation, UI controls)
- Limited access to hardware
- Needs certification and signing
- Limited subset of Java
![Page 11: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/11.jpg)
Symbian C++
Subset of C++
+ Full access to hardware
+ Low memory footprint
+ Good profiling and debugging tools
- Lack of APIs (maps, navigation, UI controls)
- Steep learning curve
- Difficult memory management
- Needs certification and signing
![Page 12: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/12.jpg)
Qt Framework+ Good set of UI controls
+ Good customization options
+ Fast to develop
+ Application can be deployed for MeeGo with minor changes
- Large memory footprint on older Symbian versions
- Lack of Symbian emulator (although Qt Simulator can simulate Qt on Symbian)
- The Mobility package can have some bugs
![Page 13: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/13.jpg)
Qt – Introduction
![Page 14: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/14.jpg)
What is Qt?
C++ framework – bindings for other languages Python, Ruby, C#, etc.
Originally for user interfaces – now for:Databases, XML, WebKit, multimedia, networking, OpenGL, scripting, location, telephony, non-GUI...
“Qt is a cross platform developmentframework written in C++.”
![Page 15: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/15.jpg)
Desktop target platforms
Windows
Mac OS X
Linux/Unix X11
![Page 16: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/16.jpg)
Mobile target platforms
Windows CE
Symbian
Maemo/MeeGo
Embedded Linux
![Page 17: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/17.jpg)
What is Qt?Qt is made up of modules
All modules have a common scheme and are built from the same API design ideas
QtCore
Phonon
QtXmlPatterns
QtXmlQtWebKit
QtSvgQtSql QtScript
QtOpenVG
QtOpenGLQtNetwork
QtMultimedia
QtGui
QtMobility
![Page 18: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/18.jpg)
What is Qt?
Qt extends C++ with macros and introspection
All Qt object inherit QObject base class
All code is still plain C++
// foreach macroforeach (int value, intList) { … }
// QObject is the base class of QtQObject *o = new QPushButton;o->metaObject()->className(); // returns ”QPushButton”
// Event handling with signal and soltsconnect(button, SIGNAL(clicked()), window, SLOT(close()));
![Page 19: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/19.jpg)
Getting Qt
Easiest way to get started is to download Qt SDK. It contains: Qt headers and documentation Pre-built Qt libraries and tools The QtCreator integrated development
environment
![Page 20: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/20.jpg)
Windows Installation
1.Download the Qt SDK for Windows
2.Run the downloaded installer
3.Click through the installer
4.Start QtCreator from the start menu
![Page 21: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/21.jpg)
Hello World
#include <QApplication>#include <Qlabel>int main( int argc, char **argv ) {
QApplication app( argc, argv );
QLabel l( "Hello World!" );
l.show(); return app.exec();
}
Windows Linux Mac
Symbian
![Page 22: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/22.jpg)
Qt – QObject
![Page 23: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/23.jpg)
The QObject
QObject is the base class of almost all Qt classes and all widgets
It contains many of the mechanisms of Qt: events signals and slots properties memory management
![Page 24: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/24.jpg)
The QObject
QObject is the base class to most Qt classes.
Examples of exceptions are: Classes that need to be lightweight such as graphical
primitives Data containers (QString, QList, QChar, etc) Classes that needs to be copyable, as QObjects cannot
be copied
![Page 25: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/25.jpg)
Meta data
Qt implements introspection in C++
Every QObject has a meta object
The meta object knows about: class name (QObject::className) inheritance (QObject::inherits) properties signals and slots general information (QObject::classInfo)
![Page 26: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/26.jpg)
How meta data is generated?
class LocationHandler : public QObject {Q_OBJECTQ_CLASSINFO("author", "Mopsi")Q_PROPERTY(QGeoPositionInfo location READ location WRITE
setInitialLocation)
public: LocationHandler(const int &desiredAccuracy, QObject *parent=0);QGeoPositionInfo location() const;
public slots:void setInitialLocation( const QGeoPositionInfo &aLocation );
signals:void locationChanged(QGeoPositionInfo );
private: QGeoPositionInfo m_location;
};
Meta data
Qt keywords
General infoabout the
class
The Q_OBJECT
macro, usually first
QObject must be inherited first (could be indirect)
![Page 27: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/27.jpg)
Getter, const, returns value,takes no arguments
class LocationHandler : public QObject {Q_OBJECTQ_CLASSINFO("author", "Mopsi")Q_PROPERTY(QGeoPositionInfo location READ location WRITE
setInitialLocation)
public: LocationHandler(const int &desiredAccuracy, QObject *parent=0);QGeoPositionInfo location() const;
public slots:void setInitialLocation( const QGeoPositionInfo &aLocation );
signals:void locationChanged(QGeoPositionInfo );
private: QGeoPositionInfo m_location;
};
QObject has properties with getter and setter methods
Naming policy: color, setColorFor booleans: isEnabled, setEnabled
QObject properties
Setter, returns void,
takes value as only argument
Macro with property
declaration
Private state
![Page 28: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/28.jpg)
Direct access
Through the meta info and property system
Discover properties at run-time
Using properties
QString text = label->text();label->setText("Hello World!");
QString text = object->property("text").toString(); object->setProperty("text", "Hello World");
int QMetaObject::propertyCount(); QMetaProperty QMetaObject::property(i); QMetaProperty::name/isConstant/isDesignable/read/write/...
![Page 29: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/29.jpg)
Memory Management
QObject can have parent and childrenWhen a parent object is deleted, it deletes its children
This is used when implementing visual hierarchies.
QDialog *parent = new QDialog();QGroupBox *box = new QGroupBox(parent);QPushButton *button = new QPushButton(parent);QRadioButton *option1 = new QRadioButton(box);QRadioButton *option2 = new QRadioButton(box);
delete parent;parent
box button
option1 option2
parent deletes box and buttonbox deletes option1 and option2
![Page 30: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/30.jpg)
Qt – Signals and slots
![Page 31: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/31.jpg)
Signals and Slots
Is the default event handling mechanism in Qt
Dynamically and loosely ties together events and state changes with reactions
It’s what makes Qt tick
// Event handling with signal and soltsconnect(button, SIGNAL(clicked()), window, SLOT(close()));
![Page 32: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/32.jpg)
Signals and Slots in Action
emit clicked();
![Page 33: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/33.jpg)
Signals and Slots in Actionconnect(trackingButton,SIGNAL(clicked()), this, SLOT(showTrackingScreen()));24
private slots: void showTrackingScreen();
![Page 34: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/34.jpg)
Signals and Slots vs Callbacks
A callback is a pointer to a function that is called when an event occurs, any function can be assigned to a callback
– No type-safety– Always works as a direct call
Signals and Slots are more dynamic– A more generic mechanism– Easier to interconnect two existing classes– Less knowledge shared between involved classes
![Page 35: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/35.jpg)
Qt – User interface
![Page 36: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/36.jpg)
Qt Widgets
User interfaces are built from individual widgets
46 widgets in Designer
59+ direct descendants from QWidget
QLabel
QPushButtonQLineEdit
QDoubleSpinBox
QScrollBar
![Page 37: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/37.jpg)
Qt QuickQt Quick is the alternative to Qt WidgetsQt Quick consists of
QML – the language (similar to JavaScript) Designed for building device user interfaces Can be used in other application too
Qt Declarative – the Qt module Contains the QML engine, context and view Qt bindings for QML Mechanisms for integrating C++ and QML
There is tooling support in Qt CreatorQt Quick supported ONLY in Symbian^3 and desktop
![Page 38: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/38.jpg)
Traits of a Widget
Occupies a rectangular area of the screen
Receives events from input devices
Emits signals for “notable” changes
Are structured in a hierarchy
Can contain other widgets
![Page 39: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/39.jpg)
Cross Platform Styles
Widgets are drawn using a platform specific style to ensure a native look
![Page 40: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/40.jpg)
Using Designer
drag-and-drop
![Page 41: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/41.jpg)
Using the Code
#ifndef MOPSIMAINSCREEN_H#define MOPSIMAINSCREEN_H
#include <QWidget>
namespace Ui { class MopsiMainScreen;}
class MopsMainScreen: public QWidget { Q_OBJECTpublic: MopsiMainScreen(QWidget *parent=0); ~MopsiMainScreen ();
private: Ui::MopsiMainScreen *ui;};
#endif // MOPSIMAINSCREEN_H
Forward declaration of theUi::MopsiMainScreen
class
A Ui::Widget pointer,ui, refers to all widgets
Basically a standard QWidget derived class
![Page 42: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/42.jpg)
#include “mopsimainscreen.h"#include "ui_widget.h"
MopsiMainScreen::MopsiMainScreen(QWidget *parent) : QWidget(parent), ui(new Ui:: MopsiMainScreen){ ui->setupUi(this);}
MopsiMainScreen::~MopsiMainScreen(){ delete ui;}
Using the Code
Instanciates theUi::MopsiMainScreen class as ui
Deletes the uiobject
Calls setupUi, creating all the
widgets as children to the given parent
(this).
![Page 43: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/43.jpg)
Style sheetsFor highlighting and cross platform styling, all QWidget classes have a styleSheet property
To style an entire application: QApplication::setStyleSheet
Style sheets are inspired from CSS
QToolButton { background-color: blue; color: white; text-align: center; font-size: 14pt; }
No stylesheet
![Page 44: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/44.jpg)
Style sheetsThe easiest way to apply a style sheet to an individual widget is to use Designer
![Page 45: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/45.jpg)
Qt – Internet
![Page 46: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/46.jpg)
Accessing internetQtWebKit classes uses the QNetworkAccessManager
Provides access to web: Independent of UI Handle requests and replies Cache web pages Keep track of cookies Use proxies Act as a protocol translator
networkAccessManager = new QNetworkAccessManager(this);connect(networkAccessManager,
SIGNAL(finished(QNetworkReply*)), this, SLOT(parseResponse(QNetworkReply*)));
![Page 47: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/47.jpg)
Classes for Network Access
QNetworkReplyQNetworkRequest
QAbstractNetworkCache QNetworkCookieJarQNetworkProxyFactory
QNetworkAccessManager
![Page 48: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/48.jpg)
Accessing HTTP programatically
Example – download a file via HTTP using QNetworkAccessManager
QNetworkAccessManager *manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply*)), this,
SLOT(downloadDone(QNetworkReply*))); manager->get(QNetworkRequest(QUrl("http://cs.uef.fi/mopsi/photos/user.png")));
InternetUtil::downloadDone(QNetworkReply *reply) {QImageReader reader(reply, "png");mImage = reader.read()); emit iconDownloaded(mImage);reply->deleteLater();
}
![Page 49: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/49.jpg)
Qt – Location
![Page 50: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/50.jpg)
Location
27
![Page 51: LAMAD Symbian Qt 17.3.2013. Symbian OS One of the first modern mobile operating systems Most popular smartphone OS until the end of 2010 Main Nokia OS](https://reader031.vdocuments.us/reader031/viewer/2022012922/56649dbe5503460f94ab1aed/html5/thumbnails/51.jpg)
Location Example// create positioning sourcesource = QGeoPositionInfoSource::createDefaultSource(this);
// Set to listen just to GPSsource->setPreferredPositioningMethods (QGeoPositionInfoSource::SatellitePositioningMethods);
source->setUpdateInterval(1000); // Update interval is 1s
// Connect source signal to a method that handles the updateconnect(source, SIGNAL(positionUpdated(QGeoPositionInfo)), MapWindow::instance(), SLOT(positionUpdated(QGeoPositionInfo)));
...void MapWindow::positionUpdated(const QGeoPositionInfo& info){
// handle here the position change