ImFusion SDK 4.3

Wrappers for usage in Qt-based Applications. More...

+ Collaboration diagram for Qt Wrappers:

Detailed Description

Wrappers for usage in Qt-based Applications.

Classes

class  QtDisplayWidget
 Specialization of a QOpenGLWidget that allows for rendering the contents of a Display into a QtWidget-based application. More...
 
class  QtDisplayWindow
 Specialization of a QWindow that allows for rendering the contents of a Display directly into the window framebuffer. More...
 
class  QtDisplayWrapperBase
 Abstract base interface for wrappers of a Display that embed them in a Qt-based GUI application. More...
 

Functions

MouseCursorShape convertFromQtCursorShape (int qtCursorShape)
 Converts a Qt::CursorShape to an ImFusion::MouseCursorShape.
 
int convertToQtCursorShape (MouseCursorShape shape)
 Converts an ImFusion::MouseCursorShape to a Qt::CursorShape.
 
std::unique_ptr< InputEventconvertFromQEvent (const QEvent *source, const DisplayWidget &display, bool flipY)
 Converts a QEvent to a corresponding ImFusion::InputEvent where applicable.
 
std::unique_ptr< QEvent > convertToQEvent (const InputEvent &source)
 Converts an InputEvent to a corresponding QEvent.
 
EventResult forwardAsQEventTo (const InputEvent &event, std::function< bool(QEvent *)> qEventHandler)
 Transforms event into a corresponding QEvent and forwards it to qEventHandler.
 
bool handleWithQt (const EventResult &result, const void *handlerInstance)
 
std::unique_ptr< QMenu > createQMenu (const Menu &menu)
 Creates a new QMenu with the same structure as menu.
 

Function Documentation

◆ convertFromQtCursorShape()

MouseCursorShape convertFromQtCursorShape ( int qtCursorShape)

#include <ImFusion/GUI/InputEventHelpers.h>

Converts a Qt::CursorShape to an ImFusion::MouseCursorShape.

Note
Not all Qt shapes are supported by the ImFusion implementation, it will return the default cursor in such cases.

◆ convertFromQEvent()

std::unique_ptr< InputEvent > convertFromQEvent ( const QEvent * source,
const DisplayWidget & display,
bool flipY )

#include <ImFusion/GUI/InputEventHelpers.h>

Converts a QEvent to a corresponding ImFusion::InputEvent where applicable.

Parameters
sourceQt event to convert to an ImFusion::InputEvent
displayParent DisplayWidget used to compute the InputEvent::LocalToGlobalCoordMapping function.
flipYFlag whether to flip the Y coordinate to convert from Qt viewport coordinates to OpenGL coordinates.

◆ convertToQEvent()

std::unique_ptr< QEvent > convertToQEvent ( const InputEvent & source)

#include <ImFusion/GUI/InputEventHelpers.h>

Converts an InputEvent to a corresponding QEvent.

Note that the returned QEvent will only carry those information which is present in source and its other settings are empty/set to their default value.

◆ forwardAsQEventTo()

EventResult forwardAsQEventTo ( const InputEvent & event,
std::function< bool(QEvent *)> qEventHandler )

#include <ImFusion/GUI/InputEventHelpers.h>

Transforms event into a corresponding QEvent and forwards it to qEventHandler.

The return value of the function as well as the QEvent's accepted state and the QApplication::overrideCursor are eventually converted to an ImFusion::EventResult. This function is intended to be used for deprecation layers and should not be used for new code.

Note
Only the information available in the InputEvent will be assigned to the QEvent. Therefore, all other properties will configured with their default value or not set at all.
Search Tab / S to search, Esc to close