lib

KoProperty::Editor Class Reference

#include <editor.h>

Inheritance diagram for KoProperty::Editor:

KListView List of all members.

Detailed Description

A listview to edit properties.

Editor uses property options using Property::option(const char *) to override default behaviour of editor items. Currently supported options are:

  • min: integer setting for minimum value of IntEdit and DoubleEdit item. Default is 0. Set "min" to -1, if you want this special value to be allowed.
  • minValueText: i18n'd QString used in IntEdit to set "specialValueText" widget's property
  • max: integer setting for minimum value of IntEdit item. Default is 0xffff.
  • precision: The number of decimals after the decimal point. (for DoubleEdit)
  • step : the size of the step that is taken when the user hits the up or down buttons (for DoubleEdit)
Author:
Cedric Pasteur <cedric.pasteur@free.fr>

Alexander Dymo <cloudtemple@mskat.net>

Jaroslaw Staniek <js@iidea.pl>

Definition at line 61 of file editor.h.


Public Slots

void changeSet (Set *set, bool preservePrevSelection=false)
void clear (bool editorOnly=false)
void acceptInput ()

Signals

void propertySetChanged (KoProperty::Set *set)

Public Member Functions

 Editor (QWidget *parent=0, bool autoSync=true, const char *name=0)
virtual ~Editor ()
virtual QSize sizeHint () const
virtual void setFocus ()

Protected Slots

void slotPropertyChanged (KoProperty::Set &set, KoProperty::Property &property)
void slotPropertyReset (KoProperty::Set &set, KoProperty::Property &property)
void slotWidgetValueChanged (Widget *widget)
void slotWidgetAcceptInput (Widget *widget)
void slotWidgetRejectInput (Widget *widget)
void slotSetWillBeCleared ()
void slotSetWillBeDeleted ()
void slotClicked (QListViewItem *item)
void undo ()
void updateEditorGeometry (bool forceUndoButtonSettings=false, bool undoButtonVisible=false)
void updateEditorGeometry (EditorItem *item, Widget *widget, bool forceUndoButtonSettings=false, bool undoButtonVisible=false)
void hideEditor ()
void slotCollapsed (QListViewItem *item)
void slotExpanded (QListViewItem *item)
void slotColumnSizeChanged (int section)
void slotColumnSizeChanged (int section, int oldSize, int newSize)
void slotCurrentChanged (QListViewItem *item)
void changeSetLater ()
void selectItemLater ()

Protected Member Functions

WidgetcreateWidgetForProperty (Property *property, bool changeWidgetProperty=true)
void clearWidgetCache ()
void fill ()
void addItem (const QCString &name, EditorItem *parent)
void showUndoButton (bool show)
virtual void resizeEvent (QResizeEvent *ev)
virtual bool eventFilter (QObject *watched, QEvent *e)
bool handleKeyPress (QKeyEvent *ev)
virtual bool event (QEvent *e)
void updateFont ()
virtual void contentsMousePressEvent (QMouseEvent *e)

Friends

class EditorItem
class Widget

Constructor & Destructor Documentation

Editor::Editor QWidget *  parent = 0,
bool  autoSync = true,
const char *  name = 0
 

Creates an empty Editor with parent as parent widget. If autoSync == true, properties values are automatically synced as soon as editor contents change (eg the user types text, etc.) and the values are written in the property set. Otherwise, property set is updated only when selected item changes or user presses Enter key. Each property can overwrite this if its autoSync() == 0 or 1.

Definition at line 122 of file editor.cpp.


Member Function Documentation

void Editor::acceptInput  )  [slot]
 

Accept the changes mae to the current editor (as if the user had pressed Enter key)

Definition at line 504 of file editor.cpp.

void Editor::addItem const QCString &  name,
EditorItem parent
[protected]
 

Todo:
allow to have child prop with child items too

Definition at line 239 of file editor.cpp.

void Editor::changeSet Set set,
bool  preservePrevSelection = false
[slot]
 

Populates the editor with an item for each property in the List. Also creates child items for composed properties.

Definition at line 275 of file editor.cpp.

void Editor::clear bool  editorOnly = false  )  [slot]
 

Clears all items in the list. if editorOnly is true, then only the current editor will be cleared, not the whole list.

Definition at line 372 of file editor.cpp.

void Editor::clearWidgetCache  )  [protected]
 

Deletes cached machines.

Definition at line 628 of file editor.cpp.

Widget * Editor::createWidgetForProperty Property property,
bool  changeWidgetProperty = true
[protected]
 

Returns:
Widget for given property. Uses cache to store created widgets. Cache will be cleared only with clearWidgetCache().

Definition at line 592 of file editor.cpp.

void KoProperty::Editor::propertySetChanged KoProperty::Set set  )  [signal]
 

Emitted when current property set has been changed. May be 0.

void Editor::slotClicked QListViewItem *  item  )  [protected, slot]
 

This slot is called when the user clicks the list view. It takes care of deleting current editor and creating a new editor for the newly selected item.

Definition at line 528 of file editor.cpp.

void Editor::slotPropertyChanged KoProperty::Set set,
KoProperty::Property property
[protected, slot]
 

Updates property widget in the editor.

Definition at line 407 of file editor.cpp.

void Editor::slotSetWillBeCleared  )  [protected, slot]
 

Called when current property set is about to be cleared.

Definition at line 575 of file editor.cpp.

void Editor::slotSetWillBeDeleted  )  [protected, slot]
 

Called when current property set is about to be destroyed.

Definition at line 585 of file editor.cpp.

void Editor::slotWidgetAcceptInput Widget widget  )  [protected, slot]
 

Called when the user presses Enter to accet the input (only applies when autoSync() == false).

Definition at line 510 of file editor.cpp.

void Editor::slotWidgetRejectInput Widget widget  )  [protected, slot]
 

Called when the user presses Esc. Calls undo().

Definition at line 519 of file editor.cpp.

void Editor::slotWidgetValueChanged Widget widget  )  [protected, slot]
 

Updates property in the list when new value is selected in the editor.

Definition at line 481 of file editor.cpp.

void Editor::undo  )  [protected, slot]
 

Undoes the last change in property editor.

Definition at line 389 of file editor.cpp.


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