SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
Qt Communication



Andreas Jakl
Senior Technical Consultant
Forum Nokia

                              20 September, 2010
                                          v3.0.0
Contents
  – Devices and streams
  – Files
  – Sockets and HTTP
  – XML
  – Internationalization
Device Abstraction
• QIODevice is base class for all “devices” capable of reading and writing
  blocks of bytes
                                       QIODevice




     QBuffer       QFile        QProcess     QAbstractSocket    QNetworkReply   QLocalSocket




               QTemporaryFile        QUdpSocket           QTcpSocket



                                                           QSslSocket
Devices
• Sequential devices
   – Data can be accessed only once
   – Start from first byte, progress serially to last byte
   – QProcess, Q*Socket
• Random access devices
   – Bytes can be read any number of times from any position
   – QFile, QTemponaryFile, QBuffer
Streams
• Higher-level stream classes
    – Take care of byte ordering, text encoding
    – QDataStream
        •   Binary data
        •   100% independent of host system
        •   Implements serialization of basic data types (C++ and Qt)
        •   Overload << and >> operators to add support for custom data types

    – QTextStream
        •   Read/write words, lines, numbers
        •   Supports formatting
        •   Operates on QIODevice, QByteArray or QString
Example: Console Application
• No need for UI
• Necessary changes for the project file (.pro):
       TEMPLATE = app
       QT = core
       CONFIG += console
       CONFIG -= app_bundle
       SOURCES += main.cpp

    – Only QtCore module is required
    – Configuration console enables console output on Windows
    – Removing app_bundle: don„t create bundle in Mac OS X
Opening Files
                                       main.cpp
•   No event loop required             #include   <QtCore>
                                       #include   <QDebug>
     → no QCoreApplication             #include   <iostream>
                                       #include   <stdio.h>
•   Error Handling
                                       int main(int argc, char* argv[])
     – Through standard error stream   {
                                         QFile outFile("data.dat");
        (std:cerr) → defaults to         if (!outFile.open(QIODevice::WriteOnly)) {
                                           std::cerr << "Cannot open file for writing: " <<
        console                               outFile.errorString().toStdString() << std::endl;
                                           return 1;
     – <iostream> has overload           }
       for std::string → convert
       QString with
       .toStdString()
Writing Data
                             main.cpp
• Data representation        QDataStream out(&outFile);
                              // Serialization format of data stream changes with
                              // new version of Qt to accommodate new
   – Specify data format      // functionality.
                              out.setVersion(QDataStream::Qt_4_5);
      version to maintain
                              // Use specific Qt datatypes to make sure integers
      forward and backward    // are the same on all platforms!
                              quint32 outValue = 12345678;
      compatibility           QTime outTime = QTime::currentTime();
                              QVariant outVar("Some text");
                              out << outValue << outTime << outVar;
   – Platform independent
                              outFile.close();
      (default: big endian
                                        Recommended: extend the example
      encoding)                                 with brief file header.
                                         1. Magic String: check if file is really
                                                   from your app.
                                        2. Version number: correctly import
                                        from old versions of your settings file.
Data Representation

                      Input stream


                      Input variables




                      Output stream




                      Output variables
main.cpp
Reading Files                            QFile inFile("data.dat");
                                          if (!inFile.open(QIODevice::ReadOnly)) {
                                            std::cerr << "Cannot open file for reading: " <<
                                              inFile.errorString().toStdString() << std::endl;
•   Reading similar to writing              return 1;
                                          }
     – Use same order and data
                                             QDataStream in(&inFile);
       stream version                        in.setVersion(QDataStream::Qt_4_5);
     – Streams don‟t save variable           quint32 inValue;
       type                                  QTime inTime;
                                             QVariant inVar;
•   QVariant recognizes type
                                             // Read values in same order as they were written
     – Here: output using qDebug()           in >> inValue >> inTime >> inVar;
       instead of standard streams           qDebug() << "Variant type:" << inVar.typeName() <<
                                                         ", contents:" << inVar.toString();
     – Advantage: direct serialization
       of Qt data types                      inFile.close();
                                             return 0;
                                         }
Communication


                Image Credit: NASA
Qt Modules
                                                QIODevice

