mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
Minor improvements in the TitleBlockTemplateLocation class.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1469 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -19,6 +19,9 @@
|
|||||||
#include "templatescollection.h"
|
#include "templatescollection.h"
|
||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
|
|
||||||
|
// make this class usable with QVariant
|
||||||
|
int t = qRegisterMetaType<TitleBlockTemplateLocation>("TitleBlockTemplateLocation");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructor
|
Constructor
|
||||||
@param collection Parent collection of the title block template
|
@param collection Parent collection of the title block template
|
||||||
@@ -124,6 +127,15 @@ QString TitleBlockTemplateLocation::protocol() const {
|
|||||||
return("unknown");
|
return("unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
This is a convenience method equivalent to
|
||||||
|
parentCollection() -> getTemplateXmlDescription
|
||||||
|
*/
|
||||||
|
QDomElement TitleBlockTemplateLocation::getTemplateXmlDescription() const {
|
||||||
|
if (!collection_ || name_.isEmpty()) return(QDomElement());
|
||||||
|
return(collection_ -> getTemplateXmlDescription(name_));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This is a convenience method equivalent to
|
This is a convenience method equivalent to
|
||||||
parentCollection() -> getTemplate(...).
|
parentCollection() -> getTemplate(...).
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#ifndef TITLEBLOCK_SLASH_TEMPLATE_LOCATION_H
|
#ifndef TITLEBLOCK_SLASH_TEMPLATE_LOCATION_H
|
||||||
#define TITLEBLOCK_SLASH_TEMPLATE_LOCATION_H
|
#define TITLEBLOCK_SLASH_TEMPLATE_LOCATION_H
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
#include <QDomElement>
|
||||||
class QETProject;
|
class QETProject;
|
||||||
class TitleBlockTemplate;
|
class TitleBlockTemplate;
|
||||||
class TitleBlockTemplatesCollection;
|
class TitleBlockTemplatesCollection;
|
||||||
@@ -46,11 +47,15 @@ class TitleBlockTemplateLocation {
|
|||||||
QString toString() const;
|
QString toString() const;
|
||||||
QETProject *parentProject() const;
|
QETProject *parentProject() const;
|
||||||
QString protocol() const;
|
QString protocol() const;
|
||||||
|
QDomElement getTemplateXmlDescription() const;
|
||||||
TitleBlockTemplate *getTemplate() const;
|
TitleBlockTemplate *getTemplate() const;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
private:
|
private:
|
||||||
TitleBlockTemplatesCollection *collection_; ///< Collection the template belongs to
|
TitleBlockTemplatesCollection *collection_; ///< Collection the template belongs to
|
||||||
QString name_; ///< Name of the template
|
QString name_; ///< Name of the template
|
||||||
|
|
||||||
|
public:
|
||||||
|
static int MetaTypeId; ///< Id of the corresponding Qt meta type
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user