Kexi API Documentation (2.0 alpha)

KFormDesigner::WidgetPropertySet Class Reference

#include <widgetpropertyset.h>

List of all members.

Public Slots

void setSelectedWidget (QWidget *w, bool add=false, bool forceReload=false, bool moreWillBeSelected=false)
void setSelectedWidgetWithoutReload (QWidget *w, bool add=false, bool moreWillBeSelected=false)
void slotPropertyChanged (KoProperty::Set &set, KoProperty::Property &property)
void slotPropertyReset (KoProperty::Set &set, KoProperty::Property &property)
void slotWidgetDestroyed ()
void createPropertyCommandsInDesignMode (QWidget *widget, const QMap< QCString, QVariant > &propValues, CommandGroup *group, bool addToActiveForm=true, bool execFlagForSubCommands=false)

Signals

void widgetPropertyChanged (QWidget *w, const QCString &property, const QVariant &v)
void widgetNameChanged (const QCString &oldname, const QCString &newname)

Public Member Functions

 WidgetPropertySet (QObject *parent)
 ~WidgetPropertySet ()
KoProperty::Property & operator[] (const QCString &name)
KoProperty::Property & property (const QCString &name)
bool contains (const QCString &property)
void addPropertyCaption (const QCString &property, const QString &caption)
void addValueCaption (const QCString &value, const QString &caption)

Protected Member Functions

void addWidget (QWidget *w)
void createPropertiesForWidget (QWidget *w)
KoProperty::Property::ListData * createValueList (WidgetInfo *winfo, const QStringList &list)
void updatePropertyValue (ObjectTreeItem *tree, const char *property, const QMetaProperty *meta=0)
KoProperty::Set * set ()
void clearSet (bool dontSignalShowPropertySet=false)
void saveModifiedProperties ()
bool isNameValid (const QString &name)
void saveEnabledProperty (bool value)
bool eventFilter (QObject *o, QEvent *ev)
void setUndoing (bool isUndoing)
bool isUndoing ()
bool isPropertyVisible (const QCString &property, bool isTopLevel, const QCString &classname=QCString())
void createAlignProperty (const QMetaProperty *meta, QWidget *widget, QWidget *subwidget)
void saveAlignProperty (const QString &property)
void createLayoutProperty (ObjectTreeItem *item)
void saveLayoutProperty (const QString &property, const QVariant &value)
void initPropertiesDescription ()
 Adds translations for general properties, by adding items in d->propDesc.
QString propertyCaption (const QCString &name)
QString valueCaption (const QCString &name)
void emitWidgetPropertyChanged (QWidget *w, const QCString &property, const QVariant &value)
 Helper.

Friends

class FormManager
class PropertyCommand
class LayoutPropertyCommand
class GeometryPropertyCommand


Constructor & Destructor Documentation

WidgetPropertySet::WidgetPropertySet QObject *  parent  ) 
 

Definition at line 91 of file widgetpropertyset.cpp.

References initPropertiesDescription(), slotPropertyChanged(), and slotPropertyReset().

WidgetPropertySet::~WidgetPropertySet  ) 
 

Definition at line 105 of file widgetpropertyset.cpp.


Member Function Documentation

void WidgetPropertySet::addPropertyCaption const QCString &  property,
const QString caption
 

i18n function used by factories to add new property caption. Should be called on Factory creation.

Definition at line 1108 of file widgetpropertyset.cpp.

void WidgetPropertySet::addValueCaption const QCString &  value,
const QString caption
 

Definition at line 1115 of file widgetpropertyset.cpp.

void WidgetPropertySet::addWidget QWidget w  )  [protected]
 

Adds the widget in d->widgets, and updates property visibilty.

Definition at line 227 of file widgetpropertyset.cpp.

References isPropertyVisible(), and KFormDesigner::FormManager::self().

Referenced by setSelectedWidget().

void WidgetPropertySet::clearSet bool  dontSignalShowPropertySet = false  )  [protected]
 

Clears the set, and reset all members.

Definition at line 141 of file widgetpropertyset.cpp.

References saveModifiedProperties(), and KFormDesigner::FormManager::self().

Referenced by setSelectedWidget(), and slotWidgetDestroyed().

bool WidgetPropertySet::contains const QCString &  property  ) 
 

Definition at line 129 of file widgetpropertyset.cpp.

Referenced by KFormDesigner::WidgetFactory::changeProperty(), KFormDesigner::FormManager::createLayout(), KexiFormManager::setDataSourceFieldOrExpression(), StdWidgetFactory::setPropertyOptions(), and KexiFormView::updateDataSourcePage().

void WidgetPropertySet::createAlignProperty const QMetaProperty *  meta,
QWidget widget,
QWidget subwidget
[protected]
 

Creates the properties related to alignment (ie hAlign, vAlign and WordBreak) for the QWidget widget. subwidget is the same as widget if the widget itself handles the property and it's a child widget if the child handles the property. For example, the second case is true for KexiDBAutoField. meta is the QMetaProperty for "alignment" property" of subwidget.

Definition at line 770 of file widgetpropertyset.cpp.

References createValueList(), isPropertyVisible(), KFormDesigner::FormManager::self(), and updatePropertyValue().

Referenced by createPropertiesForWidget().

void WidgetPropertySet::createLayoutProperty ObjectTreeItem item  )  [protected]
 

Creates the "layout" property, for the Container representing item.

Definition at line 893 of file widgetpropertyset.cpp.

References createValueList(), KFormDesigner::Container::form(), KFormDesigner::Container::layoutMargin(), KFormDesigner::Container::layoutSpacing(), KFormDesigner::Container::layoutType(), KFormDesigner::Container::layoutTypeToString(), KFormDesigner::Container::NoLayout, KFormDesigner::FormManager::self(), updatePropertyValue(), and KFormDesigner::Container::widget().

Referenced by createPropertiesForWidget().

void WidgetPropertySet::createPropertiesForWidget QWidget w  )  [protected]
 

Fills the list with properties related to the widget w. Also updates properties old value and changed state.

Definition at line 264 of file widgetpropertyset.cpp.

References KFormDesigner::ObjectTreeItem::container(), createAlignProperty(), createLayoutProperty(), createValueList(), KFormDesigner::WidgetWithSubpropertiesInterface::findMetaSubproperty(), foreach, KFormDesigner::ObjectTreeItem::isEnabled(), isPropertyVisible(), KFormDesigner::Form::library(), KFormDesigner::ObjectTreeItem::modifiedProperties(), KFormDesigner::Form::objectTree(), KFormDesigner::FormManager::self(), KFormDesigner::WidgetWithSubpropertiesInterface::subproperies(), KFormDesigner::WidgetWithSubpropertiesInterface::subwidget(), and updatePropertyValue().

Referenced by setSelectedWidget().

void WidgetPropertySet::createPropertyCommandsInDesignMode QWidget widget,
const QMap< QCString, QVariant > &  propValues,
CommandGroup group,
bool  addToActiveForm = true,
bool  execFlagForSubCommands = false
[slot]
 

Definition at line 596 of file widgetpropertyset.cpp.

References KFormDesigner::CommandGroup::addCommand(), KFormDesigner::ObjectTreeItem::addModifiedProperty(), PropertyCommand, KFormDesigner::FormManager::self(), KFormDesigner::WidgetWithSubpropertiesInterface::subwidget(), and widgetPropertyChanged().

KoProperty::Property::ListData * WidgetPropertySet::createValueList WidgetInfo winfo,
const QStringList &  list
[protected]
 

Creates a map property description->prop. value from the list of keys list.

Definition at line 1083 of file widgetpropertyset.cpp.

References KFormDesigner::FormManager::self().

Referenced by createAlignProperty(), createLayoutProperty(), and createPropertiesForWidget().

void WidgetPropertySet::emitWidgetPropertyChanged QWidget w,
const QCString &  property,
const QVariant &  value
[protected]
 

Helper.

Returns:
The i18n'ed list of values, that will be shown by Property Editor (using descFromValue()).

Definition at line 581 of file widgetpropertyset.cpp.

References KFormDesigner::Form::library(), KFormDesigner::FormManager::self(), setSelectedWidget(), and widgetPropertyChanged().

Referenced by slotPropertyChanged().

bool WidgetPropertySet::eventFilter QObject *  o,
QEvent *  ev
[protected]
 

This function filters the event of the selected widget to automatically updates the "geometry" property when the widget is moved or resized in the Form.

Definition at line 733 of file widgetpropertyset.cpp.

References foreach, GeometryPropertyCommand, and KFormDesigner::FormManager::self().

void WidgetPropertySet::initPropertiesDescription  )  [protected]
 

Adds translations for general properties, by adding items in d->propDesc.

Todo:
perhaps a few of them shouldn't be translated within KFD mode, to be more Qt Designer friendly?

Definition at line 993 of file widgetpropertyset.cpp.

Referenced by WidgetPropertySet().

bool WidgetPropertySet::isNameValid const QString name  )  [protected]
 

Checks if the name entered by user is valid, ie that it is a valid identifier, and that there is no name conflict.

Definition at line 672 of file widgetpropertyset.cpp.

References KexiUtils::isIdentifier(), and KFormDesigner::FormManager::self().

Referenced by slotPropertyChanged().

bool WidgetPropertySet::isPropertyVisible const QCString &  property,
bool  isTopLevel,
const QCString &  classname = QCString()
[protected]
 

This function is used to filter the properties to be shown (ie not show "caption" if the widget isn't toplevel).

Returns:
true if the property should be shown. False otherwise.

Definition at line 434 of file widgetpropertyset.cpp.

References KFormDesigner::WidgetWithSubpropertiesInterface::findMetaSubproperty(), KFormDesigner::FormManager::self(), and KFormDesigner::WidgetWithSubpropertiesInterface::subwidget().

Referenced by addWidget(), createAlignProperty(), and createPropertiesForWidget().

bool WidgetPropertySet::isUndoing  )  [protected]
 

Definition at line 182 of file widgetpropertyset.cpp.

KoProperty::Property & WidgetPropertySet::operator[] const QCString &  name  ) 
 

Definition at line 117 of file widgetpropertyset.cpp.

KoProperty::Property & WidgetPropertySet::property const QCString &  name  ) 
 

Definition at line 123 of file widgetpropertyset.cpp.

Referenced by KFormDesigner::FormManager::changeFont(), KexiFormPart::slotAssignAction(), and slotPropertyChanged().

QString WidgetPropertySet::propertyCaption const QCString &  name  )  [protected]
 

Returns:
The i18n'ed name of the property whose name is name, that will be displayed in PropertyEditor.

Definition at line 1071 of file widgetpropertyset.cpp.

void WidgetPropertySet::saveAlignProperty const QString property  )  [protected]
 

Saves the properties related to alignment (ie hAlign, vAlign and WordBreak) and modifies the "alignment" property of the widget.

Definition at line 853 of file widgetpropertyset.cpp.

References KFormDesigner::ObjectTreeItem::addModifiedProperty(), PropertyCommand, KFormDesigner::FormManager::self(), and KFormDesigner::WidgetWithSubpropertiesInterface::subwidget().

Referenced by slotPropertyChanged().

void WidgetPropertySet::saveEnabledProperty bool  value  )  [protected]
 

Saves 'enabled' property, and takes care of updating widget's palette.

Definition at line 642 of file widgetpropertyset.cpp.

References foreach, KFormDesigner::ObjectTreeItem::isEnabled(), KFormDesigner::FormManager::self(), KFormDesigner::ObjectTreeItem::setEnabled(), and widgetPropertyChanged().

Referenced by slotPropertyChanged().

void WidgetPropertySet::saveLayoutProperty const QString property,
const QVariant &  value
[protected]
 

Saves the "layout" property and changes the Container 's layout ( using Container::setLayout() ).

Definition at line 932 of file widgetpropertyset.cpp.

References KFormDesigner::ObjectTreeItem::addModifiedProperty(), KFormDesigner::ObjectTreeItem::container(), KFormDesigner::Container::layout(), LayoutPropertyCommand, KFormDesigner::Container::NoLayout, PropertyCommand, KFormDesigner::FormManager::self(), KFormDesigner::Container::setLayout(), KFormDesigner::Container::setLayoutMargin(), KFormDesigner::Container::setLayoutSpacing(), and KFormDesigner::Container::stringToLayoutType().

Referenced by slotPropertyChanged().

void WidgetPropertySet::saveModifiedProperties  )  [protected]
 

Saves old values of modified properties in ObjectTreeItem, so that we can restore them later.

Definition at line 160 of file widgetpropertyset.cpp.

References KFormDesigner::ObjectTreeItem::addModifiedProperty(), and KFormDesigner::FormManager::self().

Referenced by clearSet().

KoProperty::Set * WidgetPropertySet::set  )  [protected]
 

Returns:
the property list hold by this object. Do not modify the list, just use this method to change Editor's list.

Definition at line 135 of file widgetpropertyset.cpp.

Referenced by KFormDesigner::FormManager::setEditor().

void WidgetPropertySet::setSelectedWidget QWidget w,
bool  add = false,
bool  forceReload = false,
bool  moreWillBeSelected = false
[slot]
 

Sets the widget which properties are shown in the property editor. If add is true, the list switch to multiple widget mode (only common properties are shown). Should be directly connected to Form::widgetSelected() signal. If forceReload is true, the the properties will be redisplayed in the property editor even if these were already displayed. If showPropertySet is true (the default), property editor will be updated for the current selection. This flag is set to false when we're selecting multiple widgets.

Definition at line 190 of file widgetpropertyset.cpp.

References addWidget(), clearSet(), createPropertiesForWidget(), KFormDesigner::FormManager::self(), and slotWidgetDestroyed().

Referenced by emitWidgetPropertyChanged().

void KFormDesigner::WidgetPropertySet::setSelectedWidgetWithoutReload QWidget w,
bool  add = false,
bool  moreWillBeSelected = false
[inline, slot]
 

Definition at line 75 of file widgetpropertyset.h.

void WidgetPropertySet::setUndoing bool  isUndoing  )  [protected]
 

Changes undoing state of the list. Used by Undo command to prevent recursion.

Definition at line 176 of file widgetpropertyset.cpp.

Referenced by KFormDesigner::GeometryPropertyCommand::execute(), KFormDesigner::PropertyCommand::execute(), KFormDesigner::GeometryPropertyCommand::unexecute(), and KFormDesigner::PropertyCommand::unexecute().

void WidgetPropertySet::slotPropertyChanged KoProperty::Set &  set,
KoProperty::Property &  property
[slot]
 

This function is called every time a property is modifed. It also takes care of saving set and enum properties.

Definition at line 479 of file widgetpropertyset.cpp.

References KFormDesigner::ObjectTreeItem::addModifiedProperty(), emitWidgetPropertyChanged(), foreach, isNameValid(), property(), PropertyCommand, saveAlignProperty(), saveEnabledProperty(), saveLayoutProperty(), KFormDesigner::FormManager::self(), and widgetNameChanged().

Referenced by WidgetPropertySet().

void WidgetPropertySet::slotPropertyReset KoProperty::Set &  set,
KoProperty::Property &  property
[slot]
 

This slot is called when a property is reset using the "reload" button in PropertyEditor.

Definition at line 703 of file widgetpropertyset.cpp.

References foreach, KFormDesigner::ObjectTreeItem::modifiedProperties(), and KFormDesigner::FormManager::self().

Referenced by WidgetPropertySet().

void WidgetPropertySet::slotWidgetDestroyed  )  [slot]
 

This slot is called when the watched widget is destroyed. Resets the buffer.

Definition at line 720 of file widgetpropertyset.cpp.

References clearSet(), and foreach.

Referenced by setSelectedWidget().

void WidgetPropertySet::updatePropertyValue ObjectTreeItem tree,
const char *  property,
const QMetaProperty *  meta = 0
[protected]
 

Changes property old value and changed state, using the value stored in tree. Optional meta can be specified if you need to handle enum values.

Definition at line 411 of file widgetpropertyset.cpp.

References KFormDesigner::ObjectTreeItem::modifiedProperties().

Referenced by createAlignProperty(), createLayoutProperty(), and createPropertiesForWidget().

QString WidgetPropertySet::valueCaption const QCString &  name  )  [protected]
 

Returns:
The i18n'ed name of the property's value whose name is name.

Definition at line 1077 of file widgetpropertyset.cpp.

void KFormDesigner::WidgetPropertySet::widgetNameChanged const QCString &  oldname,
const QCString &  newname
[signal]
 

This signal is emitted when the name of the widget is modified. oldname is the name of the widget before the change, newname is the name after renaming.

Referenced by slotPropertyChanged().

void KFormDesigner::WidgetPropertySet::widgetPropertyChanged QWidget w,
const QCString &  property,
const QVariant &  v
[signal]
 

This signal is emitted when a property was changed. widg is the widget concerned, property is the name of the modified property, and v is the new value of this property.

Referenced by createPropertyCommandsInDesignMode(), emitWidgetPropertyChanged(), and saveEnabledProperty().


Friends And Related Function Documentation

friend class FormManager [friend]
 

Definition at line 198 of file widgetpropertyset.h.

friend class GeometryPropertyCommand [friend]
 

Definition at line 201 of file widgetpropertyset.h.

Referenced by eventFilter().

friend class LayoutPropertyCommand [friend]
 

Definition at line 200 of file widgetpropertyset.h.

Referenced by saveLayoutProperty().

friend class PropertyCommand [friend]
 

Definition at line 199 of file widgetpropertyset.h.

Referenced by createPropertyCommandsInDesignMode(), saveAlignProperty(), saveLayoutProperty(), and slotPropertyChanged().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:51:02 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003