• Networking classes in
  QtNetwork extension module
                                                      QAbstractSocket    QNetworkReply   QLocalSocket
• Using the module
   – Insert to project file (.pro):
       QT += network                         QUdpSocket            QTcpSocket


   – Source code:
                                                                    QSslSocket
       •   Include appropriate headers of classes in use, or …
       •   Use meta-include that contains whole QtNetwork module

           #include <QtNetwork>
Sockets
• Socket
   – Logical communication endpoint between 2+ software processes
• Communication
   – Peer-to-Peer: Two similar processes communicate
   – Client-Server: Different roles, e.g. web server & browser
Connection
• Connection-oriented – “reliable”
   – First establishes end-to-end-connection, then sends data
   – Connection is present  can check delivery order, arrival, errors, ...
• Connectionless – “unreliable”
   – Requires destination address each time data is sent (datagrams)
   – Each received packet is treated independently
   – No guarantees on order, duplication, delivery
TCP
• Stream-oriented protocol (“reliable”)
    – Often preferable to HTTP in the mobile context:
      less overhead
• Implementation provided by: QTcpSocket
    – Either use instance directly or derive from it
    – Operations performed asynchronously
    – Status changes and errors: emitted via signals
    – Indirectly derived from QIODevice: allows QDataStream and
      QTextStream
Servers and UDP
• TCP Server: QTcpServer
   – Single- or multi-threaded
   – See Fortune Server example from Qt SDK
• UDP (“unreliable”)
   – Connectionless
   – No extra server class required
   – Instead: use bind() of QUdpSocket
   – Data transfer: smaller datagrams
High Level Network Operations
•   For communicating with services:
     – Use high level classes for common protocols
     – QNetworkAccessManager
          •   Coordinates multiple network requests
          •   Creates and monitors the requests
          •   Currently supports: HTTP, FTP and file access
     – QNetworkRequest                                              The dedicated QHttp
          •   Represents individual request                         and QFtp classes are
                                                                        deprecated.
          •   Contains request header, URL, etc.
     – QNetworkReply
          •   Created by manager
          •   Contains response header, URL, reply contents, etc.
HTTP Overview


                                   QNetworkAccessManager
                                    Communication settings




                Transaction                   Transaction              …

                       QNetworkRequest
                         Header, Body


                                              GPRS, UMTS, …   Server

                      QNetworkResponse
                         Header, Body
HTTP Protocol
•   Higher level protocol, based on TCP
     – Stateless protocol
     – Request and response are self-contained
•   Well-known from web
     – Client browser sends request for website to server
     – Server responds with web page contents
•   Mobile world
     – HTTP-based web services: Client only requests specific data
     – Response: usually XML
     – Concept used by AJAX requests
       (Asynchronous Javascript and XML) → Web 2.0


                                      Image Credit: Mozilla Foundation
XML (Extensible Markup Language)
                                                         <kml>
• Properties                                               <Response>
                                                             <name>FH Hagenberg, Austria</name>
                                                             <Placemark id="p1">
   – General-purpose specification for                          <address>
     creating custom markup                                       Fachhochschule Hagenberg,
                                                                  4232 Hagenberg im Muehlkreis,
     languages                                                    Oesterreich
                                                                </address>
   – Textual data format                                        <ExtendedData>
                                                                  <LatLonBox north="48.3760743“
   – Markup (usually tags –                                                  south="48.3612490"
                                                                             east="14.5310893"
     e.g., <html>) and content                                               west="14.4990745"/>
                                                                </ExtendedData>
• Qt                                                            <Point>
                                                                 <coordinates>14.5150819,
   – Add xml module to                                          </Point>
                                                                              48.3686622,0</coordinates>

     project file (.pro)                                     </Placemark>
                                       Sample XML file     </Response>
                 Truncated KML data from Google Maps     </kml>
Parsing XML
• DOM (Document Object Model)
   – Standard of W3C
   – QDomeDocument builds hierarchical tree
   – Contains all nodes of XML file

           Non-consecutive access to elements (e.g., web browser)
           Easy to transfer DOM tree back into XML file



        High memory requirements (especially for mobile devices)
Parsing XML
• SAX (Simple API for XML)
   – Event-driven API: QXmlSimpleReader
       •    Triggers events; e.g., when encountering opening / closing tag
       •    Override virtual event handler methods




              More lightweight than DOM


           More difficult to manipulate structure of data
               (already handled data is discarded)
           Parsing logic distributed over various functions, based
               on tag type, not on currently parsed contents
Parsing XML
• Pull Parsing
    – Iterator over XML elements (QXmlStreamReader)
    – Application controls process of parsing the file
    – Methods pull tokens from reader one after another

            Lightweight
            More straightforward to understand and maintain



         More difficult to manipulate structure of data
Parsing XML
• XQuery / XPath (W3C)
   – Language to query XML data structure
   – Doesn‟t require manual procedural programming
   – Implementation: QtXmlPatterns


           Easy access to specific information within XML



        No support for updating XML documents
        Lacks full text search
Internationalization
Internationalization
•   ... is more than language
     – Spelling
     – Ligatures:
     – Formats (numbers, dates, currencies)
     – Non-spacing or diacritical marks (accents / umlauts in
       European languages)
     – Special line breaking behaviour
     – Character encoding
     – Presentation conventions (bidirectional writing)
     – Input techniques
•   Internationalization support built into Qt widgets & tools
Qt Linguist
• Tool to translate your application
    – Translation files
      (.ts, xml-based) extracted from
      your source code
    – Qt Linguist only needs xml file 
      simple for external translators
• Provides validation and preview
  (for Qt Designer-generated UIs)
Preparing your Application
• Mark user-visible strings for translation with tr()
    – Inside functions in QObject subclasses that use the Q_OBJECT macro:
                      label = new QLabel("Hello World"), this);



                    label = new QLabel(tr("Hello World"), this);

    – Other text-positions within your source code:
        •   Use tr() from other QObject-derived class
        •   QCoreApplication::translate()
        •   Completely outside functions: QT_TR_NOOP() / QT_TRANSLATE_NOOP() macros
Translation Context
• Translation might be different according to context
    – “Open” for file in German: “Öffnen”
    – “Open” for Internet connection in German: “Aufbauen”
• Additional Information for the Translator
    – Class name automatically provided by Qt Linguist
    – Custom comments through 2nd parameter of tr():
        •   Add explanation for context or usage area
                   setWindowTitle(tr("Welcome", "Window title"));

    – Provide even more through TRANSLATOR comments
Plural, Keyboard Accelerators
• Plural: provide extra translations depending on a value
       int nrHellos = 1;
       label2 = new QLabel(tr("Said hello %n time(s)", "", nrHellos));




    – More information:
      http://qt.nokia.com/doc/qq/qq19-plurals.html
• Also translate keyboard accelerators
       exitAct = new QAction(tr("E&xit"), this);
       exitAct->setShortcut(tr("Ctrl+Q", "Quit"));
Add Languages
•   Edit the .pro file and add desired translation(s):
                  TARGET = translator1
                  TEMPLATE = app
                  SOURCES += main.cpp 
                      mywidget.cpp
                  HEADERS += mywidget.h
                  FORMS +=
                  TRANSLATIONS = translator1_de.ts 
                                 translator1_fr.ts

•   Run lupdate <.pro-filename>
     – Finds translatable strings in source code, headers and Qt Designer files
     – Generates/updates XML file for each language
     – Translate these files with Qt Linguist
Finished Translations?
• Run lrelease <.pro-filename>
   – Produces compact binary .qm files out of .ts files
   – Only integrates translations marked as “finished”
Loading Translations
• To use translations: QTranslator
    – Usually initialized at beginning of main()

 // Get locale of the system
 QString locale = QLocale::system().name();
 // Load the correct translation file (if available)
 QTranslator translator;
 translator.load(QString("translator1_") + locale, qApp->applicationDirPath());
 // Adds the loaded file to list of active translation files
 app.installTranslator(&translator);
Loading Translations II                                        Locale: de_AT (Austrian dialect of German language)
                                                                   translator1_de_at.qm
                                                                       translator1_de_at
• Locale:                                                                  translator1_de.qm
                                                                               translator1_de
    – e.g., de_AT                                                                  translator1.qm
                                                                                       translator1
• QTranslator::load()
    – Second parameter: directory of .qm file(s)
    – Automatically tries to load more generic translations
 // Get locale of the system
 QString locale = QLocale::system().name();
 // Load the correct translation file (if available)
 QTranslator translator;
 translator.load(QString("translator1_") + locale, qApp->applicationDirPath());
 // Adds the loaded file to list of active translation files
 app.installTranslator(&translator);
Troubleshooting?
• Not loading the translations?
    – Make sure the translation files are found
    – Copy *.qm to directory of executable if in doubt!
Thank You.

Weitere ähnliche Inhalte

Was ist angesagt?

Qt Internationalization
Qt InternationalizationQt Internationalization
Qt InternationalizationICS
 
Qt everywhere a c++ abstraction platform
Qt everywhere   a c++ abstraction platformQt everywhere   a c++ abstraction platform
Qt everywhere a c++ abstraction platformDeveler S.r.l.
 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCDrsebbe
 
Serving QML applications over the network
Serving QML applications over the networkServing QML applications over the network
Serving QML applications over the networkJeremy Lainé
 
Dragoncraft Architectural Overview
Dragoncraft Architectural OverviewDragoncraft Architectural Overview
Dragoncraft Architectural Overviewjessesanford
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPrashant Rane
 
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent ProgrammingTobias Lindaaker
 
Facebook C++网络库Wangle调研
Facebook C++网络库Wangle调研Facebook C++网络库Wangle调研
Facebook C++网络库Wangle调研vorfeed chen
 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIICS
 
Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Ben Asher
 
Crossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n systemCrossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n systemDeveler S.r.l.
 
Highly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core SystemHighly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core SystemJames Gan
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency GotchasAlex Miller
 
Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3ICS
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesTobias Lindaaker
 
Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Johan Thelin
 

Was ist angesagt? (20)

Qt Internationalization
Qt InternationalizationQt Internationalization
Qt Internationalization
 
Qt everywhere a c++ abstraction platform
Qt everywhere   a c++ abstraction platformQt everywhere   a c++ abstraction platform
Qt everywhere a c++ abstraction platform
 
Qt Quick in depth
Qt Quick in depthQt Quick in depth
Qt Quick in depth
 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCD
 
Serving QML applications over the network
Serving QML applications over the networkServing QML applications over the network
Serving QML applications over the network
 
Dragoncraft Architectural Overview
Dragoncraft Architectural OverviewDragoncraft Architectural Overview
Dragoncraft Architectural Overview
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
 
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming
 
Facebook C++网络库Wangle调研
Facebook C++网络库Wangle调研Facebook C++网络库Wangle调研
Facebook C++网络库Wangle调研
 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part III
 
Stoop 305-reflective programming5
Stoop 305-reflective programming5Stoop 305-reflective programming5
Stoop 305-reflective programming5
 
Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015
 
Crossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n systemCrossing the border with Qt: the i18n system
Crossing the border with Qt: the i18n system
 
无锁编程
无锁编程无锁编程
无锁编程
 
Highly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core SystemHighly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core System
 
Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
 
Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
 
Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011
 

Andere mochten auch

05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and GraphicsAndreas Jakl
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with QtAriya Hidayat
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Softwareaccount inactive
 
Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009Nokia
 
Special Effects with Qt Graphics View
Special Effects with Qt Graphics ViewSpecial Effects with Qt Graphics View
Special Effects with Qt Graphics Viewaccount inactive
 
Qt Technical Presentation
Qt Technical PresentationQt Technical Presentation
Qt Technical PresentationDaniel Rocha
 

Andere mochten auch (6)

05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
 
Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009
 
Special Effects with Qt Graphics View
Special Effects with Qt Graphics ViewSpecial Effects with Qt Graphics View
Special Effects with Qt Graphics View
 
Qt Technical Presentation
Qt Technical PresentationQt Technical Presentation
Qt Technical Presentation
 

Ähnlich wie 06 - Qt Communication

Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesRishabh Indoria
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with QtICS
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKevin Lynch
 
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...confluent
 
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Guido Schmutz
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Daker Fernandes
 
MULTI-THREADING in python appalication.pptx
MULTI-THREADING in python appalication.pptxMULTI-THREADING in python appalication.pptx
MULTI-THREADING in python appalication.pptxSaiDhanushM
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Adam Dunkels
 
