QCAD
Open Source 2D CAD
RPropertyTypeId Class Reference

Copyright (c) 2011-2015 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)
 
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 &customPropertyTitle, const QString &customPropertyName)
 \ nonscriptable More...
 
 RPropertyTypeId (const QString &customPropertyName)
 
 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)
 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
 

Static Private Attributes

static long int counter = 0
 Copyright (c) 2011-2015 by Andrew Mustun. More...
 
static QMap< QString, QSet< RPropertyTypeId > > propertyTypeByObjectMap
 
static QMap< long int, QPair< QString, QString > > titleMap
 

Detailed Description

Copyright (c) 2011-2015 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:
This class is available in script environments.
Copyable:
Objects are cleaned up automatically by the garbage collector of the script engine.

Constructor & Destructor Documentation

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

\ nonscriptable

\ nonscriptable

RPropertyTypeId::RPropertyTypeId ( const QString &  customPropertyName)
RPropertyTypeId::RPropertyTypeId ( const RPropertyTypeId other)
RPropertyTypeId::RPropertyTypeId ( long int  id = INVALID_ID)

Member Function Documentation

void RPropertyTypeId::generateId ( const std::type_info &  classInfo,
const QString &  groupTitle,
const QString &  title,
bool  forceNew = false 
)
Non-Scriptable:
This function is not available in script environments.
void RPropertyTypeId::generateId ( const std::type_info &  classInfo,
const RPropertyTypeId other 
)
Non-Scriptable:
This function is not available in script environments.
QString RPropertyTypeId::getCustomPropertyName ( ) const
Returns
The name (key) of the custom property.
QString RPropertyTypeId::getCustomPropertyTitle ( ) const
long int RPropertyTypeId::getId ( ) const
Returns
The internal ID of this property.
QString RPropertyTypeId::getPropertyGroupTitle ( ) const
Returns
The property group title of the given property.
QString RPropertyTypeId::getPropertyTitle ( ) const
Returns
The property title of the given property.
RPropertyTypeId RPropertyTypeId::getPropertyTypeId ( const QString &  groupTitle,
const QString &  title 
)
static
QSet< RPropertyTypeId > RPropertyTypeId::getPropertyTypeIds ( const std::type_info &  classInfo)
static

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

Non-Scriptable:
This function is not available in script environments.
Parameters
classInfoThe class info, e.g. typeid(ObjectA)
Returns
a set of property type ID pointers or an empty set if the class has no registered property types.
bool RPropertyTypeId::hasPropertyType ( const std::type_info &  classInfo,
RPropertyTypeId  propertyTypeId 
)
static
Non-Scriptable:
This function is not available in script environments.
Return values
trueif the given class has the given property
bool RPropertyTypeId::isCustom ( ) const
bool RPropertyTypeId::isValid ( ) const
bool RPropertyTypeId::operator!= ( const RPropertyTypeId other) const

!= operator

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

< operator

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

== operator

void RPropertyTypeId::setCustomPropertyName ( const QString &  n)
void RPropertyTypeId::setCustomPropertyTitle ( const QString &  t)
void RPropertyTypeId::setId ( long int  id)

Member Data Documentation

long int RPropertyTypeId::counter = 0
staticprivate

Copyright (c) 2011-2015 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.

QString RPropertyTypeId::customPropertyName
private
QString RPropertyTypeId::customPropertyTitle
private
long int RPropertyTypeId::id
private
const long int RPropertyTypeId::INVALID_ID = -1
static
QMap< QString, QSet< RPropertyTypeId > > RPropertyTypeId::propertyTypeByObjectMap
staticprivate
QMap< long int, QPair< QString, QString > > RPropertyTypeId::titleMap
staticprivate

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