Qt: Add creating a VFileDevice from a QByteArray
Vicki Pfau vi@endrift.com
Mon, 01 Feb 2021 01:55:06 -0800
2 files changed,
8 insertions(+),
0 deletions(-)
M
src/platform/qt/VFileDevice.cpp
→
src/platform/qt/VFileDevice.cpp
@@ -91,6 +91,13 @@ setOpenMode(mode);
} } +VFileDevice::VFileDevice(const QByteArray& mem, QObject* parent) + : QIODevice(parent) + , m_vf(VFileMemChunk(mem.constData(), mem.size())) +{ + setOpenMode(QIODevice::ReadWrite); +} + VFileDevice::~VFileDevice() { close(); }
M
src/platform/qt/VFileDevice.h
→
src/platform/qt/VFileDevice.h
@@ -19,6 +19,7 @@ Q_OBJECT
public: VFileDevice(VFile* vf = nullptr, QObject* parent = nullptr); + VFileDevice(const QByteArray& mem, QObject* parent = nullptr); VFileDevice(const QString&, QIODevice::OpenMode, QObject* parent = nullptr); virtual ~VFileDevice();