I'm dealing with QTcpSockets right now, but with other Data. During the development I found this:

http://developer.qt.nokia.com/doc/qt-4.8/datastreamformat.html

----->
QImage If the image is null a "null image" marker is saved; otherwise the image is saved in PNG or BMP format (depending on the stream version). If you want control of the format, stream the image into a QBuffer (using QImageIO) and stream that.
<-----


I'm not sure if it can help you^^

Philipp

Am 26.02.2012 16:44, schrieb Jason Cipriani:
I have an application (Qt 4.7.4) that reads QImages from a QDataStream backed by a QTcpSocket.

Each time it reads an image it prints "Reading ras files from sequential devices not supported" to stderr.

A Google search reveals a code snippet from KDE ras handlers at http://www.oschina.net/code/explore/kde-4.5.4/kdelibs-4.5.4/kimgio/ras.cpp, lines 217 - 227 read:

217 bool RASHandler::canRead(QIODevice *device)
218 {
219    if (!device) {
220        qWarning("RASHandler::canRead() called with no device");
221        return false;
222    }
223
224    if (device->isSequential()) {
225 qWarning("Reading ras files from sequential devices not supported");
226        return false;
227        }

I'm not familiar with the Qt but I presume it runs through handler canRead()'s when attempting to guess the image data format. It's bothersome that whoever wrote that bit of code deemed that message worthy of a qWarning.

Anyways, I'd like to not have this message show up. It's causing a lot of clutter in my logs.

Is there any way to programmatically disable support for ras images in Qt? (I say programmatically because I don't know anything about Qt image drivers, so I'm not sure if this support is dependent on libraries installed on the user's machine, and if it is, uninstalling them is not an option).

Alternatively, what is the format of a QImage in a QDataStream (QDataStream::Qt_4_7)? Can I somehow explicitly tell Qt which format to use instead of having it guess?

If I can't disable ras support somehow, my other option is to filter out that specific log message in my message handler, but I'd rather not take that path if I can help it.

Thanks!
Jason


_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to