Inviwo  0.9.10.1
Inviwo documentation
inviwo::utilqt Namespace Reference

Classes

class  EditorFileObserver
 

Functions

IVW_QTEDITOR_API QImage generatePreview (const QString &classIdentifier)
 
IVW_QTEDITOR_API QImage generateProcessorPreview (const QString &classIdentifier, double opacity=1.0)
 
IVW_QTEDITOR_API QImage generateProcessorPreview (Processor *processor, double opacity=1.0)
 
IVW_QTEDITOR_API void saveProcessorPreviews (InviwoApplication *app, std::string &path)
 
IVW_MODULE_QTWIDGETS_API MouseButtons getMouseButtons (const QMouseEvent *e)
 Convert the button state when the event was generated to an inviwo button. More...
 
IVW_MODULE_QTWIDGETS_API MouseButton getMouseButtonCausingEvent (const QMouseEvent *e)
 Convert the button originally causing the event to an inviwo button. More...
 
IVW_MODULE_QTWIDGETS_API MouseButtons getMouseWheelButtons (const QWheelEvent *e)
 
IVW_MODULE_QTWIDGETS_API KeyModifiers getModifiers (const QInputEvent *e)
 
IVW_MODULE_QTWIDGETS_API GestureState getGestureState (const QGesture *e)
 
IVW_MODULE_QTWIDGETS_API IvwKey getKeyButton (const QKeyEvent *e)
 
IVW_MODULE_QTWIDGETS_API std::locale getCurrentStdLocale ()
 getCurrentStdLocale This function returns the current system locale provided by Qt. If the Qt application has not been initialized, the returned value is the environment's default locale. More...
 
IVW_MODULE_QTWIDGETS_API std::ios_base & localizeStream (std::ios_base &stream)
 localize The given stream is imbued with the currently set system locale provided by Qt. More...
 
IVW_MODULE_QTWIDGETS_API QString toLocalQString (const std::string &)
 convert a std::string to a localized QString using the currently set system locale
 
IVW_MODULE_QTWIDGETS_API std::string fromLocalQString (const QString &input)
 convert a QString to a localized 8bit std::string
 
IVW_MODULE_QTWIDGETS_API QString toQString (const std::string &)
 create a QString from a UTF8-encoded std::string
 
IVW_MODULE_QTWIDGETS_API std::string fromQString (const QString &input)
 create a UTF8-encoded std::string from a QString
 
IVW_MODULE_QTWIDGETS_API dvec2 toGLM (QPointF)
 
IVW_MODULE_QTWIDGETS_API ivec2 toGLM (QPoint)
 
IVW_MODULE_QTWIDGETS_API QPointF toQPoint (dvec2)
 
IVW_MODULE_QTWIDGETS_API QPoint toQPoint (ivec2)
 
IVW_MODULE_QTWIDGETS_API dvec2 toGLM (QSizeF)
 
IVW_MODULE_QTWIDGETS_API ivec2 toGLM (QSize)
 
IVW_MODULE_QTWIDGETS_API QSizeF toQSize (dvec2)
 
IVW_MODULE_QTWIDGETS_API QSize toQSize (ivec2)
 
IVW_MODULE_QTWIDGETS_API vec3 tovec3 (const QColor &)
 
IVW_MODULE_QTWIDGETS_API ivec3 toivec3 (const QColor &)
 
IVW_MODULE_QTWIDGETS_API vec4 tovec4 (const QColor &)
 
IVW_MODULE_QTWIDGETS_API ivec4 toivec4 (const QColor &)
 
IVW_MODULE_QTWIDGETS_API QColor toQColor (const vec3 &)
 
IVW_MODULE_QTWIDGETS_API QColor toQColor (const ivec3 &)
 
IVW_MODULE_QTWIDGETS_API QColor toQColor (const uvec3 &)
 
IVW_MODULE_QTWIDGETS_API QColor toQColor (const vec4 &)
 
IVW_MODULE_QTWIDGETS_API QColor toQColor (const ivec4 &)
 
IVW_MODULE_QTWIDGETS_API QColor toQColor (const uvec4 &)
 
IVW_MODULE_QTWIDGETS_API QPixmap toQPixmap (const TransferFunction &tf, const QSize &size)
 
IVW_MODULE_QTWIDGETS_API QPixmap toQPixmap (const TransferFunctionProperty &tfproperty, const QSize &size)
 
IVW_MODULE_QTWIDGETS_API QPixmap toQPixmap (const IsoValueProperty &property, const QSize &size)
 
IVW_MODULE_QTWIDGETS_API QPixmap toQPixmap (const util::TFPropertyConcept &propertyConcept, const QSize &size)
 
IVW_MODULE_QTWIDGETS_API QMainWindow * getApplicationMainWindow ()
 Retrieve the QMainWindow named "InviwoMainWindow" from QApplication. More...
 
IVW_MODULE_QTWIDGETS_API QPoint movePointOntoDesktop (const QPoint &point, const QSize &size, bool decorationOffset=true)
 Moves point to become relative to the main window and thereby visible. More...
 
IVW_MODULE_QTWIDGETS_API QPoint offsetWidget ()
 Offset widgets based on order added such that they do not end up on top of each other. Base offset of (350, 100). The offset will be increased by (40, 40) every time the function is called. Furthermore, the horizontal offset will be increased by 200 every tenth time. More...
 
IVW_MODULE_QTWIDGETS_API QMenu * addMenu (std::string menuName, std::string before)
 
IVW_MODULE_QTWIDGETS_API QMenu * addMenu (std::string menuName, QMenu *before=nullptr)
 
IVW_MODULE_QTWIDGETS_API QMenu * getMenu (std::string menuName, bool createIfNotFound=false)
 
IVW_MODULE_QTWIDGETS_API QImage layerToQImage (const Layer &layer)
 
IVW_MODULE_QTWIDGETS_API std::string toBase64 (const QImage &image, const std::string &format="PNG", int quality=-1)
 
IVW_MODULE_QTWIDGETS_API std::vector< std::pair< std::string, QImage > > getCanvasImages (ProcessorNetwork *network, bool alpha=true)
 
IVW_MODULE_QTWIDGETS_API void addImageActions (QMenu &menu, const Image &image, LayerType visibleLayer=LayerType::Color, size_t visibleIndex=10000)
 
IVW_MODULE_QTWIDGETS_API QString windowTitleHelper (const QString &title, const QWidget *widget)
 
constexpr int refEm ()
 
constexpr double refSpaceEm ()
 
IVW_MODULE_QTWIDGETS_API int refSpacePx (const QWidget *w)
 
IVW_MODULE_QTWIDGETS_API QSize emToPx (const QWidget *w, QSizeF)
 
IVW_MODULE_QTWIDGETS_API int emToPx (const QWidget *w, double em)
 
IVW_MODULE_QTWIDGETS_API int emToPx (const QFontMetrics &m, double em)
 

Detailed Description

utilqt

Function Documentation

◆ generatePreview()

QImage inviwo::utilqt::generatePreview ( const QString &  classIdentifier)

Generate an image of a processor including port connections and port names

◆ generateProcessorPreview()

QImage inviwo::utilqt::generateProcessorPreview ( const QString &  classIdentifier,
double  opacity = 1.0 
)

Generate an image of a processor

Parameters
classIdentifierclass Identifier of the processor to generate the preview for.
opacityif opacity is less than one, the output image will be semitransparent, range [0,1]

◆ getApplicationMainWindow()

QMainWindow * inviwo::utilqt::getApplicationMainWindow ( )

Retrieve the QMainWindow named "InviwoMainWindow" from QApplication.

Returns
The main window if the application contains the widget, otherwise null.

◆ getCurrentStdLocale()

std::locale inviwo::utilqt::getCurrentStdLocale ( )

getCurrentStdLocale This function returns the current system locale provided by Qt. If the Qt application has not been initialized, the returned value is the environment's default locale.

Returns
std::locale Qt locale converted to std::locale

◆ getMouseButtonCausingEvent()

MouseButton inviwo::utilqt::getMouseButtonCausingEvent ( const QMouseEvent *  e)

Convert the button originally causing the event to an inviwo button.

Converts QMouseEvent::getButton().

Note
Qt does not include the button that caused a release event in the regular QMouseEvent::getButtons function, which is why a separate conversion function is necessary
Parameters
ethe QT Mouse Event
Returns
MouseEvent::MouseButton

◆ getMouseButtons()

MouseButtons inviwo::utilqt::getMouseButtons ( const QMouseEvent *  e)

Convert the button state when the event was generated to an inviwo button.

Converts QMouseEvent::getButtons().

◆ localizeStream()

std::ios_base & inviwo::utilqt::localizeStream ( std::ios_base &  stream)

localize The given stream is imbued with the currently set system locale provided by Qt.

Parameters
streamthe locale is imbued onto this stream
Returns
std::ios_base& reference to the input stream

◆ movePointOntoDesktop()

QPoint inviwo::utilqt::movePointOntoDesktop ( const QPoint &  point,
const QSize &  size,
bool  decorationOffset = true 
)

Moves point to become relative to the main window and thereby visible.

Positions saved for one screen setup may end up outside on other setups. Apply this function to make sure that the widget ends up visible on the screen.

See also
CanvasProcessorWidgetQt
Parameters
pointThe previous screen position of the widget
sizeThe size of the widget
decorationOffsetOffset widget below top horizontal window bar
Returns
The adapted point on the screen, same as input point if no adjustment was necessary

◆ offsetWidget()

QPoint inviwo::utilqt::offsetWidget ( )

Offset widgets based on order added such that they do not end up on top of each other. Base offset of (350, 100). The offset will be increased by (40, 40) every time the function is called. Furthermore, the horizontal offset will be increased by 200 every tenth time.

Returns