Surface and Volumetric Data Rendering and Visualisation



Similar documents
The Most Popular UI/Apps Framework For IVI on Linux

[PRAKTISCHE ASPEKTE DER INFORMATIK SS 2014]

Andreas Burghart 6 October 2014 v1.0

Qt in Education. The Qt object model and the signal slot concept

Cross-platform C++ development using Qt

BogDan Vatra and Andy Gryc. Qt on Android: Is it right for you?

New Qt APIs for Mobile Development. Mobility I Alex Blasche

Beginning Nokia Apps. Development. Qt and HTIVIL5 for Symbian and MeeGo. Ray Rischpater. Apress. Daniel Zucker

Mobile Development with Qt

Crash course to. Qt Quick Game Programming

Building a Python Plugin

Writing standalone Qt & Python applications for Android

David Boddie. PyCon UK 2007, Birmingham

iphone Objective-C Exercises

PyQt for Desktop and Embedded Devices

GUI application set up using QT designer. Sana Siddique. Team 5

Qt at NA-MIC Summer Qt Development Frameworks: Qt is used everywhere. Qt licenses support all business models. Why Qt?

An Incomplete C++ Primer. University of Wyoming MA 5310

Programming Mobile Apps with Python

QML and JavaScript for Native App Development

CSC230 Getting Starting in C. Tyler Bletsch

BlackBerry 10. App Development. Learn. A Cascades-Driven Approach. Build cutting-edge BlackBerry 10 apps with Qt, C++, and the Cascades UI Framework

Lecture 1 Introduction to Android

Code::Blocks Student Manual

Waspmote IDE. User Guide

Our software strategy

Getting Started with Tizen SDK : How to develop a Web app. Hong Gyungpyo 洪 競 杓 Samsung Electronics Co., Ltd

Visual Studio 2008 Express Editions

IOIO for Android Beginners Guide Introduction

Embedded Linux development training 4 days session

Python for Series 60 Platform

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

From the Desktop to the Mobile Cloud: Extending your Qt Widget Desktop Application as a Back-end Service

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

The MaXX Desktop. Workstation Environment. Revised Road Map Version 0.7. for Graphics Professionals

How To Use Query Console

Overview of CS 282 & Android

Android Basics. Xin Yang

THE WHIM WINDOW MANAGER

Visual Basic Programming. An Introduction

Embedded Software Development

These instructions were tested on OS X Earlier or later versions may have slight or major differences in how things work and appear.

A Deeper Look at Signals and Slots

QNX SDK for Apps and Media 1.1. Qt Developer's Guide

CS 103 Lab Linux and Virtual Machines

VCL Access. VCL provides access to Linux and Windows 7 Virtual Machines. Users will only see those images that they are authorized to access.

A generic framework for game development

Qt Signals and Slots. Olivier Goffart. October 2013

HYBRID APPLICATION DEVELOPMENT IN PHONEGAP USING UI TOOLKITS

IVI Configuration Store

FlashAir. Firmware Update Tool Ver User s Manual. (For updating a Mac system via the Internet)

Network Programming in Qt. TCP/IP Protocol Stack

Integrating Mobile into Your Cross- Platform Strategy with Qt

Chapter 1: Getting Started

Introduction to Android SDK Jordi Linares

Qt/Embedded Whitepaper. Trolltech

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Appendix M: Introduction to Microsoft Visual C Express Edition

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

How To Sync Google Drive On A Mac Computer With A Gmail Account On A Gcd (For A Student) On A Pc Or Mac Or Mac (For An Older Person) On An Ipad Or Ipad (For Older People) On

Developing Applications for ios

MEAP Edition Manning Early Access Program Hello! ios Development version 14

Hypercosm. Studio.

Using the free iweb webpage templates

Building Mobile Applications Creating ios applications with jquery Mobile, PhoneGap, and Drupal 7

Qt Features for Hybrid Web/Native Application Development

Qt on i.mx6. Hands-on Instructions. Copyright 2012 Digia Plc.

EuroPython 2006, CERN, Geneva David Boddie and Torsten Marek * Qt and Trolltech are registered trademarks of Trolltech ASA

AES Crypt User Guide

Introduction to GUI programming in Python. Alice Invernizzi

Zend Server 4.0 Beta 2 Release Announcement What s new in Zend Server 4.0 Beta 2 Updates and Improvements Resolved Issues Installation Issues

Initial Setup of Microsoft Outlook 2011 with IMAP for OS X Lion

Android Mobile App Building Tutorial

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

The Google Web Toolkit (GWT): Declarative Layout with UiBinder Basics

Composite.Community.Newsletter - User Guide

Using ADOBE CONTRIBUTE CS5

Software Development Environment. Installation Guide

The Desktop Sharing Handbook. Brad Hards

