1 / 15

Introduction to Qt Programming

Nitish Jaisoor. Introduction to Qt Programming. 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 Q&A.

zocha
Download Presentation

Introduction to Qt Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nitish Jaisoor Introduction to Qt Programming

  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 • Q&A

  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-> setText(“Welcome!”) Signal clicked() Slot qApp->quit() 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. Q&A • Contact information: nitish_jaisoor@infosys.com

More Related