gui::DialogOption Class Reference

Abstract class for option editable as string and pickable by dialog. More...

#include <dialogoption.h>

Inheritance diagram for gui::DialogOption:
gui::Option gui::FileOption gui::FontOption

List of all members.

Public Member Functions

 DialogOption (const QString &_key=0, QWidget *parent=0, const QString &defValue=QString::null)
virtual ~DialogOption ()
virtual void writeValue ()
virtual void readValue ()
virtual QSize sizeHint () const
virtual void dialog (QString &value)=0

Protected Slots

void enableChange (const QString &newText)
void invokeDialog ()

Protected Member Functions

virtual void resizeEvent (QResizeEvent *e)

Private Attributes

QLineEdit * ed
QPushButton * pb

Detailed Description

Abstract class for option editable as string and pickable by dialog.

Abstract class for widget containing one editable string setting, with nearby "..." button allowing to invoke dialog to change the setting in some possibly more user-friently way
Subclasses should reimplement the dialog function to invoke some dialog and change the string value accordingly


Constructor & Destructor Documentation

gui::DialogOption::DialogOption ( const QString &  _key = 0,
QWidget *  parent = 0,
const QString &  defValue = QString::null 
)

Default constructor of DialogOption item

Parameters:
parent parent Option Editor containing this control
_key Key in settings for this option
defValue Default value if option not found in configuration
gui::DialogOption::~DialogOption (  )  [virtual]

default destructor

References gui::Option::changed, dialog(), and ed.


Member Function Documentation

virtual void gui::DialogOption::dialog ( QString &  value  )  [pure virtual]

Invoke the dialog to alter the edited value Reference to edited value is passed as parameter. This function should return after the dialog ended and may update the value as it seems approprieate based on user's interaction with the dialog

Parameters:
value Reference to edited string

Implemented in gui::FileOption, and gui::FontOption.

Referenced by ~DialogOption().

void gui::DialogOption::enableChange ( const QString &  newText  )  [protected, slot]

Called when text changes

Parameters:
newText value of new text
void gui::DialogOption::invokeDialog (  )  [protected, slot]

Slot called when user pressed the "..." (invoke dialog) button. Basically, the dialog function is executed and the text is updated

References gui::Option::changed.

void gui::DialogOption::readValue (  )  [virtual]

read value from settings for editing (using key specified in contructor)

Implements gui::Option.

void gui::DialogOption::resizeEvent ( QResizeEvent *  e  )  [protected, virtual]

Called on resizing of option editing control Will simply set the same fixed size to inner editbox

Parameters:
e resize event
QSize gui::DialogOption::sizeHint (  )  const [virtual]

return size hint of this option editing control

Returns:
size hint from inner editbox
void gui::DialogOption::writeValue (  )  [virtual]

write edited value to settings (using key specified in contructor)

Implements gui::Option.


Member Data Documentation

QLineEdit* gui::DialogOption::ed [private]

one line edit control used for editing the value

Referenced by ~DialogOption().

QPushButton* gui::DialogOption::pb [private]

Push button for invoking the dialog


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