Workspace 6.21.5
Public Slots | Public Member Functions | Protected Member Functions | Properties | List of all members
ColorWidget Class Reference

Simple widget which shows the current color as its background color.

#include <Workspace/Widgets/colorwidget.h>

Inherits QFrame.

Public Slots

void setColor (const QColor &color)
 

Public Member Functions

 ColorWidget (QWidget *parent=nullptr)
 
const QColor & getColor () const
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 

Properties

QColor color
 

Constructor & Destructor Documentation

◆ ColorWidget()

ColorWidget ( QWidget *  parent = nullptr)

Constructs a widget with a default color of black.

Member Function Documentation

◆ getColor()

const QColor & getColor ( ) const
Returns
The current color color.

◆ paintEvent()

void paintEvent ( QPaintEvent *  event)
overrideprotected

◆ setColor

void setColor ( const QColor &  color)
slot
Parameters
colorThe new color this widget should show.

Calling this function will update the widget.

Property Documentation

◆ color

QColor color
readwrite