Declarative benchmarking of cassandra and it's data models
Declarative benchmarking of cassandra and it's data modelsDeclarative benchmarking of cassandra and it's data models
Declarative benchmarking of cassandra and it's data modelsMonal Daxini
 
Chicago Kafka Meetup
Chicago Kafka MeetupChicago Kafka Meetup
Chicago Kafka MeetupCliff Gilmore
 
Kafka indexing service
Kafka indexing serviceKafka indexing service
Kafka indexing serviceSeoeun Park
 
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...HostedbyConfluent
 
Cassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A ComparisonCassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A Comparisonshsedghi
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetesrajdeep
 
Osnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptxOsnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptxM.Qasim Arham
 
Clojure ♥ cassandra
Clojure ♥ cassandra Clojure ♥ cassandra
Clojure ♥ cassandra Max Penet
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 introTerry Cho
 
下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application developmentcsdnmobile
 

Ähnlich wie 06 - Qt Communication (20)

Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the Datacenter
 
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
 
Introduction to istio
Introduction to istioIntroduction to istio
Introduction to istio
 
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
 
MULTI-THREADING in python appalication.pptx
MULTI-THREADING in python appalication.pptxMULTI-THREADING in python appalication.pptx
MULTI-THREADING in python appalication.pptx
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
 
Declarative benchmarking of cassandra and it's data models
Declarative benchmarking of cassandra and it's data modelsDeclarative benchmarking of cassandra and it's data models
Declarative benchmarking of cassandra and it's data models
 
Chicago Kafka Meetup
Chicago Kafka MeetupChicago Kafka Meetup
Chicago Kafka Meetup
 
Kafka indexing service
Kafka indexing serviceKafka indexing service
Kafka indexing service
 
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
 
Cassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A ComparisonCassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A Comparison
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Osnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptxOsnug meetup-tungsten fabric - overview.pptx
Osnug meetup-tungsten fabric - overview.pptx
 
Clojure ♥ cassandra
Clojure ♥ cassandra Clojure ♥ cassandra
Clojure ♥ cassandra
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development
 
GR740 User day
GR740 User dayGR740 User day
GR740 User day
 

Mehr von Andreas Jakl

Create Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented RealityCreate Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented RealityAndreas Jakl
 
AR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAndreas Jakl
 
Android Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App ManagementAndroid Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App ManagementAndreas Jakl
 
Android Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSONAndroid Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSONAndreas Jakl
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndreas Jakl
 
Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)Andreas Jakl
 
Basics of Web Technologies
Basics of Web TechnologiesBasics of Web Technologies
Basics of Web TechnologiesAndreas Jakl
 
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & MoreBluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & MoreAndreas Jakl
 
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?Andreas Jakl
 
Mobile Test Automation
Mobile Test AutomationMobile Test Automation
Mobile Test AutomationAndreas Jakl
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Andreas Jakl
 
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows PhoneWinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows PhoneAndreas Jakl
 
Nokia New Asha Platform Developer Training
Nokia New Asha Platform Developer TrainingNokia New Asha Platform Developer Training
Nokia New Asha Platform Developer TrainingAndreas Jakl
 
Windows Phone 8 NFC Quickstart
Windows Phone 8 NFC QuickstartWindows Phone 8 NFC Quickstart
Windows Phone 8 NFC QuickstartAndreas Jakl
 
Windows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosWindows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosAndreas Jakl
 
Windows 8 Platform NFC Development
Windows 8 Platform NFC DevelopmentWindows 8 Platform NFC Development
Windows 8 Platform NFC DevelopmentAndreas Jakl
 
NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)Andreas Jakl
 
03 - Qt UI Development
03 - Qt UI Development03 - Qt UI Development
03 - Qt UI DevelopmentAndreas Jakl
 
Basics of WRT (Web Runtime)
Basics of WRT (Web Runtime)Basics of WRT (Web Runtime)
Basics of WRT (Web Runtime)Andreas Jakl
 

Mehr von Andreas Jakl (20)

Create Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented RealityCreate Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented Reality
 
AR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAR / VR Interaction Development with Unity
AR / VR Interaction Development with Unity
 
Android Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App ManagementAndroid Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App Management
 
Android Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSONAndroid Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSON
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - Introduction
 
Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)
 
