QtQuick Training Course Module Qt Components. What is Qt Components? Setting up your environment Basic interface elements Style Text input Buttons Menu.

Slides:



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

MS® PowerPoint.
MS-Word XP Lesson 2. Page Setup & Margins 1.Click on file menu 2.Click on page set up menu item 3.Select margins tab sheet (default activated) 4.Type.
Chapter 3 Creating a Business Letter with a Letterhead and Table
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
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.
Microsoft Excel 2010 Chapter 7
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
1 Excel Lesson 2 Changing the Appearance of a Worksheet Microsoft Office 2010 Introductory Pasewark & Pasewark.
With Alex Conger – President of Webmajik.com FrontPage 2002 Level I (Intro & Training) FrontPage 2002 Level I (Intro & Training)
Document Basics Lesson 2. Skills Matrix SKILL #MATRIX SKILL 1.1.2Apply Quick Styles to documents 1.1.3Format documents using themes 1.1.4Customize a theme.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
XP New Perspectives on Microsoft Office PowerPoint 2003 Tutorial 2 1 Microsoft Office PowerPoint 2003 Tutorial 2 – Applying and Modifying Text and Graphic.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
IE 411/511: Visual Programming for Industrial Applications
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.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Microsoft Word 2000 Presentation 5. Major Word Topics Columns Tables Lists.
ACCESS Part 2. OBJECTIVES  Use the Form Wizard  Create a split form  Use Form Layout View  Add fields to a form  Modify form controls  Create calculations.
Designing Interface Components. Components Navigation components - the user uses these components to give instructions. Input – Components that are used.
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
WORKBOOK FORMATTING Nolan Tomboulian Tomboulian.wikispaces.com HOW THINGS LOOK CELL COLORFONT COLOR CELL BORDERSFONT SIZE CELL SIZEFONT.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Pasewark & Pasewark 1 Access Lesson 5 Creating and Modifying Reports Microsoft Office 2007: Introductory.
Chapter 7 Creating a Newsletter with a Pull-Quote and Graphics
XP New Perspectives on Microsoft PowerPoint 2002 Tutorial 2 1 Microsoft PowerPoint 2002 Tutorial 2 – Applying and Modifying Text and Graphic Objects.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Designer Basics.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Pasewark & Pasewark 1 PowerPoint Lesson 2 Creating and Enhancing PowerPoint Presentations Microsoft Office 2007: Introductory.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 4 Working with Information Graphics
Pasewark & Pasewark 1 Access Lesson 5 Creating and Modifying Reports Microsoft Office 2007: Introductory.
By: Ms. Abeer Helwa 1. CREATE A WORD DOCUMENT 2 Blank document Templates To create a new blank document: click the File tab and click Blank document.
Key Applications Module Lesson 14 — Working with Tables Computer Literacy BASICS.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
Agency Web Site Navigation Structure. Building the agency web site Agency Web Site Navigation Structure, Slide 2Copyright © 2004, Jim Schwab, University.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
Introduction to Technology. Parts of MSWord Screen Title Bar Quick Access Toolbar Button Ribbon Status Bar (views and zoom)
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
XP IT INSTRUCTOR :AHMAD HIRZALLAH 1 Microsoft Office FrontPage 2003 Creating Tables and Frames.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
MS WORD INFORMATION TECHNOLOGY MANAGEMENT SERVICE Training & Research Division.
Adobe ® Photoshop ® CS6 Chapter 1 Editing a Photo.
Chapter 7 Creating Templates, Importing Data, and Working with SmartArt, Images, and Screen Shots Microsoft Excel 2013.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Lesson 13 Tables. Overview Create a table. Key and edit text in tables. Select cells, rows, and columns. Edit table structures. Format tables and cell.
DB Implementation: MS Access Forms. MS Access Forms: Purpose Data entry, editing, & viewing data in Tables Forms are user-friendlier to end-users than.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 5 1 Microsoft Office FrontPage 2003 Tutorial 5 – Creating Tables and Frames.
With Microsoft FrontPage 2000
Shelly Cashman: Microsoft Word 2016
Building a User Interface with Forms
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
Chap 7. Building Java Graphical User Interfaces
DB Implementation: MS Access Forms
Graphical User Interfaces -- Introduction
Chapter 1 Editing a Photo
SAMPLE PRESENTATION Company Name presents PowerPoint Basics
DB Implementation: MS Access Forms
PowerPoint is for making high quality presentations
Presentation transcript:

QtQuick Training Course Module Qt Components

What is Qt Components? Setting up your environment Basic interface elements Style Text input Buttons Menu Dialog boxes Tabs Pages 1 Qt Components Module Qt Components Objectives

3 Questions 4 Lab 1 Qt Components Topics 2 Cheat Sheet Module Qt Mobility

