Questions tagged [qbuffer]

QBuffer is a class from the Qt Toolkit which provides a QIODevice interface for a QByteArray.

Documentation can be found here (Qt4) and here (Qt5).

15 questions
1
vote
1 answer

Why do I need to assign QBuffer to a variable in order not to crash QImageReader?

That's such a weird bug, if it's even a bug. This works: from PySide6.QtCore import QBuffer, QByteArray, QFile, QIODevice from PySide6.QtGui import QImageReader image_path = Path('/home/p10/testIAMAGAGADS.png') file =…
petko10
  • 115
  • 7
1
vote
1 answer

Qt QBuffer bytes written cannot be read

A bit of confusion here: I'm trying to do this: QBuffer _ourLogMessageBuffer; QByteArray theLogMessage; ... qDebug() << "Writing " << theLogMessage.size() << " bytes to buffer\n"; qint64 numberOfBytes -…
Kevin Rak
  • 336
  • 2
  • 14
1
vote
1 answer

Capture To Buffer QT

I'm trying to capture an Image using QT, and write the image buffer into an object of the QBuffer class instead of saving it to a file. This is my code so far:…
ِaliya
  • 53
  • 1
  • 6
1
vote
1 answer

PyQt5 : QMediaPlayer can't replay audio from QBuffer

I have a QBuffer in RAM with a temporary wav file, and I want to let the user listen it from any point as many times as (s)he want. But, it only allows playing it once, and doesn't allow replaying it. If I play the audio from a file…
al.zatv
  • 173
  • 1
  • 13
0
votes
0 answers

Why can't the player play audio provided by the QBuffer?

I'm trying to play a couple of audio files stored in a QByteArray object one after another. I've used a QBuffer object to be able to play the audio using QMediaPlayer. It's successful to play the audio stored for the first time in the object, but…
0
votes
0 answers

writeCharacters() of QXmlStreamWriter crashed when writting the content of a big file to QBuffer

The following code use writeCharacters with small buffer size to writing the content of big file, but it seems it only works when writing the content to a xml file, but writeCharacters() will crash when writting the content of a big file to QBuffer,…
Ming
  • 379
  • 1
  • 6
  • 20
0
votes
0 answers

Is it possible to pass a QBuffer from python backend to QML MediaPlayer?

I am trying to write a viewer for motionphoto pictures taken by my smartphone. The camera captures a few seconds of video before the image is taken and then saves both the video and jpeg file in the same jpeg file. [jpg binary data followed by mp4…
petr.z
  • 1
  • 1
0
votes
1 answer

error: unknown type name 'QBuffer'; did you mean 'Qt3DRender::QBuffer'?

I have this code: #include // --- QString m_parentName; // --- QString path = QDir::tempPath(); path = path + "/" + "temp-" + m_parentName + ".stl"; QFile file; file.setFileName(path); …
Megidd
  • 7,089
  • 6
  • 65
  • 142
0
votes
1 answer

Repeatedly write and read to/from QBuffer via QTextStream

I am trying to repeatedly write and read to/from a QBuffer object via QTextStream. First I construct both objects: QBuffer b; b.open(QIODevice::ReadWrite); QTextStream s(&b); // Setup text stream here Then I write three different portions of…
Silicomancer
  • 8,604
  • 10
  • 63
  • 130
0
votes
0 answers

Play video using QMediaplayer from buffer and append buffer while the video playing

I tried to play video from a buffer and append the buffer while playing so the two or more videos play after each other without any delay as they are one video, I tried to use the QMediaPlaylist and append the list during run time, it worked but…
user7179690
  • 1,051
  • 3
  • 17
  • 40
0
votes
2 answers

QByteArray including floats

I am a newbie of C++ and QT and i am actually on a project of writing a sound signal generator. But my problem is, I am creating the floats to be implemented in qbytearray which i will use to fill qbuffer. But i can not get float into the…
0
votes
1 answer

QBuffer writes bytes at the start of QByteArray rather than the end

I have the following code: QByteArray ba; // Declare Byte array ba.clear(); // Clear it ba.append(80, 0x00); // Append 80 bytes of 0x00 quint32 Count = 2; // The number we want to append to the byte array QBuffer tempBuffer(&ba); // We use…
Megidd
  • 7,089
  • 6
  • 65
  • 142
0
votes
1 answer

QtAV and cleaning of the buffer

I'm writing an application in Qt that permits the video streaming from a byte array. As video output component I'm using QtAV (http://www.qtav.org/). In my case the input of this component is a QIODevice (QBuffer) where has a QByteArray with my…
0
votes
1 answer

Qt Buffer Underrun Playing RAW Audio

I try playing audio that is stored at void * data with length data_size but get the message: "Got a buffer underflow!" int callback(void * data, long data_size) { QBuffer audio_buffer; audio_buffer.setData(static_cast(data),…
gro
  • 53
  • 11
0
votes
2 answers

QBuffer from void pointer and memory size

I'm looking for the most simple and or elegant way to create a QBuffer in C++ Qt5.6 from void * data and long data_size. I tried casting the void to a char pointer and using the QByteArray::fromRawData() as well as using QDataStream to fill a…
gro
  • 53
  • 11