Guis Coming To Uncommon Goods
Guis Coming To Uncommon Goods
Guis Coming To Uncommon Goods
Jason Kridner With the smartphone effect, proliferating in many applications outside the consumer space, its become apparent that slick graphical user interfaces (GUIs) sell. In this session, youll learn how to quickly develop a GUI for your product using Linux. Learn about cool tools such as Qt Creator and the entire Qt toolset. Soon, your basic washing machine control panel could be just as excitiing as a smartphone!
2/24/12
Agenda
Why fancy GUIs everywhere?
Which one to choose?
Introduction to QT
Hello World The QT Framework
Beckhoffs McAtee
takes it further.
[If you] combine [multi-touch] functionality with wide format 24-in. screens, device vendors and machine designers would be able to remove all physical push buttons from the panel, allowing the user to manage every machine function directly on the touchscreen. This would permit easy scrolling and zooming through dashboards and menus, beyond the capabilities of conventional touchscreen technology.
Source: http://m.controleng.com
Accessories
Segments
Portable Enterprise
Automotive
Industrial
JavaScript
C++ (JavaScript)
Closures
(DBUS/REST/)
Activity/Intent
Signals/Slots
Browser
Phone/Tablet/
Cross platform
Qt Getting Started
Hello World!
Create a working directory helloworld Create a C++ source file main.cpp using your favorite editor with the following contents
#include <QApplication> #include <QLabel> int main(int argc, char **argv) { QApplication app(argc, argv); QLabel label("Hello World!"); label.show(); return app.exec(); }
9
Run make to build the application make Application is built and ready in debug/ directory. Copy executable to your filesystem on your target and run.
10
The application is built and ready in debug/ directory. Copy executable to your filesystem on your target and run.
Example Applications
Matrix GUI Application Launcher provided in the SDK
Built with QT utilizing Webkit.
HTML files
Each HTML file contains a header and references up to 8 or 12 icons Each icon is associated with an submenu or an application
menu_main.html
HTML FILES
Icons
96x96 pixel images representing the application Blank icons available for future development
Applications
Each application is associated with an icon
/usr/bin/app1
{color: #ffffff;} /* Default all text to white */ /* Set the background color to black */ body {background-color: #000000;} /* This secton controls both the icon image and the text label together */ div.object { text-align: center; float: left; background-color:#000000; width: 25%; height: 30%; }
Matrix GUI displayed on two different LCD displays with different resolutions Only requires minor changes to the matrix.css HTML cascading stylesheet Scale icons down to 64x64 for wQVGA / remain native 96x96 for VGA
Decrease font size for wQVGA / increase font size for VGA wQVGA - each icon 45% of display in height / VGA each icon 30% height
Description mode is defaulted to on, but can be disabled Push ARM Push Dhrystone Push Run
When you push the icon to run the application, if a description is available it pops up.
Introduction to Qt
21
Whats Qt?
Cross platform application / UI framework Portable - Same API across desktop and embedded OS Supported on various platforms
22
QT Overview
Qt is cross-platform application and UI framework. Qt provides a well defined API that can make development quick and easy. Webkit
Well accepted open source web browser Rapidly create real-time web content and services Use HTML and Java Script integrated in native code
Qt SDK
Qt modular class library
GUI WebKit Graphics View OpenGL Multimedia Core XML Scripting Database Network UI Tests Benchmarking Font Engine Qt development tools
Qt Creator Cross-platform IDE
Qt Designer Forms Builder Qt Assistant Help reader
Cross-platform support
Windows Linux/X11 Embedded Linux Windows CE
KDE
Skype
Google Earth
24
Webkit applications
Webkit
Google Chrome
Safari
Matrix GUI
Qt Brief History
Qt 1.0 released Supported on Windows, Unix/X11 Decision to use Qt for developing KDE
Qt 3.0 released Supported on Windows, Linux, Mac OS, Embedded Open Source license
Nokia announce strategic partnership with Microsoft Digia acquires Qts commercial licensing and support
26
Qt Licensing
Commercial
License Cost Must provide source code for changes to Qt Can create proprietary application License fee charged No, modifications can be closed Yes No source code must be disclosed
LGPL v2.1
No license fee Source code must be provided Yes, in accordance with the LGPL v2.1 terms. (Must dynamically link.) Yes, made available
GPL v3.0
No license fee Source code must be provided No, applications are subject to the GPL and source code must be made available Yes, made available
Updates Provided
Yes, immediate notice sent to those with a valid support and update agreement Yes, to those with a valid support and update agreement Yes, for some embedded uses
Support
No
No
27
Qt Releases
Qt Release Qt SDK for Windows Qt SDK for Linux Qt Framework for Embedded Linux URL http://get.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2010.05.exe http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86opensource-2010.05.1.bin http://get.qt.nokia.com/qt/source/qt-everywhere-opensourcesrc-4.7.2.tar.gz
28
29
31
Window System/Mgrs
Surface Managers
HW Device
D D r a w
GDI
GWES
Widgets
Qt UI framework is based on widgets Widgets respond to UI events (key presses/ mouse movements), and update their screen area Each widget has a parent, that affects its behavior, and is embedded into it Most Qt classes are derived from QWidget
Ex, QGLWidget, QPushbutton QPushButton * myButton = new QPushButton(); myButton->doSomethingAPI();
Refer to online documentation at http://doc.qt.nokia.com/4.6/qwidget.html Tip Documentation is arranged using class names.
(1/2)
33
Widgets
QWTPlotCurve QHBoxLayout QComboBox
(2/2)
QDoubleSpinBox
Q M a i n W i n d o w
Q S l i d e r
QPushButton
Qlabel
34
Widgets
QWTPlotCurve
QHBoxLayout
QComboBox
(2/2)
QDoubleSpinBox
Q S l i d e r
QMainWindow
QMessageBox
QPushButton
Qlabel
Painting in Qt
QPainter
Low level painting API for overriding default painting behavior Uses Pen, Brush, Color to draw Can paint various shapes
Point(s) Line(s) Rectangle Ellipse Polygon Arc Polygon Text Image
(1/2)
Painting in Qt
QPaintDevice
Objects that can be painted by a QPainter using QPaintEngine Could be
QWidget QImage QPixmap QGLPixelBuffer QPicture QPrinter
(2/2)
QPaintEngine
Specifies how painting is to be done for a specific device Support for
X11 CoreGraphics OpenGL Raster Paint
37
3D graphics in Qt
Allows 3D operations to be performed in a widget As like any widget, QGLWidget operates on a target buffer QGLWidget is implemented in src\opengl\qgl.cpp
38
39
40
42
Conclusion
Qt with QML is an excellent choice for developing highly performing GUIs on all sorts of affordable devices Android is growing in complexity/cost, but is an excellent choice if you need access to the App Market Tools for HTML5 have yet to emerge, but keep an eye out for them
2/24/12
44
Thank you!
2/24/12
45
46
Qt Embedded QGLWidget QWidget GStreamer Wifi FFMPEG (MPG4, H.264, AAC) BlueZ
2D Accel
OpenGL ES
FBDEV DSS2
V4L2 ALSA
McSPI USB
Ethernet UART
System on Chip
Target Board
2/24/12
48
Agenda
Application Frameworks Qt/Webkit Overview 2D/3D Graphics Java Flash 10.x HTML5/CSS3 DSS Features Examples
Matrix GUI Matrix TUI
2/24/12
49
Qt Embedded / Webkit
Qt is cross-platform application and UI framework. Qt provides a well defined API that can make development quick and easy. Webkit
Well accepted open source web browser Rapidly create real-time web content and services Use HTML and Java Script integrated in native code
Qt SDK
Qt modular class library
GUI WebKit Graphics View OpenGL Multimedia Core XML Scripting Database Network UI Tests Benchmarking Font Engine Qt development tools
Qt Creator Cross-platform IDE
Qt Designer Forms Builder Qt Assistant Help reader
Cross-platform support
Windows Linux/X11 Embedded Linux Windows CE