Skip to content

RPropertyEditor

Class in Core Module
Header: #include <src/core/RPropertyEditor.h>
Inherits: RPropertyListener, RLayerListener

Base class for property editors.

Provides basic functionality that is common to any property editor implementation.

Scriptable: This class is available in script environments.

\generateScriptShell

RPropertyEditor()
Default Constructor.
virtual ~RPropertyEditor()
Destructor.
virtual void clearEditor()
This method is called to signal that no properties are currently relevant.
virtual void clearLayers()
This method is called to signal that no document is currently active.
virtual QStringList getAppProperties()
RPropertyAttributes getCustomPropertyAttributes(const QString &group, const QString &title)
RS::EntityType getEntityTypeFilter() const
virtual QStringList getFixedCustomPropertyNames(const QList< RS::EntityType > &objectTypes)
QStringList getGroupTitles()
RPropertyAttributes getPropertyAttributes(const QString &group, const QString &title)
RPropertyAttributes getPropertyAttributes(const RPropertyTypeId &propertyTypeId)
QStringList getPropertyTitles(const QString &group)
QVariant getPropertyValue(const QString &group, const QString &title)
QVariant getPropertyValue(const RPropertyTypeId &propertyTypeId)
int getTypeCount(RS::EntityType type)
QList< RS::EntityType > getTypes()
void listPropertyChanged(RPropertyTypeId propertyTypeId, int index, QVariant propertyValue)
void propertyChanged(RPropertyTypeId propertyTypeId, QVariant propertyValue, RS::MetaType typeHint=RS::UnknownType)
virtual void setCurrentLayer(RDocumentInterface *documentInterface, RObject::Id previousLayerId)
This method is called when a different layer becomes the new current layer.
void setEntityTypeFilter(RS::EntityType type)
virtual void updateFromDocument(RDocument *document, bool onlyChanges, RS::EntityType filter=RS::EntityUnknown, bool manual=false, bool showOnRequest=false)
Removes all but the given properties from the combined properties collected so far.
void updateFromDocumentNow(RDocument *document, bool onlyChanges, RS::EntityType filter=RS::EntityUnknown, bool manual=false, bool showOnRequest=false)
virtual void updateFromObject(RObject *object, RDocument *document=NULL)
Implements updateFromObject from RPropertyListener to show properties for one single object.
virtual void updateLayers(RDocumentInterface *documentInterface)
virtual void updateLayers(RDocumentInterface *documentInterface, QList< RObject::Id > &layerIds)
This method is called whenever at least one layer in the given document has changed.
static bool checkType(RS::EntityType type, RS::EntityType filter)
static RPropertyEditor * getInstance()
static void makeReadOnly(QWidget *control, bool on)
typedef QMap< QString, RPropertyMap > RPropertyGroupMap
group key / key,value,attributes
typedef QMap< QString, QPair< QVariant, RPropertyAttributes > > RPropertyMap
key / value / attributes
virtual bool showCustomAppProperties(RPropertyAttributes::Option opt)
Can be re-implemented to show custom app properties of the given type(s).
virtual void updateEditor(RObject &object, const QList< RPropertyTypeId > &propertyTypeIds, bool doUpdateGui, RDocument *document=NULL, bool showOnRequest=false)
Updates the property widget to include the properties of the given property owner.
virtual void updateGui(bool onlyChanges=false)
Updates the user interface of this property editor.
void updateProperty(const RPropertyTypeId &propertyTypeId, RObject &object, RDocument *document, bool showOnRequest=false)
Sets the property with the given name to the given value or to ‘mixed’ if that property exists already with a different value.
static void computePropertyValue(RProperty &property)
RPropertyGroupMap combinedProperties
QMap< RS::EntityType, int > combinedTypes
RS::EntityType entityTypeFilter
QStringList groupOrder
bool guiUpToDate
QMap< QString, QStringList > propertyOrder
bool updatesDisabled
static RPropertyEditor * instance
bool terminate

RPropertyEditor::RPropertyEditor()

Default Constructor.

virtual RPropertyEditor::~RPropertyEditor()

virtual

Destructor.

virtual void RPropertyEditor::clearEditor()

virtual

This method is called to signal that no properties are currently relevant.

For example that no entities are selected in a document or that nothing is being drawn at the moment.

Reimplemented from clearEditor.

virtual void RPropertyEditor::clearLayers()

virtual

This method is called to signal that no document is currently active.

Reimplemented from clearLayers.

virtual QStringList RPropertyEditor::getAppProperties()

virtual inline

RPropertyAttributes RPropertyEditor::getCustomPropertyAttributes(const QString &group, const QString &title)

RS::EntityType RPropertyEditor::getEntityTypeFilter() const

inline const

virtual QStringList RPropertyEditor::getFixedCustomPropertyNames(const QList< RS::EntityType > &objectTypes)

virtual inline

QStringList RPropertyEditor::getGroupTitles()

Returns: All groups in correct order.

