Qt Essentials - Fundamentals of Qt Module

Similar documents
Qt Essentials - Fundamentals of Qt Module

Document Revision No.: 1 Revised: 03/12/09 RIT KGCOE MSD Program. P09027 Upper Extremity Motion Capture System. Software Manual

Lab 12: GUI programming with Qt

Qt-Based Implementation of Low Level ROOT Graphical Layer

Object-Oriented Programming

Exercises Lecture 2 The Qt Object Model and Signal Slot Mechanism

Exercises Lecture 3 Layouts and widgets

Integrating QML with C++

Python GUIs. $ conda install pyqt

Qt Introduction. Topics. C++ Build Process. Ch & Ch 3. 1) What's Qt? 2) How can we make a Qt console program? 3) How can we use dialogs?

Oh my. Maya is Qt! Kristine Middlemiss, Autodesk Developer Consultant, Autodesk Developer Network

Qt + Maemo development

C++ GUI Programming with Qt 3

Praktische Aspekte der Informatik

Marble Developers Guide

Graphical User Interfaces

INTRODUCING Qt The Cross-Platform C++ Development Framework. Presented by Cody Bittle

CopperSpice: A Pure C++ GUI Library. Barbara Geller & Ansel Sermersheim CPPCon - September 2015

Eclipse CDT Tutorial. Eclipse CDT Homepage: Tutorial written by: James D Aniello

Application Development With Qt Creator 2nd Edition Format

Qt Quick Structures Module

Qt Essentials - Objects Module

INSTRUCTIONS: GOOD LUCK! [TURN OVER]

Friday, 4 January 13. Introduction to Qt

Kick Start your Embedded Development with Qt

Why you should be excited about Qt 5

Lab 1 The Basics of Qt

Check the Desktop development with C++ in the install options. You may want to take 15 minutes to try the Hello World C++ tutorial:

Choosing free software graphical libraries for embedded devices

Qt in Education. Qt Quick

C++ - OpenGL - Setting up Visual Studio

Qt for Device Creation

Qt Creator Manual READ ONLINE

CMPT 300. Operating Systems. Brief Intro to UNIX and C

+ C++11. Qt5 with a touch of C++11. Matthew Eshleman covemountainsoftware.com

Exercises Lecture 4 Datatypes, Collections and Files

Designing Interactive Systems II

Review. Designing Interactive Systems II. Introduction. Web 2.0 in keywords GWT Cappuccino HTML5. Cross platform GUI Toolkit

Trolltech's success with dual licensing 12 Years Of Symbiosis

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

Lab 1: First Steps in C++ - Eclipse

Interface Builders and Interface Description Languages

NSIGHT ECLIPSE EDITION

Agenda. Knoppix OS and Open Source Development Software Tools. Knoppix Features. What is Knoppix. Knoppix Features. System Requirements

COMP s1 Lecture 1

OpenGL and Qt Creator: a Gentle Introduction

The following article is about how to develop a high quality plugin.

Qt Essentials - Graphics View Module

Qt in MeeGo. Zhang Chi Manager of Qt & MeeGo ecosystem, Greater China

NSIGHT ECLIPSE EDITION

Information Technology (Degree program) Multimedia Communications (Specialization)

NSIGHT ECLIPSE EDITION

OpenGL Introduction Computer Graphics and Visualization

Intro to Qt. February 18. Kevin Krammer

GUIDE Development tools for Windows(10) installation... 2

Introduction to CGAL. Constantinos Tsirogiannis. TU/Eindhoven

LECTURE 17. GUI Programming

Tuesday, 9 March Introduction to Qt

Display Modules (DL-DM) Application Developer's Guide

The Now Platform Reference Guide

Artix Orchestration Release Notes. Version 4.0, June 2006

My First Command-Line Program

CE221 Programming in C++ Part 1 Introduction

F&S Introduction to QT5

