28 useDate(UseDateValue),
29 display_at(Qt::BottomEdge),
68 return(!(*
this == ip));
77 e.setAttribute(
"author",
author);
78 e.setAttribute(
"title",
title);
79 e.setAttribute(
"filename",
filename);
80 e.setAttribute(
"plant",
plant);
81 e.setAttribute(
"locmach",
locmach);
83 e.setAttribute(
"version",
version);
84 e.setAttribute(
"folio",
folio);
87 e.setAttribute(
"displayAt", (
display_at == Qt::BottomEdge?
"bottom" :
"right"));
95 QDomElement properties = e.ownerDocument().createElement(
"properties");
97 e.appendChild(properties);
107 if (e.hasAttribute(
"author"))
author = e.attribute(
"author");
108 if (e.hasAttribute(
"title"))
title = e.attribute(
"title");
109 if (e.hasAttribute(
"filename"))
filename = e.attribute(
"filename");
110 if (e.hasAttribute(
"plant"))
plant = e.attribute(
"plant");
111 if (e.hasAttribute(
"locmach"))
locmach = e.attribute(
"locmach");
112 if (e.hasAttribute(
"indexrev"))
indexrev = e.attribute(
"indexrev");
113 if (e.hasAttribute(
"version"))
version = e.attribute(
"version");
114 if (e.hasAttribute(
"folio"))
folio = e.attribute(
"folio");
115 if (e.hasAttribute(
"auto_page_num"))
auto_page_num = e.attribute(
"auto_page_num");
117 if (e.hasAttribute(
"displayAt"))
display_at = (e.attribute(
"displayAt") ==
"bottom" ? Qt::BottomEdge : Qt::RightEdge);
120 if (e.hasAttribute(
"titleblocktemplate"))
140 settings.setValue(prefix +
"title",
title);
141 settings.setValue(prefix +
"author",
author);
142 settings.setValue(prefix +
"filename",
filename);
143 settings.setValue(prefix +
"plant",
plant);
144 settings.setValue(prefix +
"locmach",
locmach);
145 settings.setValue(prefix +
"indexrev",
indexrev);
146 settings.setValue(prefix +
"version",
version);
147 settings.setValue(prefix +
"folio",
folio);
149 settings.setValue(prefix +
"date",
exportDate());
150 settings.setValue(prefix +
"displayAt", (
display_at == Qt::BottomEdge?
"bottom" :
"right"));
162 title = settings.value(prefix +
"title").toString();
163 author = settings.value(prefix +
"author").toString();
164 filename = settings.value(prefix +
"filename").toString();
165 plant = settings.value(prefix +
"plant").toString();
166 locmach = settings.value(prefix +
"locmach").toString();
167 indexrev = settings.value(prefix +
"indexrev").toString();
168 version = settings.value(prefix +
"version").toString();
169 folio = settings.value(prefix +
"folio",
"%id/%total").toString();
170 auto_page_num = settings.value(prefix +
"auto_page_num").toString();
172 display_at = (settings.value(prefix +
"displayAt", QVariant(
"bottom")).toString() ==
"bottom" ? Qt::BottomEdge : Qt::RightEdge);
173 template_name = settings.value(prefix +
"titleblocktemplate").toString();
199 return(QDate::currentDate());
211 QString date_setting_value;
213 if (
date.isNull()) date_setting_value =
"null";
214 else date_setting_value =
date.toString(
"yyyyMMdd");
216 date_setting_value =
"now";
218 return(date_setting_value);
227 if (date_string ==
"now") {
228 date = QDate::currentDate();
230 }
else if (date_string.isEmpty() || date_string ==
"null") {
234 date = QDate::fromString(date_string,
"yyyyMMdd");
void fromSettings(QSettings &, const QString &)
QString locmach
Location(displayed by the default template)
QString plant
Plant (displayed by the default template)
Qt::Edge display_at
Edge to display the titleblock.
void setDateFromString(const QString &)
void toSettings(QSettings &, const QString &=QString()) const
TitleBlockProperties::toSettings Export the TitleBlockProperties into a QSettings.
void toSettings(QSettings &, const QString &) const
void toXml(QDomElement &) const
void fromSettings(QSettings &, const QString &=QString())
QDate date
Date (displayed by the default template)
QetCollection
Enum used to specify the origin of a collection of thing (title block, element etc...)
QString filename
Filename (displayed by the default template)
QString qetCollectionToString(const QetCollection &c)
QET::qetCollectionToString.
QetCollection qetCollectionFromString(const QString &str)
QET::qetCollectionFromString.
QList< QString > keys(KeyOrder=None) const
DiagramContext context
Container for the additional, user-defined fields.
void fromXml(const QDomElement &)
bool operator==(const TitleBlockProperties &)
void fromXml(const QDomElement &, const QString &="property")
QString version
Version (displayed by the default template)
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
QString exportDate() const
DateManagement useDate
Wheter to use the date attribute.
bool operator!=(const TitleBlockProperties &)
void toXml(QDomElement &, const QString &="property") const
QString author
Author of the diagram/folio (displayed by the default template)
QString indexrev
Revision Index (displayed by the default template)
QET::QetCollection collection
Specify the location of the title block.
QString folio
Folio information (displayed by the default template)
QString title
Folio title (displayed by the default template)
static TitleBlockProperties defaultProperties()
TitleBlockProperties::defaultProperties Return the default properties stored in the setting file...
QString template_name
Name of the template used to render the title block - an empty string means "the default template pro...
virtual ~TitleBlockProperties()