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>
68 typedef AlocatingAlignedBuffer<TranslatedString, 64> TranslatedStringBuffer;
80 static void PostToThread(std::function<
void()>&& fun, QThread * thread =
nullptr);
86 static void PostToThread(QObject* target, std::function<
void()>&& fun);
142 static QSize
ScaleFontSizeToFit(QFont& font,
const QString& text,
const QRect& rect,
bool shrink =
true,
bool grow =
false);
150 static void FitTextToRect(QString& text, QFont& font,
const QRectF& size,
bool allow_new_line =
true);
235 static QPixmap*
DrawAnimationWidget(QWidget* widget,
bool draw_background, QPixmap* pixmap =
nullptr, QSize size = QSize());
244 static QPixmap*
DrawFullWidget(QWidget* widget,
bool draw_background, QPixmap* pixmap =
nullptr, QSize size = QSize());
282 static void ClearLayout(QLayout* layout,
bool delete_objects =
false);
320 , QMessageBox::StandardButtons buttons = { QMessageBox::StandardButton::Ok }
321 , std::function<void(QMessageBox::StandardButton,
PopupInfo info)> on_select = nullptr
334 , QMessageBox::StandardButtons buttons = { QMessageBox::StandardButton::Ok }
335 , std::function<void(QMessageBox::StandardButton,
PopupInfo info)> on_select = nullptr
347 ,
const TranslatedStringBuffer& button_labels
361 ,
const TranslatedStringBuffer& button_labels
438 template<
typename EnumType>
441 const char* enumName = qt_getEnumName(enumValue);
442 const QMetaObject* metaObject = qt_getEnumMetaObject(enumValue);
445 const int enumIndex = metaObject->indexOfEnumerator(enumName);
446 return String(metaObject->className()) +
" : "+
String(enumName) +
" : "+
String(metaObject->enumerator(enumIndex).valueToKey(enumValue));
449 return String(enumName) +
" : "+
String(
static_cast<int>(enumValue));
485 bool m_has_been_posted;
486 bool m_safe_to_delete;
507 const
std::function<
void()> m_callback;
510 template class NDEVR_WIDGETS_API
StringStream<QByteArray>;
511 #define _tqa(var) (_t(var).translation().getAs<QString>())
512 #define _tqs(var) (String(_t(var)).getAs<QString>())
513 #define _tdq(var, def) (_td(var, def).translation().getAs<QString>())
The equivelent of std::vector but with a bit more control.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Information for how to display text data.
A container for Images managed by the ImageFactory.
Describes a user key press event used to trigger behavior in the NDEVR API.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
QTAbstractResourceListener(QObject *parent=nullptr)
Constructs a resource listener tied to a Qt parent object for automatic lifetime management.
void onValueChanged() override final
Called when a subscribed resource value has changed.
virtual void onChanged()=0
Called on the main UI thread when the listened resource changes.
bool isSafeToDelete()
Returns whether it is safe to delete this listener (i.e., not in the middle of a callback).
bool hasBeenPosted()
Returns whether a change notification has been posted but not yet executed.
QTResourceListener(const std::function< void()> &callback, QObject *parent)
Constructs a resource listener that invokes the given callback on the UI thread.
void onChanged() override final
Invokes the stored callback on the main UI thread.
Represents a color in the RGB space with optional alpha transparency.
ResourceListener()
Constructs a default ResourceListener.
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
The UI ribbon is a horizontal menu bar typically located at the top of the application interface or a...
Logic for reading or writing to a string or a user friendly, TranslatedString.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Stores a generic option of any type as well as some information about how the user might interact wit...
Base class for extensions, typically added as external DLL's that can modify or enhance the behavior ...