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

#include <QTTools.h>

Collaboration diagram for QTTools:
[legend]

Static Public Member Functions

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

Static Public Attributes

static Resource< bool > is_horizontal
 

Detailed Description


class: QTTools

Manages static logic dealing with Qt and relating to the application

Author: Tyler Parke

Date: 2023-01-16

Member Function Documentation

◆ AutoWrapText()

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

◆ ClearLayout()

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

◆ ClearPallete()

void ClearPallete ( QWidget * widget)
static

◆ convert() [1/6]

QFont convert ( const Font & font)
static

◆ convert() [2/6]

RGBColor convert ( const QColor & color)
static

◆ convert() [3/6]

File convert ( const QFile & file)
static

◆ convert() [4/6]

Font convert ( const QFont & q_font)
static

◆ convert() [5/6]

QColor convert ( const RGBColor & color)
static

◆ convert() [6/6]

KeyEvent convert ( QKeyEvent * event)
static

◆ ConvertNativeKeyEvent()

KeyEvent::KEY ConvertNativeKeyEvent ( sint08 key)
static

◆ DefaultAnimationScale()

fltp08 DefaultAnimationScale ( )
static

◆ DefaultSurfaceFormat()

QSurfaceFormat DefaultSurfaceFormat ( )
static

◆ DevicePixelRatio()

qreal DevicePixelRatio ( QWindow * window = nullptr)
static

◆ DPI()

fltp08 DPI ( )
static

◆ DrawAnimationWidget()

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

◆ DrawFullWidget()

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()

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

◆ ForceSizeCalculation()

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

◆ FormatPallete()

void FormatPallete ( bool error,
QWidget * widget )
static

◆ GetFontRecursive()

Buffer< QFont > GetFontRecursive ( QWidget * widget)
static

◆ HideDialog()

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

◆ IsVisibleToUser()

bool IsVisibleToUser ( QWidget * widget)
static

◆ IsWidgetVisibleOnScreen()

bool IsWidgetVisibleOnScreen ( QWidget * widget)
static

◆ log()

ProgressInfo * log ( )
static

◆ MultiplyFontSize()

void MultiplyFontSize ( QFont & font,
fltp08 multiplier )
static

◆ PixelSize()

fltp08 PixelSize ( const QFont & font)
static

◆ PointSize()

fltp08 PointSize ( const QFont & font)
static

◆ PopupMenuLocation() [1/2]

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

◆ PopupMenuLocation() [2/2]

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

◆ postToThread() [1/2]

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

◆ postToThread() [2/2]

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

◆ QTModule()

Module QTModule ( )
static

◆ RequestExit()

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

◆ requestScreenOrientation()

void requestScreenOrientation ( bool horizontal)
static

◆ RequestScreenResolution()

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

◆ ScaleFontSizeToFit()

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

◆ ScreenForWidget()

QScreen * ScreenForWidget ( const QWidget * widget)
static

◆ ServiceQT()

void ServiceQT ( )
static

◆ SetFontRecursive() [1/2]

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

◆ SetFontRecursive() [2/2]

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

◆ SetStyleRecursive()

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

◆ ShowDialog()

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

◆ ShowExperimentalFeatureDialog()

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 files: