mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Allow user to select common or custom title block as default title block for a new project / diagram in project
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3912 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -729,3 +729,41 @@ bool QET::eachStrIsEqual(const QStringList &qsl) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QET::qetCollectionToString
|
||||
* @param c QetCollection value to convert
|
||||
* @return The QetCollection enum value converted to a QString
|
||||
*/
|
||||
QString QET::qetCollectionToString(const QET::QetCollection &c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case Common :
|
||||
return "common";
|
||||
case Custom :
|
||||
return "custom";
|
||||
case Embendded :
|
||||
return "embendded";
|
||||
default:
|
||||
return "common";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QET::qetCollectionFromString
|
||||
* @param str string to convert
|
||||
* @return The corresponding QetCollection value from a string.
|
||||
* If the string don't match anything, we return the failsafe value QetCollection::Common
|
||||
*/
|
||||
QET::QetCollection QET::qetCollectionFromString(const QString &str)
|
||||
{
|
||||
if (str == "common")
|
||||
return QetCollection::Common;
|
||||
else if (str == "custom")
|
||||
return QetCollection::Custom;
|
||||
else if (str == "embendded")
|
||||
return QetCollection::Embendded;
|
||||
else
|
||||
return QetCollection::Common;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user