SlideShare a Scribd company logo
1 of 36
Download to read offline
Qt UI Development



Andreas Jakl
Senior Technical Consultant
Forum Nokia

                              23 October, 2010
                                        v3.2.0
Contents
  – Ways of creating user interfaces with Qt
  – Subclassing Widgets (Signals & Slots, continued)
  – Dialogs
  – Main Window
  – Menus, Toolbars and Actions
User Interfaces with Qt
Qt & Graphics
• Available options
   – Traditional widgets
   – Custom widgets and QPainter
   – QGraphicsView
   – QGLWidget
   – Qt Quick
   – QtWebKit
Traditional Qt Widgets
• QWidget as base of UI components in Qt
   – Window management, layouts
   – Use native UI design
   – Support style sheets
   – Ex.: QPushButton,
      QLabel, QLineEdit
Traditional Qt Widgets
• UI Designer support
   – Instant preview, drag & drop UI
   – Integrated even with translator tool



           High level
           Exactly the same code on all platforms


        Less customization possible, UI effects difficult
        Smaller UI, different paradigms
QWidget and QPainter
• Draw manually using QPainter
   – On QWidget surfaces
   – Flexible painting: text, gradients, polygons,
      bezier curves, transparencies, etc.

           Lets you express your painting directly
           Traditional



        Makes you express your painting directly
QGraphicsView
•   Manage 2D scenes with a scene graph
     – Can manage thousands of items with hierarchies
     – Collision detection, affine transformations,
       drag and drop support
     – Hardware acceleration and integration with QWidget possible


               High level
               Conceptually nice and flexible



           No ready-made common UI components available yet
MeeGo Touch
• UI Framework based on QGraphicsView
   – Provides common UI components with
     theme support
   – Integrates transitions and effects

           Great graphics effects, theme support
           Easy to create smooth UIs
           Already available from source repositories


        Still in development
QGLWidget
     • Very low level
             – Basic setup by Qt
             – You do the hard work                                              Angry Birds and Bounce
                                                                                 by Rovio




                           Complete control over GL
                           Good if you have existing codebase & assets, cross-platform


                      OpenGL is hard work (but there’s more Qt coming for that *)
                      No Qt OpenGL for Symbian integration in Qt 4.7.0
* http://doc.qt.nokia.com/qt3d-snapshot/index.html
Qt Quick
    • Several components
              – QML language and JavaScript
              – Declarative syntax, animations and states integrated
              – Available in Qt 4.7+

                                 Very easy to make slick, fluid UIs
                                 Will soon be most important way to create mobile UIs


                          More tooling is on its way
                          Ready-made UI components on their way *
* Project page: http://bugreports.qt.nokia.com/browse/QTCOMPONENTS
Sample app to integrate web into Qt: http://wiki.forum.nokia.com/index.php/QtWebKitStub



   QtWebKit
   • Open source browser engine
          – Display HTML(5) and JavaScript content
            through a QWidget
          – Combine Qt C++ and web code if needed to
            get best of both worlds

                       Use your existing web skills to create the UI
                       Reuse web components (online help, etc.)


                   Complex UIs and interaction probably more difficult
                   Less performance than native code (but improving)
How to Choose?
• Depends on
   – Complexity of your UI
   – Existing code/assets
   – Experience with low level code
   – Which devices you’re targeting
   – Your timeframe
• Mix and match as appropriate!
Subclassing Widgets
Signal and Slots, Continued
• How to accomplish the following?




    QObject::connect(button, SIGNAL(clicked()),
                     label, SLOT(setText("new text")));

    doesn’t work that way, clicked()-signal doesn’t give required number
      of arguments to setText()-slot.
Custom Widgets (Slots)
• Commonly used: subclass widgets to extend functionality
   – Class MyWindow is a widget (parent)
   – Also manages child widgets
• Widget adds new slot
   – Put text to display into this slot method
      instead of the connect statement
