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

A widget showing a color spectrum. More...

#include <DataAnalysis/Color/colorspectrumwidget.h>

Inherits QFrame.

Public Slots

void setOrientation (Qt::Orientation orientation)
 
void setSpectrum (const ColorSpectrum &spectrum)
 

Signals

void orientationChanged (Qt::Orientation orientation)
 

Public Member Functions

 ColorSpectrumWidget (QWidget *parent=nullptr)
 
Qt::Orientation getOrientation () const
 
const ColorSpectrumgetSpectrum () const
 

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 

Properties

Qt::Orientation orientation
 

Detailed Description

Color spectrums show colors corresponding to values between zero and one. The ColorScale class adds the ability to use different minimum and maximum values for the spectrum (ie it essentially just scales and translates the spectrum). A spectrum also has a vertical or horizontal orientation, with horizontal being the default.

Constructor & Destructor Documentation

◆ ColorSpectrumWidget()

ColorSpectrumWidget ( QWidget *  parent = nullptr)

Constructs a widget with a default orientation of Qt::Horizontal and no points in the spectrum. Clients would normally need to set the spectrum after construction, since an empty spectrum serves no useful purpose for this widget (ie it will simply show solid black).

Member Function Documentation

◆ getOrientation()

Qt::Orientation getOrientation ( ) const
Returns
The current orientation of the widget.

◆ getSpectrum()

const ColorSpectrum & getSpectrum ( ) const
Returns
The current color spectrum.

◆ orientationChanged

void orientationChanged ( Qt::Orientation  orientation)
signal

◆ resizeEvent()

void resizeEvent ( QResizeEvent *  event)
overrideprotected

◆ setOrientation

void setOrientation ( Qt::Orientation  orientation)
slot
Parameters
orientationThe new orientation of the widget.

If orientation is different to the current orientation, the orientationChanged() signal will be emitted and the widget will be updated.

◆ setSpectrum

void setSpectrum ( const ColorSpectrum spectrum)
slot
Parameters
spectrumThe new color spectrum this widget should show.

Calling this function will update the widget.

Property Documentation

◆ orientation

Qt::Orientation orientation
readwrite