lib

KoProperty::Widget Class Reference

#include <widget.h>

Inheritance diagram for KoProperty::Widget:

KoProperty::BoolEdit KoProperty::ColorButton KoProperty::ComboBox KoProperty::DateEdit KoProperty::DateTimeEdit KoProperty::DoubleEdit KoProperty::DummyWidget KoProperty::FontEdit KoProperty::IntEdit KoProperty::LineStyleEdit KoProperty::PixmapEdit KoProperty::PointEdit KoProperty::RectEdit KoProperty::SizeEdit KoProperty::SizePolicyEdit KoProperty::StringEdit KoProperty::StringListEdit KoProperty::SymbolCombo KoProperty::TimeEdit KoProperty::URLEdit List of all members.

Detailed Description

The base class for all item editors used in Editor.

Author:
Cedric Pasteur <cedric.pasteur@free.fr>

Alexander Dymo <cloudtemple@mskat.net>

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 Propertyproperty () 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

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::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 91 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 111 of file widget.cpp.

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 187 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 211 of file widget.cpp.

bool Widget::leavesTheSpaceForRevertButton  )  const
 

See also:
d->leaveTheSpaceForRevertButton description

Definition at line 169 of file widget.cpp.

Property * Widget::property  )  const [virtual]
 

Returns:
edited property.

Definition at line 75 of file widget.cpp.

void Widget::setFocusWidget QWidget *  focusProxy  ) 
 

Sets the widget that will receive focus when the Widget is selected.

Definition at line 155 of file widget.cpp.

void Widget::setProperty Property property  )  [virtual]
 

Sets the name of edited property.

Reimplemented in KoProperty::ComboBox, KoProperty::CursorEdit, and KoProperty::URLEdit.

Definition at line 81 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 217 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.

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

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 230 of file widget.cpp.

void Widget::undo  )  [virtual]
 

Reverts the property value to previous setting.

Definition at line 104 of file widget.cpp.

virtual QVariant KoProperty::Widget::value  )  const [pure virtual]
 

Returns:
the value currently entered in the item editor widget.

Implemented in KoProperty::BoolEdit, 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.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys