QCAD
Open Source 2D CAD
RPropertyTypeId Class Reference

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

#include <RPropertyTypeId.h>

Public Member Functions

void generateId (const std::type_info &classInfo, const QString &groupTitle, const QString &title, bool forceNew=false, RPropertyAttributes::Options options=RPropertyAttributes::NoOptions)
 
void generateId (const std::type_info &classInfo, const RPropertyTypeId &other)
 
QString getCustomPropertyName () const
 
QString getCustomPropertyTitle () const
 
long int getId () const
 
QString getPropertyGroupTitle () const
 
QString getPropertyTitle () const
 
bool isCustom () const
 
bool isValid () const
 
bool operator!= (const RPropertyTypeId &other) const
 != operator More...
 
bool operator< (const RPropertyTypeId &other) const
 < operator More...
 
bool operator== (const RPropertyTypeId &other) const
 == operator More...
 
 RPropertyTypeId (const QString &customPropertyName)
 
 RPropertyTypeId (const QString &customPropertyTitle, const QString &customPropertyName)
 \ nonscriptable More...
 
 RPropertyTypeId (const RPropertyTypeId &other)
 
 RPropertyTypeId (long int id=INVALID_ID)
 
void setCustomPropertyName (const QString &n)
 
void setCustomPropertyTitle (const QString &t)
 
void setId (long int id)
 

Static Public Member Functions

static RPropertyTypeId getPropertyTypeId (const QString &groupTitle, const QString &title)
 
static QSet< RPropertyTypeIdgetPropertyTypeIds (const std::type_info &classInfo, RPropertyAttributes::Option=RPropertyAttributes::NoOptions)
 Gets all property type IDs that where registered for the given class. More...
 
static bool hasPropertyType (const std::type_info &classInfo, RPropertyTypeId propertyTypeId)
 

Static Public Attributes

static const long int INVALID_ID = -1
 

Private Attributes

QString customPropertyName
 
QString customPropertyTitle
 
long int id
 
RPropertyAttributes::Options options
 

Static Private Attributes

static QList< RPropertyAttributes::OptioncachedOptionList
 
static long int counter = 0
 Copyright (c) 2011-2018 by Andrew Mustun. More...
 
static QMap< long int, QPair< QString, QString > > idToTitleMap
 
static QMap< QString, QSet< RPropertyTypeId > > propertyTypeByObjectMap
 
static QMap< QPair< QString, RPropertyAttributes::Option >, QSet< RPropertyTypeId > > propertyTypeByObjectOptionMap
 
static QMap< QString, QMap< QString, RPropertyTypeId > > titleToIdMap
 

Detailed Description

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. Represents unique property type IDs. Every property type an object can have has such an unique ID.

E.g. all objects of type car may have a property type called brand. This property type is uniquely identified by an instance of this class. All instances of this class are automatically unique.

class QCADCORE_EXPORT Car {
public:
static RPropertyTypeId propertyBrand;
}
RPropertyTypeId Car::propertyBrand(typeid(Car));
Scriptable:\nThis class is available in script environments.\n
Copyable:\nObjects are cleaned up automatically by the garbage collector of the script engine.\n

Constructor & Destructor Documentation

◆ RPropertyTypeId() [1/4]

RPropertyTypeId::RPropertyTypeId ( const QString &  customPropertyTitle,
const QString &  customPropertyName 
)

\ nonscriptable

\ nonscriptable

◆ RPropertyTypeId() [2/4]

RPropertyTypeId::RPropertyTypeId ( const QString &  customPropertyName)

◆ RPropertyTypeId() [3/4]

RPropertyTypeId::RPropertyTypeId ( const RPropertyTypeId other)

◆ RPropertyTypeId() [4/4]

RPropertyTypeId::RPropertyTypeId ( long int  id = INVALID_ID)

Member Function Documentation

◆ generateId() [1/2]

void RPropertyTypeId::generateId ( const std::type_info &  classInfo,
const QString &  groupTitle,
const QString &  title,
bool  forceNew = false,
RPropertyAttributes::Options  options = RPropertyAttributes::NoOptions 
)
Non-Scriptable:\nThis function is not available in script environments.\n

◆ generateId() [2/2]

void RPropertyTypeId::generateId ( const std::type_info &  classInfo,
const RPropertyTypeId other 
)
Non-Scriptable:\nThis function is not available in script environments.\n

◆ getCustomPropertyName()

QString RPropertyTypeId::getCustomPropertyName ( ) const
Returns
The name (key) of the custom property.

◆ getCustomPropertyTitle()

QString RPropertyTypeId::getCustomPropertyTitle ( ) const

◆ getId()

long int RPropertyTypeId::getId ( ) const
Returns
The internal ID of this property.

◆ getPropertyGroupTitle()

QString RPropertyTypeId::getPropertyGroupTitle ( ) const
Returns
The property group title of the given property.

◆ getPropertyTitle()

QString RPropertyTypeId::getPropertyTitle ( ) const
Returns
The property title of the given property.

◆ getPropertyTypeId()

RPropertyTypeId RPropertyTypeId::getPropertyTypeId ( const QString &  groupTitle,
const QString &  title 
)
static

◆ getPropertyTypeIds()

QSet< RPropertyTypeId > RPropertyTypeId::getPropertyTypeIds ( const std::type_info &  classInfo,
RPropertyAttributes::Option  option = RPropertyAttributes::NoOptions 
)
static

Gets all property type IDs that where registered for the given class.

Non-Scriptable:\nThis function is not available in script environments.\n
Parameters
classInfoThe class info, e.g. typeid(ObjectA)
geometryOnlyOnly return geometric properties
Returns
a set of property type ID pointers or an empty set if the class has no registered property types.

◆ hasPropertyType()

bool RPropertyTypeId::hasPropertyType ( const std::type_info &  classInfo,
RPropertyTypeId  propertyTypeId 
)
static
Non-Scriptable:\nThis function is not available in script environments.\n
Return values
trueif the given class has the given property

◆ isCustom()

bool RPropertyTypeId::isCustom ( ) const

◆ isValid()

bool RPropertyTypeId::isValid ( ) const

◆ operator!=()

bool RPropertyTypeId::operator!= ( const RPropertyTypeId other) const

!= operator

◆ operator<()

bool RPropertyTypeId::operator< ( const RPropertyTypeId other) const

< operator

◆ operator==()

bool RPropertyTypeId::operator== ( const RPropertyTypeId other) const

== operator

◆ setCustomPropertyName()

void RPropertyTypeId::setCustomPropertyName ( const QString &  n)

◆ setCustomPropertyTitle()

void RPropertyTypeId::setCustomPropertyTitle ( const QString &  t)

◆ setId()

void RPropertyTypeId::setId ( long int  id)

Member Data Documentation

◆ cachedOptionList

QList< RPropertyAttributes::Option > RPropertyTypeId::cachedOptionList
staticprivate

◆ counter

long int RPropertyTypeId::counter = 0
staticprivate

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.

◆ customPropertyName

QString RPropertyTypeId::customPropertyName
private

◆ customPropertyTitle

QString RPropertyTypeId::customPropertyTitle
private

◆ id

long int RPropertyTypeId::id
private

◆ idToTitleMap

QMap< long int, QPair< QString, QString > > RPropertyTypeId::idToTitleMap
staticprivate

◆ INVALID_ID

const long int RPropertyTypeId::INVALID_ID = -1
static

◆ options

RPropertyAttributes::Options RPropertyTypeId::options
private

◆ propertyTypeByObjectMap

QMap< QString, QSet< RPropertyTypeId > > RPropertyTypeId::propertyTypeByObjectMap
staticprivate

◆ propertyTypeByObjectOptionMap

QMap< QPair< QString, RPropertyAttributes::Option >, QSet< RPropertyTypeId > > RPropertyTypeId::propertyTypeByObjectOptionMap
staticprivate

◆ titleToIdMap

QMap< QString, QMap< QString, RPropertyTypeId > > RPropertyTypeId::titleToIdMap
staticprivate

The documentation for this class was generated from the following files:
RPropertyTypeId
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RPropertyTypeId.h:59
QCADCORE_EXPORT
#define QCADCORE_EXPORT
Definition: core_global.h:10