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 widgets use 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)
  • 3rdState: i18n'd QString used in BoolEdit. If not empty, the the editor's button accept third "null" state with name equal to this string. When this value is selected, Widget::value() returns null QVariant. This option is used for example in the "defaultValue" property for a field of type boolean (in Kexi Table Designer). Third, "null" value of the property means there is no "defaultValue" specified.
Author:
Cedric Pasteur <cedric.pasteur@free.fr>

Alexander Dymo <cloudtemple@mskat.net>

Jaroslaw Staniek <js@iidea.pl>

Definition at line 63 of file editor.h.


Public Slots

void changeSet (Set *set, bool preservePrevSelection=false)
void changeSet (Set *set, const QCString &propertyToSelect)
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 QSize sizeHint () const
virtual void setFocus ()
virtual void setSorting (int column, bool ascending=true)

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 updateGroupLabelsPosition ()
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)
void changeSetInternal (Set *set, bool preservePrevSelection, const QCString &propertyToSelect)

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::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. If preservePrevSelection is true, previously selected editor item will be kept selected, if present.

Definition at line 287 of file editor.cpp.

void Editor::changeSet ( Set set,
const QCString &  propertyToSelect 
) [slot]

Populates the editor with an item for each property in the List. Also creates child items for composed properties. If propertyToSelect is not empty, editor item for this property name will be selected, if present.

Definition at line 293 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 409 of file editor.cpp.

void Editor::acceptInput (  )  [slot]

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

Definition at line 545 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::slotPropertyChanged ( KoProperty::Set set,
KoProperty::Property property 
) [protected, slot]

Updates property widget in the editor.

Todo:
should we move this somewhere?

Definition at line 444 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 520 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 551 of file editor.cpp.

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

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

Definition at line 560 of file editor.cpp.

void Editor::slotSetWillBeCleared (  )  [protected, slot]

Called when current property set is about to be cleared.

Definition at line 616 of file editor.cpp.

void Editor::slotSetWillBeDeleted (  )  [protected, slot]

Called when current property set is about to be destroyed.

Definition at line 627 of file editor.cpp.

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 569 of file editor.cpp.

void Editor::undo (  )  [protected, slot]

Undoes the last change in property editor.

Definition at line 426 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 634 of file editor.cpp.

void Editor::clearWidgetCache (  )  [protected]

Deletes cached machines.

Definition at line 670 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 251 of file editor.cpp.

void Editor::changeSetInternal ( Set set,
bool  preservePrevSelection,
const QCString &  propertyToSelect 
) [protected]

Used for changeSet().

Definition at line 299 of file editor.cpp.


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