Capture and analysis of wireless traffic

CS420: Operating Systems OS Services & System Calls

Using SQL Developer. Copyright 2008, Oracle. All rights reserved.

Creating Basic Reports with the SAP Query Tool

Pcounter Web Administrator User Guide - v Pcounter Web Administrator User Guide Version 1.0

Building and Using Web Services With JDeveloper 11g

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Best Practices in Qt Quick/QML. Langston Ball Senior Qt Developer ICS, Inc.

Select the name of the application and click on Force Quit.

Quick start. A project with SpagoBI 3.x

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Ball Aerospace s COSMOS Open Source Test System

Mobile application development with QML & PySide

Tizen.org Web Infrastructure. Michael Shaver, Intel Daehyeon Jung, Samsung

Installing Microsoft Outlook on a Macintosh. This document explains how to download, install and configure Microsoft Outlook on a Macintosh.

Creating a Poster in PowerPoint A. Set Up Your Poster

Lazy OpenCV installation and use with Visual Studio

Chapter 4. Operating Systems and File Management

WebPlus X7. Quick Start Guide. Simple steps for designing your site and getting it online.

Give a Push to Your Qt Application with Qt Cloud Services and WebSockets

JavaFX Session Agenda

Transcription:

Surface and Volumetric Data Rendering and Visualisation THE Qt TOOLKIT Department of Information Engineering Faculty of Engineering University of Brescia Via Branze, 38 25231 Brescia - ITALY 1

What is Qt? Qt is a cross platform development framework written in C++. C++ framework bindings for other languages Python, Ruby, C#, etc. Cross platform applications built from one source Originally used for interfaces, now for everything Databases, XML, WebKit, multimedia, networking, OpenGL, scripting, non-gui... 2

What is Qt? Qt is made up of modules All modules have a common scheme and are built from the same API design ideas 3

Desktop target platforms Windows Mac OS X Linux/Unix X11 4

Embedded target platforms Windows CE Symbian Maemo Embedded Linux Direct framebuffer access 5

The history of Qt 1991 Haavard Nord and Eirik Chambe-Eng begin to develop what will be Qt supporting X11 and Windows 1993 They produced Qt's first graphics kernel and could implement their own widget 1994 The company Trolltech was formed 1996 The KDE project was started by Matthias Ettrich (now works for Nokia Qt Development Frameworks) 2001 Added support for Mac OS X 2005 All platforms released under GPL 2008 Nokia acquires Trolltech 2009 Support for S60 6

The Qt Community QtCentre (www.qtcentre.org) Forum, news, wiki Qt labs (labs.trolltech.com) developer blogs, research projects #qt at freenode IRC channel, has wiki at qtnode.net Mailing lists (lists.trolltech.com) Qt interest(still very active) 7

Getting Qt Installers and snapshots are downloaded from qt.nokia.com/downloads 8

Windows Installation 1.Download the Qt SDK for Windows 2.Run the downloaded installer 3.Click through the installer 4.Start QtCreator from the start menu 9

Mac OS X installation 1.Download the Qt SDK for Mac OS X 2.Run the downloaded installer package 3.Click through the installer 4.Start QtCreator from the Finder 10

X11 installation If possible, use the package manager from your distribution (K)ubuntu qt-sdk from universe Debian qtcreator OpenSUSE qt-creator Gentoo qt-creator Arch Linux qt qt-doc qt-creator... 11

X11 installation 1.Download the Qt SDK for your Linux version 2.Make the installer executable chmod u+x qt-sdk-linux-*.bin 3.Run the installer and click your way through it 4.Start QtCreator from your desktop or menu 12

Hello World Open Qt Creator File New File or Project Other Project Empty Qt Project 13

Hello World File New File or Project C++ C++ Source file 14

Hello World #include <QApplication> #include <QWidget> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; window.resize(250, 150); window.setwindowtitle("hello World!"); window.show(); return app.exec(); } 15

Hello World #include <QApplication> #include <QWidget> We include necessary header files. int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; window.resize(250, 150); window.setwindowtitle("hello World!"); window.show(); return app.exec(); } 16

Hello World #include <QApplication> #include <QWidget> This is the application object. Each application programmed in Qt4 must have this object. Except for console applications. int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; window.resize(250, 150); window.setwindowtitle("hello World!"); window.show(); return app.exec(); } 17

Hello World This is our main widget. #include <QApplication> #include <QWidget> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; window.resize(250, 150); window.setwindowtitle("hello World!"); window.show(); return app.exec(); } 18

Hello World #include <QApplication> #include <QWidget> int main(int argc, char *argv[]) { QApplication app(argc, argv); Here we resize the widget. Set a title for our main window. In this case, the QWidget is our main window. And finally show the widget on the screen. QWidget window; window.resize(250, 150); window.setwindowtitle("hello World!"); window.show(); return app.exec(); } 19

Hello World #include <QApplication> #include <QWidget> We start the main loop of the application. int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; window.resize(250, 150); window.setwindowtitle("hello World!"); window.show(); return app.exec(); } 20

Hello World 21

The QObject QObject is the base class of almost all Qt classes and all widgets Exception: Classes that need to be lightweight such as graphical primitives Data containers (QString, QList, QChar, etc) Classes that needs to be copyable, as QObjects cannot be copied It contains many of the mechanisms that make up Qt events signals and slots properties memory management 22

Memory Management QObject can have parent and children When a parent object is deleted, it deletes its children #include <QApplication> #include <QWidget> #include <QLabel> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget *parent = new QWidget; parent->resize(250, 150); parent->setwindowtitle("hello World!"); QLabel *mylabel = new QLabel("Hello World!!!",parent); mylabel->move(80,60); parent->show(); return app.exec(); } 23

Memory Management QObject can have parent and children When a parent object is deleted, it deletes its children 24

Signals and Slots The signals and slots are what makes the different Qt components as reusable as they are. They provide a mechanism through which it is possible to expose interfaces that can be freely interconnected (a menu item, push button, tool-bar button,, can expose signal corresponding to "activated", "clicked" or any other appropriate event). By connecting such a signal to a slot of any other item, the event automatically calls the slots. The key advantage of the signals and slots is that the caller does not have to know anything about the receiver and vice versa. You can connect as many signals as you want to a single slot, and a signal can be connected to as many slots as you need. It is even possible to connect a signal directly to another signal. (This will emit the second signal immediately whenever the first is emitted.) 25

Signals and Slots In order to be able to use the signals and slots each class has to be declared in a header file. The implementation is best placed in a separate cpp file. The header file is then passed through a Qt tool known as the moc. The moc produces a cpp containing the code that makes the signals and slots happen (and more). The figure illustrates this flow. Notice the naming convention used (the moc_ prefix) in the figure. This additional compilation stage may seem to complicate the building process, but there is yet another Qt tool, qmake that makes it as simple to build any Qt application. This will be described in further on in this tutorial. 26

Signals and Slots Qt's widgets have many predefined signals, but we can always subclass widgets to add our own signals to them. A slot is a function that is called in response to a particular signal. 27

A More Complex Example File New File or Project QtWidget Project Qt GUI Application 28

A More Complex Example Base class: QWidget 29

A More Complex Example An empty Window... 30

A More Complex Example 5 Files: A.pro project file We don't need to change it :) 31

A More Complex Example 5 Files: A main.cpp file We don't need to change it :) 32

A More Complex Example 5 Files: widget.cpp and widget.h files We talk about them later 5 Files: widget.ui double click on it: it should start the Qt Designer 33

A More Complex Example Add a Text Browser (double-click it for setting the default text) Add 2 Push Buttons (call them through the inspector my_button and quit) Optionally add layouts and spacers for a more precise localization of the objects You can already run the application, but it just do nothing :) 34

A More Complex Example widget.h #ifndef WIDGET_H #define WIDGET_H #include <QWidget> namespace Ui { class Widget;} class Widget : public Qwidget { Q_OBJECT public: explicit Widget(QWidget *parent = 0); ~Widget(); We define the slots that we want public slots: void rewrite_text(); to be executed when a certain void quit(); signal is emitted. private: Ui::Widget *ui;}; #endif // WIDGET_H 35

A More Complex Example widget.cpp #include "widget.h" #include "ui_widget.h" void Widget::rewrite_text(){ ui->textbrowser->settext("you have clicked the button!!!");} void Widget::quit(){ qapp->quit();} Widget::Widget(QWidget *parent) : QWidget(parent),ui(new Ui::Widget){ ui->setupui(this); connect(ui->my_button, SIGNAL(clicked()),this,SLOT(rewrite_text())); connect(ui->quit, SIGNAL(clicked()),this,SLOT(quit())); } Widget::~Widget(){ delete ui;} We define which slot is executed when the specified signal is emitted. 36

A More Complex Example widget.cpp #include "widget.h" #include "ui_widget.h" And obviously the implementation of the slots. void Widget::rewrite_text(){ ui->textbrowser->settext("you have clicked the button!!!");} void Widget::quit(){ qapp->quit();} Widget::Widget(QWidget *parent) : QWidget(parent),ui(new Ui::Widget){ ui->setupui(this); connect(ui->my_button, SIGNAL(clicked()),this,SLOT(rewrite_text())); connect(ui->quit, SIGNAL(clicked()),this,SLOT(quit())); } Widget::~Widget(){ delete ui;} 37

Documentation http://doc.qt.nokia.com/ 38