QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RPropertyEditor Class Reference

Base class for property editors. More...

#include <RPropertyEditor.h>

Inheritance diagram for RPropertyEditor:
RPropertyListener RLayerListener PropertyEditorImpl

Public Member Functions

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::EntityTypegetTypes ()
 
void listPropertyChanged (RPropertyTypeId propertyTypeId, int index, QVariant propertyValue)
 
void propertyChanged (RPropertyTypeId propertyTypeId, QVariant propertyValue, RS::MetaType typeHint=RS::UnknownType)
 
 RPropertyEditor ()
 Default Constructor.
 
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.
 
virtual ~RPropertyEditor ()
 Destructor.
 
- Public Member Functions inherited from RPropertyListener
virtual ~RPropertyListener ()
 
- Public Member Functions inherited from RLayerListener
virtual ~RLayerListener ()
 

Static Public Member Functions

static bool checkType (RS::EntityType type, RS::EntityType filter)
 
static RPropertyEditorgetInstance ()
 
static void makeReadOnly (QWidget *control, bool on)
 

Protected Types

typedef QMap< QString, RPropertyMapRPropertyGroupMap
 group key / key,value,attributes
 
typedef QMap< QString, QPair< QVariant, RPropertyAttributes > > RPropertyMap
 key / value / attributes
 

Protected Member Functions

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 Protected Member Functions

static void computePropertyValue (RProperty &property)
 

Protected Attributes

RPropertyGroupMap combinedProperties
 
QMap< RS::EntityType, int > combinedTypes
 
RS::EntityType entityTypeFilter
 
QStringList groupOrder
 
bool guiUpToDate
 
QMap< QString, QStringList > propertyOrder
 
bool updatesDisabled
 

Static Protected Attributes

static RPropertyEditorinstance = NULL
 Copyright (c) 2011-2018 by Andrew Mustun.
 

Private Attributes

bool terminate
 

Detailed Description

Base class for property editors.

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

Scriptable:\nThis class is available in script environments.\n
\generateScriptShell

Member Typedef Documentation

◆ RPropertyGroupMap

group key / key,value,attributes

◆ RPropertyMap

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

key / value / attributes

Constructor & Destructor Documentation

◆ RPropertyEditor()

RPropertyEditor::RPropertyEditor ( )

Default Constructor.

◆ ~RPropertyEditor()

RPropertyEditor::~RPropertyEditor ( )
virtual

Destructor.

Member Function Documentation

◆ checkType()

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

◆ clearEditor()

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.

Implements RPropertyListener.

◆ clearLayers()

void RPropertyEditor::clearLayers ( )
virtual

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

Implements RLayerListener.

◆ computePropertyValue()

void RPropertyEditor::computePropertyValue ( RProperty & property)
staticprotected

◆ getAppProperties()

virtual QStringList RPropertyEditor::getAppProperties ( )
inlinevirtual

◆ getCustomPropertyAttributes()

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

◆ getEntityTypeFilter()

RS::EntityType RPropertyEditor::getEntityTypeFilter ( ) const
inline

◆ getFixedCustomPropertyNames()

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

◆ getGroupTitles()

QStringList RPropertyEditor::getGroupTitles ( )
Returns
All groups in correct order.

◆ getInstance()

RPropertyEditor * RPropertyEditor::getInstance ( )
static

◆ getPropertyAttributes() [1/2]

RPropertyAttributes RPropertyEditor::getPropertyAttributes ( const QString & group,
const QString & title )
Returns
Property attributes for given property.

◆ getPropertyAttributes() [2/2]

RPropertyAttributes RPropertyEditor::getPropertyAttributes ( const RPropertyTypeId & propertyTypeId)
Returns
Property attributes of given property.

◆ getPropertyTitles()

QStringList RPropertyEditor::getPropertyTitles ( const QString & group)
Returns
All properties of the given group in correct order.

◆ getPropertyValue() [1/2]

QVariant RPropertyEditor::getPropertyValue ( const QString & group,
const QString & title )
Returns
Property value of given property.

◆ getPropertyValue() [2/2]

QVariant RPropertyEditor::getPropertyValue ( const RPropertyTypeId & propertyTypeId)
Returns
Property value of given property.

◆ getTypeCount()

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

◆ getTypes()

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

◆ listPropertyChanged()

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

◆ makeReadOnly()

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

◆ propertyChanged()

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

◆ setCurrentLayer()

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

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

Implements RLayerListener.

◆ setEntityTypeFilter()

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

◆ showCustomAppProperties()

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

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

◆ updateEditor()

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

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

Non-Scriptable:\nThis function is not available in script environments.\n

◆ updateFromDocument()

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
filterRS::EntityUnknown to use same filter as previously used, any other value to change filter.

Implements RPropertyListener.

◆ updateFromDocumentNow()

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

◆ updateFromObject()

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

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

Implements RPropertyListener.

◆ updateGui()

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

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.

◆ updateLayers() [1/2]

void RPropertyEditor::updateLayers ( RDocumentInterface * documentInterface)
virtual

◆ updateLayers() [2/2]

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.

Implements RLayerListener.

◆ updateProperty()

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
propertyTypeIdId of the property.
showOnRequestTrue to show also slow properties shown on request.

Member Data Documentation

◆ combinedProperties

RPropertyGroupMap RPropertyEditor::combinedProperties
protected

◆ combinedTypes

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

◆ entityTypeFilter

RS::EntityType RPropertyEditor::entityTypeFilter
protected

◆ groupOrder

QStringList RPropertyEditor::groupOrder
protected

◆ guiUpToDate

bool RPropertyEditor::guiUpToDate
protected

◆ instance

RPropertyEditor * RPropertyEditor::instance = NULL
staticprotected

Copyright (c) 2011-2018 by Andrew Mustun.

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.

◆ propertyOrder

QMap<QString, QStringList> RPropertyEditor::propertyOrder
protected

◆ terminate

bool RPropertyEditor::terminate
private

◆ updatesDisabled

bool RPropertyEditor::updatesDisabled
protected

The documentation for this class was generated from the following files: