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

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

#include <klfguiutil.h>

List of all members.

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::KLFEnumComboBox ( QWidget *  parent = 0)

Definition at line 264 of file klfguiutil.cpp.

References setEnumValues().

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

Definition at line 271 of file klfguiutil.cpp.

References setEnumValues().

Definition at line 279 of file klfguiutil.cpp.


Member Function Documentation

QString KLFEnumComboBox::enumText ( int  enumValue) const

Definition at line 311 of file klfguiutil.cpp.

References QList::contains(), and KLF_FUNC_NAME.

void KLFEnumComboBox::selectedValueChanged ( int  enumValue) [signal]
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, and QList::size().

Referenced by KLFEnumComboBox().

void KLFEnumComboBox::setSelectedValue ( int  val) [slot]

Definition at line 320 of file klfguiutil.cpp.

References QMap::contains(), and KLF_FUNC_NAME.


Property Documentation

int KLFEnumComboBox::selectedValue [read, write]

Definition at line 343 of file klfguiutil.h.


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

Generated by doxygen 1.7.6.1. The KLatexFormula website is hosted on sourceforge.net