QCAD
Open Source 2D CAD
RPropertyEditor Class Reference

Copyright (c) 2011-2016 by Andrew Mustun. 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. More...
 
virtual void clearLayers ()
 This method is called to signal that no document is currently active. More...
 
RS::EntityType getEntityTypeFilter () const
 
QStringList getGroupTitles ()
 
RPropertyAttributes getPropertyAttributes (const RPropertyTypeId &propertyTypeId)
 
RPropertyAttributes getPropertyAttributes (const QString &group, const QString &title)
 
QStringList getPropertyTitles (const QString &group)
 
QVariant getPropertyValue (const RPropertyTypeId &propertyTypeId)
 
QVariant getPropertyValue (const QString &group, const QString &title)
 
int getTypeCount (RS::EntityType type)
 
QList< RS::EntityTypegetTypes ()
 
void listPropertyChanged (RPropertyTypeId propertyTypeId, int index, QVariant propertyValue)
 
void propertyChanged (RPropertyTypeId propertyTypeId, QVariant propertyValue, QVariant::Type typeHint=QVariant::Invalid)
 
 RPropertyEditor ()
 Copyright (c) 2011-2016 by Andrew Mustun. More...
 
virtual void setCurrentLayer (RDocumentInterface *documentInterface)
 This method is called when a different layer becomes the new current layer. More...
 
void setEntityTypeFilter (RS::EntityType type)
 
virtual void updateFromDocument (RDocument *document, bool onlyChanges, RS::EntityType filter=RS::EntityUnknown, bool manual=false)
 Updates the property editor to contain the properties of the objects that are selected for editing in the given document. More...
 
virtual void updateFromObject (RObject *object, RDocument *document=NULL)
 Implements update from RPropertyListener. More...
 
virtual void updateLayers (RDocumentInterface *documentInterface)
 This method is called whenever at least one layer in the given document has changed. More...
 
virtual ~RPropertyEditor ()
 Destructor. More...
 
- 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)
 

Protected Types

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

Protected Member Functions

void removeAllButThese (const QMultiMap< QString, QString > &propertyTitles, bool customOnly=false)
 Removes all but the given properties from the combined properties collected so far. More...
 
virtual void updateEditor (RObject &object, bool doUpdateGui, RDocument *document=NULL)
 Updates the property widget to include the properties of the given property owner. More...
 
virtual void updateGui (bool onlyChanges=false)
 Updates the user interface of this property editor. More...
 
void updateProperty (const RPropertyTypeId &propertyTypeId, RObject &object, RDocument *document)
 Sets the property with the given name to the given value or to 'mixed' if that property exists already with a different value. More...
 

Protected Attributes

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

Detailed Description

Copyright (c) 2011-2016 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. Base class for property editors. Provides basic functionality that is common to any property editor implementation.

Scriptable:
This class is available in script environments.

Member Typedef Documentation

typedef QMap<QString, RPropertyMap> RPropertyEditor::RPropertyGroupMap
protected

group key / key,value,attributes

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

key / value / attributes

Constructor & Destructor Documentation

RPropertyEditor::RPropertyEditor ( )

Copyright (c) 2011-2016 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. Default Constructor.

RPropertyEditor::~RPropertyEditor ( )
virtual

Destructor.

Member Function Documentation

bool RPropertyEditor::checkType ( RS::EntityType  type,
RS::EntityType  filter 
)
static
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.

void RPropertyEditor::clearLayers ( )
virtual

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

Implements RLayerListener.

RS::EntityType RPropertyEditor::getEntityTypeFilter ( ) const
inline
QStringList RPropertyEditor::getGroupTitles ( )
Returns
All groups in correct order.
RPropertyAttributes RPropertyEditor::getPropertyAttributes ( const RPropertyTypeId propertyTypeId)
Returns
Property attributes of given propery.
RPropertyAttributes RPropertyEditor::getPropertyAttributes ( const QString &  group,
const QString &  title 
)
Returns
Property attributes of given propery.
QStringList RPropertyEditor::getPropertyTitles ( const QString &  group)
Returns
All properties of the given group in correct order.
QVariant RPropertyEditor::getPropertyValue ( const RPropertyTypeId propertyTypeId)
Returns
Property value of given propery.
QVariant RPropertyEditor::getPropertyValue ( const QString &  group,
const QString &  title 
)
Returns
Property value of given propery.
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,
QVariant::Type  typeHint = QVariant::Invalid 
)
void RPropertyEditor::removeAllButThese ( const QMultiMap< QString, QString > &  propertyTitles,
bool  customOnly = false 
)
protected

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

void RPropertyEditor::setCurrentLayer ( RDocumentInterface documentInterface)
virtual

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

Implements RLayerListener.

void RPropertyEditor::setEntityTypeFilter ( RS::EntityType  type)
inline
void RPropertyEditor::updateEditor ( RObject object,
bool  doUpdateGui,
RDocument document = NULL 
)
protectedvirtual

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

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

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.

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

Implements update from RPropertyListener.

Implements RPropertyListener.

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.

void RPropertyEditor::updateLayers ( RDocumentInterface documentInterface)
virtual

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

Implements RLayerListener.

void RPropertyEditor::updateProperty ( const RPropertyTypeId propertyTypeId,
RObject object,
RDocument document 
)
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 in the format "Group|Property".
propertyValue and attributes of the property.

Member Data Documentation

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

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