Class: QgsColorPreviewWidget

class qgis.gui.QgsColorPreviewWidget(parent: QWidget = None)

Bases: QgsColorWidget

Construct a new color preview widget.

Parameters

parent (QWidget = None) – parent QWidget for the widget

A preview box which displays one or two colors as swatches.

actionEvent()
alterColor()
changeEvent()
childEvent()
closeEvent()
color2(self) → QColor

Returns the secondary color for the widget

Return type

QColor

Returns

secondary widget color, or an invalid color if the widget has no secondary color

See also

color()

See also

setColor2()

componentRange()
componentValue()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
hue()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

mousePressEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

mouseReleaseEvent(self, e: QMouseEvent)
Parameters

e (QMouseEvent) –

moveEvent()
nativeEvent()
paintEvent(self, event: QPaintEvent)
Parameters

event (QPaintEvent) –

receivers()
resizeEvent()
sender()
senderSignalIndex()
setColor2(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets the second color for the widget

Parameters

color (Union[QColor) – secondary widget color. Set to an invalid color to prevent drawing of a secondary color

See also

setColor()

See also

color2()

sharedPainter()
showEvent()
sizeHint(self) → QSize
Return type

QSize

tabletEvent()
timerEvent()
transparentBackground()
updateMicroFocus()
wheelEvent()