Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbQtHelper Class Reference

VSG extension Utilities class for Qt management. More...

#include <Inventor/Qt/SbQtHelper.h>

Static Public Member Functions

static void addPlatformPluginsPath (SbString path="")
 When a Qt5 application is run, Qt will first treat the application's executable directory as the base directory for searching for platform plugins.
 
static SbString qtPluginsPath ()
 
static float getDevicePixelRatio (QWidget *widget)
 Return pixel ratio of the widget.
 

Detailed Description

VSG extension Utilities class for Qt management.

Definition at line 44 of file SbQtHelper.h.

Member Function Documentation

◆ addPlatformPluginsPath()

static void SbQtHelper::addPlatformPluginsPath ( SbString  path = "")
inlinestatic

When a Qt5 application is run, Qt will first treat the application's executable directory as the base directory for searching for platform plugins.

The purpose of this function is to load Qt platform plugins by guessing the Qt platforms path from the Open Inventor binaries path.

The Qt environment variable QT_QPA_PLATFORM_PLUGIN_PATH also enables to specify the platform plugins path. Nevertheless, the use of both this environment variable and the Qt method QCoreApplication::addLibraryPath causes significant load delay.

Qt platform plugins are stored in $OIVHOME/$OIVHARCH/bin/platforms

Parameters
path: force the directory for searching for platforms plugins.

Definition at line 61 of file SbQtHelper.h.

◆ getDevicePixelRatio()

static float SbQtHelper::getDevicePixelRatio ( QWidget *  widget)
inlinestatic

Return pixel ratio of the widget.

HDPI devices, like Retina screen, may contains several pixel per point. Qt coordinates, like widget size, move event position, etc... are generally returned in points. Coordinates must be multiplied by this value to be converted in pixels. warning: Function return relevant value only once a SoGlContext has been created Note that Retina screen can be simulated on windows by setting QT_DEVICE_PIXEL_RATIO=2 See http://doc.qt.io/qt-5/highdpi.html for details.

Parameters
widget: widget from which pixel ratio is return.

Definition at line 104 of file SbQtHelper.h.

◆ qtPluginsPath()

static SbString SbQtHelper::qtPluginsPath ( )
inlinestatic

Definition at line 88 of file SbQtHelper.h.


The documentation for this class was generated from the following file: