summaryrefslogtreecommitdiffstats
path: root/commands/command_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'commands/command_base.h')
-rw-r--r--commands/command_base.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/commands/command_base.h b/commands/command_base.h
index d805610e5..8c905d09a 100644
--- a/commands/command_base.h
+++ b/commands/command_base.h
@@ -139,6 +139,17 @@
// v.clear(v); // Reset the vector to zero length. If the elements weren't release()d,
// // the pointed-to dives are freed with free_dive()
+// Qt is making their containers a lot harder to integrate with std::vector
+template<typename T>
+QVector<T> stdToQt(const std::vector<T> &v)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+ return QVector<T>(v.begin(), v.end());
+#else
+ return QVector<T>::fromStdVector(v);
+#endif
+}
+
// We put everything in a namespace, so that we can shorten names without polluting the global namespace
namespace Command {