QtQuick Training Course Module One. What is it? Why use it? Who uses it? 1 Things to know about Qt Module One Objectives Declarative UI Syntax Examples.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

Working with Tables for Page Design – Lesson 41 Working with Tables for Page Design Lesson 4.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
Qt.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Chapter 1: An Introduction to Visual Basic 2012
QtQuick Training Course Module Eight. How to export? File preparation Export result overview Exporting tips and common issues 2 Exporting from Photoshop.
QtQuick Training Course Module Seven. Understanding the User Interface Design and Code Panels Properties 1 Qt Quick Design Module Seven Objectives Creating.
QtQuick Training Course Meet QtQuick. What is Qt? Why use Qt? Who uses Qt? 1 QtQuick Meet QtQuick Objectives Creating the file Background Foreground elements.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
An Overview of Qt - asankar1. Agenda About Qt –A brief intro of Qt Qt development tools –Tools used for building Qt application Qt Architecture –The underlying.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
Lab 5: drawing and output User Interface Lab: GUI Lab Sep. 25 th, 2013.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery,
IE 411/511: Visual Programming for Industrial Applications
ASP.NET Web Server Controls Basic Web Server Controls.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Copyright © 2013 MyGraphicsLab / Pearson Education STRUCTURE AND HTML TAGS MyGraphicsLab: Adobe Dreamweaver CS6 ACA Certification Preparation for Web Communication.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
-1- 3D Visualization. Sonia Pujol, Ph.D., Harvard Medical School National Alliance for Medical Image Computing 3D Visualization Sonia Pujol, Ph.D. Surgical.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
QML Qt Quick with QML and you can use JavaScript for engine along C++ Started to be released since late 2009 (Qt 4.7) Nokia focused on that for the Symbian/Meego.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
QtQuick Training Course Module Qt Components. What is Qt Components? Setting up your environment Basic interface elements Style Text input Buttons Menu.
Lab 6: event & input intro User Interface Lab: GUI Lab Oct. 2 nd, 2013.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Laboratory Exercise # 9 – Inserting Graphics to Documents Office Productivity Tools 1 Laboratory Exercise # 9 Inserting Graphics to Documents Objectives:
Chapter Two Creating a First Project in Visual Basic.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
. The ideas behind Qt and a live demo Qt in Education.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery,
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Chapter 15 Creating a Presentation. Practical Computer Literacy, 2 nd edition Chapter 15 2 What’s inside and on the CD? In this chapter, you will learn.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
QML and JavaScript for Native App Development Michael Tims Jen Trieu.
Dive Into® Visual Basic 2010 Express
Creating a Presentation
Java FX: Scene Builder.
3D Visualization Sonia Pujol, Ph.D. Instructor of Radiology
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: An Introduction to Visual Basic 2015
Chapter A - Getting Started with Dreamweaver MX 2004
Chapter 2 – Introduction to the Visual Studio .NET IDE
Jonathan Riddell Canonical Kubuntu Ubuntu KDE
This Week: Tkinter for GUI Interfaces Some examples
Chapter 2 – Introduction to the Visual Studio .NET IDE
Understanding the Visual IDE
DREAMWEAVER MX 2004 Chapter 3 Working with Tables
New Features in StarBoard Software Version 9.0
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

QtQuick Training Course Module One

What is it? Why use it? Who uses it? 1 Things to know about Qt Module One Objectives Declarative UI Syntax Examples Qt Creator IDE Comparison between languages Hello world 2 Getting started with QtQuick

Item Rectangle Image Text Mouse Events Key Events 3 Layout and Interaction Module One Objectives

2 Getting started with QtQuick 3 Layout and Interaction 4 Questions 1 Things to know about Qt 5 Lab Module One Topics

What is Qt? Things to know about Qt Cross-platform framework For GUI and non-GUI apps Used everywhere (Desktop, web and embedded development) LGPL licensed in 2009 Free for anyone to use it:

Why Qt? Things to know about Qt Just one code to all platforms Three licenses to fit your needs (Commercial, LGLP or GPL) Huge community support Provides free tools to start learning Used by developers (commercial and open source) Qt is intuitive

Qt Applications Things to know about Qt Autodesk software (Maya and 3d Studio) Google Earth Skype for Linux Opera Full support for Nokia devices

2 Getting started with QtQuick 3 Layout and Interaction 4 Questions 1 Things to know about Qt 5 Lab Module One Topics

Qt Quick is Getting started with QtQuick QML (language) QtDeclarative (native module, C++ API) Qt Creator Rectangle { width: 200 height: 200 Text { x: 66 y: 93 text: "Hello World" } See example: addon/module-001/examples/hello-world.qml

Tools Getting started with QtQuick Qt Qt Creator IDE Visual editor for creating QML components (Qt Quick Designer) Project and build management tools Integrated, context-sensitive help system Visual debugger Rapid code navigation tools

Qt Creator Getting started with QtQuick Mode Selector Run Build Quick Search Output Panes Projects BarSymbol Overview Designer Mode

Comparison between languages Getting started with QtQuick Actionscript: MenuButton.as QtQuick: MenuButton.qml Item { x:60; MouseArea: { anchors.fill: parent; onClicked: print("clicked"); } public class MenuButton extends MovieClip { public function MenuButton() { this.x = 60; this.addEventListener(MouseEvent.MOUSE_DOWN, ClickBt); } function ClickBt(e:MouseEvent) { trace(“clicked”); }

2 Getting started with QtQuick 3 Layout and Interaction 4 Questions 1 Things to know about Qt 5 Lab Module One Topics

Layout Layout and Interaction Item Rectangle Image Text and TextInput

Item Layout and Interaction The base of all visual elements in QtQuick Item has no visual appearance It defines all the properties that are common across visual items Common properties examples: anchors, clip, width, height, opacity, x, y, rotation or scale

Item code snippet Item { id: label2 anchors.left: label1.left anchors.top: label1.top anchors.topMargin: 30 } Anchors Item { id: label1 x: 80 width: 100 height: 100 } Layout and Interaction The basic of all visual elements in QtQuick Use the Anchor property instead of hardcoding the x and y. On module two, there will be more explanation about anchors

Layout Item Rectangle Image Text and TextInput Layout and Interaction

Rectangle Item { id: label1 width: 100 height: 100 Rectangle { anchors.fill: parent color: "red" border.color: "black" border.width: 5 radius: 10 } Layout and Interaction A Rectangle is painted using a solid color and an optional border. You can use the radius property to create rounded borders. See example: addon/module-001/examples/item-example.qml

Layout Item Rectangle Image Text and TextInput Layout and Interaction

Image Item { id: label1 width: 100 height: 100 Image { id: button source: "pngs/img.png" } Layout and Interaction This element allows you to add bitmap to a scene. It is a good practice not to hardcode the image width and height. QtQuick will automatically do this job. See example: addon/module-001/examples/image-example.qml To know more about which formats are supported:

Layout Item Rectangle Image Text and TextInput Layout and Interaction

Text and TextInput Layout and Interaction This item allows you to add formatted texts to a scene. Text { id: text1 text: "Hello World!" font.family: "Helvetica" font.pixelSize: 18 color: "red" } TextInput { id: input color: "red" text: "Default Text" width: 200; height: 24 focus: true } To know more about different text properties:

Interaction MouseArea FocusScope Flickable Layout and Interaction

MouseArea Layout and Interaction This item handles mouse events for items that are on the scene. Rectangle { width: 100; height: 100 color: "green" MouseArea { anchors.fill: parent onClicked: { parent.color = 'red' } }

MouseArea Layout and Interaction Drag an item in a determined space to create a scrollbar. Rectangle { id: slider; width: 320; height: 40; color: "green" Rectangle { id: handle; width: 40; height: 40 color: "red" MouseArea { anchors.fill: parent drag.target: parent; drag.axis: "XAxis" drag.minimumX: 0 drag.maximumX: slider.width - handle.width } See example: addon/module-001/examples/scrollbar-mousearea.qml

MouseArea Layout and Interaction All Signals onCanceled onClicked onDoubleClicked onEntered onExited onPositionChanged onPressAndHold onPressed onReleased To know more about MouseArea signals:

Interaction MouseArea FocusScope Flickable Layout and Interaction

Key focus Layout and Interaction You can generate a key event when a key is pressed. Rectangle { color: "lightsteelblue"; width: 240; height: 25 Text { id: myText } Item { id: keyHandler focus: true Keys.onPressed: { if (event.key == Qt.Key_A) myText.text = 'Key A was pressed' else if (event.key == Qt.Key_B) myText.text = 'Key B was pressed' else if (event.key == Qt.Key_C) myText.text = 'Key C was pressed' } See example: addon/module-001/examples/focusscope-event.qml

Key navigation Layout and Interaction It is common in key-based UIs to use arrow keys to navigate between focused items Grid { columns: 2 width: 100; height: 100 Rectangle { id: item1 focus: true width: 50; height: 50 color: focus ? "red" : "lightgray" KeyNavigation.right: item2 } Rectangle { id: item2 width: 50; height: 50 color: focus ? "red" : "lightgray" KeyNavigation.left: item1 } See example: addon/module-001/examples/key-navigation.qml To know more about keyboard focus:

Interaction MouseArea FocusScope Flickable Layout and Interaction

Flickable Layout and Interaction All elements placed in a Flickable item can be dragged and flicked. Flickable { width: 200; height: 200 contentWidth: image.width contentHeight: image.height Image { id: image; source: "bigImage.png" } } For fine-tuning your needs: See example: addon/module-001/examples/flickable-area.qml

2 Getting started with QtQuick 3 Layout and Interaction 4 Questions 1 Things to know about Qt 5 Lab Module One Topics

Questions What is Qt and QtQuick? How is a QtQuick component file structured? What is the basic visual element in QtQuick? How can you position an item relatively to another? How can you handle mouse events in QtQuick? Name some QtQuick elements that inherits from Item. How many components can you declare in a QtQuick file?

2 Getting started with QtQuick 3 Layout and Interaction 4 Questions 1 Things to know about Qt 5 Lab Module One Topics

Align items inside a Flickable area. Use anchors to do the job Lab Optional: Create a scrollbar for it See lab: addon/module-001/labs/lab-flickable/LabOne.qmlproject See video: addon/module-001/videos/lab-video-example.mov

(c) 2011 Nokia Corporation and its Subsidiary(-ies). The enclosed Qt Training Materials are provided under the CreativeCommons Attribution ShareAlike 2.5 License Agreement. The full license text is available here: sa/2.5/legalcodehttp://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.