Basics of Web Technologies
Basics of Web TechnologiesBasics of Web Technologies
Basics of Web Technologies
 
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & MoreBluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
 
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
 
Mobile Test Automation
Mobile Test AutomationMobile Test Automation
Mobile Test Automation
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
 
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows PhoneWinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
 
Nokia New Asha Platform Developer Training
Nokia New Asha Platform Developer TrainingNokia New Asha Platform Developer Training
Nokia New Asha Platform Developer Training
 
Windows Phone 8 NFC Quickstart
Windows Phone 8 NFC QuickstartWindows Phone 8 NFC Quickstart
Windows Phone 8 NFC Quickstart
 
Windows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosWindows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App Scenarios
 
Windows 8 Platform NFC Development
Windows 8 Platform NFC DevelopmentWindows 8 Platform NFC Development
Windows 8 Platform NFC Development
 
NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)
 
03 - Qt UI Development
03 - Qt UI Development03 - Qt UI Development
03 - Qt UI Development
 
02 - Basics of Qt
02 - Basics of Qt02 - Basics of Qt
02 - Basics of Qt
 
Basics of WRT (Web Runtime)
Basics of WRT (Web Runtime)Basics of WRT (Web Runtime)
Basics of WRT (Web Runtime)
 

Kürzlich hochgeladen

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

06 - Qt Communication

  • 1. Qt Communication Andreas Jakl Senior Technical Consultant Forum Nokia 20 September, 2010 v3.0.0
  • 2. Contents – Devices and streams – Files – Sockets and HTTP – XML – Internationalization
  • 3. Device Abstraction • QIODevice is base class for all “devices” capable of reading and writing blocks of bytes QIODevice QBuffer QFile QProcess QAbstractSocket QNetworkReply QLocalSocket QTemporaryFile QUdpSocket QTcpSocket QSslSocket
  • 4. Devices • Sequential devices – Data can be accessed only once – Start from first byte, progress serially to last byte – QProcess, Q*Socket • Random access devices – Bytes can be read any number of times from any position – QFile, QTemponaryFile, QBuffer
  • 5. Streams • Higher-level stream classes – Take care of byte ordering, text encoding – QDataStream • Binary data • 100% independent of host system • Implements serialization of basic data types (C++ and Qt) • Overload << and >> operators to add support for custom data types – QTextStream • Read/write words, lines, numbers • Supports formatting • Operates on QIODevice, QByteArray or QString
  • 6. Example: Console Application • No need for UI • Necessary changes for the project file (.pro): TEMPLATE = app QT = core CONFIG += console CONFIG -= app_bundle SOURCES += main.cpp – Only QtCore module is required – Configuration console enables console output on Windows – Removing app_bundle: don„t create bundle in Mac OS X
  • 7. Opening Files main.cpp • No event loop required #include <QtCore> #include <QDebug> → no QCoreApplication #include <iostream> #include <stdio.h> • Error Handling int main(int argc, char* argv[]) – Through standard error stream { QFile outFile("data.dat"); (std:cerr) → defaults to if (!outFile.open(QIODevice::WriteOnly)) { std::cerr << "Cannot open file for writing: " << console outFile.errorString().toStdString() << std::endl; return 1; – <iostream> has overload } for std::string → convert QString with .toStdString()
  • 8. Writing Data main.cpp • Data representation QDataStream out(&outFile); // Serialization format of data stream changes with // new version of Qt to accommodate new – Specify data format // functionality. out.setVersion(QDataStream::Qt_4_5); version to maintain // Use specific Qt datatypes to make sure integers forward and backward // are the same on all platforms! quint32 outValue = 12345678; compatibility QTime outTime = QTime::currentTime(); QVariant outVar("Some text"); out << outValue << outTime << outVar; – Platform independent outFile.close(); (default: big endian Recommended: extend the example encoding) with brief file header. 1. Magic String: check if file is really from your app. 2. Version number: correctly import from old versions of your settings file.
  • 9. Data Representation Input stream Input variables Output stream Output variables
  • 10. main.cpp Reading Files QFile inFile("data.dat"); if (!inFile.open(QIODevice::ReadOnly)) { std::cerr << "Cannot open file for reading: " << inFile.errorString().toStdString() << std::endl; • Reading similar to writing return 1; } – Use same order and data QDataStream in(&inFile); stream version in.setVersion(QDataStream::Qt_4_5); – Streams don‟t save variable quint32 inValue; type QTime inTime; QVariant inVar; • QVariant recognizes type // Read values in same order as they were written – Here: output using qDebug() in >> inValue >> inTime >> inVar; instead of standard streams qDebug() << "Variant type:" << inVar.typeName() << ", contents:" << inVar.toString(); – Advantage: direct serialization of Qt data types inFile.close(); return 0; }
  • 11. Communication Image Credit: NASA
  • 12. Qt Modules QIODevice • Networking classes in QtNetwork extension module QAbstractSocket QNetworkReply QLocalSocket • Using the module – Insert to project file (.pro): QT += network QUdpSocket QTcpSocket – Source code: QSslSocket • Include appropriate headers of classes in use, or … • Use meta-include that contains whole QtNetwork module #include <QtNetwork>
  • 13. Sockets • Socket – Logical communication endpoint between 2+ software processes • Communication – Peer-to-Peer: Two similar processes communicate – Client-Server: Different roles, e.g. web server & browser
  • 14. Connection • Connection-oriented – “reliable” – First establishes end-to-end-connection, then sends data – Connection is present  can check delivery order, arrival, errors, ... • Connectionless – “unreliable” – Requires destination address each time data is sent (datagrams) – Each received packet is treated independently – No guarantees on order, duplication, delivery
  • 15. TCP • Stream-oriented protocol (“reliable”) – Often preferable to HTTP in the mobile context: less overhead • Implementation provided by: QTcpSocket – Either use instance directly or derive from it – Operations performed asynchronously – Status changes and errors: emitted via signals – Indirectly derived from QIODevice: allows QDataStream and QTextStream
  • 16. Servers and UDP • TCP Server: QTcpServer – Single- or multi-threaded – See Fortune Server example from Qt SDK • UDP (“unreliable”) – Connectionless – No extra server class required – Instead: use bind() of QUdpSocket – Data transfer: smaller datagrams
  • 17. High Level Network Operations • For communicating with services: – Use high level classes for common protocols – QNetworkAccessManager • Coordinates multiple network requests • Creates and monitors the requests • Currently supports: HTTP, FTP and file access – QNetworkRequest The dedicated QHttp • Represents individual request and QFtp classes are deprecated. • Contains request header, URL, etc. – QNetworkReply • Created by manager • Contains response header, URL, reply contents, etc.
  • 18. HTTP Overview QNetworkAccessManager Communication settings Transaction Transaction … QNetworkRequest Header, Body GPRS, UMTS, … Server QNetworkResponse Header, Body
  • 19. HTTP Protocol • Higher level protocol, based on TCP – Stateless protocol – Request and response are self-contained • Well-known from web – Client browser sends request for website to server – Server responds with web page contents • Mobile world – HTTP-based web services: Client only requests specific data – Response: usually XML – Concept used by AJAX requests (Asynchronous Javascript and XML) → Web 2.0 Image Credit: Mozilla Foundation
  • 20. XML (Extensible Markup Language) <kml> • Properties <Response> <name>FH Hagenberg, Austria</name> <Placemark id="p1"> – General-purpose specification for <address> creating custom markup Fachhochschule Hagenberg, 4232 Hagenberg im Muehlkreis, languages Oesterreich </address> – Textual data format <ExtendedData> <LatLonBox north="48.3760743“ – Markup (usually tags – south="48.3612490" east="14.5310893" e.g., <html>) and content west="14.4990745"/> </ExtendedData> • Qt <Point> <coordinates>14.5150819, – Add xml module to </Point> 48.3686622,0</coordinates> project file (.pro) </Placemark> Sample XML file </Response> Truncated KML data from Google Maps </kml>
  • 21. Parsing XML • DOM (Document Object Model) – Standard of W3C – QDomeDocument builds hierarchical tree – Contains all nodes of XML file Non-consecutive access to elements (e.g., web browser) Easy to transfer DOM tree back into XML file High memory requirements (especially for mobile devices)
  • 22. Parsing XML • SAX (Simple API for XML) – Event-driven API: QXmlSimpleReader • Triggers events; e.g., when encountering opening / closing tag • Override virtual event handler methods More lightweight than DOM More difficult to manipulate structure of data (already handled data is discarded) Parsing logic distributed over various functions, based on tag type, not on currently parsed contents
  • 23. Parsing XML • Pull Parsing – Iterator over XML elements (QXmlStreamReader) – Application controls process of parsing the file – Methods pull tokens from reader one after another Lightweight More straightforward to understand and maintain More difficult to manipulate structure of data
  • 24. Parsing XML • XQuery / XPath (W3C) – Language to query XML data structure – Doesn‟t require manual procedural programming – Implementation: QtXmlPatterns Easy access to specific information within XML No support for updating XML documents Lacks full text search
  • 26. Internationalization • ... is more than language – Spelling – Ligatures: – Formats (numbers, dates, currencies) – Non-spacing or diacritical marks (accents / umlauts in European languages) – Special line breaking behaviour – Character encoding – Presentation conventions (bidirectional writing) – Input techniques • Internationalization support built into Qt widgets & tools
  • 27. Qt Linguist • Tool to translate your application – Translation files (.ts, xml-based) extracted from your source code – Qt Linguist only needs xml file  simple for external translators • Provides validation and preview (for Qt Designer-generated UIs)
  • 28. Preparing your Application • Mark user-visible strings for translation with tr() – Inside functions in QObject subclasses that use the Q_OBJECT macro: label = new QLabel("Hello World"), this); label = new QLabel(tr("Hello World"), this); – Other text-positions within your source code: • Use tr() from other QObject-derived class • QCoreApplication::translate() • Completely outside functions: QT_TR_NOOP() / QT_TRANSLATE_NOOP() macros
  • 29. Translation Context • Translation might be different according to context – “Open” for file in German: “Öffnen” – “Open” for Internet connection in German: “Aufbauen” • Additional Information for the Translator – Class name automatically provided by Qt Linguist – Custom comments through 2nd parameter of tr(): • Add explanation for context or usage area setWindowTitle(tr("Welcome", "Window title")); – Provide even more through TRANSLATOR comments
  • 30. Plural, Keyboard Accelerators • Plural: provide extra translations depending on a value int nrHellos = 1; label2 = new QLabel(tr("Said hello %n time(s)", "", nrHellos)); – More information: http://qt.nokia.com/doc/qq/qq19-plurals.html • Also translate keyboard accelerators exitAct = new QAction(tr("E&xit"), this); exitAct->setShortcut(tr("Ctrl+Q", "Quit"));
  • 31. Add Languages • Edit the .pro file and add desired translation(s): TARGET = translator1 TEMPLATE = app SOURCES += main.cpp mywidget.cpp HEADERS += mywidget.h FORMS += TRANSLATIONS = translator1_de.ts translator1_fr.ts • Run lupdate <.pro-filename> – Finds translatable strings in source code, headers and Qt Designer files – Generates/updates XML file for each language – Translate these files with Qt Linguist
  • 32. Finished Translations? • Run lrelease <.pro-filename> – Produces compact binary .qm files out of .ts files – Only integrates translations marked as “finished”
  • 33. Loading Translations • To use translations: QTranslator – Usually initialized at beginning of main() // Get locale of the system QString locale = QLocale::system().name(); // Load the correct translation file (if available) QTranslator translator; translator.load(QString("translator1_") + locale, qApp->applicationDirPath()); // Adds the loaded file to list of active translation files app.installTranslator(&translator);
  • 34. Loading Translations II Locale: de_AT (Austrian dialect of German language) translator1_de_at.qm translator1_de_at • Locale: translator1_de.qm translator1_de – e.g., de_AT translator1.qm translator1 • QTranslator::load() – Second parameter: directory of .qm file(s) – Automatically tries to load more generic translations // Get locale of the system QString locale = QLocale::system().name(); // Load the correct translation file (if available) QTranslator translator; translator.load(QString("translator1_") + locale, qApp->applicationDirPath()); // Adds the loaded file to list of active translation files app.installTranslator(&translator);
  • 35. Troubleshooting? • Not loading the translations? – Make sure the translation files are found – Copy *.qm to directory of executable if in doubt!