AudioDial is a nicer-looking QDial that by default reacts to mouse movement on horizontal and vertical axes instead of in a radial motion. More...

#include <AudioDial.h>

Inheritance diagram for AudioDial:
Inheritance graph
Collaboration diagram for AudioDial:
Collaboration graph

Public Slots

void setKnobColor (const QColor &color)
 Set the colour of the knob. More...
 
void setMeterColor (const QColor &color)
 Set the colour of the meter (the highlighted area around the knob that shows the current value). More...
 
void setMouseDial (bool mouseDial)
 Specify that the dial should respond to radial mouse movements in the same way as QDial. More...
 
void setDefaultValue (int defaultValue)
 
void setValue (int value)
 
void setDefaultMappedValue (double mappedValue)
 
void setMappedValue (double mappedValue)
 
void setToDefault ()
 
void edit ()
 

Signals

void mouseEntered ()
 
void mouseLeft ()
 

Public Member Functions

 AudioDial (QWidget *parent=0)
 
 ~AudioDial ()
 
const QColor & getKnobColor () const
 
const QColor & getMeterColor () const
 
bool getMouseDial () const
 
void setRangeMapper (RangeMapper *mapper)
 
const RangeMapper * rangeMapper () const
 
double mappedValue () const
 
int defaultValue () const
 
void setShowToolTip (bool show)
 
void setProvideContextMenu (bool provide)
 

Protected Slots

void updateMappedValue (int value)
 
void contextMenuRequested (const QPoint &)
 

Protected Member Functions

void drawTick (QPainter &paint, double angle, int size, bool internal)
 
void paintEvent (QPaintEvent *) override
 
void mousePressEvent (QMouseEvent *pMouseEvent) override
 
void mouseMoveEvent (QMouseEvent *pMouseEvent) override
 
void mouseReleaseEvent (QMouseEvent *pMouseEvent) override
 
void mouseDoubleClickEvent (QMouseEvent *pMouseEvent) override
 
void enterEvent (QEvent *) override
 
void leaveEvent (QEvent *) override
 

Properties

QColor knobColor
 
QColor meterColor
 
bool mouseDial
 

Private Attributes

QColor m_knobColor
 
QColor m_meterColor
 
int m_defaultValue
 
double m_defaultMappedValue
 
double m_mappedValue
 
bool m_noMappedUpdate
 
bool m_mouseDial
 
bool m_mousePressed
 
QPoint m_posMouse
 
bool m_showTooltip
 
bool m_provideContextMenu
 
QString m_title
 
QMenu * m_lastContextMenu
 
RangeMapper * m_rangeMapper
 

Detailed Description

AudioDial is a nicer-looking QDial that by default reacts to mouse movement on horizontal and vertical axes instead of in a radial motion.

Move the mouse up or right to increment the value, down or left to decrement it. AudioDial also responds to the mouse wheel.

The programming interface for this widget is compatible with QDial, with the addition of properties for the knob colour and meter colour and a boolean property mouseDial that determines whether to respond to radial mouse motion in the same way as QDial (the default is no).

Definition at line 60 of file AudioDial.h.

Constructor & Destructor Documentation

AudioDial::AudioDial ( QWidget *  parent = 0)

Definition at line 76 of file AudioDial.cpp.

References contextMenuRequested(), m_mouseDial, and m_mousePressed.

AudioDial::~AudioDial ( void  )

Definition at line 98 of file AudioDial.cpp.

References m_lastContextMenu, and m_rangeMapper.

Member Function Documentation

const QColor& AudioDial::getKnobColor ( ) const
inline

Definition at line 71 of file AudioDial.h.

References m_knobColor.

const QColor& AudioDial::getMeterColor ( ) const
inline

Definition at line 72 of file AudioDial.h.

References m_meterColor.

bool AudioDial::getMouseDial ( ) const
inline

Definition at line 73 of file AudioDial.h.

References m_mouseDial, and setRangeMapper().

void AudioDial::setRangeMapper ( RangeMapper *  mapper)
const RangeMapper* AudioDial::rangeMapper ( ) const
inline

Definition at line 76 of file AudioDial.h.

References m_rangeMapper, and mappedValue().

Referenced by PluginParameterBox::dialChanged(), and PluginParameterBox::spinBoxChanged().

double AudioDial::mappedValue ( ) const

Definition at line 455 of file AudioDial.cpp.

References m_mappedValue, and m_rangeMapper.

Referenced by PluginParameterBox::dialChanged(), rangeMapper(), and setMappedValue().

void AudioDial::setShowToolTip ( bool  show)
void AudioDial::setProvideContextMenu ( bool  provide)

Definition at line 449 of file AudioDial.cpp.

References m_provideContextMenu.

Referenced by defaultValue().

void AudioDial::mouseEntered ( )
signal

Referenced by defaultValue(), and enterEvent().

void AudioDial::mouseLeft ( )
signal

Referenced by defaultValue(), and leaveEvent().

void AudioDial::setKnobColor ( const QColor &  color)
slot

Set the colour of the knob.

The default is to inherit the colour from the widget's palette.

Definition at line 378 of file AudioDial.cpp.

References m_knobColor.

Referenced by defaultValue().

void AudioDial::setMeterColor ( const QColor &  color)
slot

Set the colour of the meter (the highlighted area around the knob that shows the current value).

The default is to inherit the colour from the widget's palette.

Definition at line 385 of file AudioDial.cpp.

References m_meterColor.

Referenced by defaultValue().

void AudioDial::setMouseDial ( bool  mouseDial)
slot

Specify that the dial should respond to radial mouse movements in the same way as QDial.

Definition at line 392 of file AudioDial.cpp.

References m_mouseDial, and mouseDial.

Referenced by defaultValue().

void AudioDial::setDefaultValue ( int  defaultValue)
slot
void AudioDial::setDefaultMappedValue ( double  mappedValue)
slot

Definition at line 412 of file AudioDial.cpp.

References m_defaultMappedValue, m_defaultValue, and m_rangeMapper.

Referenced by defaultValue().

void AudioDial::setMappedValue ( double  mappedValue)
slot
void AudioDial::setToDefault ( )
slot
void AudioDial::edit ( )
slot
void AudioDial::drawTick ( QPainter &  paint,
double  angle,
int  size,
bool  internal 
)
protected

Definition at line 350 of file AudioDial.cpp.

Referenced by defaultValue(), and paintEvent().

void AudioDial::paintEvent ( QPaintEvent *  )
overrideprotected
void AudioDial::mousePressEvent ( QMouseEvent *  pMouseEvent)
overrideprotected

Definition at line 522 of file AudioDial.cpp.

References m_mouseDial, m_mousePressed, m_posMouse, and setToDefault().

Referenced by defaultValue().

void AudioDial::mouseMoveEvent ( QMouseEvent *  pMouseEvent)
overrideprotected

Definition at line 616 of file AudioDial.cpp.

References m_mouseDial, m_mousePressed, and m_posMouse.

Referenced by defaultValue().

void AudioDial::mouseReleaseEvent ( QMouseEvent *  pMouseEvent)
overrideprotected

Definition at line 636 of file AudioDial.cpp.

References m_mouseDial, and m_mousePressed.

Referenced by defaultValue().

void AudioDial::mouseDoubleClickEvent ( QMouseEvent *  pMouseEvent)
overrideprotected

!! needs a common base class with Thumbwheel

Definition at line 537 of file AudioDial.cpp.

References edit(), and m_mouseDial.

Referenced by defaultValue().

void AudioDial::enterEvent ( QEvent *  e)
overrideprotected

Definition at line 646 of file AudioDial.cpp.

References mouseEntered().

Referenced by defaultValue().

void AudioDial::leaveEvent ( QEvent *  e)
overrideprotected

Definition at line 653 of file AudioDial.cpp.

References mouseLeft().

Referenced by defaultValue().

void AudioDial::updateMappedValue ( int  value)
protectedslot
void AudioDial::contextMenuRequested ( const QPoint &  pos)
protectedslot

Member Data Documentation

QColor AudioDial::m_knobColor
private

Definition at line 137 of file AudioDial.h.

Referenced by getKnobColor(), paintEvent(), and setKnobColor().

QColor AudioDial::m_meterColor
private

Definition at line 138 of file AudioDial.h.

Referenced by getMeterColor(), paintEvent(), and setMeterColor().

int AudioDial::m_defaultValue
private

Definition at line 140 of file AudioDial.h.

Referenced by defaultValue(), setDefaultMappedValue(), setDefaultValue(), and setToDefault().

double AudioDial::m_defaultMappedValue
private

Definition at line 141 of file AudioDial.h.

Referenced by setDefaultMappedValue(), setDefaultValue(), and setToDefault().

double AudioDial::m_mappedValue
private

Definition at line 142 of file AudioDial.h.

Referenced by edit(), mappedValue(), setMappedValue(), and updateMappedValue().

bool AudioDial::m_noMappedUpdate
private

Definition at line 143 of file AudioDial.h.

Referenced by setMappedValue(), setShowToolTip(), and updateMappedValue().

bool AudioDial::m_mouseDial
private
bool AudioDial::m_mousePressed
private

Definition at line 147 of file AudioDial.h.

Referenced by AudioDial(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

QPoint AudioDial::m_posMouse
private

Definition at line 148 of file AudioDial.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

bool AudioDial::m_showTooltip
private

Definition at line 150 of file AudioDial.h.

Referenced by setShowToolTip(), and updateMappedValue().

bool AudioDial::m_provideContextMenu
private

Definition at line 151 of file AudioDial.h.

Referenced by contextMenuRequested(), and setProvideContextMenu().

QString AudioDial::m_title
private

Definition at line 153 of file AudioDial.h.

Referenced by contextMenuRequested(), and updateMappedValue().

QMenu* AudioDial::m_lastContextMenu
private

Definition at line 155 of file AudioDial.h.

Referenced by contextMenuRequested(), and ~AudioDial().

RangeMapper* AudioDial::m_rangeMapper
private

Property Documentation

QColor AudioDial::knobColor
readwrite

Definition at line 63 of file AudioDial.h.

Referenced by paintEvent().

QColor AudioDial::meterColor
readwrite

Definition at line 64 of file AudioDial.h.

Referenced by paintEvent().

bool AudioDial::mouseDial
readwrite

Definition at line 65 of file AudioDial.h.

Referenced by defaultValue(), and setMouseDial().


The documentation for this class was generated from the following files: