Hi Marcos,

This is nice, it creates an additionaly layer to deal with
QT resources. What I had in mind is a little bit different;
do you think it's possible to use a QT API to set an icon from
memory, like this:

myicon := hb_memoread( "myicon.png" )
qicon := QIcon( myicon, "mime/png" )

or similar. The idea here is that myicon can be filled
from regular Windows resources, from database, whatever
source and passed that as data to QT.

Brgds,
Viktor

On 2009.04.27., at 11:25, Marcos Gambeta wrote:

Pritpal Bedi escreveu:

+1) Not showstopper, but definitely something to solve: Icon
    handling made interoperable thorough our GTs. Current
    HB_GTI_ICONRES isn't portable (not supported in GTQTC,
    for good reason), HB_GTI_ICONFILE isn't good because one
    must save that icon as a file before usage, which isn't ideal.
Possibly there is a way to achieve so. Looking for tips.

Icons can be stored in a resource file (.qrc):

Example: qapplication.qrc

<!DOCTYPE RCC><RCC version="1.0">
<qresource>
    <file>images/copy.png</file>
    <file>images/cut.png</file>
    <file>images/new.png</file>
    <file>images/open.png</file>
    <file>images/paste.png</file>
    <file>images/save.png</file>
</qresource>
</RCC>

To use the images in resource file:

QIcon(":/images/new.png")

To compile a qrc file:

c:\Qt\2009.02\qt\bin\rcc.exe -name application application.qrc -o qrc_application.cpp

.qrc is equivalent to .rc and qrc_*.cpp (can be another name) is equivalent to .res.


Regards,
Marcos Gambeta

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to