SlideShare ist ein Scribd-Unternehmen logo
1 von 70
. Widgets and Layouts Qt in Education Semana de tecnologia do  Barão de Mauá Instrutor: Marcelo Barros de Almeida [email_address]
© 2010 Nokia Corporation and its Subsidiary(-ies). The enclosed Qt Educational Training Materials are provided under the Creative Commons  Attribution-Non-Commercial-Share Alike 2.5 License Agreement.  The full license text is available here:  http://creativecommons.org/licenses/by-nc-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.
User Interface Components ,[object Object]
46 widgets in Designer
59+ direct descendants from  QWidget QLabel QPushButton QLineEdit QDoubleSpinBox QScrollBar
Widgets in Widgets ,[object Object]
Container classes provide visual structure...
...but also functional (e.g.  QRadioButton ) QGroupBox QTabWidget
Traits of a Widget ,[object Object]
Receives events from input devices
Emits signals for “notable” changes
Are structured in a hierarchy
Can contain other widgets
An Example Dialog ,[object Object]
Why is Elastic Good? ,[object Object]
Lets widgets adapt to translations
Lets widgets adapt to user settings
Layouts ,[object Object]
Layouts and widgets “negotiate” for sizes and positions
Spacer springs can be used to fill voids QGridLayout QVBoxLayout QHBoxLayout
An Example Dialog ,[object Object]
An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem( new QSpacerItem(...) ); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem( new QSpacerItem(...) ); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem( new QSpacerItem(...) ); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerIte m(new QSpacerItem(...)); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem(new QSpacerItem(...)); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
An Example Dialog QHBoxLayout *groupLayout = new QHBoxLayout(); QGroupBox *orientationGroup = new QGroupBox(); QVBoxLayout *orientationLayout = new QVBoxLayout(orientationGroup); orientationLayout->addWidget(new QRadioButton("Landscape")); orientationLayout->addWidget(new QRadioButton("Portrait")); groupLayout->addWidget(orientationGroup); QGroupBox *colorGroup = new QGroupBox(); QVBoxLayout *colorLayout = new QVBoxLayout(colorGroup); colorLayout->addWidget(new QRadioButton("Black and White")); colorLayout->addWidget(new QRadioButton("Color")); groupLayout->addWidget(colorGroup); ,[object Object]
An Example Dialog ,[object Object]
Cross Platform Styles ,[object Object]
Cross Platform Issues ,[object Object]
Dialog button ordering
Standard dialogs
Cross Platform Issues ,[object Object]
Dialog button ordering
Standard dialogs Plastique ClearLooks Windows MacOS X
Cross Platform Issues ,[object Object]
Dialog button ordering
Standard dialogs
Cross Platform Issues ,[object Object]
Dialog button ordering
Standard dialogs
Common Widgets ,[object Object]
Designer has a good overview of the widget groups
Common Widgets Buttons ,[object Object]
Signals ,[object Object]
toggled(bool)  – emitted when the check state of the button is changed. ,[object Object],[object Object]
checked  – true when the button is checked.
text – the text of the button.
icon – an icon on the button (can be displayed together with text). QPushButton QCheckBox QRadioButton
Common Widgets Item Widgets ,[object Object]
Adding items ,[object Object]
insertItem(int row, QString)  – inserts an item at the specified row ,[object Object],[object Object],[object Object],[object Object],[object Object],QListWidget QComboBox
Common Widgets Containers ,[object Object]
They can be considered passive (not entirely true)
A plain  QWidget  can be used as a container
Designer: Place widgets in the container and apply a layout to the container
Code: Create a layout for the container and add widgets to the layout QGroupBox *box = new QGroupBox(); QVBoxLayout *layout = new QVBoxLayout(box); layout->addWidget(...); ... QGroupBox QTabWidget QFrame
Common Widgets Input Widgets ,[object Object]
Signals:  ,[object Object]
editingFinished()  - emitted when the widget is left
returnPressed()  - emitted when return is pressed ,[object Object],[object Object]
maxLength  – limits the length of the input
readOnly  – can be set to true to prevent editing (still allows copying) QLineEdit
Common Widgets Input Widgets ,[object Object]
Signals ,[object Object],[object Object],[object Object]
html  – HTML formatted text
readOnly  – can be set to prevent editing ,[object Object]
Signals ,[object Object],[object Object],[object Object],QComboBox QTextEdit
Common Widgets Input Widgets ,[object Object]
There are more for doubles, time and dates

Weitere ähnliche Inhalte

Was ist angesagt?

Building the QML Run-time
Building the QML Run-timeBuilding the QML Run-time
Building the QML Run-timeJohan Thelin
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...ICS
 
