Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
#pragma once
#include <QVector>
#include <QDebug>
namespace LtsScriptTimeline
{
template <typename T>
class TemporaryPointerVector : public QVector<T>
{
static_assert(std::is_pointer<T>::value, "Type must be of pointer type");
public:
TemporaryPointerVector() = default;
explicit TemporaryPointerVector(const QVector<T> &other)
{
discard();
this->append(other);
}
~TemporaryPointerVector()
{
discard();
}
void setDiscardable(bool discardable)
{
m_discard = discardable;
}
private:
bool m_discard = true;
void discard()
{
if (m_discard)
qDeleteAll(this->begin(), this->end());
this->clear();
}
};
} // namespace LtsScriptTimeline