MeVisLab Scripting Reference
MLABGraphicsFrame Class Reference

#include <mlabGraphicsFrame.h>

Inherits QGraphicsWidget.

Public Slots

Scripting


void setFramePixmap (const QPixmap &pixmap, const QMargins &margins)
 
void setFillGradient (const QGradient &gradient)
 
void setFillVerticalLinearGradient (const QColor &startColor, const QColor &endColor)
 
void setFillHorizontalLinearGradient (const QColor &startColor, const QColor &endColor)
 
void setFillColor (const QColor &color)
 
void setBorderPen (const QPen &pen)
 
void setBorderPen (const QColor &color, float width)
 
void setRoundedBorder (qreal xRadius, qreal yRadius)
 
void setContentsMargins (qreal left, qreal top, qreal right, qreal bottom)
 

Detailed Description

Frame graphics view item draws a background frame around/below a given child item.

Member Function Documentation

◆ setBorderPen [1/2]

void MLABGraphicsFrame::setBorderPen ( const QColor & color,
float width )
slot

set the pen to use for drawing the border of the frame

◆ setBorderPen [2/2]

void MLABGraphicsFrame::setBorderPen ( const QPen & pen)
slot

set the pen to use for drawing the border of the frame

◆ setContentsMargins

void MLABGraphicsFrame::setContentsMargins ( qreal left,
qreal top,
qreal right,
qreal bottom )
slot

sets the margins for the content widget, the default is 11 pixels in all directions.

◆ setFillColor

void MLABGraphicsFrame::setFillColor ( const QColor & color)
slot

sets the fill color

◆ setFillGradient

void MLABGraphicsFrame::setFillGradient ( const QGradient & gradient)
slot

sets the frame fill gradient that should be drawn

Example for creating a linear vertical gradient using PythonQt:

gradient = QtGui.QLinearGradient(0,0,0,1)
gradient.setCoordinateMode(gradient.ObjectBoundingMode)
gradient.setColorAt(0, QtGui.QColor(128,0,0,128))
gradient.setColorAt(1, QtGui.QColor(255,128,128,128))
item.setFillGradient(gradient)

◆ setFillHorizontalLinearGradient

void MLABGraphicsFrame::setFillHorizontalLinearGradient ( const QColor & startColor,
const QColor & endColor )
slot

sets the frame fill gradient as a horizontal linear gradient with start and end color

◆ setFillVerticalLinearGradient

void MLABGraphicsFrame::setFillVerticalLinearGradient ( const QColor & startColor,
const QColor & endColor )
slot

sets the frame fill gradient as a vertical linear gradient with start and end color

◆ setFramePixmap

void MLABGraphicsFrame::setFramePixmap ( const QPixmap & pixmap,
const QMargins & margins )
slot

draws the given pixmap as streched frame, using qDrawBorderPixmap with 9 segments defined by given margins

◆ setRoundedBorder

void MLABGraphicsFrame::setRoundedBorder ( qreal xRadius,
qreal yRadius )
slot

sets to draw a rounded border (using absolute pixel radii), default is to not draw rounded corners