34#include <NDEVR/PopupInfo.h>
35#include <NDEVR/StringStream.h>
36#include <NDEVR/BaseValues.h>
37#include <NDEVR/Resource.h>
38#include <NDEVR/Translator.h>
39#include <NDEVR/Event.h>
40#if NDEVR_SUPPORTS_THREADING
44#include <QAbstractEventDispatcher>
75 static void postToThread(std::function<
void()>&& fun, QThread * thread =
nullptr);
76 static void postToThread(QObject* target, std::function<
void()>&& fun);
85 static QSize
ScaleFontSizeToFit(QFont& font,
const QString& text,
const QRect& rect,
bool shrink =
true,
bool grow =
false);
86 static void FitTextToRect(QString& text, QFont& font,
const QRectF& size,
bool allow_new_line =
true);
98 static QPixmap*
DrawAnimationWidget(QWidget* widget,
bool draw_background, QPixmap* pixmap =
nullptr, QSize size = QSize());
99 static QPixmap*
DrawFullWidget(QWidget* widget,
bool draw_background, QPixmap* pixmap =
nullptr, QSize size = QSize());
105 static void ClearLayout(QLayout* layout,
bool delete_objects =
false);
110 , QMessageBox::StandardButtons buttons = { QMessageBox::StandardButton::Ok }
111 , std::function<void(QMessageBox::StandardButton,
PopupInfo info)> on_select = nullptr
114 , QMessageBox::StandardButtons buttons = { QMessageBox::StandardButton::Ok }
115 , std::function<void(QMessageBox::StandardButton,
PopupInfo info)> on_select = nullptr
142 template<
typename EnumType>
145 const char* enumName = qt_getEnumName(enumValue);
146 const QMetaObject* metaObject = qt_getEnumMetaObject(enumValue);
149 const int enumIndex = metaObject->indexOfEnumerator(enumName);
150 return String(metaObject->className()) +
" : "+
String(enumName) +
" : "+
String(metaObject->enumerator(enumIndex).valueToKey(enumValue));
153 return String(enumName) +
" : "+
String(
static_cast<int>(enumValue));
164 bool m_has_been_posted;
165 bool m_safe_to_delete;
173 const
std::function<
void()> m_callback;
177 #define _tqa(var) (_t(var).translation().getAs<QString>())
178 #define _tqs(var) (String(_t(var)).getAs<QString>())
179 #define _tdq(var, def) (_td(var, def).translation().getAs<QString>())
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
A class which describes a user key press.
Definition Event.h:49
Definition MemoryManager.h:261
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
QTAbstractResourceListener(QObject *parent=nullptr)
void onValueChanged() override final
virtual ~QTAbstractResourceListener()
virtual void onChanged()=0
QTResourceListener(const std::function< void()> &callback, QObject *parent)
void onChanged() override final
virtual ~QTResourceListener()
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Definition Toggle.h:41
A class that can subscribe to any number of Resources which will get updates when the Resource(s) hav...
Definition ResourceListener.h:62
The core String class for the NDEVR API.
Definition String.h:69
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:230
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Definition BaseValues.hpp:71
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Information for how to display text data.
Definition Font.h:46
Stores a generic option of any type as well as some information about how the user might interact wit...
Definition GenericOptions.h:57
Base class for extensions, typically added as external DLL's that can modify or enhance the behavior ...
Definition ModuleManager.h:59