MIRA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
mira::QtUtils Namespace Reference

Functions

MIRA_GUI_WIDGETS_EXPORT QImage toQImage (const Img<> &img, double s_min, double s_max)
 Convert an image to QImage. More...
 
MIRA_GUI_WIDGETS_EXPORT void fromQImage (const QImage &qimage, Img<> &oImg)
 Convert a QImage to an image. More...
 
MIRA_GUI_WIDGETS_EXPORT void setTransform (QGraphicsItem *item, const RigidTransform2f &t)
 Applies a transform (translation and rotation) to a graphics scene item. More...
 
MIRA_GUI_WIDGETS_EXPORT QString getOpenFileName (QWidget *parent=NULL, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=NULL, QFileDialog::Options options=QFileDialog::DontUseNativeDialog)
 Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences. More...
 
MIRA_GUI_WIDGETS_EXPORT QString getSaveFileName (QWidget *parent=NULL, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=NULL, QFileDialog::Options options=QFileDialog::DontUseNativeDialog, const QStringList &enforceExtension=QStringList())
 Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences. More...
 
MIRA_GUI_WIDGETS_EXPORT QString getExistingDirectory (QWidget *parent=NULL, const QString &caption=QString(), const QString &dir=QString(), QFileDialog::Options options=QFileDialog::DontUseNativeDialog|QFileDialog::ShowDirsOnly)
 Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences. More...
 
MIRA_GUI_WIDGETS_EXPORT void initPainterFrom (QPainter &painter, const QWidget &widget)
 Init painter's pen, background and font from widget. More...
 

Function Documentation

MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::toQImage ( const Img<> &  img,
double  s_min,
double  s_max 
)

Convert an image to QImage.

Min and max are used for scaling in images with > 8bit color values.

MIRA_GUI_WIDGETS_EXPORT void mira::QtUtils::fromQImage ( const QImage &  qimage,
Img<> &  oImg 
)

Convert a QImage to an image.

MIRA_GUI_WIDGETS_EXPORT void mira::QtUtils::setTransform ( QGraphicsItem *  item,
const RigidTransform2f &  t 
)

Applies a transform (translation and rotation) to a graphics scene item.

Examples:
tutorials/Point2Visualization.C.
MIRA_GUI_WIDGETS_EXPORT QString mira::QtUtils::getOpenFileName ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  dir = QString(),
const QString &  filter = QString(),
QString *  selectedFilter = NULL,
QFileDialog::Options  options = QFileDialog::DontUseNativeDialog 
)

Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences.

MIRA_GUI_WIDGETS_EXPORT QString mira::QtUtils::getSaveFileName ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  dir = QString(),
const QString &  filter = QString(),
QString *  selectedFilter = NULL,
QFileDialog::Options  options = QFileDialog::DontUseNativeDialog,
const QStringList &  enforceExtension = QStringList() 
)

Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences.

Parameters
[in]enforceExtensionIf a non-empty list is provided as argument, the method will make sure one of these extensions is selected, replacing the extension entered by the user with the first element in the list if necessary.
MIRA_GUI_WIDGETS_EXPORT QString mira::QtUtils::getExistingDirectory ( QWidget *  parent = NULL,
const QString &  caption = QString(),
const QString &  dir = QString(),
QFileDialog::Options  options = QFileDialog::DontUseNativeDialog|QFileDialog::ShowDirsOnly 
)

Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences.

MIRA_GUI_WIDGETS_EXPORT void mira::QtUtils::initPainterFrom ( QPainter &  painter,
const QWidget &  widget 
)

Init painter's pen, background and font from widget.

Replaces QPainter::initFrom(QPaintDevice*) deprecated in Qt5.15.