05 - Qt External Interaction and GraphicsAndreas Jakl
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.
05 - Qt External Interaction and GraphicsAndreas Jakl
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.
3. 7.1 QEvent
● The QEvent class is the base class of all event
classes
● Qt's main event loop
(QCoreApplication::exec())
fetches native window system events from the
event queue, translates them into QEvents, and
sends the translated events to QObjects.
4. QWidget::event()
● This is the main event handler; it handles event
event
● You can re-implement this function in a
subclass, but we recommend using one of
the specialized event handlers instead
( keyPressEvent(), mouseMoveEvent(),
paintEvent(), etc... ).