Reading from a QFile in different thread
问题 What would be the optimal way of reading from a QFile that resides in a different thread than the one I want to read from? Consider: class AFile : public QObject { Q_OBJECT public: AFile(const QString &name, QObject *parent = Q_NULLPTR) : QObject(parent), m_File(name) { m_File.open(QIODevice::ReadWrite); } public slots: void write(const QByteArray &data, qint64 pos) { m_File.seek(pos); m_File.write(data); } private: mutable QFile m_File; }; class AData : public QObject { Q_OBJECT public: