gui::Property Class Reference

Abstract class for property editing widget. More...

#include <property.h>

Inheritance diagram for gui::Property:
gui::BoolProperty gui::RefProperty gui::StringProperty gui::IntProperty gui::NameProperty gui::RealProperty

List of all members.

Signals

void propertyChanged (Property *prop)
void infoText (const QString &message)
void warnText (const QString &message)

Public Member Functions

 Property (const QString &_name=0, QWidget *parent=0, PropertyFlags _flags=defaultPropertyMode)
void initLabel (QLabel *widget)
virtual ~Property ()
QString getName ()
PropertyFlags getFlags ()
bool isHidden ()
void setFlags (PropertyFlags flag)
void override (bool showHidden, bool editReadOnly)
void modifyColor (QWidget *widget)
virtual void applyHidden (bool hideThis)
virtual void setDisabled (bool disabled)=0
virtual void applyReadOnly (bool _readonly)=0
virtual void setValue (IProperty *pdfObject)=0
virtual void readValue (IProperty *pdfObject)=0
virtual bool isValid ()=0

Static Public Member Functions

static QString modeName (PropertyFlags flag)

Protected Member Functions

void emitChanged ()
virtual void enterEvent (QEvent *e)
virtual void leaveEvent (QEvent *e)

Protected Attributes

QString name
PropertyFlags flags
bool changed
QWidget * propertyLabel
bool effectiveReadonly

Private Attributes

bool readonly
bool hidden

Detailed Description

Abstract class for property editing widget.

Ancestor of all property editor items.


Constructor & Destructor Documentation

gui::Property::Property ( const QString &  _name = 0,
QWidget *  parent = 0,
PropertyFlags  _flags = defaultPropertyMode 
)

Default constructor of property item

Parameters:
parent parent Property Editor containing this control
_name name of this property
_flags flags of this property items (default 0)

References changed, effectiveReadonly, hidden, name, readonly, and setFlags().

gui::Property::~Property (  )  [virtual]

default destructor


Member Function Documentation

void gui::Property::applyHidden ( bool  hideThis  )  [virtual]

Apply "hidden" flag to property, thus showing or hiding it

Parameters:
hideThis New hidden flag value

References debug::DBG_DBG, guiPrintDbg, propertyLabel, and Q_OUT.

Referenced by override().

virtual void gui::Property::applyReadOnly ( bool  _readonly  )  [pure virtual]

Apply this value of "read only" to the property

Parameters:
_readonly True for read-only, false for read-write

Implemented in gui::BoolProperty, gui::RefProperty, and gui::StringProperty.

Referenced by override().

void gui::Property::emitChanged (  )  [protected]

Emit signal indicating change of the property and set state of property to 'changed'

References changed, debug::DBG_DBG, guiPrintDbg, name, propertyChanged(), and Q_OUT.

void gui::Property::enterEvent ( QEvent *  e  )  [protected, virtual]

Event handler for mouse cursor entering widget.

Parameters:
e Event

References flags, infoText(), and modeName().

PropertyFlags gui::Property::getFlags (  ) 

Return flags of this property

Returns:
Property flags

References flags.

QString gui::Property::getName (  ) 

Return name of this property

Returns:
Property name

References name.

void gui::Property::infoText ( const QString &  message  )  [signal]

Send informational message when mouse cursor enters/leaves the property The message is sent on enter and QString::null on leave.

Parameters:
message Message

Referenced by enterEvent(), and leaveEvent().

void gui::Property::initLabel ( QLabel *  widget  ) 

Initialize label belonging to this property.
Called after setting text to the label.
Guaranteed to be called before override.
Property may change the label test, style or colors.

Parameters:
widget Property's label

References util::colorMod(), debug::DBG_DBG, flags, guiPrintDbg, mdAdvanced, mdHidden, mdNormal, mdReadOnly, mdUnknown, modeName(), propertyLabel, and Q_OUT.

bool gui::Property::isHidden (  ) 

Check if this property is hidden

Returns:
true if hidden

References hidden.

virtual bool gui::Property::isValid (  )  [pure virtual]

Check if edited property is currently valid.

Returns:
true if valid, false if not

Implemented in gui::BoolProperty, gui::RefProperty, and gui::StringProperty.

void gui::Property::leaveEvent ( QEvent *  e  )  [protected, virtual]

Event handler for mouse cursor leaving widget.

Parameters:
e Event

References infoText().

QString gui::Property::modeName ( PropertyFlags  flag  )  [static]

For given properyy mode return its localized description

Parameters:
flag Mode
Returns:
description

References mdAdvanced, mdHidden, mdNormal, mdReadOnly, and mdUnknown.

Referenced by enterEvent(), and initLabel().

void gui::Property::modifyColor ( QWidget *  widget  ) 

Modify the widget color according to widget flags Best results are with themes in which the widget is "white or at least light color"

Parameters:
widget Widget to modify its color

References util::colorMod(), flags, mdAdvanced, mdHidden, mdNormal, mdReadOnly, and mdUnknown.

Referenced by gui::StringProperty::StringProperty().

void gui::Property::override ( bool  showHidden,
bool  editReadOnly 
)

Apply overrides bypassing limitation set by modecontroller.

Parameters:
showHidden Show hidden properties
editReadOnly Edit read-only properties

References applyHidden(), applyReadOnly(), effectiveReadonly, hidden, and readonly.

void gui::Property::propertyChanged ( Property prop  )  [signal]

Signal emitted when property is edited. Send property pointer with the signal

Parameters:
prop Pointer to changed property item

Referenced by gui::StringProperty::emitChange(), gui::BoolProperty::emitChange(), and emitChanged().

virtual void gui::Property::readValue ( IProperty pdfObject  )  [pure virtual]

read internal value from given PDF object

Parameters:
pdfObject Objet to read from

Implemented in gui::BoolProperty, gui::IntProperty, gui::NameProperty, gui::RealProperty, gui::RefProperty, and gui::StringProperty.

Referenced by gui::PropertyEditor::appendMessage().

virtual void gui::Property::setDisabled ( bool  disabled  )  [pure virtual]

Disable this control

Parameters:
disabled True to disable, false to enable

Implemented in gui::BoolProperty, gui::RefProperty, and gui::StringProperty.

void gui::Property::setFlags ( PropertyFlags  flag  ) 

Set flags of this property

Parameters:
flag New value for property flags

References flags, hidden, mdAdvanced, mdHidden, mdReadOnly, and readonly.

Referenced by Property().

virtual void gui::Property::setValue ( IProperty pdfObject  )  [pure virtual]

write internal value to given PDF object

Parameters:
pdfObject Objet to write to

Implemented in gui::BoolProperty, gui::IntProperty, gui::NameProperty, gui::RealProperty, gui::RefProperty, and gui::StringProperty.

void gui::Property::warnText ( const QString &  message  )  [signal]

Send warning message on some events (only once when the event occurs)

Parameters:
message Message

Member Data Documentation

bool gui::Property::changed [protected]

flags of the property (from PDF object)

Referenced by enterEvent(), getFlags(), initLabel(), modifyColor(), and setFlags().

bool gui::Property::hidden [private]

is this property hidden? Set from flags

Referenced by isHidden(), override(), Property(), and setFlags().

QString gui::Property::name [protected]

Name of this property

Referenced by emitChanged(), getName(), and Property().

QWidget* gui::Property::propertyLabel [protected]

Label of property

Referenced by applyHidden(), and initLabel().

bool gui::Property::readonly [private]

is this property readonly? Set from flags

Referenced by override(), Property(), and setFlags().


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