Introduction to Qt Programming - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Introduction to Qt Programming

Description:

Introduction to Qt Programming – PowerPoint PPT presentation

Number of Views:145
Avg rating:3.0/5.0
Slides: 16
Provided by: foss
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Qt Programming


1
Introduction to Qt Programming
  • Nitish Jaisoor

2
Agenda
  • The need for GUI programming
  • Why Qt?
  • Introduction to the Qt GUI toolkit
  • What's involved in GUI design
  • Part 1 Widgets the visible stuff
  • Part 2 Signals the hidden stuff
  • Part 3 Code snippets
  • References
  • QA

3
The need for GUI programming
  • The need to present all the options available to
    the user in an easy, pleasing style
  • Front ends to console based applications can make
    them easier to use
  • Linux newbies find GUIs very user friendly
  • Pictorial presentation of data is possible

4
Why Qt?
  • Some common toolkits GTK, Qt, Tk, Visual Studio
    IDE.
  • Licensing issues
  • Cross platform portability
  • Object oriented design
  • Development language C or C?
  • Ease of learning
  • Well structured documentation

5
Introduction to the Qt GUI toolkit
  • Developed by Trolltech AS
  • Based on OO C
  • Available for Linux, Win32, Mac OsX, Embedded
  • Basic C knowledge required
  • Qt Object model
  • Applications developed using Qt
  • Reference documentation
  • Useful tools QtDesigner, qmake

6
What's involved in GUI design
  • Obtain the requirements
  • List out the functionality required
  • Map the functionality to a GUI element
  • Group similar functional elements
  • Plan a user friendly layout
  • User friendliness Error messages, Help dialogs
  • Connect the functions and GUI elements

7
Part-1 Widgets the visible stuff
  • A user interface object that can process user
    input and draw graphics
  • Properties of a widget
  • Types of widgets
  • Parent and child widgets

8
Part-1 (cont.) Widget types
9
Part 1 (cont.) Parents and children
Main Widget (QWidget)
Button 1 (QPushButton)
Label (QLabel)
Button 2 (QPushButton)
10
Part 2 Signals the hidden stuff
  • Signals and Slots provide an effective means of
    communication between objects
  • They provide the functionality to the widget
    element while hiding the actual processing

Object 1
Signal 1 Signal 2
Object 2
Signal 1
Slot 1
Slot 1 Slot 2
11
Part 2 (cont.) Signals and Slots
Slot displayMessage()
MessageLabel-gt setText(Welcome!)
Signal clicked()
Slot qApp-gtquit()
Signal clicked()
12
Part 2 (cont.) Events and stuff
  • Events are delivered to objects when a certain
    event takes place
  • Strong support for events like mouse events,
    timer events, etc.
  • Timers enable the scheduling of events in an
    object

13
Part 3 Code snippets
  • A simple widget
  • A widget with a label and 2 buttons
  • The above with signals and slots
  • A small timer application

14
References
  • The Qt documentation with the distribution or
    at http//www.trolltech.com
  • Programming with Qt Matthias Kalle Dalheimer
    (O'Reilly)
  • OSS code get them at sites like
    http//apps.kde.com

15
QA
  • Contact information nitish_jaisoor_at_infosys.com
Write a Comment
User Comments (0)
About PowerShow.com