KDevelop API Documentation

PropertyLib::PropertyWidget Class Reference

An abstract base class of property viewer and editor vidget. More...

#include <propertywidget.h>

Inheritance diagram for PropertyLib::PropertyWidget:

Inheritance graph
[legend]
Collaboration diagram for PropertyLib::PropertyWidget:

Collaboration graph
[legend]
List of all members.

Signals

void propertyChanged (MultiProperty *property, const QVariant &value)
 Emit this signal when property value is changed.

Public Member Functions

 PropertyWidget (MultiProperty *property, QWidget *parent=0, const char *name=0)
 Constructs widget for property with name "propertyName".
virtual ~PropertyWidget ()
virtual QVariant value () const =0
virtual void setValue (const QVariant &value, bool emitChange=true)=0
 Sets the value shown in the editor widget.
virtual QString propertyName () const
virtual void setProperty (MultiProperty *property)
 Sets the name of edited property.
virtual void setValueList (const QMap< QString, QVariant > &valueList)
 Sets the list of possible values shown in the editor widget.
virtual void drawViewer (QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value)
 Function to draw a property viewer when the editor isn't shown.
virtual void undo ()
 Reverts the property value to previous setting.

Protected Attributes

MultiPropertym_property

Detailed Description

An abstract base class of property viewer and editor vidget.

Subclass this class to create custom property viewer and editor widget.

Descendants should implement value() and setValue() methods.

Hint: in case you want to implement your property editor widget using existing widgets like QLineEdit, QComboBox, etc. you can't use multiple inheritance from two QObject descendants due to Qt library restriction. Therefore use line edits and combo boxes as child widgets.

A set of predefined widgets for predefined property types are available in the library.

Definition at line 49 of file propertywidget.h.


Constructor & Destructor Documentation

PropertyLib::PropertyWidget::PropertyWidget MultiProperty property,
QWidget parent = 0,
const char *  name = 0
 

Constructs widget for property with name "propertyName".

Definition at line 26 of file propertywidget.cpp.

virtual PropertyLib::PropertyWidget::~PropertyWidget  )  [inline, virtual]
 

Definition at line 54 of file propertywidget.h.


Member Function Documentation

void PropertyLib::PropertyWidget::drawViewer QPainter p,
const QColorGroup cg,
const QRect r,
const QVariant value
[virtual]
 

Function to draw a property viewer when the editor isn't shown.

Reimplemented in PropertyLib::PCheckBox, PropertyLib::PColorButton, PropertyLib::PColorCombo, PropertyLib::PCursorEdit, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PDummyWidget, PropertyLib::PFontButton, PropertyLib::PPixmapEdit, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PStringListEdit, PropertyLib::PSymbolCombo, and PropertyLib::PYesNoButton.

Definition at line 41 of file propertywidget.cpp.

void PropertyLib::PropertyWidget::propertyChanged MultiProperty property,
const QVariant value
[signal]
 

Emit this signal when property value is changed.

Probably you want to emit it only from setValue() method. PropertyEditor widget will connect this to the appropriate slot which will make updates to the PropertyAccessor that hold propeties.

Referenced by PropertyLib::PYesNoButton::setValue(), PropertyLib::PUrlEdit::setValue(), PropertyLib::PSymbolCombo::setValue(), PropertyLib::PStringListEdit::setValue(), PropertyLib::PSpinBox::setValue(), PropertyLib::PSizePolicyEdit::setValue(), PropertyLib::PSizeEdit::setValue(), PropertyLib::PRectEdit::setValue(), PropertyLib::PPointEdit::setValue(), PropertyLib::PPixmapEdit::setValue(), PropertyLib::PLineEdit::setValue(), PropertyLib::PFontCombo::setValue(), PropertyLib::PFontButton::setValue(), PropertyLib::PDummyWidget::setValue(), PropertyLib::PDoubleNumInput::setValue(), PropertyLib::PDateTimeEdit::setValue(), PropertyLib::PDateEdit::setValue(), PropertyLib::PComboBox::setValue(), PropertyLib::PColorCombo::setValue(), PropertyLib::PColorButton::setValue(), PropertyLib::PCheckBox::setValue(), PropertyLib::PStringListEdit::showEditor(), PropertyLib::PYesNoButton::updateProperty(), PropertyLib::PUrlEdit::updateProperty(), PropertyLib::PSymbolCombo::updateProperty(), PropertyLib::PSpinBox::updateProperty(), PropertyLib::PPixmapEdit::updateProperty(), PropertyLib::PLineEdit::updateProperty(), PropertyLib::PFontCombo::updateProperty(), PropertyLib::PFontButton::updateProperty(), PropertyLib::PDoubleNumInput::updateProperty(), PropertyLib::PDateTimeEdit::updateProperty(), PropertyLib::PDateEdit::updateProperty(), PropertyLib::PComboBox::updateProperty(), PropertyLib::PColorCombo::updateProperty(), PropertyLib::PColorButton::updateProperty(), and PropertyLib::PCheckBox::updateProperty().

QString PropertyLib::PropertyWidget::propertyName  )  const [virtual]
 

Returns:
the name of edited property.

Definition at line 31 of file propertywidget.cpp.

References m_property, and PropertyLib::MultiProperty::name().

Referenced by PropertyLib::PropertyEditor::propertyValueChanged().

void PropertyLib::PropertyWidget::setProperty MultiProperty property  )  [virtual]
 

Sets the name of edited property.

Definition at line 36 of file propertywidget.cpp.

References m_property.

Referenced by PropertyLib::PropertyEditor::prepareEditor().

virtual void PropertyLib::PropertyWidget::setValue const QVariant value,
bool  emitChange = true
[pure virtual]
 

Sets the value shown in the editor widget.

Set emitChange to false if you don't want to emit propertyChanged signal.

Implemented in PropertyLib::PCheckBox, PropertyLib::PColorButton, PropertyLib::PColorCombo, PropertyLib::PComboBox, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PDoubleNumInput, PropertyLib::PDummyWidget, PropertyLib::PFontButton, PropertyLib::PFontCombo, PropertyLib::PLineEdit, PropertyLib::PPixmapEdit, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PSpinBox, PropertyLib::PStringListEdit, PropertyLib::PSymbolCombo, PropertyLib::PUrlEdit, and PropertyLib::PYesNoButton.

Referenced by PropertyLib::PropertyEditor::prepareEditor(), PropertyLib::PropertyEditor::propertyValueChanged(), and PropertyLib::PropertyWidgetProxy::setValue().

void PropertyLib::PropertyWidget::setValueList const QMap< QString, QVariant > &  valueList  )  [virtual]
 

Sets the list of possible values shown in the editor widget.

This method does not emit propertyChanged signal.

Reimplemented in PropertyLib::PComboBox.

Definition at line 49 of file propertywidget.cpp.

Referenced by PropertyLib::PropertyEditor::prepareEditor().

void PropertyLib::PropertyWidget::undo  )  [virtual]
 

Reverts the property value to previous setting.

Definition at line 54 of file propertywidget.cpp.

References m_property, and PropertyLib::MultiProperty::undo().

Referenced by PropertyLib::PropertyEditor::undo().

virtual QVariant PropertyLib::PropertyWidget::value  )  const [pure virtual]
 

Returns:
the value currently entered in the editor widget.

Implemented in PropertyLib::PCheckBox, PropertyLib::PColorButton, PropertyLib::PColorCombo, PropertyLib::PComboBox, PropertyLib::PDateEdit, PropertyLib::PDateTimeEdit, PropertyLib::PDoubleNumInput, PropertyLib::PDummyWidget, PropertyLib::PFontButton, PropertyLib::PFontCombo, PropertyLib::PLineEdit, PropertyLib::PPixmapEdit, PropertyLib::PPointEdit, PropertyLib::PRectEdit, PropertyLib::PSizeEdit, PropertyLib::PSizePolicyEdit, PropertyLib::PSpinBox, PropertyLib::PStringListEdit, PropertyLib::PSymbolCombo, PropertyLib::PUrlEdit, and PropertyLib::PYesNoButton.

Referenced by PropertyLib::PropertyWidgetProxy::value().


Member Data Documentation

MultiProperty* PropertyLib::PropertyWidget::m_property [protected]
 

Definition at line 83 of file propertywidget.h.

Referenced by propertyName(), setProperty(), and undo().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:33:29 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003