PythonQt.Qt.QStylePainter
QStylePainter
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
QStylePainter extends QPainter with
a set of high-level draw...() functions implemented on top of
QStyle's API. The advantage of using
QStylePainter is that the parameter lists get considerably shorter. Whereas a
QStyle object must be able to draw on
any widget using any painter (because the application normally has one
QStyle object shared by all widget), a
QStylePainter is initialized with a widget, eliminating the need to specify the
QWidget, the
QPainter, and the
QStyle for every function call.
Example using QStyle directly:
void MyWidget::paintEvent(QPaintEvent * /* event */)
{
QPainter painter(this);
QStyleOptionFocusRect option;
option.initFrom(this);
option.backgroundColor = palette().color(QPalette::Background);
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this);
}
Example using QStylePainter:
void MyWidget::paintEvent(QPaintEvent * /* event */)
{
QStylePainter painter(this);
QStyleOptionFocusRect option;
option.initFrom(this);
option.backgroundColor = palette().color(QPalette::Background);
painter.drawPrimitive(QStyle::PE_FrameFocusRect, option);
}
Source: https://doc.qt.io/archives/qt-5.15/qstylepainter.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
Antialiasing |
attribute | Any |
(shared captured text) |
CompositionMode |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
CompositionMode_Clear |
attribute | Any |
(shared captured text) |
CompositionMode_ColorBurn |
attribute | Any |
(shared captured text) |
CompositionMode_ColorDodge |
attribute | Any |
(shared captured text) |
CompositionMode_Darken |
attribute | Any |
(shared captured text) |
CompositionMode_Destination |
attribute | Any |
(shared captured text) |
CompositionMode_DestinationAtop |
attribute | Any |
(shared captured text) |
CompositionMode_DestinationIn |
attribute | Any |
(shared captured text) |
CompositionMode_DestinationOut |
attribute | Any |
(shared captured text) |
CompositionMode_DestinationOver |
attribute | Any |
(shared captured text) |
CompositionMode_Difference |
attribute | Any |
(shared captured text) |
CompositionMode_Exclusion |
attribute | Any |
(shared captured text) |
CompositionMode_HardLight |
attribute | Any |
(shared captured text) |
CompositionMode_Lighten |
attribute | Any |
(shared captured text) |
CompositionMode_Multiply |
attribute | Any |
(shared captured text) |
CompositionMode_Overlay |
attribute | Any |
(shared captured text) |
CompositionMode_Plus |
attribute | Any |
(shared captured text) |
CompositionMode_Screen |
attribute | Any |
(shared captured text) |
CompositionMode_SoftLight |
attribute | Any |
(shared captured text) |
CompositionMode_Source |
attribute | Any |
(shared captured text) |
CompositionMode_SourceAtop |
attribute | Any |
(shared captured text) |
CompositionMode_SourceIn |
attribute | Any |
(shared captured text) |
CompositionMode_SourceOut |
attribute | Any |
(shared captured text) |
CompositionMode_SourceOver |
attribute | Any |
(shared captured text) |
CompositionMode_Xor |
attribute | Any |
(shared captured text) |
HighQualityAntialiasing |
attribute | Any |
(shared captured text) |
NonCosmeticDefaultPen |
attribute | Any |
(shared captured text) |
OpaqueHint |
attribute | Any |
(shared captured text) |
PixmapFragmentHint |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
PixmapFragmentHints |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
Qt4CompatiblePainting |
attribute | Any |
(shared captured text) |
RasterOp_ClearDestination |
attribute | Any |
(shared captured text) |
RasterOp_NotDestination |
attribute | Any |
(shared captured text) |
RasterOp_NotSource |
attribute | Any |
(shared captured text) |
RasterOp_NotSourceAndDestination |
attribute | Any |
(shared captured text) |
RasterOp_NotSourceAndNotDestination |
attribute | Any |
(shared captured text) |
RasterOp_NotSourceOrDestination |
attribute | Any |
(shared captured text) |
RasterOp_NotSourceOrNotDestination |
attribute | Any |
(shared captured text) |
RasterOp_NotSourceXorDestination |
attribute | Any |
(shared captured text) |
RasterOp_SetDestination |
attribute | Any |
(shared captured text) |
RasterOp_SourceAndDestination |
attribute | Any |
(shared captured text) |
RasterOp_SourceAndNotDestination |
attribute | Any |
(shared captured text) |
RasterOp_SourceOrDestination |
attribute | Any |
(shared captured text) |
RasterOp_SourceOrNotDestination |
attribute | Any |
(shared captured text) |
RasterOp_SourceXorDestination |
attribute | Any |
(shared captured text) |
RenderHint |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
RenderHints |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
SmoothPixmapTransform |
attribute | Any |
(shared captured text) |
TextAntialiasing |
attribute | Any |
(shared captured text) |
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
background |
function | (self) -> Any |
X.background() -> PythonQt.QtGui.QBrush (shared captured text) |
backgroundMode |
function | (self) -> Any |
(shared captured text) |
begin |
function | (self, pd: Any, w: Any) -> bool |
X.begin(pd, w) -> bool (shared captured text) |
beginNativePainting |
function | (self) -> Any |
(shared captured text) |
boundingRect |
function | (self, x: Any, y: Any, w: Any, h: Any, arg4: flags, text: Any) -> Any |
X.boundingRect(x, y, w, h, flags, text) -> PythonQt.QtCore.QRect (shared captured text) |
brush |
function | (self) -> Any |
X.brush() -> PythonQt.QtGui.QBrush (shared captured text) |
brushOrigin |
function | (self) -> Any |
X.brushOrigin() -> PythonQt.QtCore.QPoint (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
clipBoundingRect |
function | (self) -> Any |
X.clipBoundingRect() -> PythonQt.QtCore.QRectF (shared captured text) |
clipPath |
function | (self) -> Any |
X.clipPath() -> PythonQt.QtGui.QPainterPath (shared captured text) |
clipRegion |
function | (self) -> Any |
X.clipRegion() -> PythonQt.QtGui.QRegion (shared captured text) |
combinedMatrix |
function | (self) -> Any |
X.combinedMatrix() -> PythonQt.QtGui.QMatrix (shared captured text) |
combinedTransform |
function | (self) -> Any |
X.combinedTransform() -> PythonQt.QtGui.QTransform (shared captured text) |
compositionMode |
function | (self) -> Any |
(shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
device |
function | (self) -> Any |
X.device() -> PythonQt.QtGui.QPaintDevice (shared captured text) |
deviceMatrix |
function | (self) -> Any |
X.deviceMatrix() -> PythonQt.QtGui.QMatrix (shared captured text) |
deviceTransform |
function | (self) -> Any |
X.deviceTransform() -> PythonQt.QtGui.QTransform (shared captured text) |
drawArc |
function | (self, x: Any, y: Any, w: Any, h: Any, a: Any, alen: Any) -> Any |
X.drawArc(x, y, w, h, a, alen) (shared captured text) |
drawChord |
function | (self, x: Any, y: Any, w: Any, h: Any, a: Any, alen: Any) -> Any |
X.drawChord(x, y, w, h, a, alen) (shared captured text) |
drawComplexControl |
function | (self, cc: Any, opt: Any) -> None |
X.drawComplexControl(cc, opt) (shared captured text) |
drawControl |
function | (self, ce: Any, opt: Any) -> None |
X.drawControl(ce, opt) (shared captured text) |
drawConvexPolygon |
function | (self, polygon: Any) -> Any |
(shared captured text) |
drawEllipse |
function | (self, x: Any, y: Any, w: Any, h: Any) -> Any |
X.drawEllipse(x, y, w, h) (shared captured text) |
drawGlyphRun |
function | (self, position: Any, glyphRun: Any) -> Any |
X.drawGlyphRun(position, glyphRun) (shared captured text) |
drawImage |
function | (self, x: Any, y: Any, image: Any, sx: Any, sy: Any, sw: Any, sh: Any, arg7: flags) -> Any |
X.drawImage(x, y, image, sx, sy, sw, sh, flags) (shared captured text) |
drawItemPixmap |
function | (self, r: Any, arg1: flags, pixmap: Any) -> None |
X.drawItemPixmap(r, flags, pixmap) (shared captured text) |
drawItemText |
function | (self, r: Any, arg1: flags, pal: Any, enabled: bool, text: str, textRole: Any) -> None |
X.drawItemText(r, flags, pal, enabled, text, textRole) (shared captured text) |
drawLine |
function | (self, x1: Any, y1: Any, x2: Any, y2: Any) -> Any |
X.drawLine(x1, y1, x2, y2) (shared captured text) |
drawLines |
function | (self, lines: Any) -> Any |
(shared captured text) |
drawPath |
function | (self, path: Any) -> Any |
(shared captured text) |
drawPicture |
function | (self, x: Any, y: Any, picture: Any) -> Any |
X.drawPicture(x, y, picture) (shared captured text) |
drawPie |
function | (self, x: Any, y: Any, w: Any, h: Any, a: Any, alen: Any) -> Any |
X.drawPie(x, y, w, h, a, alen) (shared captured text) |
drawPixmap |
function | (self, x: Any, y: Any, w: Any, h: Any, pm: Any, sx: Any, sy: Any, sw: Any, sh: Any) -> Any |
X.drawPixmap(x, y, w, h, pm, sx, sy, sw, sh) (shared captured text) |
drawPixmapFragments |
function | (self, fragments: Any, fragmentCount: Any, pixmap: Any, hints: Any) -> Any |
X.drawPixmapFragments(fragments, fragmentCount, pixmap, hints) (shared captured text) |
drawPoint |
function | (self, x: Any, y: Any) -> Any |
X.drawPoint(x, y) (shared captured text) |
drawPoints |
function | (self, points: Any) -> Any |
(shared captured text) |
drawPolygon |
function | (self, polygon: Any, fillRule: Any) -> Any |
X.drawPolygon(polygon, fillRule) (shared captured text) |
drawPolyline |
function | (self, polygon: Any) -> Any |
(shared captured text) |
drawPrimitive |
function | (self, pe: Any, opt: Any) -> None |
X.drawPrimitive(pe, opt) (shared captured text) |
drawRect |
function | (self, x1: Any, y1: Any, w: Any, h: Any) -> Any |
X.drawRect(x1, y1, w, h) (shared captured text) |
drawRects |
function | (self, rectangles: Any) -> Any |
(shared captured text) |
drawRoundRect |
function | (self, x: Any, y: Any, w: Any, h: Any, arg__5: Any, arg__6: Any) -> Any |
X.drawRoundRect(x, y, w, h, arg__5, arg__6) (shared captured text) |
drawRoundedRect |
function | (self, x: Any, y: Any, w: Any, h: Any, xRadius: Any, yRadius: Any, mode: Any) -> Any |
X.drawRoundedRect(x, y, w, h, xRadius, yRadius, mode) (shared captured text) |
drawStaticText |
function | (self, left: Any, top: Any, staticText: Any) -> Any |
X.drawStaticText(left, top, staticText) (shared captured text) |
drawText |
function | (self, x: Any, y: Any, w: Any, h: Any, arg4: flags, text: Any, br: Any) -> Any |
X.drawText(x, y, w, h, flags, text, br) (shared captured text) |
drawTextItem |
function | (self, x: Any, y: Any, ti: Any) -> Any |
X.drawTextItem(x, y, ti) (shared captured text) |
drawTiledPixmap |
function | (self, x: Any, y: Any, w: Any, h: Any, arg__5: Any, sx: Any, sy: Any) -> Any |
X.drawTiledPixmap(x, y, w, h, arg__5, sx, sy) (shared captured text) |
end |
function | (self) -> bool |
X.end() -> bool (shared captured text) |
endNativePainting |
function | (self) -> Any |
(shared captured text) |
eraseRect |
function | (self, x: Any, y: Any, w: Any, h: Any) -> Any |
X.eraseRect(x, y, w, h) (shared captured text) |
fillPath |
function | (self, path: Any, brush: Any) -> Any |
X.fillPath(path, brush) (shared captured text) |
fillRect |
function | (self, x: Any, y: Any, w: Any, h: Any, style: Any) -> Any |
X.fillRect(x, y, w, h, style) (shared captured text) |
font |
function | (self) -> Any |
X.font() -> PythonQt.QtGui.QFont (shared captured text) |
fontInfo |
function | (self) -> Any |
X.fontInfo() -> PythonQt.QtGui.QFontInfo (shared captured text) |
fontMetrics |
function | (self) -> Any |
X.fontMetrics() -> PythonQt.QtGui.QFontMetrics (shared captured text) |
hasClipping |
function | (self) -> bool |
X.hasClipping() -> bool (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
initFrom |
function | (self, device: Any) -> Any |
(shared captured text) |
isActive |
function | (self) -> bool |
X.isActive() -> bool (shared captured text) |
layoutDirection |
function | (self) -> Any |
(shared captured text) |
opacity |
function | (self) -> float |
X.opacity() -> float (shared captured text) |
paintEngine |
function | (self) -> Any |
X.paintEngine() -> PythonQt.QtGui.QPaintEngine (shared captured text) |
pen |
function | (self) -> Any |
X.pen() -> PythonQt.QtGui.QPen (shared captured text) |
redirected |
function | (self, device: Any, offset: Any) -> Any |
X.redirected(device, offset) -> PythonQt.QtGui.QPaintDevice (shared captured text) |
renderHints |
function | (self) -> Any |
(shared captured text) |
resetMatrix |
function | (self) -> Any |
(shared captured text) |
resetTransform |
function | (self) -> Any |
(shared captured text) |
restore |
function | (self) -> Any |
(shared captured text) |
restoreRedirected |
function | (self, device: Any) -> Any |
(shared captured text) |
rotate |
function | (self, a: Any) -> Any |
(shared captured text) |
save |
function | (self) -> Any |
(shared captured text) |
scale |
function | (self, sx: Any, sy: Any) -> Any |
X.scale(sx, sy) (shared captured text) |
setBackground |
function | (self, bg: Any) -> Any |
(shared captured text) |
setBackgroundMode |
function | (self, mode: Any) -> Any |
(shared captured text) |
setBrush |
function | (self, brush: Any) -> Any |
(shared captured text) |
setBrushOrigin |
function | (self, x: Any, y: Any) -> Any |
X.setBrushOrigin(x, y) (shared captured text) |
setClipPath |
function | (self, path: Any, op: Any) -> Any |
X.setClipPath(path, op) (shared captured text) |
setClipRect |
function | (self, x: Any, y: Any, w: Any, h: Any, op: Any) -> Any |
X.setClipRect(x, y, w, h, op) (shared captured text) |
setClipRegion |
function | (self, arg__1: Any, op: Any) -> Any |
X.setClipRegion(arg__1, op) (shared captured text) |
setClipping |
function | (self, enable: Any) -> Any |
(shared captured text) |
setCompositionMode |
function | (self, mode: Any) -> Any |
(shared captured text) |
setFont |
function | (self, f: Any) -> Any |
(shared captured text) |
setLayoutDirection |
function | (self, direction: Any) -> Any |
(shared captured text) |
setOpacity |
function | (self, opacity: Any) -> Any |
(shared captured text) |
setPen |
function | (self, style: Any) -> Any |
(shared captured text) |
setRedirected |
function | (self, device: Any, replacement: Any, offset: Any) -> Any |
X.setRedirected(device, replacement, offset) (shared captured text) |
setRenderHint |
function | (self, hint: Any, on: Any) -> Any |
X.setRenderHint(hint, on) (shared captured text) |
setRenderHints |
function | (self, hints: Any, on: Any) -> Any |
X.setRenderHints(hints, on) (shared captured text) |
setTransform |
function | (self, transform: Any, combine: Any) -> Any |
X.setTransform(transform, combine) (shared captured text) |
setViewTransformEnabled |
function | (self, enable: Any) -> Any |
(shared captured text) |
setViewport |
function | (self, x: Any, y: Any, w: Any, h: Any) -> Any |
X.setViewport(x, y, w, h) (shared captured text) |
setWindow |
function | (self, x: Any, y: Any, w: Any, h: Any) -> Any |
X.setWindow(x, y, w, h) (shared captured text) |
setWorldMatrix |
function | (self, matrix: Any, combine: Any) -> Any |
X.setWorldMatrix(matrix, combine) (shared captured text) |
setWorldMatrixEnabled |
function | (self, enabled: Any) -> Any |
(shared captured text) |
setWorldTransform |
function | (self, matrix: Any, combine: Any) -> Any |
X.setWorldTransform(matrix, combine) (shared captured text) |
shear |
function | (self, sh: Any, sv: Any) -> Any |
X.shear(sh, sv) (shared captured text) |
strokePath |
function | (self, path: Any, pen: Any) -> Any |
X.strokePath(path, pen) (shared captured text) |
style |
function | (self) -> Any |
X.style() -> PythonQt.QtGui.QStyle (shared captured text) |
testRenderHint |
function | (self, hint: Any) -> bool |
X.testRenderHint(hint) -> bool (shared captured text) |
transform |
function | (self) -> Any |
X.transform() -> PythonQt.QtGui.QTransform (shared captured text) |
translate |
function | (self, dx: Any, dy: Any) -> Any |
X.translate(dx, dy) (shared captured text) |
viewTransformEnabled |
function | (self) -> bool |
X.viewTransformEnabled() -> bool (shared captured text) |
viewport |
function | (self) -> Any |
X.viewport() -> PythonQt.QtCore.QRect (shared captured text) |
window |
function | (self) -> Any |
X.window() -> PythonQt.QtCore.QRect (shared captured text) |
worldMatrix |
function | (self) -> Any |
X.worldMatrix() -> PythonQt.QtGui.QMatrix (shared captured text) |
worldMatrixEnabled |
function | (self) -> bool |
X.worldMatrixEnabled() -> bool (shared captured text) |
worldTransform |
function | (self) -> Any |
X.worldTransform() -> PythonQt.QtGui.QTransform (shared captured text) |