lib
KoProperty::Widget Class Reference
#include <widget.h>
Inheritance diagram for KoProperty::Widget:

Detailed Description
The base class for all item editors used in Editor.
Definition at line 36 of file widget.h.
Signals | |
void | valueChanged (Widget *widget) |
void | acceptInput (Widget *widget) |
void | rejectInput (Widget *widget) |
Public Member Functions | |
Widget (Property *property, QWidget *parent, const char *name="property_editor") | |
virtual | ~Widget () |
virtual QVariant | value () const=0 |
virtual void | setValue (const QVariant &value, bool emitChange=true)=0 |
virtual Property * | property () const |
virtual void | setProperty (Property *property) |
virtual void | drawViewer (QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) |
virtual void | undo () |
void | setFocusWidget (QWidget *focusProxy) |
bool | leavesTheSpaceForRevertButton () const |
bool | hasBorders () const |
bool | isReadOnly () const |
void | setReadOnly (bool readOnly) |
bool | visibleFlag () const |
Protected Member Functions | |
void | setEditor (QWidget *editor) |
virtual bool | eventFilter (QObject *watched, QEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
void | setLeavesTheSpaceForRevertButton (bool set) |
void | setHasBorders (bool set) |
virtual void | setReadOnlyInternal (bool readOnly)=0 |
void | setVisibleFlag (bool visible) |
Protected Attributes | |
WidgetPrivate * | d |
Member Function Documentation
virtual QVariant KoProperty::Widget::value | ( | ) | const [pure virtual] |
- Returns:
- the value currently entered in the item editor widget.
Implemented in KoProperty::BoolEdit, KoProperty::ThreeStateBoolEdit, KoProperty::ColorButton, KoProperty::ComboBox, KoProperty::CursorEdit, KoProperty::DateEdit, KoProperty::DateTimeEdit, KoProperty::DummyWidget, KoProperty::FontEdit, KoProperty::LineStyleEdit, KoProperty::PixmapEdit, KoProperty::PointEdit, KoProperty::RectEdit, KoProperty::SizeEdit, KoProperty::SizePolicyEdit, KoProperty::IntEdit, KoProperty::DoubleEdit, KoProperty::StringEdit, KoProperty::StringListEdit, KoProperty::SymbolCombo, KoProperty::TimeEdit, and KoProperty::URLEdit.
virtual void KoProperty::Widget::setValue | ( | const QVariant & | value, | |
bool | emitChange = true | |||
) | [pure virtual] |
Sets the value shown in the item editor widget. Set emitChange to false if you don't want to emit propertyChanged signal.
Implemented in KoProperty::BoolEdit, KoProperty::ThreeStateBoolEdit, KoProperty::ColorButton, KoProperty::ComboBox, KoProperty::CursorEdit, KoProperty::DateEdit, KoProperty::DateTimeEdit, KoProperty::DummyWidget, KoProperty::FontEdit, KoProperty::LineStyleEdit, KoProperty::PixmapEdit, KoProperty::PointEdit, KoProperty::RectEdit, KoProperty::SizeEdit, KoProperty::SizePolicyEdit, KoProperty::IntEdit, KoProperty::DoubleEdit, KoProperty::StringEdit, KoProperty::StringListEdit, KoProperty::SymbolCombo, KoProperty::TimeEdit, and KoProperty::URLEdit.
Property * Widget::property | ( | ) | const [virtual] |
void Widget::setProperty | ( | Property * | property | ) | [virtual] |
Sets the name of edited property.
Reimplemented in KoProperty::ThreeStateBoolEdit, KoProperty::ComboBox, KoProperty::CursorEdit, and KoProperty::URLEdit.
Definition at line 78 of file widget.cpp.
void Widget::drawViewer | ( | QPainter * | p, | |
const QColorGroup & | cg, | |||
const QRect & | r, | |||
const QVariant & | value | |||
) | [virtual] |
Function to draw a property viewer when the item editor isn't shown.
Reimplemented in KoProperty::BoolEdit, KoProperty::ThreeStateBoolEdit, KoProperty::ColorButton, KoProperty::ComboBox, KoProperty::CursorEdit, KoProperty::DateEdit, KoProperty::DateTimeEdit, KoProperty::DummyWidget, KoProperty::FontEdit, KoProperty::LineStyleEdit, KoProperty::PixmapEdit, KoProperty::PointEdit, KoProperty::RectEdit, KoProperty::SizeEdit, KoProperty::SizePolicyEdit, KoProperty::IntEdit, KoProperty::DoubleEdit, KoProperty::StringListEdit, KoProperty::SymbolCombo, and KoProperty::TimeEdit.
Definition at line 88 of file widget.cpp.
void Widget::undo | ( | ) | [virtual] |
Reverts the property value to previous setting.
Definition at line 101 of file widget.cpp.
void Widget::setFocusWidget | ( | QWidget * | focusProxy | ) |
Sets the widget that will receive focus when the Widget is selected.
Definition at line 152 of file widget.cpp.
bool Widget::leavesTheSpaceForRevertButton | ( | ) | const |
bool Widget::hasBorders | ( | ) | const |
- Returns:
- true if this editor has borders. Editors with borders have slightly larger height and width set by property editor widget.
Definition at line 184 of file widget.cpp.
bool Widget::isReadOnly | ( | ) | const |
- Returns:
- true if the widget is read-only. Read-only property widget does not allow to change its property value. The flag is inherited from the underlying property and property set. Editor::setValue() method will still work, however.
- See also:
- Set::isReadOnly().
Definition at line 208 of file widget.cpp.
void Widget::setReadOnly | ( | bool | readOnly | ) |
Sets this widget to be read-only. Disables or enables editing in the appropriate widget(s).
- See also:
- isReadOnly()
Definition at line 214 of file widget.cpp.
bool Widget::eventFilter | ( | QObject * | watched, | |
QEvent * | e | |||
) | [protected, virtual] |
Filters some event for main widget, eg Enter or Esc key presses.
Reimplemented in KoProperty::BoolEdit, KoProperty::ColorButton, KoProperty::FontEdit, and KoProperty::PixmapEdit.
Definition at line 108 of file widget.cpp.
virtual void KoProperty::Widget::setReadOnlyInternal | ( | bool | readOnly | ) | [protected, pure virtual] |
Called by setReadOnly(bool). For implementation: for read-only you should disable editing in the appropriate widget(s).
Implemented in KoProperty::BoolEdit, KoProperty::ColorButton, KoProperty::ComboBox, KoProperty::DateEdit, KoProperty::DateTimeEdit, KoProperty::DummyWidget, KoProperty::FontEdit, KoProperty::LineStyleEdit, KoProperty::PixmapEdit, KoProperty::PointEdit, KoProperty::RectEdit, KoProperty::SizeEdit, KoProperty::SizePolicyEdit, KoProperty::IntEdit, KoProperty::DoubleEdit, KoProperty::StringEdit, KoProperty::StringListEdit, KoProperty::SymbolCombo, KoProperty::TimeEdit, and KoProperty::URLEdit.
void Widget::setVisibleFlag | ( | bool | visible | ) | [protected] |
Used only in setReadOnlyInternal() to make the widget visible or invisible. This flag is checked by Editor when the widget is about to show. By default widgets are visible.
Definition at line 227 of file widget.cpp.
The documentation for this class was generated from the following files: