brown.interface.qt.converters

Helper methods for conversion between brown.utils and Qt classes

methods

unit_to_qt_int (unit) permalink view source

Create a Qt integer from a Unit

arguments:

unit (Unit): The source unit

returns:

int

unit_to_qt_float (unit) permalink view source

Create a Qt integer from a Unit

arguments:

unit (Unit): The source unit

returns:

float

qt_point_to_point (qt_point, unit=None) permalink view source

Create a Point from a QPoint or QPointF

arguments:

qt_point (QPoint or QPointF): The source point

unit (Unit): An optional unit to convert values to in the output Point. If omitted, values in the output Point will be plain int or float values.

returns:

point_to_qt_point (point) permalink view source

Create a QPoint from a Point

arguments:

point (Point): The source point

returns:

QPoint

point_to_qt_point_f (point) permalink view source

Create a QPointF from a Point

arguments:

point (Point): The source point

returns:

QPointF

qt_rect_to_rect (qt_rect, unit=None) permalink view source

Create a Rect from a QRect or QRectF

arguments:

qt_rect (QRect or QRectF): The source rect

unit (Unit): An optional unit to convert values to in the output Rect. If omitted, values in the output Rect will be plain int or float values.

returns:

rect_to_qt_rect (rect) permalink view source

Create a QRect from a Rect

arguments:

rect (Rect): The source rect

returns:

QRect

rect_to_qt_rect_f (rect) permalink view source

Create a QRectF from a Rect

arguments:

rect (Rect): The source rect

returns:

QRectF

color_to_q_color (color) permalink view source

Create a QColor from a Color

arguments:

color (Color): The source Color

returns:

QColor

q_color_to_color (q_color) permalink view source

Create a Color from a QColor

arguments:

q_color (QColor): The source QColor

returns: