PDA

View Full Version : QAbstractFileEngine behaves strange in different Qt versions



segi
20th December 2010, 18:38
Hello,

Mostly I'm using debian sid with qt-4.6.3.
Now I try Qt 4.7.1 and my application can't load images from a database anymore (same code working with debians qt-4.6.3).
I configure Qt 4.7.1 with the following command:

./configure -confirm-license -prefix "/home/sebastian/qt-devel/qt4.7.1/" -opensource -fast -plugin-sql-mysql -plugin-sql-sqlite -system-sqlite -xmlpatterns -multimedia -audio-backend -phonon -svg -webkit -system-zlib -qt-gif -system-libtiff -system-libpng -system-libjpeg -optimized-qmake -lfontconfig -I/usr/include/freetype2 -qvfb -gtkstyle

I have written a little example application (attached: 5634).
I get the following output:
Qt 4.6.3 => loading an image from file (show it as a pixmap), put it into the database, load it from the database (and show it as a pixmap, too)


5447 "ÿØÿÃ
sqlFileEngine::sqlFileEngine(const QString&) "questions/tImages/bild.jpg"
void sqlFileEngine::init()
"SELECT data FROM tImages WHERE LOWER(filename)=LOWER('bild.jpg')"
"ÿØÿÃ
sqlFileEngine::sqlFileEngine(const QString&) RAW: 5447
virtual qint64 sqlFileEngine::size() const
virtual QString sqlFileEngine::fileName(QAbstractFileEngine::FileN ame) const 3
sqlFileEngine::sqlFileEngine(const QString&) "questions/tImages/bild.jpg"
void sqlFileEngine::init()
"SELECT data FROM tImages WHERE LOWER(filename)=LOWER('bild.jpg')"
"ÿØÿÃ
sqlFileEngine::sqlFileEngine(const QString&) RAW: 5447
virtual bool sqlFileEngine::open(QFlags<QIODevice::OpenModeFlag>) OpenMode( "ReadOnly|Unbuffered" )
virtual QString sqlFileEngine::fileName(QAbstractFileEngine::FileN ame) const 0
virtual bool sqlFileEngine::isSequential() const
virtual bool sqlFileEngine::seek(qint64) 0
virtual bool sqlFileEngine::isSequential() const
virtual qint64 sqlFileEngine::read(char*, qint64) 0 16384
virtual qint64 sqlFileEngine::read(char*, qint64) 5447 2745
virtual bool sqlFileEngine::isSequential() const
virtual bool sqlFileEngine::seek(qint64) 5447
virtual bool sqlFileEngine::close()


Qt 4.7.1 => loading an image from file (show it as a pixmap), put it into the database; These both steps work properly. But loading the image from database fails.


5447 "ÿØÿÃ
sqlFileEngine::sqlFileEngine(const QString&) "questions/tImages/bild.jpg"
void sqlFileEngine::init()
"SELECT data FROM tImages WHERE LOWER(filename)=LOWER('bild.jpg')"
"ÿØÿÃ
sqlFileEngine::sqlFileEngine(const QString&) RAW: 5447
virtual qint64 sqlFileEngine::size() const
virtual QString sqlFileEngine::fileName(QAbstractFileEngine::FileN ame) const 3
virtual QString sqlFileEngine::fileName(QAbstractFileEngine::FileN ame) const 1

Because showing jpeg file from harddisk works very well, I suppose QAbstractFileEngine behaves strange.

What did happen between Qt 4.6 and 4.7?
What did I wrong?