myWindow.h                            myWindow.cpp                               #include <QtGui/QApplication>
                                                                                 #include "MyWindow.h"
 #ifndef MYWINDOW_H                   #include "MyWindow.h"
                                                                                 int main(int argc, char *argv[])
 #define MYWINDOW_H                                                              {
                                      MyWindow::MyWindow(QWidget* parent)            QApplication a(argc, argv);
 #include    <QWidget>                    :                                          MyWindow* window = new MyWindow();
                                                                                     window->show();
 #include    <QVBoxLayout>                QWidget(parent)                            return a.exec();
 #include    <QPushButton>            {                                          }
 #include    <QLabel>                     label = new QLabel("old text");
 #include    <QObject>                    button0 = new QPushButton("Update labels");                            main.cpp
                                          button1 = new QPushButton("Exit");
 class MyWindow : public QWidget
 {                                         layout = new QVBoxLayout(this);
     Q_OBJECT                              layout->addWidget(button0);
 public:                                   layout->addWidget(button1);
     MyWindow(QWidget *parent = 0);        layout->addWidget(label);
                                           setLayout(layout);
 private:
     QLabel* label;                        connect(button0, SIGNAL(clicked()),
     QPushButton* button0;                         this, SLOT(setText()));
     QPushButton* button1;                 connect(button1, SIGNAL(clicked()),
     QVBoxLayout* layout;                          this, SLOT(close()));
                                      }
 private slots:
     void setText();                  void MyWindow::setText()
 };                                   {
                                          label->setText("new text");
 #endif // MYWINDOW_H                 }
Dialogs
Dialogs                                                          QObject               QPaintDevice


•   Dialog is:
                                                                             QWidget
      –   Top-level window
      –   Used for short-term tasks, brief user communication
      –   Can provide return value                                           QDialog
•   Modal
      –   Dialog blocks other application windows (e.g., file open dialog)
      –   Usually called with exec(), returns when dialog is closed
      –   Call with show(): returns immediately, get results via signals
•   Modeless
      –   Operates independently from other windows
          (e.g., find & replace dialog)
      –   Always called with show(): returns immediately
Custom Dialog
  clicked() signal from button in main widget triggers dialog
  Change label in main widget depending on user action selected in dialog
Signals & Slots Diagram
    Signals                               Signals
   clicked()                              clicked()


    Slots                                 Slots

                  Slots      Signals
                 exec(int)
                 accept()    accepted()
                 reject()    rejected()
    Signals                               Signals
   clicked()


    Slots                                  Slots
                                          checkInputDialog()
The Dialog
myDialog.h                         myDialog.cpp
 #ifndef MYDIALOG_H                 #include "mydialog.h"
 #define MYDIALOG_H
                                    MyDialog::MyDialog()
 #include    <QDialog>              {
 #include    <QPushButton>              setFixedSize(150, 100);
 #include    <QVBoxLayout>              QVBoxLayout* vbox = new QVBoxLayout();
 #include    <QLabel>                   QLabel* label = new QLabel("Please confirm.");
                                        QPushButton* okButton = new QPushButton("Ok");
 class MyDialog : public QDialog        QPushButton* cancelButton = new QPushButton("Cancel");
 {
     Q_OBJECT                            // Set the ok button as default
 public:                                 okButton->setDefault(true);
     MyDialog();                         vbox->addWidget(label);
 };                                      vbox->addWidget(okButton);
                                         vbox->addWidget(cancelButton);
 #endif // MYDIALOG_H                    setLayout(vbox);

                                         // Connect the buttons to slots defined by QDialog
                                         connect(okButton, SIGNAL(clicked()),
                                                 this, SLOT(accept()));
                                         connect(cancelButton, SIGNAL(clicked()),
                                                 this, SLOT(reject()));
                                    }
QDialog Base Class
Slot                        Description
virtual void accept()       Hides the dialog and sets the result code to Accepted (1).

virtual void reject()       Hides the dialog and sets the result code to Rejected (0).

virtual void done(int r)    Closes the dialog and sets return value to r.
                            If the dialog is started via exec(), done() causes the event loop to finish, and exec() to return r.
                            Deletes the dialog if Qt::WA_DeleteOnClose is set.
int exec()                  Shows the dialog as a modal dialog, blocking until the user closes it. Returns dialog return value
                            (DialogCode) like Accepted or Rejected.

Signal                      Description
void accepted()             Emitted when dialog has been accepted through calling accept() or done() with the argument
                            QDialog::Accepted
void rejected()             Emitted when dialog has been rejected through calling reject() or done() with the argument
                            QDialog::Rejected
void finished(int result)   Emitted when the dialog’s result code has been set (setResult()) and either accept(), reject() or
                            done() is called.
The Widget
 mywidget.h                            mywidget.cpp
  [...]                                 #include "mywidget.h"

  class MyWidget : public QWidget       MyWidget::MyWidget(QWidget *parent) : QWidget(parent) {
  {                                         setWindowTitle("Main Window - Dialog Example");
      Q_OBJECT                              startButton = new QPushButton("Start dialog");
                                            instructionsLabel = new QLabel("Please push the button");
  public:                                   resultLabel = new QLabel();
      MyWidget(QWidget *parent = 0);
      ~MyWidget();                          layout = new QVBoxLayout(this);
                                            layout->addWidget(instructionsLabel);
  private slots:                            layout->addWidget(startButton);
      void checkInputDialog();              layout->addWidget(resultLabel);

  private:                                  dialog = new MyDialog();
      QPushButton* startButton;
      QLabel* instructionsLabel;            connect(startButton, SIGNAL(clicked()),
      QLabel* resultLabel;                          dialog, SLOT(exec()));
      QVBoxLayout* layout;                  connect(dialog, SIGNAL(accepted()),
      MyDialog* dialog;                             this, SLOT(checkInputDialog()));
                                            connect(dialog, SIGNAL(rejected()),
  };                                                this, SLOT(checkInputDialog()));
                                        }
  #endif // MYWIDGET_H
                                        void MyWidget::checkInputDialog() {
                                            int res = dialog->result(); // Gets result (Accepted/Rejected)
                                            if (res == QDialog::Accepted) {
                                                resultLabel->setText(""Ok" was selected");
                                            } else if (res == QDialog::Rejected) {
                                                resultLabel->setText(""Cancel" was selected");
                                            }
                                        }
Custom Return Values

mydialog.h
 [...]
 private slots:
     void setResult();
 [...]

mydialog.cpp
 [...]
     connect(ignoreButton, SIGNAL(clicked()),
             this, SLOT(setResult()));
 [...]
 void MyDialog::setResult()                     mywidget.cpp
 {
                                                 [...]
     int result = 99;
                                                     connect(dialog, SIGNAL(finished(int)),
     emit done(result);
                                                             this, SLOT(checkInputDialog(int)));
 }
                                                 [...]
                                                 void MyWidget::checkInputDialog(int res)
mywidget.h                                       {
 [...]                                               if (res == 99)
 private slots:                                      {
     void checkInputDialog();                            resultLabel->setText(""Ignore" was selected");
     void checkInputDialog(int);                     }
 [...]                                           }
Predefined Dialogs                         QColorDialog


                            QInputDialog
      QMessageBox




                     QFontDialog
QFileDialog



                                                          QErrorMessage
Predefined Dialogs
• Example: Message box
   – Modal dialog
   – User selection → return value

     int ret = QMessageBox::warning( this, "Exit?",
               "Do you really want to exit the application?",
               QMessageBox::Yes | QMessageBox::No );
Main Window, Menu, Action
Main Window
•   Provides main application window                     Menu Bar
     – Pre-defined layout for standard components                       Toolbars
     – Central widget must be defined, others
                                                                      Dock Widgets
       optional
     – Subclass to create your own implementation
                                                                      Central Widget
•   Differences?
     – Possible with dialog / widgets as well
     – But: more comfortable, consistent and efficient


                                                         Status Bar
Example - QMainWindow
mainwindow.h                                 mainwindow.cpp
  [...]                                       #include "mainwindow.h"

  class MainWindow : public QMainWindow       MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
  {                                               : QMainWindow(parent, flags)
      Q_OBJECT                                {
                                                  editor = new QTextEdit();
  public:                                         setMinimumSize(160, 160);
      MainWindow(QWidget *parent = 0,             resize(480, 320);
                Qt::WFlags flags = 0);            setCentralWidget(editor);
      ~MainWindow();                              setWindowTitle("QMainWindow with Menus");

  private:                                        QString message = "Welcome";
      QTextEdit* editor;                          statusBar()->showMessage(message);
                                              }
  [...]
  };

  #endif // MAINWINDOW_H


                    main.cpp is similar to
                    the previous example
Action




                                                                         Image by Anna Cervova
                                                                            (Public Domain)
• Represent abstract user interface           • Stores
  action                                        information about
    – Define once, use in multiple               – Icons
      components                                 – Text
    – Inserted into widgets                      – Keyboard shortcut
        •   Menus
            (can create actions implicitly)
                                                 – Status text
        •   Toolbar buttons                      – “What’s This?” text
        •   Keyboard shortcuts
                                                 – Tooltip
Menu Bar
•   QMenu provides:
     –   a menu widget for menu bars, context menus
         and other popup menus
•   Supports:
     –   Triggered Items
     –   Separators
     –   Submenus
     –   Tear-off menus
•   QMenuBar automatically created by
    QMainWindow
•   QMenu(s) contains individual menu items (
    Actions)
