Widget to edit option by picking from list of choices. More...
#include <combooption.h>
Public Member Functions | |
| ComboOption (const QStringList &_values, const QStringList &_valueDesc, const QString &_key=0, QWidget *parent=0) | |
| ComboOption (const QStringList &_values, const QString &_key=0, QWidget *parent=0) | |
| ~ComboOption () | |
| virtual void | writeValue () |
| virtual void | readValue () |
| virtual QSize | sizeHint () const |
| void | setCaseSensitive (bool value) |
Protected Slots | |
| void | itemActivated (int index) |
Protected Member Functions | |
| virtual void | resizeEvent (QResizeEvent *e) |
Protected Attributes | |
| QComboBox * | ed |
| QStringList | values |
| bool | caseSensitive |
| int | idx |
Private Member Functions | |
| void | init (const QStringList &_values, const QStringList &_desc) |
Widget to edit option by picking from list of choices.
Class for widget containing one editable setting of type string, selectable from combobox
If current setting specify item not in the list, the first item in list is shown instead
User is unable to specify string not in the list
Used as one item type in option window
| gui::ComboOption::ComboOption | ( | const QStringList & | _values, | |
| const QStringList & | _valueDesc, | |||
| const QString & | _key = 0, |
|||
| QWidget * | parent = 0 | |||
| ) |
Default constructor of ComboOption item
| parent | parent Option Editor containing this control | |
| _key | Key in settings for this option | |
| _values | List of accepted values | |
| _valueDesc | List of value descriptions, must map 1:1 with values (same count and order of items) |
Referenced by ComboOption().
| gui::ComboOption::ComboOption | ( | const QStringList & | _values, | |
| const QString & | _key = 0, |
|||
| QWidget * | parent = 0 | |||
| ) |
Default constructor of ComboOption item
| parent | parent Option Editor containing this control | |
| _key | Key in settings for this option | |
| _values | List of accepted values |
References ComboOption().
| gui::ComboOption::~ComboOption | ( | ) |
default destructor
| void gui::ComboOption::init | ( | const QStringList & | _values, | |
| const QStringList & | _desc | |||
| ) | [private] |
Internal initialization function used in constructor
| _values | list to use as item values | |
| _desc | list to use as item descriptions |
| void gui::ComboOption::itemActivated | ( | int | index | ) | [protected, slot] |
Slot called when changing the item in combobox
| index | Index of newly selected item |
| void gui::ComboOption::readValue | ( | ) | [virtual] |
read value from settings for editing
Implements gui::Option.
| void gui::ComboOption::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Called on resizing of option editing control
| e | Resize event data (new size) |
References ed.
| void gui::ComboOption::setCaseSensitive | ( | bool | value | ) |
Set case sensitivity of list items. Default is case insensitive
| value | New value for case-sensitivity |
| QSize gui::ComboOption::sizeHint | ( | ) | const [virtual] |
| void gui::ComboOption::writeValue | ( | ) | [virtual] |
write edited value to settings
Implements gui::Option.
bool gui::ComboOption::caseSensitive [protected] |
Are items case sensitive?
Referenced by sizeHint().
QComboBox* gui::ComboOption::ed [protected] |
edit control used for editing the value (combo box)
Referenced by resizeEvent().
int gui::ComboOption::idx [protected] |
Index of selected item
QStringList gui::ComboOption::values [protected] |
List of values in the control.