gui::ComboOption Class Reference

Widget to edit option by picking from list of choices. More...

#include <combooption.h>

Inheritance diagram for gui::ComboOption:
gui::Option

List of all members.

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)

Detailed Description

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


Constructor & Destructor Documentation

gui::ComboOption::ComboOption ( const QStringList &  _values,
const QStringList &  _valueDesc,
const QString &  _key = 0,
QWidget *  parent = 0 
)

Default constructor of ComboOption item

Parameters:
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

Parameters:
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


Member Function Documentation

void gui::ComboOption::init ( const QStringList &  _values,
const QStringList &  _desc 
) [private]

Internal initialization function used in constructor

Parameters:
_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

Parameters:
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

Parameters:
e Resize event data (new size)

References ed.

void gui::ComboOption::setCaseSensitive ( bool  value  ) 

Set case sensitivity of list items. Default is case insensitive

Parameters:
value New value for case-sensitivity
QSize gui::ComboOption::sizeHint (  )  const [virtual]

return size hint of this option editing control

Returns:
Optimal size

References caseSensitive.

void gui::ComboOption::writeValue (  )  [virtual]

write edited value to settings

Implements gui::Option.


Member Data Documentation

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.


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