QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPropertyEditor Class Reference

Copyright (c) 2011-2013 by Andrew Mustun. More...

#include <RPropertyEditor.h>

Inheritance diagram for RPropertyEditor:
RPropertyListener PropertyEditorImpl

List of all members.

Public Member Functions

virtual void clearEditor ()
 This method is called to signal that no properties are currently relevant.
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, RS::EntityType entityTypeFilter=RS::EntityAll)
void propertyChanged (RPropertyTypeId propertyTypeId, QVariant propertyValue, RS::EntityType entityTypeFilter=RS::EntityAll, QVariant::Type typeHint=QVariant::Invalid)
 RPropertyEditor ()
 Copyright (c) 2011-2013 by Andrew Mustun.
virtual void updateFromDocument (RDocument *document, bool onlyChanges, RS::EntityType entityTypeFilter=RS::EntityAll)
 Updates the property editor to contain the properties of the objects that are selected for editing in the given document.
virtual void updateFromObject (RObject *object, RDocument *document=NULL)
 Implements update from RPropertyListener.
virtual ~RPropertyEditor ()
 Destructor.
- Public Member Functions inherited from RPropertyListener
virtual ~RPropertyListener ()

Protected Types

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

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.
virtual void updateEditor (RObject &object, bool doUpdateGui, RDocument *document=NULL)
 Updates the property widget to include the properties of the given property owner.
virtual void updateGui (bool onlyChanges=false, RS::EntityType entityTypeFilter=RS::EntityAll)
 Updates the user interface of this property editor.
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.

Protected Attributes

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

Detailed Description

Copyright (c) 2011-2013 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 wrapped for 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-2013 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

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.

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,
RS::EntityType  entityTypeFilter = RS::EntityAll 
)
void RPropertyEditor::propertyChanged ( RPropertyTypeId  propertyTypeId,
QVariant  propertyValue,
RS::EntityType  entityTypeFilter = RS::EntityAll,
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::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  entityTypeFilter = RS::EntityAll 
)
virtual

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

Implements RPropertyListener.

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

Implements update from RPropertyListener.

Implements RPropertyListener.

virtual void RPropertyEditor::updateGui ( bool  onlyChanges = false,
RS::EntityType  entityTypeFilter = RS::EntityAll 
)
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::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:
propertyTypeId,:Id of the property in the format "Group|Property".
property,:Value and attributes of the property.

Member Data Documentation

RPropertyGroupMap RPropertyEditor::combinedProperties
protected
QMap<RS::EntityType, int> RPropertyEditor::combinedTypes
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: