piqt importand fix with qmap serialization
ImageView now supprt view interaction BlockView update background when EnabledChange
This commit is contained in:
@@ -127,6 +127,20 @@ inline const QVector<T> PI2QVector(const PIVector<T> & v) {QVector<T> ret; ret.r
|
||||
template<typename T>
|
||||
inline const PIVector<T> Q2PIVector(const QVector<T> & v) {if (v.isEmpty()) return PIVector<T>(); return PIVector<T>(v.constData(), (size_t)v.size());}
|
||||
|
||||
template <typename K, typename T>
|
||||
inline QMap<K, T> PI2QMap(const PIMap<K, T> & v) {
|
||||
QMap<K, T> ret;
|
||||
auto it = v.makeIterator();
|
||||
while (it.hasNext()) {it.next(); ret[it.key()] = it.value();}
|
||||
return ret;}
|
||||
template <typename K, typename T>
|
||||
inline PIMap<K, T> Q2PIMap(const QMap<K, T> & v) {
|
||||
PIMap<K, T> ret;
|
||||
ret.reserve((size_t)v.size());
|
||||
QMapIterator<K, T> it(v);
|
||||
while (it.hasNext()) {it.next(); ret[it.key()] = it.value();}
|
||||
return ret;}
|
||||
|
||||
|
||||
inline PIPropertyStorage Q2PIPropertyStorage(const PropertyStorage & props) {
|
||||
PIPropertyStorage ret;
|
||||
@@ -203,7 +217,7 @@ template <typename K, typename T> inline PIByteArray & operator <<(PIByteArray &
|
||||
t.reserve(v.size());
|
||||
QMapIterator<K, T> it(v);
|
||||
while (it.hasNext()) {it.next(); t[it.key()] = it.value();}
|
||||
s >> t;
|
||||
s << t;
|
||||
return s;}
|
||||
template <typename K, typename T> inline PIByteArray & operator >>(PIByteArray & s, QMap<K, T> & v) {
|
||||
v.clear();
|
||||
|
||||
Reference in New Issue
Block a user