Example – QAction
   mainwindow.h                mainwindow.cpp
    [...]                       [...]
                                    // Create a new “Open” action with an icon, keyboard shortcut and
    class MainWindow                // info-text for the status bar.
        : public QMainWindow        openAct = new QAction("&Open...", this);
    {                               openAct->setIcon(QIcon("images/open.png"));
        Q_OBJECT                    openAct->setShortcut(tr("Ctrl+O"));
    [...]                           openAct->setStatusTip(tr("Open an existing file"));
                                    connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));
    private slots:
        void openFile();            // Add the action to the menu
                                    fileMenu = menuBar()->addMenu(tr("&File"));
    private:                        fileMenu->addAction(openAct);
        QMenu *fileMenu;
        QAction *openAct;       [...]
    };
                                void MainWindow::openFile()
                                {
                                    // Define two filter options – one for documents, one for all files
                                    // The filter mask is automatically parsed, “;;” separates lines
                                    QString file = QFileDialog::getOpenFileName(this,
                                        "Please choose a file to open", QDir::homePath(),
                                        "Documents (*.pdf *.doc *.docx);;All files (*.*)");

                                    if (!file.isNull())
                                    {
                                        QString info("You chose this filen");
                                        info.append(file);
                                        QMessageBox::information(this, "Your Choice", info, QMessageBox::Ok);
                                    }
                                }
Toolbar
• Same actions as for menu can be used for toolbar
• Default automatically enables drag & drop
Example – QToolBar
   mainwindow.h                mainwindow.cpp
    [...]                       #include "mainwindow.h"

    class MainWindow            MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
        : public QMainWindow        : QMainWindow(parent, flags) {
    {                           [...]
        Q_OBJECT                    // Open action
    [...]                           openAct = new QAction("&Open...", this);
                                    openAct->setIcon(QIcon("images/open.png"));
    private:                        openAct->setShortcut(tr("Ctrl+O"));
        QToolBar *toolFile;         openAct->setStatusTip(tr("Open an existing file"));
    };                              connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));

                                    // Exit action
                                    exitAct = new QAction("E&xit", this);
                                    exitAct->setIcon(QIcon("images/exit.png"));
                                    exitAct->setShortcut(tr("Ctrl+Q"));
                                    exitAct->setStatusTip(tr("Exit the application"));
                                    connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));

                                    // Create the file menu
                                    fileMenu = menuBar()->addMenu(tr("&File"));
                                    fileMenu->addAction(openAct);
                                    fileMenu->addSeparator();
                                    fileMenu->addAction(exitAct);

                                    // Add the actions to the toolbar
                                    toolFile = addToolBar("File");
                                    toolFile->addAction(openAct);
                                    toolFile->addAction(exitAct);
                                [...]
                                }
Thank You.

More Related Content

What's hot

Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systemsaccount inactive
 
Observer pattern with Stl, boost and qt
Observer pattern with Stl, boost and qtObserver pattern with Stl, boost and qt
Observer pattern with Stl, boost and qtDaniel Eriksson
 
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
 
Qt for Python
Qt for PythonQt for Python
Qt for PythonICS
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)chan20kaur
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...ICS
 
Multithreading done right
Multithreading done rightMultithreading done right
Multithreading done rightPlatonov Sergey
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt InternationalizationICS
 
Clockless design language - ilia greenblat
Clockless design language - ilia greenblatClockless design language - ilia greenblat
Clockless design language - ilia greenblatchiportal
 
Lockless Producer Consumer Threads: Asynchronous Communications Made Easy
Lockless Producer Consumer Threads: Asynchronous Communications Made EasyLockless Producer Consumer Threads: Asynchronous Communications Made Easy
Lockless Producer Consumer Threads: Asynchronous Communications Made EasyICS
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applicationsaccount inactive
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2NokiaAppForum
 
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
 
QVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI developmentQVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI developmentICS
 
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
 

What's hot (20)

The Future of Qt Widgets
The Future of Qt WidgetsThe Future of Qt Widgets
The Future of Qt Widgets
 
Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systems
 
Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
 
Observer pattern with Stl, boost and qt
Observer pattern with Stl, boost and qtObserver pattern with Stl, boost and qt
Observer pattern with Stl, boost and qt
 
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
 
Cross Platform Qt
Cross Platform QtCross Platform Qt
Cross Platform Qt
 
Qt for Python
Qt for PythonQt for Python
Qt for Python
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
Multithreading done right
Multithreading done rightMultithreading done right
Multithreading done right
 
Qt for beginners
Qt for beginnersQt for beginners
Qt for beginners
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt Internationalization
 
