I've found an interesting thing.
qPixmap := QPixmap():new( "test.gif" )
oLabel:setPixmap( qPixmap )
This works fine, but only if QT is installed in the machine.
If you copy the exe and the three runtime files required
(qtgui4.dll,qtcore4.dll and mingwm10.dll) to a machine without QT
installed, you'll loose support for jpg and gif (bmp and png still working).
What is needed at runtime to get gif/jpg support without to install the
complete QT package?
It was tested on Windows 7 and XP.
Thanks in advance.
Regards,
Roberto.
> Yep, this is an interesting thing, indeed.
> May be some other .dll is required, just make experiments.
> I could not figure-out which .dll it could be. I am suseptible
> about this behavior, though.
I'm doing some experiments. If found something, I'll post here.
> NOTE: .png is the supported format Qt recommends which would
> definitely
> be working on all platforms. Also Harbour has inbuild support to embed
> .png resources into the executable. So focus your directions onto this
> fact.
Ok.
Thanks.
Regards,
Roberto.
[Paths]
plugins=./plugins
> Yep, this is an interesting thing, indeed.
> May be some other .dll is required, just make experiments.
> I could not figure-out which .dll it could be. I am suseptible
> about this behavior, though.
The required dll's are located at qt/4.x.x/plugins/imageformats (you'll
loose jpg/gif support just renaming that folder).
They are qgif4.dll, qico4.dll, qjpeg4.dll, qmng4.dll, qsv4,dll and
qtiff4.dll.
The problem is that coping them to system32 or the app folder is not enough.
So, perhaps, they need a registry key to be found by a QT application at
runtime. If that is the case, is really strange... I'll keep trying...
Regards,
Roberto.
It works!!!, Thanks Marcos!!!
Regards,
Roberto.
More info about qt.conf and plugins:
http://doc.qt.nokia.com/4.6/qt-conf.html
http://doc.qt.nokia.com/4.6/plugins-howto.html
Regards,
Marcos Gambeta
This page have more info about the plugins directory:
http://doc.qt.nokia.com/4.6/deployment-plugins.html
"The Plugin Directory
When the application is run, Qt will first treat the application's
executable directory as the pluginsbase. For example if the application
is in C:\Program Files\MyApp and has a style plugin, Qt will look in
C:\Program Files\MyApp\styles. (See
QCoreApplication::applicationDirPath() for how to find out where the
application's executable is.) Qt will also look in the directory
specified by QLibraryInfo::location(QLibraryInfo::PluginsPath), which
typically is located in QTDIR/plugins (where QTDIR is the directory
where Qt is installed). If you want Qt to look in additional places you
can add as many paths as you need with calls to
QCoreApplication::addLibraryPath(). And if you want to set your own path
or paths you can use QCoreApplication::setLibraryPaths(). You can also
use a qt.conf file to override the hard-coded paths that are compiled
into the Qt library. For more information, see the Using qt.conf
documentation. Yet another possibility is to set the QT_PLUGIN_PATH
environment variable before running the application. If set, Qt will
look for plugins in the paths (separated by the system path separator)
specified in the variable."
If I understand correctly, we can use:
c:\myapp\app.exe
c:\myapp\imageformats\qgif4.dll
Regards,
Marcos Gambeta
You've understood correctly.
I've tested and it works perfect.
Thanks again!
Regards,
Roberto.