[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Slots | Signals | Public Member Functions | Properties | List of all members
KLFEnumComboBox Class Reference

a combo box proposing a list of (integer) enumeration values. More...

#include <klfguiutil.h>

Inheritance diagram for KLFEnumComboBox:
Inheritance graph
[legend]
Collaboration diagram for KLFEnumComboBox:
Collaboration graph
[legend]

Public Slots

void setSelectedValue (int val)
 
void setEnumValues (const QList< int > &enumValues, const QStringList &enumTitles)
 

Signals

void selectedValueChanged (int enumValue)
 

Public Member Functions

 KLFEnumComboBox (QWidget *parent=0)
 
 KLFEnumComboBox (const QList< int > &enumValues, const QStringList &enumTitles, QWidget *parent=0)
 
virtual ~KLFEnumComboBox ()
 
int selectedValue () const
 
QString enumText (int enumValue) const
 

Properties

int selectedValue
 

Detailed Description

a combo box proposing a list of (integer) enumeration values.

Utility class built over QComboBox that can be used to propose a list of enumeration values to user.

You can set the enumeration values in the constructor or with setEnumValues(), and retrieve the currently selected enum value with selectedValue().

Note
We say "enumeration values" because that is this widget's main purpose, however of course this is just a widget that more conveniently connects a title displayed to the user with an integer, and allows the user to select the former while the program code manipulates the latter.
Note also that this widget sets item data in the QComboBox with setItemData() using the default role number. If you want also to set item data, use another role number!

Definition at line 339 of file klfguiutil.h.

Constructor & Destructor Documentation

◆ KLFEnumComboBox() [1/2]

KLFEnumComboBox::KLFEnumComboBox ( QWidget *  parent = 0)

Definition at line 264 of file klfguiutil.cpp.

References setEnumValues().

◆ KLFEnumComboBox() [2/2]

KLFEnumComboBox::KLFEnumComboBox ( const QList< int > &  enumValues,
const QStringList enumTitles,
QWidget *  parent = 0 
)

Definition at line 271 of file klfguiutil.cpp.

References setEnumValues().

◆ ~KLFEnumComboBox()

KLFEnumComboBox::~KLFEnumComboBox ( )
virtual

Definition at line 279 of file klfguiutil.cpp.

Member Function Documentation

◆ enumText()

QString KLFEnumComboBox::enumText ( int  enumValue) const

Definition at line 311 of file klfguiutil.cpp.

References QList::contains(), and KLF_FUNC_NAME.

◆ selectedValue()

int KLFEnumComboBox::selectedValue ( ) const

Referenced by setEnumValues().

◆ selectedValueChanged

void KLFEnumComboBox::selectedValueChanged ( int  enumValue)
signal

Referenced by setSelectedValue().

◆ setEnumValues

void KLFEnumComboBox::setEnumValues ( const QList< int > &  enumValues,
const QStringList enumTitles 
)
slot

Definition at line 283 of file klfguiutil.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, selectedValue(), and QList::size().

Referenced by KLFEnumComboBox().

◆ setSelectedValue

void KLFEnumComboBox::setSelectedValue ( int  val)
slot

Definition at line 320 of file klfguiutil.cpp.

References QMap::contains(), KLF_FUNC_NAME, and selectedValueChanged().

Property Documentation

◆ selectedValue

int KLFEnumComboBox::selectedValue
readwrite

Definition at line 343 of file klfguiutil.h.


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

Generated by doxygen 1.8.13