[Paraview] Custom Panel will NOT load image as Icon.

Paul Edwards paul.m.edwards at gmail.com
Fri Feb 5 04:15:49 EST 2010


1) You need to check you are adding the resources:

    QT4_ADD_RESOURCES(RCS_SRCS MyResource.qrc)

Check this by looking at the generated file in the build directory
(qrc_MyResource.cxx).

2) Make sure you are including it in the plugin:

    ADD_PARAVIEW_PLUGIN(MyPlugin ....
                    ....
                    SOURCES ... ${RCS_SRCS} ...)

Check this with make VERBOSE=1 to make sure it is being linked in

3) And, if both of the above are correct make sure that you refer to your
resource correctly.

e.g. for foo.jpg in ResourceFile.qrc:

<RCC>
  <qresource prefix="/MyResource">
    <file>foo.jpg</file>
  </qresource>
</RCC>

Use:
    :/MyResource/foo.jpg


Hope that helps!

Regards,
Paul

PS there is something qt documentation that mentions how you may need to
call Q_INIT_RESOURCE if the resource is in a static library:-
http://doc.qt.nokia.com/4.6/resources.html

Make sure you are linking this file into your executable
On 4 February 2010 21:40, Michael Jackson <mike.jackson at bluequartz.net>wrote:

> Yep.
> --
> mike
>
>
> On Feb 4, 2010, at 4:38 PM, Paul Edwards wrote:
>
>  Are you adding the resource file in your CMakeLists.txt?
>>
>> Regards,
>> Paul
>>
>>
>>  On Feb 4, 2010 9:31 PM, "Michael Jackson" <mike.jackson at bluequartz.net>
>>> wrote:
>>>
>>> I am developing a custom panel for a vtkFilter that I wrote. As part of
>>> the GUI, I need to load up a jpg image to use as an icon in the GUI. I put
>>> an entry into the .qrc file where the entry for the .ui file is located but
>>> when I load the panel the image does not show up. I don't get any type of
>>> error either so I am not really sure where to start hunting this down.
>>>
>>> Anyone have any ideas?
>>> ___________________________________________________________
>>> Mike Jackson                      www.bluequartz.net
>>> Principal Software Engineer       mike.jackson at bluequartz.net
>>> BlueQuartz Software               Dayton, Ohio
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100205/ed26279e/attachment.htm>


More information about the ParaView mailing list