Clockless design language - ilia greenblat
Clockless design language - ilia greenblatClockless design language - ilia greenblat
Clockless design language - ilia greenblat
 
Lockless Producer Consumer Threads: Asynchronous Communications Made Easy
Lockless Producer Consumer Threads: Asynchronous Communications Made EasyLockless Producer Consumer Threads: Asynchronous Communications Made Easy
Lockless Producer Consumer Threads: Asynchronous Communications Made Easy
 
分散式系統
分散式系統分散式系統
分散式系統
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applications
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2
 
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
 
QVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI developmentQVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI development
 
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
 

Viewers also liked

Accelerating performance on Qt and WebKit for the MIPS architecture
Accelerating performance on Qt and WebKit for the MIPS architectureAccelerating performance on Qt and WebKit for the MIPS architecture
Accelerating performance on Qt and WebKit for the MIPS architectureaccount inactive
 
Designing and Building (Your Own) UI Frameworks For the Enterprise
Designing and Building (Your Own) UI Frameworks For the EnterpriseDesigning and Building (Your Own) UI Frameworks For the Enterprise
Designing and Building (Your Own) UI Frameworks For the EnterpriseExoLeaders.com
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeChang W. Doh
 
Charity apprentice logo-blue-6675
Charity apprentice logo-blue-6675Charity apprentice logo-blue-6675
Charity apprentice logo-blue-6675FITC
 
Chromium ui framework(shared)
Chromium ui framework(shared)Chromium ui framework(shared)
Chromium ui framework(shared)gnomekr
 

Viewers also liked (8)

了解 Qt
了解 Qt了解 Qt
了解 Qt
 
Accelerating performance on Qt and WebKit for the MIPS architecture
Accelerating performance on Qt and WebKit for the MIPS architectureAccelerating performance on Qt and WebKit for the MIPS architecture
Accelerating performance on Qt and WebKit for the MIPS architecture
 
Designing and Building (Your Own) UI Frameworks For the Enterprise
Designing and Building (Your Own) UI Frameworks For the EnterpriseDesigning and Building (Your Own) UI Frameworks For the Enterprise
Designing and Building (Your Own) UI Frameworks For the Enterprise
 
Maemo 6 UI Framework
Maemo 6 UI FrameworkMaemo 6 UI Framework
Maemo 6 UI Framework
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source Tree
 
Charity apprentice logo-blue-6675
Charity apprentice logo-blue-6675Charity apprentice logo-blue-6675
Charity apprentice logo-blue-6675
 
Qt5 embedded
Qt5 embeddedQt5 embedded
Qt5 embedded
 
Chromium ui framework(shared)
Chromium ui framework(shared)Chromium ui framework(shared)
Chromium ui framework(shared)
 

Similar to 03 - Qt UI Development

Qt & Webkit
Qt & WebkitQt & Webkit
Qt & WebkitQT-day
 
Meet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UIMeet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UIICS
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS DevelopmentJussi Pohjolainen
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgetsICS
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 
Petri Niemi Qt Web Kit
Petri Niemi Qt Web KitPetri Niemi Qt Web Kit
Petri Niemi Qt Web KitNokiaAppForum
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarICS
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarJanel Heilbrunn
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1NokiaAppForum
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84Mahmoud Samir Fayed
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web ToolkitsYiguang Hu
 
The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189Mahmoud Samir Fayed
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitAriya Hidayat
 

Similar to 03 - Qt UI Development (20)

Qt & Webkit
Qt & WebkitQt & Webkit
Qt & Webkit
 
Meet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UIMeet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UI
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgets
 
Qt
QtQt
Qt
 
GWT MVP Case Study
GWT MVP Case StudyGWT MVP Case Study
GWT MVP Case Study
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Treinamento Qt básico - aula III
Treinamento Qt básico - aula IIITreinamento Qt básico - aula III
Treinamento Qt básico - aula III
 
Petri Niemi Qt Web Kit
Petri Niemi Qt Web KitPetri Niemi Qt Web Kit
Petri Niemi Qt Web Kit
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
Qt programming-using-cpp
Qt programming-using-cppQt programming-using-cpp
Qt programming-using-cpp
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1
 
Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1
 
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.2 book - Part 51 of 84
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189The Ring programming language version 1.6 book - Part 73 of 189
The Ring programming language version 1.6 book - Part 73 of 189
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
 

More from 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
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt CommunicationAndreas Jakl
 
05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and GraphicsAndreas Jakl
 

More from 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)
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt Communication
 
05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics
 
04 - Qt Data
04 - Qt Data04 - Qt Data
04 - Qt Data
 