ECE 462 Object-Oriented Programming using C++ and Java. Graphical User Interface

Programming With Qt (2nd Edition) By Matthias Kalle Dalheimer READ ONLINE

Test-Driven Development with Qt and KDE

C++ Important Questions with Answers

Building an Android* command-line application using the NDK build tools

Introduction to Supercomputing

PySide. overview. Marc Poinot (ONERA/DSNA)

In the Driver s Seat

Moblin v2 SDK. Open Source Technology Center Presented by Bob Spencer

CS103 Lecture 1 Slides. Introduction Mark Redekopp

Oracle Database Express Edition

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

C / C++ Coding Rules

Exercises Lecture 6 The Graphics View Canvas

Targeting the NetWare Operating System PDK 5.0

Image Processing with Qt BY KLAUDIO VITO

SII RENNES L espace Nobel Bâtiment A 2 allée de Becquerel RENNES Tél. : Fax. :

Android App Development for Beginners

EasyFlow - v Application Developer Guide

Costly mistakes IoT developers make and how to avoid them

Apros 6 Demo download and installation

Qt a Framework for the Multi-Screen World

Working with the ArcGIS Viewer for Flex Application Builder

Software Development With Emacs: The Edit-Compile-Debug Cycle

Exercises Lecture 8 The Model View Framework

Xcode Release Notes. Apple offers a number of resources where you can get Xcode development support:

AN 834: Developing for the Intel HLS Compiler with an IDE

PetaLinux SDK User Guide. Application Development Guide

Starting to Program in C++ (Basics & I/O)

Programming the DMCC in C

Mastering CMake Fifth Edition

CORBA Tutorial C++ Version 6.3, December 2005

Why C++ is much more fun than C (C++ FAQ)?

Monitor website performance in a dashboard

Lab: Supplying Inputs to Programs

Learn Qt 5. Build modern, responsive cross-platform desktop applications with Qt, C++, and QML. Nicholas Sherriff BIRMINGHAM - MUMBAI

Transcription:

Qt Essentials - Fundamentals of Qt Module Qt Essentials - Training Course Produced by Nokia, Qt Development Frameworks Material based on Qt 4.7, created on December 15, 2010 http://qt.nokia.com 1/28

Module: Fundamentals of Qt The Story of Qt Developing a Hello World Application Hello World using Qt Creator Practical Tips for Developers Fundamentals of Qt 2/28

Module Learning Objectives Learn...... about the history of Qt... about Qt s ecosystem... a high-level overview of Qt... how to create first hello world program... build and run a program cross platform... to use Qt Creator IDE... some practical tips for developing with Qt Fundamentals of Qt 3/28

Module: Fundamentals of Qt The Story of Qt Developing a Hello World Application Hello World using Qt Creator Practical Tips for Developers Fundamentals of Qt The Story of Qt 4/28

Meet Qt Qt Development Frameworks founded in 1994 Trolltech acquired by Nokia in 2008 More than 250 employees in eight locations worldwide Trusted by over 6,500 companies worldwide Qt: a cross-platform application and UI framework For desktop, mobile and embedded development Used by more than 350,000 commercial and open source developers Backed by Qt consulting, support and training See Service & Partners Fundamentals of Qt The Story of Qt 5/28

Qt is used everywhere Fundamentals of Qt The Story of Qt 6/28

The Qt virtuous cycle See Qt Business Model Fundamentals of Qt The Story of Qt 7/28

Why Qt Write code once to target multiple platforms Produce compact, high-performance applications Focus on innovation, not infrastructure coding Choose the license that fits you Commercial, LGPL or GPL Count on professional services, support and training Take part in an active Qt ecosystem 15 years of customer success and community growth Fundamentals of Qt The Story of Qt 8/28

Qt Architecture Fundamentals of Qt The Story of Qt 9/28

Qt Demo Let s have a look at the QtDemo Application Demo $QTDIR/bin/qtdemo Comes with every Qt installation Technology Painting Widgets Widgets Graphics View OpenGL WebKit Demo Demonstrations/Path Stroking Demonstrations/Books Demonstrations/TextEdit Demonstrations/40.000 Chips Demonstrations/Boxes Demonstrations/Browser Fundamentals of Qt The Story of Qt 10/28

Module: Fundamentals of Qt The Story of Qt Developing a Hello World Application Hello World using Qt Creator Practical Tips for Developers Fundamentals of Qt Developing a Hello World Application 11/28

Hello World in Qt // main.cpp #include <QtGui> int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton button("hello world"); button.show(); return app.exec(); } Program consists of main.cpp - application code helloworld.pro - project file Demo fundamentals/ex-helloworld Fundamentals of Qt Developing a Hello World Application 12/28

Project File - helloworld.pro helloworld.pro file lists source and header files provides project configuration # File: helloworld.pro SOURCES = main.cpp HEADERS += # No headers used Assignment to variables Possible operators =, +=, -= See qmake tutorial Documentation Fundamentals of Qt Developing a Hello World Application 13/28

Using qmake qmake tool Creates cross-platform make-files Build project using qmake cd helloworld qmake helloworld.pro # creates Makefile make # compiles and links application./helloworld # executes application Tip: qmake -project Creates default project file based on directory content See qmake Manual Documentation Qt Creator does it all for you Fundamentals of Qt Developing a Hello World Application 14/28

Module: Fundamentals of Qt The Story of Qt Developing a Hello World Application Hello World using Qt Creator Practical Tips for Developers Fundamentals of Qt Hello World using Qt Creator 15/28

Advanced C++ code editor QtCreator IDE Integrated GUI layout and forms designer Project and build management tools Integrated, context-sensitive help system Visual debugger Rapid code navigation tools Supports multiple platforms Fundamentals of Qt Hello World using Qt Creator 16/28

Overview of Qt Creator Components See Creator Quick Tour Documentation Fundamentals of Qt Hello World using Qt Creator 17/28

Finding Code -Locator Click on Locator or press Ctrl+K (Mac OS X: Cmd+K) Type in the file name Press Return Locator Prefixes : <class name> - Go to a symbol definition l <line number> - Go to a line in the current document? <help topic> - Go to a help topic o <open document> - Go to an opened document See Navigating Around Your Code with Locator Documentation Fundamentals of Qt Hello World using Qt Creator 18/28

Debugging an Application Debug > Start Debugging (or F5) See Qt Creator and Debugging Documentation Fundamentals of Qt Hello World using Qt Creator 19/28

Qt Creator Demo "Hello World" What we ll show: Creation of an empty Qt project Adding the main.cpp source file Writing of the Qt Hello World Code Showing Locator Features Running the application Debugging the application Looking up the text property of our button There is more to Qt Creator See Qt Creator Manual Documentation Fundamentals of Qt Hello World using Qt Creator 20/28

Module: Fundamentals of Qt The Story of Qt Developing a Hello World Application Hello World using Qt Creator Practical Tips for Developers Fundamentals of Qt Practical Tips for Developers 21/28

How much C++ do you need to know? Objects and classes Declaring a class, inheritance, calling member functions etc. Polymorphism That is virtual methods Operator overloading Templates For the container classes only No...... RTTI... sophisticated templates... exceptions thrown... Fundamentals of Qt Practical Tips for Developers 22/28

Qt Documentation Reference Documentation All classes documented Contains tons of examples Collection of Howto s and Overviews A set of Tutorials for Learners Fundamentals of Qt Practical Tips for Developers 23/28

Finding the Answers Documentation in Qt Assistant (or QtCreator) Qt s examples: $QTDIR/examples Qt developer network: http://developer.qt.nokia.com/ Qt Centre Forum: http://www.qtcentre.org/ KDE project source code http://lxr.kde.org/ (cross-referenced). Mailing lists see http://qt.nokia.com/lists IRC: On irc.freenode.org channel: #qt Use the source! Qt s source code is easy to read, and can answer questions the reference manual cannot answer! Fundamentals of Qt Practical Tips for Developers 24/28

Modules and Include files Qt Modules QtCore, QtGui, QtXml, QtSql, QtNetwork, QtTest... See Qt Modules Documentation Enable Qt Module in qmake.pro file: QT += network Default: qmake projects use QtCore and QtGui Any Qt class has a header file. #include <QLabel> #include <QtGui/QLabel> Any Qt Module has a header file. #include <QtGui> Fundamentals of Qt Practical Tips for Developers 25/28

Module includes #include <QtGui> Includes and Compilation Time Precompiled header and the compiler If not supported may add extra compile time If supported may speed up compilation Supported on: Windows, Mac OS X, Unix See qmake precompiled headers Documentation Class includes #include <QLabel> Reduce compilation time Use class includes (#include <QLabel>) Forward declarations (class QLabel;) Place module includes before other includes. Fundamentals of Qt Practical Tips for Developers 26/28

Questions And Answers What is Qt? Which code lines do you need for a minimal Qt application? What is a.pro file? What is qmake, and when is it a good idea to use it? What is a Qt module and how to enable it in your project? How can you include a QLabel from the QtGui module? Name places where you can find answers about Qt problems Fundamentals of Qt Practical Tips for Developers 27/28

Questions And Answers What is Qt? Which code lines do you need for a minimal Qt application? What is a.pro file? What is qmake, and when is it a good idea to use it? What is a Qt module and how to enable it in your project? How can you include a QLabel from the QtGui module? Name places where you can find answers about Qt problems Fundamentals of Qt Practical Tips for Developers 27/28

Questions And Answers What is Qt? Which code lines do you need for a minimal Qt application? What is a.pro file? What is qmake, and when is it a good idea to use it? What is a Qt module and how to enable it in your project? How can you include a QLabel from the QtGui module? Name places where you can find answers about Qt problems Fundamentals of Qt Practical Tips for Developers 27/28

Questions And Answers What is Qt? Which code lines do you need for a minimal Qt application? What is a.pro file? What is qmake, and when is it a good idea to use it? What is a Qt module and how to enable it in your project? How can you include a QLabel from the QtGui module? Name places where you can find answers about Qt problems Fundamentals of Qt Practical Tips for Developers 27/28

Questions And Answers What is Qt? Which code lines do you need for a minimal Qt application? What is a.pro file? What is qmake, and when is it a good idea to use it? What is a Qt module and how to enable it in your project? How can you include a QLabel from the QtGui module? Name places where you can find answers about Qt problems Fundamentals of Qt Practical Tips for Developers 27/28

Questions And Answers What is Qt? Which code lines do you need for a minimal Qt application? What is a.pro file? What is qmake, and when is it a good idea to use it? What is a Qt module and how to enable it in your project? How can you include a QLabel from the QtGui module? Name places where you can find answers about Qt problems Fundamentals of Qt Practical Tips for Developers 27/28

Questions And Answers What is Qt? Which code lines do you need for a minimal Qt application? What is a.pro file? What is qmake, and when is it a good idea to use it? What is a Qt module and how to enable it in your project? How can you include a QLabel from the QtGui module? Name places where you can find answers about Qt problems Fundamentals of Qt Practical Tips for Developers 27/28

c 2010 Nokia Corporation and its Subsidiary(-ies). The enclosed Qt Training Materials are provided under the Creative Commons Attribution ShareAlike 2.5 License Agreement. The full license text is available here: http://creativecommons.org/licenses/by-sa/2.5/legalcode Nokia, Qt and the Nokia and Qt logos are the registered trademarks of Nokia Corporation in Finland and other countries worldwide. Fundamentals of Qt Legal 28/28