[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8Picker Weng
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)chan20kaur
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgetsICS
 
Observer pattern with Stl, boost and qt
Observer pattern with Stl, boost and qtObserver pattern with Stl, boost and qt
Observer pattern with Stl, boost and qtDaniel Eriksson
 
Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013aleks-f
 
QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? ICS
 
Learn basics of Clojure/script and Reagent
Learn basics of Clojure/script and ReagentLearn basics of Clojure/script and Reagent
Learn basics of Clojure/script and ReagentMaty Fedak
 
Python-GTK
Python-GTKPython-GTK
Python-GTKYuren Ju
 
6.1.1一步一步学repast代码解释
6.1.1一步一步学repast代码解释6.1.1一步一步学repast代码解释
6.1.1一步一步学repast代码解释zhang shuren
 

Was ist angesagt? (19)

Building the QML Run-time
Building the QML Run-timeBuilding the QML Run-time
Building the QML Run-time
 
Qt
QtQt
Qt
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8[C++ GUI Programming with Qt4] chap8
[C++ GUI Programming with Qt4] chap8
 
Treinamento Qt básico - aula I
Treinamento Qt básico - aula ITreinamento Qt básico - aula I
Treinamento Qt básico - aula I
 
Qt Animation
Qt AnimationQt Animation
Qt Animation
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)
 
Mattbrenner
MattbrennerMattbrenner
Mattbrenner
 
Qt Widget In-Depth
Qt Widget In-DepthQt Widget In-Depth
Qt Widget In-Depth
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgets
 
Qt for beginners
Qt for beginnersQt for beginners
Qt for beginners
 
Observer pattern with Stl, boost and qt
Observer pattern with Stl, boost and qtObserver pattern with Stl, boost and qt
Observer pattern with Stl, boost and qt
 
Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013Dynamic C++ ACCU 2013
Dynamic C++ ACCU 2013
 
QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong?
 
The Future of Qt Widgets
The Future of Qt WidgetsThe Future of Qt Widgets
The Future of Qt Widgets
 
Learn basics of Clojure/script and Reagent
Learn basics of Clojure/script and ReagentLearn basics of Clojure/script and Reagent
Learn basics of Clojure/script and Reagent
 
Python-GTK
Python-GTKPython-GTK
Python-GTK
 
6.1.1一步一步学repast代码解释
6.1.1一步一步学repast代码解释6.1.1一步一步学repast代码解释
6.1.1一步一步学repast代码解释
 
Hello, QML
Hello, QMLHello, QML
Hello, QML
 

Andere mochten auch

Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...Marcelo Barros de Almeida
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applicationsaccount inactive
 

Andere mochten auch (7)

Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...
 
Agenda em bash e dialog
Agenda em bash e dialogAgenda em bash e dialog
Agenda em bash e dialog
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applications
 
Lista de exercícios em Bash (resolvida)
Lista de exercícios em Bash (resolvida) Lista de exercícios em Bash (resolvida)
Lista de exercícios em Bash (resolvida)
 
Administração de Redes Linux - II
Administração de Redes Linux - IIAdministração de Redes Linux - II
Administração de Redes Linux - II
 
Administração de Redes Linux - I
Administração de Redes Linux - IAdministração de Redes Linux - I
Administração de Redes Linux - I
 
Administração de Redes Linux - III
Administração de Redes Linux - IIIAdministração de Redes Linux - III
Administração de Redes Linux - III
 

Ähnlich wie Treinamento Qt básico - aula III

Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWTbackdoor
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01JONDHLEPOLY
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01Ankit Dubey
 
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15Rajes Wari
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programmingAmol Gaikwad
 
