Ref T109, datastore object and list

* unified properties in int/string DB objects
* fixed typo dbKeysAsString
This commit is contained in:
Klaus Basan
2017-07-17 00:17:25 +02:00
committed by Mathew Sutcliffe
parent 03a551d016
commit dfb6b05e9d
6 changed files with 59 additions and 15 deletions

View File

@@ -49,6 +49,8 @@ namespace BlackMisc
enum ColumnIndex
{
IndexDbIntegerKey = CPropertyIndex::GlobalIndexIDatastoreInteger,
IndexDbKeyAsString,
IndexIsLoadedFromDb,
IndexDatabaseIcon
};
@@ -61,7 +63,7 @@ namespace BlackMisc
//! Key as JSON value, or null
QJsonValue getDbKeyAsJsonValue() const;
//! Db ley in parentheses, e.g. "(3)"
//! Db key in parentheses, e.g. "(3)"
QString getDbKeyAsStringInParentheses(const QString &prefix = {}) const;
//! Set the DB key
@@ -130,6 +132,7 @@ namespace BlackMisc
enum ColumnIndex
{
IndexDbStringKey = CPropertyIndex::GlobalIndexIDatastoreString,
IndexDbKeyAsString,
IndexIsLoadedFromDb,
IndexDatabaseIcon
};
@@ -137,9 +140,15 @@ namespace BlackMisc
//! Get DB key.
const QString &getDbKey() const { return m_dbKey; }
//! DB key as string
QString getDbKeyAsString() const { return getDbKey(); }
//! Key as JSON value, or null
QJsonValue getDbKeyAsJsonValue() const;
//! Db key in parentheses, e.g. "(3)"
QString getDbKeyAsStringInParentheses(const QString &prefix = {}) const;
//! Set the DB key
void setDbKey(const QString &key) { m_dbKey = key.trimmed().toUpper(); }