Recently uploaded

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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
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
 
"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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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
 
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
 
"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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

03 - Qt UI Development

  • 1. Qt UI Development Andreas Jakl Senior Technical Consultant Forum Nokia 23 October, 2010 v3.2.0
  • 2. Contents – Ways of creating user interfaces with Qt – Subclassing Widgets (Signals & Slots, continued) – Dialogs – Main Window – Menus, Toolbars and Actions
  • 4. Qt & Graphics • Available options – Traditional widgets – Custom widgets and QPainter – QGraphicsView – QGLWidget – Qt Quick – QtWebKit
  • 5. Traditional Qt Widgets • QWidget as base of UI components in Qt – Window management, layouts – Use native UI design – Support style sheets – Ex.: QPushButton, QLabel, QLineEdit
  • 6. Traditional Qt Widgets • UI Designer support – Instant preview, drag & drop UI – Integrated even with translator tool High level Exactly the same code on all platforms Less customization possible, UI effects difficult Smaller UI, different paradigms
  • 7. QWidget and QPainter • Draw manually using QPainter – On QWidget surfaces – Flexible painting: text, gradients, polygons, bezier curves, transparencies, etc. Lets you express your painting directly Traditional Makes you express your painting directly
  • 8. QGraphicsView • Manage 2D scenes with a scene graph – Can manage thousands of items with hierarchies – Collision detection, affine transformations, drag and drop support – Hardware acceleration and integration with QWidget possible High level Conceptually nice and flexible No ready-made common UI components available yet
  • 9. MeeGo Touch • UI Framework based on QGraphicsView – Provides common UI components with theme support – Integrates transitions and effects Great graphics effects, theme support Easy to create smooth UIs Already available from source repositories Still in development
  • 10. QGLWidget • Very low level – Basic setup by Qt – You do the hard work Angry Birds and Bounce by Rovio Complete control over GL Good if you have existing codebase & assets, cross-platform OpenGL is hard work (but there’s more Qt coming for that *) No Qt OpenGL for Symbian integration in Qt 4.7.0 * http://doc.qt.nokia.com/qt3d-snapshot/index.html
  • 11. Qt Quick • Several components – QML language and JavaScript – Declarative syntax, animations and states integrated – Available in Qt 4.7+ Very easy to make slick, fluid UIs Will soon be most important way to create mobile UIs More tooling is on its way Ready-made UI components on their way * * Project page: http://bugreports.qt.nokia.com/browse/QTCOMPONENTS
  • 12. Sample app to integrate web into Qt: http://wiki.forum.nokia.com/index.php/QtWebKitStub QtWebKit • Open source browser engine – Display HTML(5) and JavaScript content through a QWidget – Combine Qt C++ and web code if needed to get best of both worlds Use your existing web skills to create the UI Reuse web components (online help, etc.) Complex UIs and interaction probably more difficult Less performance than native code (but improving)
  • 13. How to Choose? • Depends on – Complexity of your UI – Existing code/assets – Experience with low level code – Which devices you’re targeting – Your timeframe • Mix and match as appropriate!
  • 15. Signal and Slots, Continued • How to accomplish the following? QObject::connect(button, SIGNAL(clicked()), label, SLOT(setText("new text")));  doesn’t work that way, clicked()-signal doesn’t give required number of arguments to setText()-slot.
  • 16. Custom Widgets (Slots) • Commonly used: subclass widgets to extend functionality – Class MyWindow is a widget (parent) – Also manages child widgets • Widget adds new slot – Put text to display into this slot method instead of the connect statement
  • 17. myWindow.h myWindow.cpp #include <QtGui/QApplication> #include "MyWindow.h" #ifndef MYWINDOW_H #include "MyWindow.h" int main(int argc, char *argv[]) #define MYWINDOW_H { MyWindow::MyWindow(QWidget* parent) QApplication a(argc, argv); #include <QWidget> : MyWindow* window = new MyWindow(); window->show(); #include <QVBoxLayout> QWidget(parent) return a.exec(); #include <QPushButton> { } #include <QLabel> label = new QLabel("old text"); #include <QObject> button0 = new QPushButton("Update labels"); main.cpp button1 = new QPushButton("Exit"); class MyWindow : public QWidget { layout = new QVBoxLayout(this); Q_OBJECT layout->addWidget(button0); public: layout->addWidget(button1); MyWindow(QWidget *parent = 0); layout->addWidget(label); setLayout(layout); private: QLabel* label; connect(button0, SIGNAL(clicked()), QPushButton* button0; this, SLOT(setText())); QPushButton* button1; connect(button1, SIGNAL(clicked()), QVBoxLayout* layout; this, SLOT(close())); } private slots: void setText(); void MyWindow::setText() }; { label->setText("new text"); #endif // MYWINDOW_H }
  • 19. Dialogs QObject QPaintDevice • Dialog is: QWidget – Top-level window – Used for short-term tasks, brief user communication – Can provide return value QDialog • Modal – Dialog blocks other application windows (e.g., file open dialog) – Usually called with exec(), returns when dialog is closed – Call with show(): returns immediately, get results via signals • Modeless – Operates independently from other windows (e.g., find & replace dialog) – Always called with show(): returns immediately
  • 20. Custom Dialog clicked() signal from button in main widget triggers dialog Change label in main widget depending on user action selected in dialog
  • 21. Signals & Slots Diagram Signals Signals clicked() clicked() Slots Slots Slots Signals exec(int) accept() accepted() reject() rejected() Signals Signals clicked() Slots Slots checkInputDialog()
  • 22. The Dialog myDialog.h myDialog.cpp #ifndef MYDIALOG_H #include "mydialog.h" #define MYDIALOG_H MyDialog::MyDialog() #include <QDialog> { #include <QPushButton> setFixedSize(150, 100); #include <QVBoxLayout> QVBoxLayout* vbox = new QVBoxLayout(); #include <QLabel> QLabel* label = new QLabel("Please confirm."); QPushButton* okButton = new QPushButton("Ok"); class MyDialog : public QDialog QPushButton* cancelButton = new QPushButton("Cancel"); { Q_OBJECT // Set the ok button as default public: okButton->setDefault(true); MyDialog(); vbox->addWidget(label); }; vbox->addWidget(okButton); vbox->addWidget(cancelButton); #endif // MYDIALOG_H setLayout(vbox); // Connect the buttons to slots defined by QDialog connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); }
  • 23. QDialog Base Class Slot Description virtual void accept() Hides the dialog and sets the result code to Accepted (1). virtual void reject() Hides the dialog and sets the result code to Rejected (0). virtual void done(int r) Closes the dialog and sets return value to r. If the dialog is started via exec(), done() causes the event loop to finish, and exec() to return r. Deletes the dialog if Qt::WA_DeleteOnClose is set. int exec() Shows the dialog as a modal dialog, blocking until the user closes it. Returns dialog return value (DialogCode) like Accepted or Rejected. Signal Description void accepted() Emitted when dialog has been accepted through calling accept() or done() with the argument QDialog::Accepted void rejected() Emitted when dialog has been rejected through calling reject() or done() with the argument QDialog::Rejected void finished(int result) Emitted when the dialog’s result code has been set (setResult()) and either accept(), reject() or done() is called.
  • 24. The Widget mywidget.h mywidget.cpp [...] #include "mywidget.h" class MyWidget : public QWidget MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { { setWindowTitle("Main Window - Dialog Example"); Q_OBJECT startButton = new QPushButton("Start dialog"); instructionsLabel = new QLabel("Please push the button"); public: resultLabel = new QLabel(); MyWidget(QWidget *parent = 0); ~MyWidget(); layout = new QVBoxLayout(this); layout->addWidget(instructionsLabel); private slots: layout->addWidget(startButton); void checkInputDialog(); layout->addWidget(resultLabel); private: dialog = new MyDialog(); QPushButton* startButton; QLabel* instructionsLabel; connect(startButton, SIGNAL(clicked()), QLabel* resultLabel; dialog, SLOT(exec())); QVBoxLayout* layout; connect(dialog, SIGNAL(accepted()), MyDialog* dialog; this, SLOT(checkInputDialog())); connect(dialog, SIGNAL(rejected()), }; this, SLOT(checkInputDialog())); } #endif // MYWIDGET_H void MyWidget::checkInputDialog() { int res = dialog->result(); // Gets result (Accepted/Rejected) if (res == QDialog::Accepted) { resultLabel->setText(""Ok" was selected"); } else if (res == QDialog::Rejected) { resultLabel->setText(""Cancel" was selected"); } }
  • 25. Custom Return Values mydialog.h [...] private slots: void setResult(); [...] mydialog.cpp [...] connect(ignoreButton, SIGNAL(clicked()), this, SLOT(setResult())); [...] void MyDialog::setResult() mywidget.cpp { [...] int result = 99; connect(dialog, SIGNAL(finished(int)), emit done(result); this, SLOT(checkInputDialog(int))); } [...] void MyWidget::checkInputDialog(int res) mywidget.h { [...] if (res == 99) private slots: { void checkInputDialog(); resultLabel->setText(""Ignore" was selected"); void checkInputDialog(int); } [...] }
  • 26. Predefined Dialogs QColorDialog QInputDialog QMessageBox QFontDialog QFileDialog QErrorMessage
  • 27. Predefined Dialogs • Example: Message box – Modal dialog – User selection → return value int ret = QMessageBox::warning( this, "Exit?", "Do you really want to exit the application?", QMessageBox::Yes | QMessageBox::No );
  • 29. Main Window • Provides main application window Menu Bar – Pre-defined layout for standard components Toolbars – Central widget must be defined, others Dock Widgets optional – Subclass to create your own implementation Central Widget • Differences? – Possible with dialog / widgets as well – But: more comfortable, consistent and efficient Status Bar
  • 30. Example - QMainWindow mainwindow.h mainwindow.cpp [...] #include "mainwindow.h" class MainWindow : public QMainWindow MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags) { : QMainWindow(parent, flags) Q_OBJECT { editor = new QTextEdit(); public: setMinimumSize(160, 160); MainWindow(QWidget *parent = 0, resize(480, 320); Qt::WFlags flags = 0); setCentralWidget(editor); ~MainWindow(); setWindowTitle("QMainWindow with Menus"); private: QString message = "Welcome"; QTextEdit* editor; statusBar()->showMessage(message); } [...] }; #endif // MAINWINDOW_H main.cpp is similar to the previous example
  • 31. Action Image by Anna Cervova (Public Domain) • Represent abstract user interface • Stores action information about – Define once, use in multiple – Icons components – Text – Inserted into widgets – Keyboard shortcut • Menus (can create actions implicitly) – Status text • Toolbar buttons – “What’s This?” text • Keyboard shortcuts – Tooltip
  • 32. Menu Bar • QMenu provides: – a menu widget for menu bars, context menus and other popup menus • Supports: – Triggered Items – Separators – Submenus – Tear-off menus • QMenuBar automatically created by QMainWindow • QMenu(s) contains individual menu items ( Actions)
  • 33. Example – QAction mainwindow.h mainwindow.cpp [...] [...] // Create a new “Open” action with an icon, keyboard shortcut and class MainWindow // info-text for the status bar. : public QMainWindow openAct = new QAction("&Open...", this); { openAct->setIcon(QIcon("images/open.png")); Q_OBJECT openAct->setShortcut(tr("Ctrl+O")); [...] openAct->setStatusTip(tr("Open an existing file")); connect(openAct, SIGNAL(triggered()), this, SLOT(openFile())); private slots: void openFile(); // Add the action to the menu fileMenu = menuBar()->addMenu(tr("&File")); private: fileMenu->addAction(openAct); QMenu *fileMenu; QAction *openAct; [...] }; void MainWindow::openFile() { // Define two filter options – one for documents, one for all files // The filter mask is automatically parsed, “;;” separates lines QString file = QFileDialog::getOpenFileName(this, "Please choose a file to open", QDir::homePath(), "Documents (*.pdf *.doc *.docx);;All files (*.*)"); if (!file.isNull()) { QString info("You chose this filen"); info.append(file); QMessageBox::information(this, "Your Choice", info, QMessageBox::Ok); } }
  • 34. Toolbar • Same actions as for menu can be used for toolbar • Default automatically enables drag & drop
  • 35. Example – QToolBar mainwindow.h mainwindow.cpp [...] #include "mainwindow.h" class MainWindow MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags) : public QMainWindow : QMainWindow(parent, flags) { { [...] Q_OBJECT // Open action [...] openAct = new QAction("&Open...", this); openAct->setIcon(QIcon("images/open.png")); private: openAct->setShortcut(tr("Ctrl+O")); QToolBar *toolFile; openAct->setStatusTip(tr("Open an existing file")); }; connect(openAct, SIGNAL(triggered()), this, SLOT(openFile())); // Exit action exitAct = new QAction("E&xit", this); exitAct->setIcon(QIcon("images/exit.png")); exitAct->setShortcut(tr("Ctrl+Q")); exitAct->setStatusTip(tr("Exit the application")); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); // Create the file menu fileMenu = menuBar()->addMenu(tr("&File")); fileMenu->addAction(openAct); fileMenu->addSeparator(); fileMenu->addAction(exitAct); // Add the actions to the toolbar toolFile = addToolBar("File"); toolFile->addAction(openAct); toolFile->addAction(exitAct); [...] }