[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6Picker Weng
 
Unit – I-AWT-updated.pptx
Unit – I-AWT-updated.pptxUnit – I-AWT-updated.pptx
Unit – I-AWT-updated.pptxssuser10ef65
 
Nokia Asha App Development - Part 2
Nokia Asha App Development - Part 2Nokia Asha App Development - Part 2
Nokia Asha App Development - Part 2Marlon Luz
 
Meet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UIMeet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UIICS
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training Moutasm Tamimi
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Javasuraj pandey
 

Ähnlich wie Treinamento Qt básico - aula III (20)

Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
 
Gui
GuiGui
Gui
 
Unit 5 java-awt (1)
Unit 5 java-awt (1)Unit 5 java-awt (1)
Unit 5 java-awt (1)
 
Awt
AwtAwt
Awt
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
 
tL19 awt
tL19 awttL19 awt
tL19 awt
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
 
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programming
 
[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6[C++ GUI Programming with Qt4] chap6
[C++ GUI Programming with Qt4] chap6
 
13457272.ppt
13457272.ppt13457272.ppt
13457272.ppt
 
Unit – I-AWT-updated.pptx
Unit – I-AWT-updated.pptxUnit – I-AWT-updated.pptx
Unit – I-AWT-updated.pptx
 
Gui programming
Gui programmingGui programming
Gui programming
 
Nokia Asha App Development - Part 2
Nokia Asha App Development - Part 2Nokia Asha App Development - Part 2
Nokia Asha App Development - Part 2
 
Meet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UIMeet the Widgets: Another Way to Implement UI
Meet the Widgets: Another Way to Implement UI
 
Windows form application - C# Training
Windows form application - C# Training Windows form application - C# Training
Windows form application - C# Training
 
GWT Widgets
GWT WidgetsGWT Widgets
GWT Widgets
 
Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
 
28 awt
28 awt28 awt
28 awt
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Java
 

Mehr von Marcelo Barros de Almeida

[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...Marcelo Barros de Almeida
 
Projeto de Hardware com Microcontroladores STM32
Projeto de Hardware com Microcontroladores STM32Projeto de Hardware com Microcontroladores STM32
Projeto de Hardware com Microcontroladores STM32Marcelo Barros de Almeida
 
Criando Placas Eletrônicas com KiCAD (Marcelo Barros)
Criando Placas Eletrônicas com KiCAD (Marcelo Barros)Criando Placas Eletrônicas com KiCAD (Marcelo Barros)
Criando Placas Eletrônicas com KiCAD (Marcelo Barros)Marcelo Barros de Almeida
 
Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...Marcelo Barros de Almeida
 
Python para desenvolvedores - material apoio (parte I)
Python para desenvolvedores - material apoio (parte I)Python para desenvolvedores - material apoio (parte I)
Python para desenvolvedores - material apoio (parte I)Marcelo Barros de Almeida
 
Sistemas embarcados: motivação e primeiros passos
Sistemas embarcados: motivação e primeiros passosSistemas embarcados: motivação e primeiros passos
Sistemas embarcados: motivação e primeiros passosMarcelo Barros de Almeida
 

Mehr von Marcelo Barros de Almeida (14)

[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[9/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[8/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[7/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[6/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[5/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[4/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[3/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
[2/9] Sistemas embarcados de alto desempenho para tratamento e processamento ...
 
Projeto de Hardware com Microcontroladores STM32
Projeto de Hardware com Microcontroladores STM32Projeto de Hardware com Microcontroladores STM32
Projeto de Hardware com Microcontroladores STM32
 
Criando Placas Eletrônicas com KiCAD (Marcelo Barros)
Criando Placas Eletrônicas com KiCAD (Marcelo Barros)Criando Placas Eletrônicas com KiCAD (Marcelo Barros)
Criando Placas Eletrônicas com KiCAD (Marcelo Barros)
 
Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...Fundamentos de Sistemas  Operacionais de Tempo Real - Criando seu próprio esc...
Fundamentos de Sistemas Operacionais de Tempo Real - Criando seu próprio esc...
 
Python para desenvolvedores - material apoio (parte I)
Python para desenvolvedores - material apoio (parte I)Python para desenvolvedores - material apoio (parte I)
Python para desenvolvedores - material apoio (parte I)
 
Tutorial sobre iptables
Tutorial sobre iptablesTutorial sobre iptables
Tutorial sobre iptables
 
Sistemas embarcados: motivação e primeiros passos
Sistemas embarcados: motivação e primeiros passosSistemas embarcados: motivação e primeiros passos
Sistemas embarcados: motivação e primeiros passos
 

Kürzlich hochgeladen

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Treinamento Qt básico - aula III

  • 1. . Widgets and Layouts Qt in Education Semana de tecnologia do Barão de Mauá Instrutor: Marcelo Barros de Almeida [email_address]
  • 2. © 2010 Nokia Corporation and its Subsidiary(-ies). The enclosed Qt Educational Training Materials are provided under the Creative Commons Attribution-Non-Commercial-Share Alike 2.5 License Agreement. The full license text is available here: http://creativecommons.org/licenses/by-nc-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.
  • 3.
  • 4. 46 widgets in Designer
  • 5. 59+ direct descendants from QWidget QLabel QPushButton QLineEdit QDoubleSpinBox QScrollBar
  • 6.
  • 7. Container classes provide visual structure...
  • 8. ...but also functional (e.g. QRadioButton ) QGroupBox QTabWidget
  • 9.
  • 10. Receives events from input devices
  • 11. Emits signals for “notable” changes
  • 12. Are structured in a hierarchy
  • 13. Can contain other widgets
  • 14.
  • 15.
  • 16. Lets widgets adapt to translations
  • 17. Lets widgets adapt to user settings
  • 18.
  • 19. Layouts and widgets “negotiate” for sizes and positions
  • 20. Spacer springs can be used to fill voids QGridLayout QVBoxLayout QHBoxLayout
  • 21.
  • 22. An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem( new QSpacerItem(...) ); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
  • 23. An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem( new QSpacerItem(...) ); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
  • 24. An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem( new QSpacerItem(...) ); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
  • 25. An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerIte m(new QSpacerItem(...)); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
  • 26. An Example Dialog QVBoxLayout *outerLayout = new QVBoxLayout(this); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->addWidget(new QLabel("Printer:")); topLayout->addWidget(c=new QComboBox()); outerLayout->addLayout(topLayout); QHBoxLayout *groupLayout = new QHBoxLayout(); ... outerLayout->addLayout(groupLayout); outerLayout->addSpacerItem(new QSpacerItem(...)); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addSpacerItem(new QSpacerItem(...)); buttonLayout->addWidget(new QPushButton("Print")); buttonLayout->addWidget(new QPushButton("Cancel")); outerLayout->addLayout(buttonLayout);
  • 27.
  • 28.
  • 29.
  • 30.
  • 33.
  • 35. Standard dialogs Plastique ClearLooks Windows MacOS X
  • 36.
  • 39.
  • 42.
  • 43. Designer has a good overview of the widget groups
  • 44.
  • 45.
  • 46.
  • 47. checked – true when the button is checked.
  • 48. text – the text of the button.
  • 49. icon – an icon on the button (can be displayed together with text). QPushButton QCheckBox QRadioButton
  • 50.
  • 51.
  • 52.
  • 53.
  • 54. They can be considered passive (not entirely true)
  • 55. A plain QWidget can be used as a container
  • 56. Designer: Place widgets in the container and apply a layout to the container
  • 57. Code: Create a layout for the container and add widgets to the layout QGroupBox *box = new QGroupBox(); QVBoxLayout *layout = new QVBoxLayout(box); layout->addWidget(...); ... QGroupBox QTabWidget QFrame
  • 58.
  • 59.
  • 60. editingFinished() - emitted when the widget is left
  • 61.
  • 62. maxLength – limits the length of the input
  • 63. readOnly – can be set to true to prevent editing (still allows copying) QLineEdit
  • 64.
  • 65.
  • 66. html – HTML formatted text
  • 67.
  • 68.
  • 69.
  • 70. There are more for doubles, time and dates
  • 71.
  • 72. maximum – the maximum value
  • 73. minimum – the minimum value QSlider QScrollBar QDial QSpinBox
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79. enabled – enable or disable user interaction
  • 80. visible – shown or not (alter with show and hide)
  • 81. These properties affect child widgets as well. For instance, enable or disable a container widget.
  • 82.
  • 83.
  • 84.
  • 86.
  • 87.
  • 88. Minimum – the hint specifies the smallest possible size
  • 89. Maximum – the hint specifies the largest possible size
  • 90. Preferred – the hint specifies preferred, but not required
  • 91. Expanding – as preferred, but wants to grow
  • 92. MinimumExpanding – as minimum, but wants to grow
  • 93. Ignored – the size hint is ignored, widget gets as much space as possible
  • 94.
  • 95. Minimum – can grow
  • 96. Maximum – can shrink
  • 97. Preferred – can grow , can shrink
  • 98. Expanding – can grow , can shrink , wants to grow
  • 99. MinimumExpanding – can grow , wants to grow
  • 100. Ignored – the size hint is ignored, can grow , can shrink
  • 101.
  • 102. One preferred, one expanding
  • 103. Two expanding next to each other
  • 104. Not enough widget to fill the space (fixed)
  • 105.
  • 106. maximumSize – largest possible size
  • 107. minimumSize – smallest possible size ui->pushButton->setMinimumSize(100, 150); ui->pushButton->setMaximumHeight(250);
  • 108.
  • 109. A visual editor for forms
  • 113. Introducing Designer includes compiles links compiles mocs
  • 114. Introducing Designer uic includes compiles links compiles mocs
  • 115. Using the Code #ifndef WIDGET_H #define WIDGET_H #include <QWidget> namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); private: Ui::Widget *ui; }; #endif // WIDGET_H Forward declaration of the Ui::Widget class A Ui::Widget pointer, ui , refers to all widgets Basically a standard QWidget derived class
  • 116. Using the Code #include &quot;widget.h&quot; #include &quot;ui_widget.h&quot; Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); } Widget::~Widget() { delete ui; } Instanciates the Ui::Widget class as ui Deletes the ui object Calls setupUi , creating all the widgets as children to the given parent ( this ).
  • 117.
  • 118. Apply layouts from the inside out, add spacers as needed
  • 120.
  • 121. Using Designer drag-and-drop Place widgets roughly
  • 122. Using Designer Apply layouts from the inside out, add spacers as needed 1 . Select each group box, 2 . apply a vertical box layout
  • 123. Using Designer Apply layouts from the inside out, add spacers as needed 1 . Select the label (click), 2 . Select the combobox (Ctrl+click)
  • 124. Using Designer Apply layouts from the inside out, add spacers as needed 1 . Apply a horizontal box layout
  • 125. Using Designer Apply layouts from the inside out, add spacers as needed 1 . Select both group boxes and lay them out, 2 . add a horizontal spacer, 3 . place the buttons and spacer in a layout
  • 126. Using Designer Apply layouts from the inside out, add spacers as needed 1 . Add a vertical spacer, 2 . select the form itself, 3 . apply a vertical box layout
  • 127. Using Designer Make connections (between widgets) 1 . Switch to signals and slot editing mode, 2 . drag from one widget to another, 3 . pick the signal and slot, 4 . see the result in the connections' dock
  • 128. Using Designer Make connections (to your code) 1 . Use the widget editing mode, 2 . right click on a widget and pick Go to slot... 3 . pick the signal to connect to your code
  • 129.
  • 130.
  • 131. QDialog – a dialog, usually expecting a result such as Ok, Cancel, etc
  • 132.
  • 133.
  • 134. Widgets without parent are automatically windows
  • 135. Widgets with parent have to pass the Qt::Window flag to the QWidget constructor
  • 136.
  • 137. WindowModal – the parent window is blocked
  • 138. ApplicationModal – all other windows are blocked
  • 139.
  • 140.
  • 141.
  • 144. etc
  • 145.
  • 146. Inherited from QDialog
  • 147.
  • 148. Buttons for accepting or rejecting
  • 149. The Programming Interface class SearchDialog : public QDialog { Q_OBJECT public: explicit SearchDialog(const QString &initialText, bool isBackward, QWidget *parent = 0); bool isBackward() const; const QString &searchText() const; private: Ui::SearchDialog *ui; };
  • 150. The Implementation SearchDialog::SearchDialog(const QString &initialText, bool isBackward, QWidget *parent) : QDialog(parent), ui(new Ui::SearchDialog) { ui->setupUi(this); ui->searchText->setText(initialText); if(isBackward) ui->directionBackward->setChecked(true); else ui->directionForward->setChecked(true); } bool SearchDialog::isBackward() const { return ui->directionBackward->isChecked(); } const QString &SearchDialog::searchText() const { return ui->searchText->text(); }
  • 151.
  • 152.
  • 155. Docks
  • 157.
  • 158. A QAction object can represent all these access ways – and hold tool tips, statusbar hints, etc too Ctrl+S Action
  • 159.
  • 160.
  • 161. icon – icon to be used everywhere
  • 162. shortcut – shortcut
  • 163. checkable / checked – if the action is checkable and the current check status
  • 164. toolTip / statusTip – tips text for tool tips (hover and wait) and status bar tips (hover, no wait)
  • 165.
  • 166.
  • 167. In Designer, simply drag and drop each action into place on a tool bar or menu myMenu->addAction(action); myToolBar->addAction(action);
  • 168.
  • 169. QMainWindow::addDockWidget adds the docks to the window
  • 170. Dock widgets void MainWindow::createDock() { QDockWidget *dock = new QDockWidget (&quot;Dock&quot;, this); dock-> setFeatures (QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); dock-> setAllowedAreas (Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); dock-> setWidget (actualWidget); ... addDockWidget (Qt::RightDockWidgetArea, dock); }
  • 171.
  • 172. No need to try to determine the path for the icons for each specific install type
  • 173. All fits neatly into the build system
  • 174. ...
  • 175. You can add anything into resources, not only icons
  • 176.
  • 177. Prefix path and filenames with : to use a resource
  • 178. Or simply pick an icon from the list in Designer QPixmap pm(&quot; : / images/logo.png&quot;);
  • 179.
  • 180. Style sheets are inspired from CSS
  • 181. They can be used for highlighting and for various small alternations
  • 182. As well as a total overhaul of the entire user interface
  • 183.
  • 184.