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:
blacksun
2015-04-17 11:36:28 +00:00
parent 6ec0c1dbbc
commit cf7ffb5452
11 changed files with 207 additions and 72 deletions

View File

@@ -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;
}