QtPdWidgets  2.4.0
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Pd::ComboBox Class Reference

Combo box for selecting a value of an integer process variable. More...

#include <ComboBox.h>

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

Classes

struct  Impl
 

Public Member Functions

 ComboBox (QWidget *parent=0)
 Constructor. More...
 
virtual ~ComboBox ()
 Destructor. More...
 
void clearData ()
 

Protected Member Functions

void wheelEvent (QWheelEvent *) override
 Ignores wheel events, if the widget has no focus. 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< Impl > impl
 

Detailed Description

Combo box for selecting a value of an integer process variable.

Each item represents a value, that is stored as the item's user data (see QComboBox::addItem(const QString &, const QVariant &)):

comboBox->addItem("Local", 0);
comboBox->addItem("Remote", 1);
comboBox->setVariable(process, "/Mode/Value");

The item matching the current process value is selected. If there is no item for the current value, no item is selected and the value is displayed as placeholder text (Qt >= 5.15). Selecting an item by the user writes its value to the process.

To avoid unintentional changes, mouse wheel events are only processed, if the widget has the keyboard focus.

Constructor & Destructor Documentation

◆ ComboBox()

ComboBox::ComboBox ( QWidget *  parent = 0)

Constructor.

Parameters
parentparent widget

References Impl.

◆ ~ComboBox()

ComboBox::~ComboBox ( )
virtual

Destructor.

Member Function Documentation

◆ clearData()

void ComboBox::clearData ( )

References impl.

◆ newValues()

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

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

References impl.

◆ wheelEvent()

void ComboBox::wheelEvent ( QWheelEvent *  event)
overrideprotected

Ignores wheel events, if the widget has no focus.

This avoids changing process values unintentionally while scrolling.

Member Data Documentation

◆ Impl

Referenced by ComboBox().

◆ impl

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

Referenced by clearData(), and newValues().


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