QtPdWidgets  2.3.2
Classes | Public Types | Public Member Functions | Protected Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes | List of all members
Pd::Digital Class Reference

Base functionality for digital displays. More...

#include <Digital.h>

Inheritance diagram for Pd::Digital:
Inheritance graph
[legend]
Collaboration diagram for Pd::Digital:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Types

enum  TimeDisplay { None, Seconds, Minutes, Hours }
 

Public Member Functions

 Digital (QWidget *parent=0)
 Constructor. More...
 
virtual ~Digital ()
 Destructor. More...
 
void clearData ()
 
double getValue () const
 
Qt::Alignment getAlignment () const
 
void setAlignment (Qt::Alignment)
 Sets the text alignment. More...
 
void resetAlignment ()
 Resets the number of decimals. More...
 
quint32 getDecimals () const
 
void setDecimals (quint32)
 Sets the number of decimals. More...
 
void resetDecimals ()
 Resets the number of decimals. More...
 
QString getSuffix () const
 
void setSuffix (const QString &)
 Sets the suffix to display after the value. More...
 
void resetSuffix ()
 Resets the suffix to display after the value. More...
 
TimeDisplay getTimeDisplay () const
 
void setTimeDisplay (TimeDisplay)
 Sets the timeDisplay method. More...
 
void resetTimeDisplay ()
 Resets the timeDisplay method. More...
 
int getBase () const
 
void setBase (int)
 Sets the number base. More...
 
void resetBase ()
 Resets the number base. More...
 
QString getValueString () const
 
QSize sizeHint () const override
 Gives a hint aboute the optimal size. More...
 

Protected Member Functions

bool event (QEvent *) override
 Event function. More...
 
void paintEvent (QPaintEvent *) override
 Paint function. More...
 

Properties

Qt::Alignment alignment
 
quint32 decimals
 
QString suffix
 
TimeDisplay timeDisplay
 
int base
 

Private Slots

PD_PRIVATE void redrawEvent ()
 Redraw event slot, that is called by the redraw timer. More...
 

Private Member Functions

PD_PRIVATE void newValues (std::chrono::nanoseconds) override
 This virtual method is called by the ProcessVariable, if its value changes. More...
 

Private Attributes

struct PD_PRIVATE Impl
 
std::unique_ptr< Implimpl
 

Detailed Description

Base functionality for digital displays.

Member Enumeration Documentation

◆ TimeDisplay

Enumerator
None 
Seconds 
Minutes 
Hours 

Constructor & Destructor Documentation

◆ Digital()

Digital::Digital ( QWidget *  parent = 0)

Constructor.

Parameters
parentParent widget.

References Pd::Widget::getTimer(), impl, and redrawEvent().

◆ ~Digital()

Digital::~Digital ( )
virtual

Destructor.

Member Function Documentation

◆ clearData()

void Digital::clearData ( )

References impl.

◆ event()

bool Digital::event ( QEvent *  event)
overrideprotected

Event function.

Parameters
eventEvent flags.

References impl.

Referenced by Pd::TouchEdit::event(), and paintEvent().

◆ getAlignment()

Qt::Alignment Digital::getAlignment ( ) const
Returns
The text alignment.

References impl.

◆ getBase()

int Digital::getBase ( ) const
Returns
The base.

References impl.

◆ getDecimals()

quint32 Digital::getDecimals ( ) const
Returns
The number of displayed decimals.

References impl.

Referenced by Pd::TouchEdit::Impl::openDialog().

◆ getSuffix()

QString Digital::getSuffix ( ) const
Returns
The suffix.

References impl.

Referenced by Pd::TouchEdit::Impl::openDialog().

◆ getTimeDisplay()

Digital::TimeDisplay Digital::getTimeDisplay ( ) const

References impl.

◆ getValue()

double Digital::getValue ( ) const
Returns
The current #value.

References impl.

Referenced by Pd::TouchEdit::Impl::openDialog().

◆ getValueString()

QString Pd::Digital::getValueString ( ) const

◆ newValues()

void Digital::newValues ( std::chrono::nanoseconds  )
overrideprivate

This virtual method is called by the ProcessVariable, if its value changes.

References impl.

◆ paintEvent()

void Digital::paintEvent ( QPaintEvent *  event)
overrideprotected

Paint function.

Parameters
eventPaint event flags.

References event(), and impl.

◆ redrawEvent

void Digital::redrawEvent ( )
privateslot

Redraw event slot, that is called by the redraw timer.

References impl.

Referenced by Digital().

◆ resetAlignment()

void Digital::resetAlignment ( )

Resets the number of decimals.

References DEFAULT_ALIGNMENT, and setAlignment().

◆ resetBase()

void Digital::resetBase ( )

Resets the number base.

References DEFAULT_BASE, and setBase().

◆ resetDecimals()

void Digital::resetDecimals ( )

Resets the number of decimals.

References DEFAULT_DECIMALS, and setDecimals().

◆ resetSuffix()

void Digital::resetSuffix ( )

Resets the suffix to display after the value.

References DEFAULT_SUFFIX, and setSuffix().

◆ resetTimeDisplay()

void Digital::resetTimeDisplay ( )

Resets the timeDisplay method.

References DEFAULT_TIME_DISPLAY, and setTimeDisplay().

◆ setAlignment()

void Digital::setAlignment ( Qt::Alignment  a)

Sets the text alignment.

References impl.

Referenced by resetAlignment().

◆ setBase()

void Digital::setBase ( int  base)

Sets the number base.

References base, and impl.

Referenced by resetBase().

◆ setDecimals()

void Digital::setDecimals ( quint32  decimals)

Sets the number of decimals.

References decimals, and impl.

Referenced by resetDecimals().

◆ setSuffix()

void Digital::setSuffix ( const QString &  suffix)

Sets the suffix to display after the value.

References impl, and suffix.

Referenced by resetSuffix().

◆ setTimeDisplay()

void Digital::setTimeDisplay ( TimeDisplay  timeDisplay)

Sets the timeDisplay method.

References impl, and timeDisplay.

Referenced by resetTimeDisplay().

◆ sizeHint()

QSize Digital::sizeHint ( ) const
override

Gives a hint aboute the optimal size.

Member Data Documentation

◆ Impl

struct PD_PRIVATE Pd::Digital::Impl
private

◆ impl

std::unique_ptr<Impl> Pd::Digital::impl
private

Property Documentation

◆ alignment

Qt::Alignment Pd::Digital::alignment
readwrite

◆ base

int Pd::Digital::base
readwrite

Referenced by setBase().

◆ decimals

quint32 Pd::Digital::decimals
readwrite

Referenced by setDecimals().

◆ suffix

QString Pd::Digital::suffix
readwrite

Referenced by setSuffix().

◆ timeDisplay

TimeDisplay Pd::Digital::timeDisplay
readwrite

Referenced by setTimeDisplay().


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