mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-06 13:40:52 +01:00
Nomenclature now use properly the element type 'thumbnail'
Use function provided by ElementData to check element type and master type instead of use plain text (code is more strong)
This commit is contained in:
@@ -345,6 +345,13 @@ ElementData::Type ElementData::typeFromString(const QString &string)
|
||||
return ElementData::Simple;
|
||||
}
|
||||
|
||||
QString ElementData::masterTypeToString() const {
|
||||
if (m_type == Master)
|
||||
return masterTypeToString(m_master_type);
|
||||
else
|
||||
return QLatin1String();
|
||||
}
|
||||
|
||||
QString ElementData::masterTypeToString(ElementData::MasterType type)
|
||||
{
|
||||
switch (type) {
|
||||
|
||||
@@ -43,6 +43,7 @@ class ElementData : public PropertiesInterface
|
||||
Terminale = 32,
|
||||
Thumbnail = 64};
|
||||
Q_ENUM(Type)
|
||||
Q_DECLARE_FLAGS(Types, Type)
|
||||
|
||||
enum MasterType {
|
||||
Coil,
|
||||
@@ -109,6 +110,7 @@ class ElementData : public PropertiesInterface
|
||||
static QString typeToString(ElementData::Type type);
|
||||
static ElementData::Type typeFromString(const QString &string);
|
||||
|
||||
QString masterTypeToString() const;
|
||||
static QString masterTypeToString(ElementData::MasterType type);
|
||||
static ElementData::MasterType masterTypeFromString(const QString &string);
|
||||
|
||||
@@ -157,4 +159,7 @@ class ElementData : public PropertiesInterface
|
||||
private:
|
||||
void kindInfoFromXml(const QDomElement &xml_element);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(ElementData::Types)
|
||||
|
||||
#endif // ELEMENTDATA_H
|
||||
|
||||
Reference in New Issue
Block a user