API Documentation
Loading...
Searching...
No Matches
QTTools Class Reference

Manages static logic dealing with Qt and relating to the application. More...

#include <QTTools.h>

Collaboration diagram for QTTools:
[legend]

Static Public Member Functions

static QString AutoWrapText (const QString &value, const QFontMetrics &metrics, fltp08 length)
 
static void ClearLayout (QLayout *layout, bool delete_objects=false)
 
static void ClearPallete (QWidget *widget)
 
static QFont convert (const Font &font)
 
static RGBColor convert (const QColor &color)
 
static File convert (const QFile &file)
 
static Font convert (const QFont &q_font)
 
static QColor convert (const RGBColor &color)
 
static KeyEvent convert (QKeyEvent *event)
 
static KeyEvent::KEY ConvertNativeKeyEvent (sint08 key)
 
static fltp08 DefaultAnimationScale ()
 
static QSurfaceFormat DefaultSurfaceFormat ()
 
static qreal DevicePixelRatio (QWindow *window=nullptr)
 
static fltp08 DPI ()
 
static QPixmap * DrawAnimationWidget (QWidget *widget, bool draw_background, QPixmap *pixmap=nullptr, QSize size=QSize())
 
static QPixmap * DrawFullWidget (QWidget *widget, bool draw_background, QPixmap *pixmap=nullptr, QSize size=QSize())
 
template<typename EnumType >
static String EnumString (const EnumType &enumValue)
 
static void FitTextToRect (QString &text, QFont &font, const QRectF &size, bool allow_new_line=true)
 
static void ForceSizeCalculation (QWidget *widget, bool process_events=false)
 
static void FormatPallete (bool error, QWidget *widget)
 
static Buffer< QFont > GetFontRecursive (QWidget *widget)
 
static void HideDialog (QWidget *widget, const PopupInfo &end_location=PopupInfo())
 
static bool IsVisibleToUser (QWidget *widget)
 
static bool IsWidgetVisibleOnScreen (QWidget *widget)
 
static ProgressInfolog ()
 
static void MultiplyFontSize (QFont &font, fltp08 multiplier)
 
static fltp08 PixelSize (const QFont &font)
 
static fltp08 PointSize (const QFont &font)
 
static QRect PopupMenuLocation (QRect popup_origin, const QSize &size)
 
static QRect PopupMenuLocation (QWidget *widget, const QSize &size)
 
static void postToThread (QObject *target, std::function< void()> &&fun)
 
static void postToThread (std::function< void()> &&fun, QThread *thread=nullptr)
 
static Module QTModule ()
 
static void RequestExit (bool relaunch, const PopupInfo &popup_origin=PopupInfo())
 
static void requestScreenOrientation (bool horizontal)
 
static void RequestScreenResolution (const Vector< 2, uint04 > &size)
 
static QSize ScaleFontSizeToFit (QFont &font, const QString &text, const QRect &rect, bool shrink=true, bool grow=false)
 
static QScreen * ScreenForWidget (const QWidget *widget)
 
static void ServiceQT ()
 
static void SetFontRecursive (QWidget *widget, const Buffer< QFont > &font)
 
static void SetFontRecursive (QWidget *widget, const QFont &font)
 
static void SetStyleRecursive (QWidget *widget, QStyle *style)
 
static bool ShowDialog (QWidget *widget, const PopupInfo &info, const PopupInfo &end_location=PopupInfo())
 
static void ShowExperimentalFeatureDialog (const TranslatedString &feature)
 
static bool ShowMessageBox (const GenericOption &options, const String &image, std::function< bool(GenericOption, PopupInfo info)> on_select, const PopupInfo &popup_origin=PopupInfo())
 
static bool ShowMessageBox (const GenericOption &options, std::function< bool(GenericOption, PopupInfo info)> on_select, const PopupInfo &popup_origin=PopupInfo())
 
static bool ShowMessageBox (const TranslatedString &title, const String &image, const TranslatedString &text, const Buffer< TranslatedString, uint04, ObjectAllocator< false > > &button_labels, std::function< void(TranslatedString, PopupInfo info)> on_select=nullptr, const PopupInfo &popup_origin=PopupInfo())
 
static bool ShowMessageBox (const TranslatedString &title, const String &image, const TranslatedString &text, QMessageBox::StandardButtons buttons={ QMessageBox::StandardButton::Ok }, std::function< void(QMessageBox::StandardButton, PopupInfo info)> on_select=nullptr, const PopupInfo &popup_origin=PopupInfo())
 
static bool ShowMessageBox (const TranslatedString &title, const TranslatedString &text, const Buffer< TranslatedString, uint04, ObjectAllocator< false > > &button_labels, std::function< void(TranslatedString, PopupInfo info)> on_select=nullptr, const PopupInfo &popup_origin=PopupInfo())
 
static bool ShowMessageBox (const TranslatedString &title, const TranslatedString &text, QMessageBox::StandardButtons buttons={ QMessageBox::StandardButton::Ok }, std::function< void(QMessageBox::StandardButton, PopupInfo info)> on_select=nullptr, const PopupInfo &popup_origin=PopupInfo())
 

Static Public Attributes

static Resource< bool > is_horizontal
 

Detailed Description

Manages static logic dealing with Qt and relating to the application.


Member Function Documentation

◆ AutoWrapText()

static QString AutoWrapText ( const QString & value,
const QFontMetrics & metrics,
fltp08 length )
static

◆ ClearLayout()

static void ClearLayout ( QLayout * layout,
bool delete_objects = false )
static

◆ ClearPallete()

static void ClearPallete ( QWidget * widget)
static

◆ convert() [1/6]

static QFont convert ( const Font & font)
static

◆ convert() [2/6]

static RGBColor convert ( const QColor & color)
static

◆ convert() [3/6]

static File convert ( const QFile & file)
static

◆ convert() [4/6]

static Font convert ( const QFont & q_font)
static

◆ convert() [5/6]

static QColor convert ( const RGBColor & color)
static

◆ convert() [6/6]

static KeyEvent convert ( QKeyEvent * event)
static

◆ ConvertNativeKeyEvent()

static KeyEvent::KEY ConvertNativeKeyEvent ( sint08 key)
static

◆ DefaultAnimationScale()

static fltp08 DefaultAnimationScale ( )
static

◆ DefaultSurfaceFormat()

static QSurfaceFormat DefaultSurfaceFormat ( )
static

◆ DevicePixelRatio()

static qreal DevicePixelRatio ( QWindow * window = nullptr)
static

◆ DPI()

static fltp08 DPI ( )
static

◆ DrawAnimationWidget()

static QPixmap * DrawAnimationWidget ( QWidget * widget,
bool draw_background,
QPixmap * pixmap = nullptr,
QSize size = QSize() )
static

◆ DrawFullWidget()

static QPixmap * DrawFullWidget ( QWidget * widget,
bool draw_background,
QPixmap * pixmap = nullptr,
QSize size = QSize() )
static

◆ EnumString()

template<typename EnumType >
static String EnumString ( const EnumType & enumValue)
inlinestatic

◆ FitTextToRect()

static void FitTextToRect ( QString & text,
QFont & font,
const QRectF & size,
bool allow_new_line = true )
static

◆ ForceSizeCalculation()

static void ForceSizeCalculation ( QWidget * widget,
bool process_events = false )
static

◆ FormatPallete()

static void FormatPallete ( bool error,
QWidget * widget )
static

◆ GetFontRecursive()

static Buffer< QFont > GetFontRecursive ( QWidget * widget)
static

◆ HideDialog()

static void HideDialog ( QWidget * widget,
const PopupInfo & end_location = PopupInfo() )
static

◆ IsVisibleToUser()

static bool IsVisibleToUser ( QWidget * widget)
static

◆ IsWidgetVisibleOnScreen()

static bool IsWidgetVisibleOnScreen ( QWidget * widget)
static

◆ log()

static ProgressInfo * log ( )
static

◆ MultiplyFontSize()

static void MultiplyFontSize ( QFont & font,
fltp08 multiplier )
static

◆ PixelSize()

static fltp08 PixelSize ( const QFont & font)
static

◆ PointSize()

static fltp08 PointSize ( const QFont & font)
static

◆ PopupMenuLocation() [1/2]

static QRect PopupMenuLocation ( QRect popup_origin,
const QSize & size )
static

◆ PopupMenuLocation() [2/2]

static QRect PopupMenuLocation ( QWidget * widget,
const QSize & size )
static

◆ postToThread() [1/2]

static void postToThread ( QObject * target,
std::function< void()> && fun )
static

◆ postToThread() [2/2]

static void postToThread ( std::function< void()> && fun,
QThread * thread = nullptr )
static

◆ QTModule()

static Module QTModule ( )
static

◆ RequestExit()

static void RequestExit ( bool relaunch,
const PopupInfo & popup_origin = PopupInfo() )
static

◆ requestScreenOrientation()

static void requestScreenOrientation ( bool horizontal)
static

◆ RequestScreenResolution()

static void RequestScreenResolution ( const Vector< 2, uint04 > & size)
static

◆ ScaleFontSizeToFit()

static QSize ScaleFontSizeToFit ( QFont & font,
const QString & text,
const QRect & rect,
bool shrink = true,
bool grow = false )
static

◆ ScreenForWidget()

static QScreen * ScreenForWidget ( const QWidget * widget)
static

◆ ServiceQT()

static void ServiceQT ( )
static

◆ SetFontRecursive() [1/2]

static void SetFontRecursive ( QWidget * widget,
const Buffer< QFont > & font )
static

◆ SetFontRecursive() [2/2]

static void SetFontRecursive ( QWidget * widget,
const QFont & font )
static

◆ SetStyleRecursive()

static void SetStyleRecursive ( QWidget * widget,
QStyle * style )
static

◆ ShowDialog()

static bool ShowDialog ( QWidget * widget,
const PopupInfo & info,
const PopupInfo & end_location = PopupInfo() )
static

◆ ShowExperimentalFeatureDialog()

static void ShowExperimentalFeatureDialog ( const TranslatedString & feature)
static

◆ ShowMessageBox() [1/6]

static bool ShowMessageBox ( const GenericOption & options,
const String & image,
std::function< bool(GenericOption, PopupInfo info)> on_select,
const PopupInfo & popup_origin = PopupInfo() )
static

◆ ShowMessageBox() [2/6]

static bool ShowMessageBox ( const GenericOption & options,
std::function< bool(GenericOption, PopupInfo info)> on_select,
const PopupInfo & popup_origin = PopupInfo() )
static

◆ ShowMessageBox() [3/6]

static bool ShowMessageBox ( const TranslatedString & title,
const String & image,
const TranslatedString & text,
const Buffer< TranslatedString, uint04, ObjectAllocator< false > > & button_labels,
std::function< void(TranslatedString, PopupInfo info)> on_select = nullptr,
const PopupInfo & popup_origin = PopupInfo() )
static

◆ ShowMessageBox() [4/6]

static bool ShowMessageBox ( const TranslatedString & title,
const String & image,
const TranslatedString & text,
QMessageBox::StandardButtons buttons = { QMessageBox::StandardButton::Ok },
std::function< void(QMessageBox::StandardButton, PopupInfo info)> on_select = nullptr,
const PopupInfo & popup_origin = PopupInfo() )
static

◆ ShowMessageBox() [5/6]

static bool ShowMessageBox ( const TranslatedString & title,
const TranslatedString & text,
const Buffer< TranslatedString, uint04, ObjectAllocator< false > > & button_labels,
std::function< void(TranslatedString, PopupInfo info)> on_select = nullptr,
const PopupInfo & popup_origin = PopupInfo() )
static

◆ ShowMessageBox() [6/6]

static bool ShowMessageBox ( const TranslatedString & title,
const TranslatedString & text,
QMessageBox::StandardButtons buttons = { QMessageBox::StandardButton::Ok },
std::function< void(QMessageBox::StandardButton, PopupInfo info)> on_select = nullptr,
const PopupInfo & popup_origin = PopupInfo() )
static

Member Data Documentation

◆ is_horizontal

Resource<bool> is_horizontal
static

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