What is Qt Components? Qt Components Speed up Qt Quick development Ready-made QML-based UI building blocks Functional Symbian components

Setting up your environment Qt Components Create a Qt Quick Application project Set the project up for Qt Simulator

Basic interface elements Qt Components First, import the Qt Components API Window: the root component (handles transitions when rotating the screen) StatusBar: display device’s informations (connection, battery, time) ToolBar: container for quick access to tasks See example: addon/module-010/examples/Basic/Basic.pro

Basic interface elements Qt Components ScrollDecorator: sets a temporary scrollbar to a flickable content while it is being dragged. See video: addon/module-010/videos/Scroll.mov See example: addon/module-010/examples/Scroll/Scroll.pro

Style Qt Components Use platformStyle on properties (e.g. font.family: platformStyle.fontFamilyRegular) fontFamilyRegular: default font family fontSizeLarge: pixel size for a font fontSizeMedium / fontSizeSmall graphicSizeLarge: size of a graphical object (Image) graphicSizeMedium / graphicSizeSmall / graphicSizeTiny paddingLarge: size of padding, in pixels paddingMedium / paddingSmall colorNormalLight: default foreground color colorNormalMid / colorNormalDark / colorNormalLink See the cheat sheet in the end of the module for more. See example: addon/module-010/examples/Style/Style.pro

Text input Qt Components TextField can have placeholderText, integrated buttons and actions See videos: addon/module-010/videos/ClearableTextField.mov ; TextArea.mov ; TextAreaNoHeight.mov See example: addon/module-010/examples/Text/Text.pro TextArea can either be scrollable on fixed width and height or resize to fit all input characters

Buttons Qt Components See video: addon/module-010/videos/Button.mov See example: addon/module-010/examples/Button/Button.pro Button: standard button with a text ToolButton: different button compatible with icons ButtonRow: arranges a set of buttons in a row ButtonColumn: arranges a set of buttons in a column RadioButton / CheckBox: button variations for specific purposes ToolBarLayout: automatically arranges items on a toolbar See the cheat sheet in the end of the module for more.

Menu Qt Components The Component element defines a QML component within the document, rather than a separate QML file The Menu component is hidden by default, therefore, you’ll need to call it in an ‘open’ function. MenuLayout automatically arranges the items in a Menu See video: addon/module-010/videos/Menu.mov See example: addon/module-010/examples/Menu/Menu.pro

Dialog boxes Qt Components See video: addon/module-010/videos/Dialog.mov See example: addon/module-010/examples/Dialog/Dialog.pro CommonDialog and QueryDialog are variations of Dialog with subtle differences CommonDialog: Dialog with support to title text QueryDialog: CommonDialog with support to icon, accept and reject buttons, and message SelectionDialog: Can work together with SelectionListItem, showing the current value ContextMenu: Menu meets Dialog

Tabs Qt Components See video: addon/module-010/videos/Tab.mov See example: addon/module-010/examples/Tab/Tab.pro TabBar: themeable background for TabBarLayout TabBarLayout: positioner for the tab buttons TabButton: has an image or label and can be clicked to activate a tab TabGroup: set of pages for a tabbed interface

Pages Qt Components See video: addon/module-010/videos/Pages.mov See example: addon/module-010/examples/Pages/Pages.pro Page: defines one screen of user interface content PageStack: defines a container for pages and a stack-based navigation model

3 Questions 4 Lab 1 Qt Components Topics 2 Cheat Sheet Module Qt Components

Cheat Sheet The root component which handles transitions when rotating screen, maintaining a full screen view. Window Display the device’s informations. Ex.:Window { id: root StatusBar { id: statusBar anchors.top: root.top } StatusBar

Cheat Sheet Adds a visual indicator to a Flickable element to show the size relationship between the visible and the complete contents. Ex.:ListView { id: listView anchors.fill: parent focus: true clip: true model: listModel delegate: listDelegate } ScrollDecorator { id: scrollDecorator flickableItem: listView } ScrollDecorator

Cheat Sheet Symbian platform specific style parameters for fonts, colors and layouts. Use platformStyle property. fontFamilyRegular: default font family fontSizeLarge: pixel size for a large font (also: fontSizeMedium / fontSizeSmall) graphicSizeLarge: size of a large graphical object (also: graphicSizeMedium / graphicSizeSmall / graphicSizeTiny) paddingLarge: size of a large padding in pixels (also: paddingMedium / paddingSmall) borderSizeMedium: size for medium size border parts of a BorderImage, in pixels colorNormalLight: default light foreground color (also: colorNormalMid / colorNormalDark / colorNormalLink) colorPressed: foreground color for the pressed state (also: colorChecked / colorHighlighted) colorDisabledLight: light foreground color for the disabled state (also: colorDisabledMid / colorDisabledDark) colorTextSelection: background color for a selected item Ex.:Text { font.family: platformStyle.fontFamilyRegular font.pixelSize: platformStyle.fontSizeMedium } Style

Cheat Sheet Style Image sources in the location “image://theme/”. qtg_graf_popup_close_normalqtg_graf_popup_close_pressed qtg_graf_search_indicator qtg_graf_slider_decrement_normal qtg_graf_slider_decrement_pressed qtg_graf_slider_increment_normalqtg_graf_slider_increment_pressed qtg_graf_textfield_add_normalqtg_graf_textfield_add_pressed qtg_graf_textfield_clear_normal qtg_graf_textfield_clear_pressed Ex.:Image { source: “image://theme/qtg_graf_popup_close_normal” }

Cheat Sheet Style ToolButton icons. toolbar-addtoolbar-back toolbar-deletetoolbar-dialer toolbar-hometoolbar-list toolbar-mediacontrol-backwardstoolbar-mediacontrol- forward toolbar-mediacontrol-pausetoolbar-mediacontrol-play toolbar-mediacontrol-stoptoolbar-menu toolbar-nexttoolbar-previous toolbar-refreshtoolbar-search toolbar-settingstoolbar-share Ex.:ToolButton { iconSource: “toolbar-home” }

Cheat Sheet TextField / TextArea TextField and TextArea accept key inputs. TextArea is a multiline editor that resizes vertically to fit all characters. font: font information for the text placeholderText: text shown before the user enters any text readOnly: if set to true, the field can’t be edited, only viewed text: already entered text Ex.:TextField {TextArea { width: parent.width – platformStyle.paddingLarge width: parent.width – platformStyle.paddingLarge font { height: platformStyle.graphicSizeLarge family: fontFamilyRegular placeholderText: “I accept many lines\nof text” pixelSize: fontSizeMedium readOnly: true } text: “You cannot change me” placeholderText: “Type some text here”} readOnly: false text: “This text is already entered” }

Cheat Sheet Button checkable: if true, it becomes a toggle button with two states, ‘on’ and ‘off’ checked: if true, it is toggled ‘on’ font: font information for the text text: the button label Ex.:Button { width: parent.width – platformStyle.paddingLarge anchors.horizontalCenter: parent.horizontalCenter font { family: fontFamilyRegular pixelSize: fontSizeMedium } checkable: true checked: true text: “This button is already checked” } See video: addon/module-010/videos/CS_Button.mov

Cheat Sheet ToolButton Different button, compatible with icons. checkable: if true, it becomes a toggle button with two states, ‘on’ and ‘off’ checked: if true, it is toggled ‘on’ checkedIconSource: icon source for the checked state enabled: if false, the button is disabled flat: if true, it has a flat look iconSource: icon source for the normal state pressedIconSource: icon source for the pressed state text: the button label Ex.:ToolButton { width: parent.width – platformStyle.paddingLarge anchors.horizontalCenter: parent.horizontalCenter iconSource: “toolbar-home” text: “Tool Button” }

Cheat Sheet ButtonRow / ButtonColumn Button positioners. checkedButton: defines which button is checked exclusive: if true, only one button at a time is toggled Ex.:ButtonRow { width: parent.width – platformStyle.paddingLarge anchors.horizontalCenter: parent.horizontalCenter checkedButton: b2 exclusive: true Button { text: “One” } Button { id: b2; text: “Two” } Button { text: “Three” } }

Cheat Sheet RadioButton / CheckBox Button variations for specific purposes. checked: if true, it is toggled ‘on’ text: text shown beside the button platformExclusiveGroup: exclusive group the RadioButton belongs to (can be replaced with ButtonRow or ButtonColumn) Ex.:CheckableGroup { id: group }ButtonColumn { Row { spacing: 10 RadioButton { exclusive: false text: “Choose this...” platformExclusiveGroup: group CheckBox { text: “Choose this…” } } CheckBox { RadioButton { text: “…and this.” text: “…or this.” checked: true platformExclusiveGroup: group } }} }

Cheat Sheet ToolBar Container for quick access to common tasks tools: the tools that make up the content of the toolbar transition: type of transition (set / push / pop / replace) ToolBarLayout Automatically arranges items on the ToolBar backButton: if set to ‘false’, the leftmost space will be empty Ex.:ToolBar { anchors.bottom: root.bottom tools: ToolBarLayout { ToolButton { iconSource: “toolbar-back” } ToolButton { iconSource: “toolbar-settings” } ToolButton { iconSource: “toolbar-menu” } }

Cheat Sheet Menu / ContextMenu Provides a list of options the user can select from. ContextMenu opens in a popup dialog. content: where you call for the content MenuLayout Automatically arranges the MenuItems in a Menu Ex.:Menu { content: MenuLayout { MenuItem { text: “Menu Item” } MenuItem { text: “Quit” onclicked: Qt.quit() }

Cheat Sheet Dialog Popup dialogs that float above the top layer of the application view title: items for the title area of the dialog content: items for the content area of the dialog buttons: items for the buttons area of the dialog Ex.:Dialog { title: Text { anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 } text: “Dialog” font { family: platformStyle.fontFamilyRegular; pixelSize: platformStyle.fontSizeLarge } color: platformStyle.colorNormalLink } buttons: ToolBar { tools: Row { ToolButton { text: “Ok” } ToolButton { text: “Cancel” } } content: Text { text: “This is the content” color: platformStyle.colorNormalLight font.pixelSize: 16 }

Cheat Sheet CommonDialog Dialog with predefined layout for the title titleText: string for predefined title layout Ex.:CommonDialog { titleText: “Common Dialog” buttons: ToolBar { width: parent.width tools: Row { anchors.center: parent spacing: platformStyle.paddingMedium ToolButton { text: “Ok” } ToolButton { text: “Cancel” } } content: Text { text: “This is the content” color: platformStyle.colorNormalLight font.pixelSize: 16 anchor.fill: parent horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter }

Cheat Sheet QueryDialog CommonDialog with predefined layout for the icon, accept and reject buttons, and content message. icon: predefined icon layout, beside the title message: predefined content message layout acceptButtonText: predefined button layout (left) rejectButtonText: predefined button layout (right) Ex.:QueryDialog { titleText: “Query Dialog” message: “Lorem ipsum dolor sit amet, consectetur adipisici ” + “elit, sed eiusmod tempor incidunt ut labore et…” } acceptButtonText: “Ok” rejectButtonText: “Cancel” icon: “image://theme/qtg_anim_spinner_large_1” }

Cheat Sheet SelectionDialog Provides a list of options the user can choose from titleText: predefined title layout selectedIndex: selected option model: options Ex.:SelectionDialog { titleText: “Select” selectedIndex: 2 model: ListModel { ListElement { name: “One” } ListElement { name: “Two” } ListElement { name: “Three” } ListElement { name: “Four” } ListElement { name: “Five” } ListElement { name: “Six” } ListElement { name: “Seven” } ListElement { name: “Eight” } ListElement { name: “Nine” } }

Cheat Sheet TabBarLayout Positioner for Tab Buttons TabBar Functions the same way as TabBarLayout, but is themed in a Symbian device style Ex.:TabBarLayout {TabBar { anchors.bottom: root.bottom width: parent.width TabButton { text: “1” } TabButton { text: “1” } TabButton { iconSource: “toolbar-home” } TabButton { iconSource: “toolbar-home” } TabButton { text: “3” } TabButton { text: “3” }} }

Cheat Sheet TabButton Has an image or label and can be clicked to activate a tab checked: if button corresponds to the activated tab iconSource: image shown on the button tab: indicates the tab content (child of TabGroup) that is activated when the TabButton is clicked text: text to be displayed on the button Ex.:TabButton { tab: tab1Content text: “Home” iconSource: “toolbar-home” checked: false }

Cheat Sheet TabGroup A set of pages for a tabbed interface Ex.:TabGroup { anchors: { top: toolBar.bottom; bottom: tabBar.top; left: parent.left; right: parent.right } Button { id: tab1content text: “tab1” } Text { id: tab2content text: “tab2” horizontalAlignment: “AlignHCenter” verticalAlignment: “AlignVCenter” color: platformStyle.colorNormalLight } Page { id: tab3content CheckBox { anchors.centerIn: parent text: “tab3” }

Cheat Sheet Page Defines one screen of the interface content tools: defines the tools for the page Ex.:Page { Text { id: label anchors.centerIn: parent text: “Page 1” color: “white” } tools: ToolBarLayout { ToolButton { flat: true iconSource: “toolbar-back” } ToolButton { flat: true text: “Page 2” }

Cheat Sheet PageStack Defines a container for pages and a stack-based navigation model currentPage: the page in the stack that is currently visible toolBar: toolbar container for the tools associated with each page (if toolbar is null, no tools are shown to the user even if a page has tools) Ex.:PageStack { id: pageStack anchors { left: root.left; top: root.top; right: root.right; bottom: mainToolBar.top } toolBar: mainToolBar } ToolBar { id: mainToolBar anchor.bottom: parent.bottom }

3 Questions 4 Lab 1 Qt Components Topics 2 Cheat Sheet Module Qt Components

Questions How can you retrieve Symbian platform specific styles? How does Menu work? What’s the difference between TabBar and TabBarLayout? What’s the difference between Page and Component? When would you use QueryDialog, CommonDialog and Dialog?

3 Questions 4 Lab 1 Qt Components Topics 2 Cheat Sheet Module Qt Components

Build a 3-tabbed app using the provided cheat sheet as reference Lab See lab: addon/module-010/labs/lab-10 See video: addon/module-010/videos/lab.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.