This module explores the remaining aspects of writing own widgets and explains how to handle low-level events, which can originate from for example the mouse or the keyboard. Low level painting, however, can not only be used to draw custom widget - a short overview gives you an idea of the power behind the QPainter class. If your application has to manage multiple graphics items or if you want to build a dynamic UI, the section about the graphics view framework will contain an overview of the classes required to build scene-graph-like user interfaces. At the end of this module, a few slides explain optimizing images, which is important to keep the file sizes and loading times down on mobile devices.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for part 1 of our 4 part webinar series where we explore the best of QML for mobile, embedded and desktop.
Part 1 will cover:
Building Blocks of QML
Qt Properties
Declarative Code
Anchors
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part III will cover:
- C++ Backends
- Reusing existing code
- Creating QML Modules
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for part 1 of our 4 part webinar series where we explore the best of QML for mobile, embedded and desktop.
Part 1 will cover:
Building Blocks of QML
Qt Properties
Declarative Code
Anchors
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part III will cover:
- C++ Backends
- Reusing existing code
- Creating QML Modules
The model/view design pattern is the standard way of separating UI from business logic, especially when the data exchanged is dynamic. In a series of blog posts released in May, we presented an introduction to model/view design and provided an example of how this pattern is leveraged in Qt applications. In this webinar, we will go more in depth, illustrating model/view with a set of two QML programming examples. The first will consider the simple case where data size remains constant. The second will cover the more common situation where data size is dynamic.
QVariant, QObject — Qt's not just for GUI developmentICS
In part II of our Qt for Beginners Summer Webinar Series we will explore how Qt is so much more than just a GUI toolkit. Through two classes, QObject and QVariant, Qt brings us introspection, makes it easier to manage memory in C++ and makes it easier to decouple classes.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part IV will cover:
- Dynamic Item Creation
- Keyboard Input Handling
Interacting with the Qt Quick scene graph is a good bonus skill for any Qt developer to have. In this introductory webinar we will present this component: a graphical representation of the Item scene and an alternative method to QML coding. Proper use of the underlying scene graph can save performance at runtime. We will explore how to interact with the scene graph through a simple example and suggest when it is appropriate to use.
In the final webinar in our summer series we will illustrate how the Model/View/Controller design pattern fits in Qt applications, specifically with the item-view objects. We'll present them, the model classes, and how they both interact. The concept will be demonstrated through a Napster/iTunes-like download manager.
Introduction to the Qt State Machine Framework using Qt 6ICS
The Qt State Machine Framework provides a practical mechanism to implement a GUI application as a state chart. Using Qt 6, this webinar will:
-Provide an intro to the framework
-Explore its features and its API in both C++ and QML
-Illustrate with an example how it can simplify development where the user interface is written in QML
This webinar is for any developer who wants to implement robust user interfaces.
How to write multi threaded applications using Qt:
In the slides you'll learn about 3 alternatives, all of which allow running tasks simultaneously in Qt applications, and understand the use cases leading to choosing each.
Everything you want to know about QWidget, but were afraid to ask. QWidget is the base-class for all Qt's user interface objects. This talk will take an in-depth look at how QWidget works internally and how it interacts with the native windowing system.
Presentation by Marius Bugge Monsen held during Qt Developer Days 2009.
http://qt.nokia.com/developer/learning/elearning
The model/view design pattern is the standard way of separating UI from business logic, especially when the data exchanged is dynamic. In a series of blog posts released in May, we presented an introduction to model/view design and provided an example of how this pattern is leveraged in Qt applications. In this webinar, we will go more in depth, illustrating model/view with a set of two QML programming examples. The first will consider the simple case where data size remains constant. The second will cover the more common situation where data size is dynamic.
QVariant, QObject — Qt's not just for GUI developmentICS
In part II of our Qt for Beginners Summer Webinar Series we will explore how Qt is so much more than just a GUI toolkit. Through two classes, QObject and QVariant, Qt brings us introspection, makes it easier to manage memory in C++ and makes it easier to decouple classes.
Qt Quick/QML brings designers and developers together to create and collaborate. QML is a collection of technologies that can build modern and fluid interfaces for applications – quickly. Join us for this webinar to explore the best of QML for mobile, embedded and desktop.
Part IV will cover:
- Dynamic Item Creation
- Keyboard Input Handling
Interacting with the Qt Quick scene graph is a good bonus skill for any Qt developer to have. In this introductory webinar we will present this component: a graphical representation of the Item scene and an alternative method to QML coding. Proper use of the underlying scene graph can save performance at runtime. We will explore how to interact with the scene graph through a simple example and suggest when it is appropriate to use.
In the final webinar in our summer series we will illustrate how the Model/View/Controller design pattern fits in Qt applications, specifically with the item-view objects. We'll present them, the model classes, and how they both interact. The concept will be demonstrated through a Napster/iTunes-like download manager.
Introduction to the Qt State Machine Framework using Qt 6ICS
The Qt State Machine Framework provides a practical mechanism to implement a GUI application as a state chart. Using Qt 6, this webinar will:
-Provide an intro to the framework
-Explore its features and its API in both C++ and QML
-Illustrate with an example how it can simplify development where the user interface is written in QML
This webinar is for any developer who wants to implement robust user interfaces.
How to write multi threaded applications using Qt:
In the slides you'll learn about 3 alternatives, all of which allow running tasks simultaneously in Qt applications, and understand the use cases leading to choosing each.
Everything you want to know about QWidget, but were afraid to ask. QWidget is the base-class for all Qt's user interface objects. This talk will take an in-depth look at how QWidget works internally and how it interacts with the native windowing system.
Presentation by Marius Bugge Monsen held during Qt Developer Days 2009.
http://qt.nokia.com/developer/learning/elearning
Qt Application Programming with C++ is one of the best Qt QML training and courses in Bangalore India. This workshop is ideal for anyone who want to get started with developing GUI Application using Qt framework. Starting with basics, this workshop covers developing multi-threaded, multimedia and 2D graphics based applications with multiple Do-It-Yourself (DIY) exercises.
With the introduction of multi-touch and gesture support coming in Qt, application developers now have the possibility of introducing new types of input and interaction to their applications. We will examine the various types of devices that one can expect to encounter in the multi-touch and gesture "world". This presentation will also introduce and explain the new API, walk through some example code, and show some demos of some of the possibilities we foresee with this technology.
Presentation by Jens Bache-Wiig held during Qt Developer Days 2009.
http://qt.nokia.com/developer/learning/elearning
In this webinar (Part IV) we explore how to implement UI and UI behavior with traditional widgets as opposed to QML. As we create a simple widgets applications we will point out the differences with Qt Quick and give rules of thumb of which one to use for a particular project.
Meetup Streaming data loaded and analysed successfully.
Streaming events data loaded through Spark Streaming using Custom Receivers and handled as Asynchronous HTTP requests.
History Events and Rsvp data analysed through Spark MLlib to build an Group member recommendations based on K-means clustering model.
Code: https://github.com/ssushmanth/meetup-stream
Create Engaging Healthcare Experiences with Augmented RealityAndreas Jakl
Would you like to try hands-on how to create your first Augmented Reality app? In this session, you will see how easy it is to use 3D technologies and automated speech processing (through Amazon Sumerian) to explain healthcare-related topics. The session is defined for health professionals with little or no prior experience in app design, who would love to share their knowledge with new didactic methods. Additionally, we will provide a behind-the-scenes look on the use case “Enlightening Patients with Augmented Reality” within the funded research project “Immersive Media Lab”.
Presented at the build.well.being conference on June 14th, 2019:
https://buildwellbeing.fhstp.ac.at/
More information about the contents:
https://www.andreasjakl.com/
AR / VR Interaction Development with UnityAndreas Jakl
Introduction to using C# for making Augmented Reality & Virtual Reality scenes interactive in Unity 2018 and beyond.
The lecture slides first cover the basics of C# and clarify the different C# / .NET settings in Unity. Next, an in-depth look at how GameObjects work behind the scenes from the C# perspective. To complete the necessary basics, Coroutines provide means to handle autonomous code for a better software architecture - but these shouldn't be confused with true asynchronous threads.
The next part is specially geared towards AR / VR: how to implement gaze from the main headset camera. Raycasting provides the necessary search capabilities for the hit target.
How to inform the hit object? The described approach utilizes C# Events. These are a complex topic; therefore, the materials take a deeper look at what's behind Events: Delegates, EventHandler, Actions and UnityEvents.
To wrap up, the examples are completed using a reticle / cursor for raycasts. To put this into context with AR / VR, the examples are based on a canvas to place a 2D sprite in a 3D world space canvas.
Content overview:
- Scripting: Frameworks, APIs and Languages
- GameObjects: Behind the Scenes
- Coroutines
- Gaze & Raycasting
- Delegates, Events & Actions
- Reticle / Cursor for Raycasts, based on a Canvas
Android Development with Kotlin, Part 3 - Code and App ManagementAndreas Jakl
- Code Management
- Open Source
- Version Control & Git
- App Stores
- Testing Mobile Apps
- Automated Tests
- Visual Studio App Center
- Espresso Test Recorder
- Firebase Test Lab
- Robo Tests
- App Distribution
In this presentation, you will learn how to add NFC tag reading to an Android app. It registers for auto-starting when the user taps a specific NDEF NFC tag with the phone. In addition, the app reads the NDEF records from the tag.
Further instructions: https://www.andreasjakl.com/nfc-tags-ndef-and-android-with-kotlin/
Open source sample app: https://github.com/andijakl/NfcDemo
- Target Audience (mobile vs. desktop)
- Web site technologies
- Structure & content: HTML / HTML5
- Styling: CSS
- Interactivity & scripting languages: JavaScript
- Behind the Scenes
- Client vs Server
- HTTP and web requests
- IP address & server location
- Accessibility
- Content Management Systems: Wordpress
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & MoreAndreas Jakl
iBeacons (Apple) and Eddystone (Google) have conquered the Bluetooth Beacon market. Both specifications allow to trigger specific actions on a smartphone at a well defined area. How do these formats work, what can you do with Bluetooth Beacons, what's changed for Beacons with Bluetooth 5 and what new possibilities does the Windows 10 Creators Update offer for Bluetooth developers?
More information:
Blog: https://www.andreasjakl.com/
Open Source Bluetooth Beacon Library & Example App: https://github.com/andijakl/universal-beacon/
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?Andreas Jakl
Beacons are one of the hottest topics of mobile development right now. Bluetooth Smart / LE is indispensable for Wearables and the Internet of Things (IoT). NFC is now finally arriving in the mass market.
With Windows 10, Microsoft has significantly expanded the possibilities for proximity technologies. In this overview, you will learn about the new scenarios and see several concrete examples of what is possible and how you can leverage it for your own projects!
Agenda:
NFC
- NFC simulation
- Smart Cards
- Raw NFC tag access
- Host card emulation (HCE)
Bluetooth Smart
- Bluetooth Beacon support
- Beacon specifications (iBeacon, Eddystone & co)
How to use cloud-based app testing to ensure that your mobile app doesn't suffer from bad reviews!
After an overview of the current state of mobile devices (operating system and device fragmentation for Android, iOS and Windows Phone), we take a look at current scientific studies that analyze app store reviews on a large scale, in order to extract useful app quality data.
In order to improve your app's quality, you will have to test a lot. Manual testing is usually limited to a few devices. Therefore, the best solution is often using cloud-based services like the Xamarin Test Cloud, which can test your app with a single click on 1000+ real devices.
You will also learn the basics of setting up your app for cloud-based testing and what kind of data you can extract.
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Andreas Jakl
How to create a cross-platform native app? What is Qt and which platforms does it support?
Get the latest information on the open source, C++ based framework that lets you target Android, iOS and Windows Phone - plus desktop and embedded platforms! Also contains info on contained UI technologies, the Qt dual-licensing model and the roadmap.
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows PhoneAndreas Jakl
How to create cross-platform mobile apps with HTML5 that integrate directly into the platform.
By combining several enterprise-class frameworks and tools, you can create apps that run on all mobile devices, developed in a central repository and tool.
In this presentation, you will learn how to create HTML5 apps with the Visual Studio Multi-Device Hybrid Apps plug-in. Apache Cordova is directly integrated and resposible for creating native apps for the mobile platforms.
WinJS can be used as a major UI framework that is now open source and works accross all platforms and browsers.
To check how you can integrate apps deeper with the native platforms, you will also see how to install and use a custom plug-in that enables Near Field Communication (NFC) on both Android and Windows Phone.
Nokia New Asha Platform Developer TrainingAndreas Jakl
In-depth look at the new opportunities and APIs of the Nokia Asha SDK, which enables you to develop apps for the latest phones like the Nokia Asha 501.
The training materials includes a quick overview of the refreshed UX, UI development and iconography, internationalization, phone / network / SIM state detection, file selections, notifications, radio tuner, maps, gestures and porting between different touch and non-touch devices.
The developer training was held by Mopius in Budapest on May 14th and was the world's first on-site training for the new Asha platform, just a few days after the platform's release.
The quick walkthrough will show you how to create your first NFC app for Windows Phone 8.
The NearSpeak app (available soon in the WP Store) writes voice NFC tags - touch the tags again to hear your message! Leave notes for your partner, reminders for yourself, or use them for a fun public social experiment.
This hands-on tutorial will show you how to create this app. You will see how to write a LaunchApp tag using the NDEF Library for Proximity APIs, how to recognize text spoken by the user, and how to use the speech synthesizer to let the phone read the text again.
Note that the instructions require basic knowledge of Windows Phone development.
The three most important NFC (Near Field Communication) scenarios for Windows 8 / Windows Phone 8 (WP8) app developers:
- Discover Your App
- Share to Others
- Seamless Multi-User Games & Collaboration
This presentation describes these three scenarios, and shows you how to implement them in C# from a technical perspective. It contains examples for both Windows 8 and Windows Phone 8 development, based on the new Windows Proximity APIs.
In addition, this presentation contains a quick overview of NFC as a technology, as well as pointers towards tools and documentation, including the open source NDEF library for more powerful and sophisticated NFC tag writing and reading tasks.
Introduction to the Windows 8 Platform Proximity APIs for NFC apps.
Create your own Near Field Communication apps to interact with peers as well as NFC tags. Also introduces the open source NDEF Library for Proximity APIs: http://ndef.codeplex.com/
- Subscribe to proximity messages
- Publish messages to peers and tags (WindowsUri and NDEF records)
- Parse & create NDEF messages (including Smart Posters)
- Launching apps on own and peer devices
- Registering for custom URI schemes and protocols
- LaunchApp tags to directly start the app
- Peer to peer: quick data exchange and long term connections with Wi-Fi Direct / Bluetooth
- Establishing peer to peer socket communications simply by tapping two devices
- User Experience Recommendations for peer to peer apps
NFC Development with Qt - v2.2.0 (5. November 2012)Andreas Jakl
Learn developing Near Field Communication (NFC) apps for Nokia's Symbian and MeeGo phones with step-by-step tutorials!
The three development options Qt, Symbian native and Java ME are outlined. A more detailed explanation shows the Qt Mobility 1.2 APIs to create modern NFC applications for smartphones.
In the final part, step-by-step hands-on tutorials walk you through developing your first two NFC apps. The first demo extends an example from the Qt SDK with reading & writing both URI and text NDEF records to create new sticky notes on the virtual corkboards visible on the screen. The second demo uses the LLCP protocol to create a peer-to-peer chat application between two NFC Forum compatible devices.
Most applications will need to communicate with other services or devices at some point, or at least save settings on the host computer. These concepts are covered in this module.
After introducing the generic concept behind devices, short examples show how to use files.
Afterwards, the module covers networking and its representation in Qt. In addition to providing classes for handling low level sockets, network managers simplify handling web service requests and responses like for the HTTP protocol. At the end, a short section explains the basics of different methods of parsing XML in Qt, including DOM trees, SAX, pull parsing and XQuery/XPath.
A section about internationalization demonstrates the process step-by-step, showing all required components to make your application multi-lingual.
This module explains several additional important concepts. These include properties of QObjects, data types, QString and various list types.
Special classes in Qt provide even more convenient APIs if you want to save settings in the right way for the target platform.
At the end, a guide walks you through what you need to know about embedding files and resources into your application.
Continuing where module 2 left off, this part of the course explains signals and slots in more detail and tells you how to extend functionality of existing widgets by subclassing them. In real applications, widgets are often used in dialogs or inside the main window, which is a container for widgets and by default supports menus, toolbars and actions. These topics are all demonstrated via small examples.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
4. Events
• UI applications are event-based
– Wait for user to interact
– Then start working on the requested task
• Alternative
– Polling for status changes
“Is the user pressing a button?”
→ Events save processing time, thus battery life
Picture credits: Pearson Scott Foresman
Public domain
5. Events vs. Signals?
• Signals
– For using widgets
– e.g., push button should
return clicked() signal, not
low-level mouse or key events
• Events
– For implementing widgets
• Modifying existing widgets
• New widgets
– e.g., implement own push button: handle mouse and key events and emit clicked()
signal when necessary
6. Events and Signals
• Mouse button’s way to become a clicked() signal
QCoreApplication::exec()
Mouse button Operating
QEventLoop::exec()
released system
QEvent sent through event dispatcher
QPushButton::event()
QAbstractButton::
QAbstractButton::event()
mouseReleasedEvent()
QWidget::event()
→ emit clicked() signal
QObject::event()
Signal & slots connection
Custom slot that handles button
click
7. Event Loop
• Threads in Qt can have an event loop
– Initial thread starts its loop through QCoreApplication::exec()
– Other threads: QThread::exec()
• Events
– Derived from QEvent
– Source:
• Window system (QMouseEvent, QKeyEvent)
• Generated by Qt itself (QTimerEvent)
– Handled by QObject subclass (especially widgets)
8. QEvent
• Get type of event through QEvent::type()
– 100+ events defined through enum values in Qt
– Own events can be defined
• Event is an instance of a QEvent subclass
– Adds additional information about event
– e.g., QMouseEvent: buttons, position, ...
9. Handling Events in Widgets
– Events delivered to event() function of QObject
– Calls appropriate virtual event handler functions
qwidget.cpp
bool QWidget::event(QEvent *event)
{
Q_D(QWidget);
// ...
switch (event->type()) {
case QEvent::MouseMove:
mouseMoveEvent((QMouseEvent*)event);
break; You only need to
case QEvent::Paint:
paintEvent((QPaintEvent*)event); override virtual, pre-
defined handler method
break;
case QEvent::Close:
closeEvent((QCloseEvent*)event);
break; from QWidget base class
// ...
default:
return QObject::event(event);
}
return true;
}
10. Example: Ticker
• Scrolling text
– 1 Pixel / 30 ms
– Demonstrates Timer events
• Handles 4 events
– Paint event: manual drawing of the text
– Timer event: regular call-backs
– Show event: start timer when widget is shown
– Hide event: end timer when widget becomes invisible
11. Ticker – General Definition
ticker.h ticker.cpp
#ifndef TICKER_H #include "ticker.h"
#define TICKER_H
Ticker::Ticker(QWidget* parent)
#include <QtGui> : QWidget(parent)
{
class Ticker : public QWidget m_offset = 0;
{ m_timerId = 0;
Q_OBJECT }
Q_PROPERTY(QString text READ text WRITE setText)
void Ticker::setText(const QString &newText)
public: {
Ticker(QWidget* parent = 0); m_text = newText;
void setText(const QString &newText); update();
QString text() const { return m_text; } updateGeometry();
QSize sizeHint() const; }
protected: // Return recommended size of this widget
void paintEvent(QPaintEvent* event); QSize Ticker::sizeHint() const
void timerEvent(QTimerEvent* event); {
void showEvent(QShowEvent* event); // Determine size required by the text
void hideEvent(QHideEvent* event); // First argument isn't needed here -> 0
return fontMetrics().size(0, text());
private: }
QString m_text;
int m_offset;
int m_timerId;
};
#endif // TICKER_H
12. Ticker – Event Handling
ticker.cpp ticker.cpp
void Ticker::paintEvent(QPaintEvent* /*event*/) void Ticker::timerEvent(QTimerEvent* event)
{ {
QPainter painter(this); // Called by the system at intervals
if (event->timerId() == m_timerId)
// Get required width of the text {
int textWidth = fontMetrics().width(text()); // Increase offset by 1 to simulate movement
if (textWidth < 1) ++m_offset;
return; if (m_offset >= fontMetrics().width(text()))
m_offset = 0;
// Draw the text as many times as necessary // Call to QWidget::scroll(), moves existing
// to fill the entire width of the widget // pixels on-screen and only paints new area.
// (taking offset into account) // Also possible: call update() to redraw
int x = -m_offset; // the whole widget.
while (x < width()) scroll(-1, 0);
{ } else {
painter.drawText(x, 0, textWidth, height(), // Event not from the timer we are
Qt::AlignLeft | Qt::AlignVCenter, text()); // interested in -> pass to base class
x += textWidth; QWidget::timerEvent(event);
} }
} }
void Ticker::showEvent(QShowEvent* /*event*/) void Ticker::hideEvent(QHideEvent* /*event*/)
{ {
// Starts a timer. Returned ID number can be // Stop the timer
// used to identify timer later killTimer(m_timerId);
m_timerId = startTimer(30); m_timerId = 0;
} }
13. Event Filters
• Look at / intercept events delivered to other object
– e.g., dialogs filter key presses for widgets to modify Return-key handling
– Set up through QObject::installEventFilter()
– Target object gets events before monitored object
– Accepts or rejects events: allow / deny further event processing
monitoredObj->installEventFilter(targetObj);
14. Ways to Influence Event Handling I
1. Incoming event first goes to virtual function QCoreApplication::notify()
– Override notify()
– Get all events before any event filters can intercept
– Only one subclass of QCoreApplication can be active at a time
2. Install an event filter on QCoreApplication::instance()
– implement eventFilter()
– Get events after sent out by notify()
– As powerful as option 1, also allows multiple application-global event
filters
15. Ways to Influence Event Handling II
3. Event filter on target object
– implement eventFilter()
– Gets all events (except Tab, Shift+Tab) before actual target object
4. Event handler of target object
– override QObject::event()
– Gets events after event filter
– Don’t forget to call event handler of base class for unhandled events!
5. Re-implement event handling functions
– implement paintEvent(), mousePressEvent()
– Easiest, most common, but least powerful
17. Painting
• Low-level drawing handled through QPainter
• Draws on paint devices (QPaintDevice):
– QWidget: most common use case
– QImage: optimized for I/O and direct pixel manipulation
– QPixmap: optimized for showing images on screen
• QBitmap: convenience for monochrome QPixmap –
e.g., QCursor, QBrush, QRegion
– QPicture: records and replays QPainter commands
– QPrinter: paint on a printer
– ...
19. Example: Drawing
– Draws line between coordinates of two mouse clicks
– Uses image to store drawing
– Text written directly on Widget surface
20. Drawing
mainWidget.cpp
MainWidget::MainWidget() {
// Use standard colors of system
setBackgroundRole(QPalette::Base);
lastX = -1;
lastY = -1;
resize( 300, 200 );
bgImg = new QPixmap(300, 200);
bgImg->fill(QColor(255, 255, 255));
}
void MainWidget::mousePressEvent(QMouseEvent* event) {
if (event->button() == Qt::LeftButton && lastX > -1 && lastY > -1) {
// Create painter object for our image
QPainter painter(bgImg);
// Draw a line from previous pos to new position mainWidget.h
painter.setPen(QPen(Qt::red, 3));
painter.drawLine(lastX, lastY, event->x(), event->y()); class MainWidget : public QWidget {
update(); Q_OBJECT
} public:
lastX = event->x(); MainWidget();
lastY = event->y();
}
protected:
void mousePressEvent(QMouseEvent* event);
void MainWidget::paintEvent(QPaintEvent* event) { void paintEvent(QPaintEvent* event);
// Paint directly on the widget surface private:
QPainter painter(this); int lastX;
// Draw the image to the widget int lastY;
painter.drawPixmap(0, 0, *bgImg); QPixmap* bgImg;
// Draw text on top of the image to the widget };
painter.setPen(QPen(Qt::blue, 1));
painter.drawText(5, 15, tr("Draw using left mouse button clicks"));
painter.drawText(5, 30, tr("Set position with right mouse button"));
}
24. Graphics View Framework – Example
• Setting up a simple scene
scene = new QGraphicsScene(0, 0, 400, 400);
QGraphicsLineItem *wall = new QGraphicsLineItem
(QLineF(0.0, 200.0, 100.0, 200.0));
scene->addItem(wall);
view = new QGraphicsView(scene);
view->setRenderHint(QPainter::Antialiasing);
26. Using Widgets as Items?
• Possible through two ways:
– QGraphicsWidget
• New subclass for widgets in QGraphicsScenes
• Resembles QWidget, only few limitations
– QGraphicsProxyWidget
• Embeds a standard QWidget into QGraphicsScene
• Translates coordinate systems
• Automatically manages child widgets
• Not suitable for high performance scenarios
28. Scene: QGraphicsScene
• Surface for managing items on a 2D surface
– 3 layers: background, item layer, foreground
– Scene can be parent of items, or items are children of other items
– Manages items: position & transformation, visibility, collision, locate
items
– Propagates events to items
– Indexes items with BSP tree by default
• Suitable for large scenes with relatively static items
29. View: QGraphicsView
• Widget that presents a scene
– Multiple views for a single scene
possible
– Supports transformations
(zooming, rotation, etc.)
– Provides scroll bars if necessary
Image Credit: Ricardo J. Reyes
Public Domain
– By default uses 2D paint engine,
possible to use OpenGL
30. Coordinate Systems
• Item Coordinates
– Each item has its own coordinate system
– Usually centered around its center point (0,0)
– Relative to parent’s coordinates
• Scene Coordinates
– Base coordinate system for all items
– Describes position for all top-level items
• View Coordinates
– Coordinates relative to the widget
31. Coordinate Mappings / Transformations
• Coordinate mappings with utility functions
– mapToScene() / mapFromScene()
– Available in view / scene / item classes
• Affine Transformations
– Extra methods (rotate(), etc.)
– QMatrix
QTransform transform;
transform.rotate(newPos.x() / 6.0, Qt::YAxis);
transform.rotate(newPos.y() / 6.0, Qt::XAxis);
baseItem->setTransform(transform);
32. Animation Framework
• Part of Qt Kinetic project (→ Qt 4.6)
– Animate Qt properties of widgets and
QObjects
– Can be used on its own or with state
machine
– Supports easing curves, animation
groups
34. Pixel Images
• Most common pixel-based formats:
– .png (Portable Network Graphics)
• Similar to .gif (which was patented until 2003 because of
its LZW compression)
• Compression: works well for graphics, not so well for
photos
• Transparency: support depends on device – 1 bit increasing JPEG compression
transparency or full alpha-channel.
– .jpg (Joint Photographic Experts Group)
• Compression: for photos (wavelength), not for graphics
• Transparency: not supported Image Credit: Ilmari_Karonen / Brianski
Creative Commons
35. Save PNGs – File Size Reduction
1. Optimized export – Photoshop: Save for Web
2. Further optimization – Pngcrush: http://pmt.sourceforge.net/pngcrush/
Use as few colors as
possible (fine
No dithering gradients compress
(compression gets worse)
more difficult)
Transparenter Kanal
You can set a
transparency
kann gesetzt
channel
werden
36. PNG Optimization – Example: 472 x 472 px
256 colours, no dither 64 colours, no dither 8 colours, no dither
30,0 kB 16,3 kB 6,3 kB
Results:
- Not much difference between 256
and 64 colours (especially on a device
display), but only half of the file size
- Limits of optimization: 8 colours not
enough
- Dithering at 8 colours: same file size
as visually better 64 colours image
8 colours, Diffusion dither
→ often, dithering is problematic! 15,9 kB