Qt-interest Archive, October 2006
Qt 4.1.3 Widget background problem
Message 1 in thread
Hello,
I have a QDialog window in which i want to put a background image. I do
this in the following way:
<code>
QPalette palette;
palette.setBrush(QPalette::Window, QPixmap(QString(".\\menu.jpg")));
Dialog->setPalette(palette);
Dialog->setAutoFillBackground(true);
</code>
and it all works fine on my computer with VS2005 and Qt 4.1.3 installed.
I need to run the program on a computer with neither of the mentioned
programs installed. Therefore I add QtCore4.dll, QtGui4.dll and
QtOpenGL4.dll along with the program. This makes the program run on
computers without Qt/VS2005, but I cant see the background image. (Yes it
is included in the same dir as the .exe)
The only thing I see is a black background.. (The "base" color of the
image is black but i don't know if black is just some sort of default
color?)
Can anyone help me? Any missing .dll's? Ive tried adding most in the
qt\bin folder but nothing seems to help.
Any help appreciated.
/regards
Kato
--
[ signature omitted ]
Message 2 in thread
You need to distribute Qt JPEG plugin qjpeg1.dll with your program
2006/10/16, Kato Griff Klæboe <katogk@xxxxxxxxx>:
> Hello,
>
> I have a QDialog window in which i want to put a background image. I do
> this in the following way:
>
> <code>
> QPalette palette;
> palette.setBrush(QPalette::Window, QPixmap(QString(".\\menu.jpg")));
> Dialog->setPalette(palette);
> Dialog->setAutoFillBackground(true);
> </code>
>
> and it all works fine on my computer with VS2005 and Qt 4.1.3 installed.
> I need to run the program on a computer with neither of the mentioned
> programs installed. Therefore I add QtCore4.dll, QtGui4.dll and
> QtOpenGL4.dll along with the program. This makes the program run on
> computers without Qt/VS2005, but I cant see the background image. (Yes it
> is included in the same dir as the .exe)
> The only thing I see is a black background.. (The "base" color of the
> image is black but i don't know if black is just some sort of default
> color?)
>
> Can anyone help me? Any missing .dll's? Ive tried adding most in the
> qt\bin folder but nothing seems to help.
>
> Any help appreciated.
>
> /regards
>
>
> Kato
> --
> Sendt med Operas revolusjonerende e-postprogram: http://www.opera.com/mail/
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]
Message 3 in thread
Thanks for the suggestion, but it didnt work.. :/
Been looking at some other posts which say that I need to add
QTPLUGIN += qjpeg qgif
win32:QMAKE_LFLAGS += /LIBPATH:$$[QT_INSTALL_PLUGINS]/imageformats
to my .pro file and
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
to my main.cpp.. But my project does not have any .pro file?
Again, help appreciated,
/regards
Kato
På Mon, 16 Oct 2006 15:32:48 +0200, skrev Vitaly Peretiatko
<viperet@xxxxxxxxx>:
> You need to distribute Qt JPEG plugin qjpeg1.dll with your program
>
> 2006/10/16, Kato Griff Klæboe <katogk@xxxxxxxxx>:
>> Hello,
>>
>> I have a QDialog window in which i want to put a background image. I do
>> this in the following way:
>>
>> <code>
>> QPalette palette;
>> palette.setBrush(QPalette::Window,
>> QPixmap(QString(".\\menu.jpg")));
>> Dialog->setPalette(palette);
>> Dialog->setAutoFillBackground(true);
>> </code>
>>
>> and it all works fine on my computer with VS2005 and Qt 4.1.3 installed.
>> I need to run the program on a computer with neither of the mentioned
>> programs installed. Therefore I add QtCore4.dll, QtGui4.dll and
>> QtOpenGL4.dll along with the program. This makes the program run on
>> computers without Qt/VS2005, but I cant see the background image. (Yes
>> it
>> is included in the same dir as the .exe)
>> The only thing I see is a black background.. (The "base" color of the
>> image is black but i don't know if black is just some sort of default
>> color?)
>>
>> Can anyone help me? Any missing .dll's? Ive tried adding most in the
>> qt\bin folder but nothing seems to help.
>>
>> Any help appreciated.
>>
>> /regards
>>
>>
>> Kato
>> --
>> Sendt med Operas revolusjonerende e-postprogram:
>> http://www.opera.com/mail/
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 4 in thread
Hi,
> Thanks for the suggestion, but it didnt work.. :/
It should work.
What did you do exactly? How did you distribute the Qt JPEG plugin? It
should be in a plugins\imageformats sub-directory.
Read this:
http://doc.trolltech.com/4.2/deployment-windows.html#qt-plugins
--
[ signature omitted ]
Message 5 in thread
Thanks, now it works!:-)
I needed to make a qt.conf in the program directory containing:
[Paths]
Prefix = .\
Thanks again.
/regards
Kato
På Mon, 16 Oct 2006 21:56:57 +0200, skrev Dimitri <dimitri@xxxxxxxxxxxxx>:
> Hi,
>
>> Thanks for the suggestion, but it didnt work.. :/
>
> It should work.
>
> What did you do exactly? How did you distribute the Qt JPEG plugin? It
> should be in a plugins\imageformats sub-directory.
>
> Read this:
> http://doc.trolltech.com/4.2/deployment-windows.html#qt-plugins
>
> --
> Dimitri
--
[ signature omitted ]