RPropertyAttributes RPropertyEditor::getPropertyAttributes(const QString &group, const QString &title)

Returns: Property attributes for given property.

RPropertyAttributes RPropertyEditor::getPropertyAttributes(const RPropertyTypeId &propertyTypeId)

Returns: Property attributes of given property.

QStringList RPropertyEditor::getPropertyTitles(const QString &group)

Returns: All properties of the given group in correct order.

QVariant RPropertyEditor::getPropertyValue(const QString &group, const QString &title)

Returns: Property value of given property.

QVariant RPropertyEditor::getPropertyValue(const RPropertyTypeId &propertyTypeId)

Returns: Property value of given property.

int RPropertyEditor::getTypeCount(RS::EntityType type)

QList< RS::EntityType > RPropertyEditor::getTypes()

void RPropertyEditor::listPropertyChanged(RPropertyTypeId propertyTypeId, int index, QVariant propertyValue)

void RPropertyEditor::propertyChanged(RPropertyTypeId propertyTypeId, QVariant propertyValue, RS::MetaType typeHint=RS::UnknownType)

virtual void RPropertyEditor::setCurrentLayer(RDocumentInterface *documentInterface, RObject::Id previousLayerId)

virtual

This method is called when a different layer becomes the new current layer.

Reimplemented from setCurrentLayer.

void RPropertyEditor::setEntityTypeFilter(RS::EntityType type)

inline

virtual void RPropertyEditor::updateFromDocument(RDocument *document, bool onlyChanges, RS::EntityType filter=RS::EntityUnknown, bool manual=false, bool showOnRequest=false)

virtual

Removes all but the given properties from the combined properties collected so far.

Implements updateFromDocument from RPropertyListener to show properties for selected objects.

Updates the property editor to contain the properties of the objects that are selected for editing in the given document.

Parameters:

  • filter: RS::EntityUnknown to use same filter as previously used, any other value to change filter.

Reimplemented from updateFromDocument.

void RPropertyEditor::updateFromDocumentNow(RDocument *document, bool onlyChanges, RS::EntityType filter=RS::EntityUnknown, bool manual=false, bool showOnRequest=false)

virtual void RPropertyEditor::updateFromObject(RObject *object, RDocument *document=NULL)

virtual

Implements updateFromObject from RPropertyListener to show properties for one single object.

Reimplemented from updateFromObject.

virtual void RPropertyEditor::updateLayers(RDocumentInterface *documentInterface)

virtual

virtual void RPropertyEditor::updateLayers(RDocumentInterface *documentInterface, QList< RObject::Id > &layerIds)

virtual

This method is called whenever at least one layer in the given document has changed.

Reimplemented from updateLayers.

static bool RPropertyEditor::checkType(RS::EntityType type, RS::EntityType filter)

static

static RPropertyEditor * RPropertyEditor::getInstance()

static

static void RPropertyEditor::makeReadOnly(QWidget *control, bool on)

static

typedef QMap<QString, RPropertyMap> RPropertyEditor::RPropertyGroupMap

protected

group key / key,value,attributes

typedef QMap<QString, QPair<QVariant, RPropertyAttributes> > RPropertyEditor::RPropertyMap

protected

key / value / attributes

virtual bool RPropertyEditor::showCustomAppProperties(RPropertyAttributes::Option opt)

virtual protected

Can be re-implemented to show custom app properties of the given type(s).

virtual void RPropertyEditor::updateEditor(RObject &object, const QList< RPropertyTypeId > &propertyTypeIds, bool doUpdateGui, RDocument *document=NULL, bool showOnRequest=false)

virtual protected

Updates the property widget to include the properties of the given property owner.

Non-Scriptable: This function is not available in script environments.

virtual void RPropertyEditor::updateGui(bool onlyChanges=false)

virtual inline protected

Updates the user interface of this property editor.

This is the only part of the property editor that depends on the user interface and GUI toolkit that is available.

void RPropertyEditor::updateProperty(const RPropertyTypeId &propertyTypeId, RObject &object, RDocument *document, bool showOnRequest=false)

protected

Sets the property with the given name to the given value or to ‘mixed’ if that property exists already with a different value.

Parameters:

  • propertyTypeId: Id of the property.
  • showOnRequest: True to show also slow properties shown on request.

static void RPropertyEditor::computePropertyValue(RProperty &property)

static protected

RPropertyGroupMap RPropertyEditor::combinedProperties

protected

QMap<RS::EntityType, int> RPropertyEditor::combinedTypes

protected

RS::EntityType RPropertyEditor::entityTypeFilter

protected

QStringList RPropertyEditor::groupOrder

protected

bool RPropertyEditor::guiUpToDate

protected

QMap<QString, QStringList> RPropertyEditor::propertyOrder

protected

bool RPropertyEditor::updatesDisabled

protected

static RPropertyEditor * RPropertyEditor::instance = NULL

static protected

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

bool RPropertyEditor::terminate

private