CQtDeployer/Deploy/defines.h

22 lines
492 B
C
Raw Normal View History

2020-09-07 10:14:15 +03:00
#ifndef DEFINES_H
#define DEFINES_H
#include <QtGlobal>
#if QT_VERSION > QT_VERSION_CHECK(5, 13, 0)
#define splitbehavior Qt::SkipEmptyParts
#else
#define splitbehavior QString::SkipEmptyParts
#endif
2020-12-03 20:00:14 +03:00
template<class Container, class Key, class T>
T& valueLink(Container& ctr, const Key& key, const T& defaultValue) {
auto it = ctr.find(key);
if (it != ctr.end()) {
return *it;
}
return *ctr.insert(key, defaultValue);
};
2020-09-07 10:14:15 +03:00
#endif // DEFINES_H