BUG: Displaying icons on the dive list

Anton Lundin glance at acc.umu.se
Sat Nov 19 07:22:10 PST 2016


On 19 November, 2016 - Willem Ferguson wrote:

> Here are two snippets of code, with reference to
> subsurface/qt-models/divetripmodel.cpp. The first part (A), below is
> the existing code. It is the part that adds the globe icon (filename
> :Emblem-earth.svg) that appears in the Location field of the dive
> list. The actual icon referred to in the code below is actually
> satellite.svg. So there appears to be a bug in the existing code and
> that the appropriate icon is shown by accident?? If I change the
> icon name below to :star, then the star icon is shown. But the
> satellite icon in the existing code is not shown.
> 
...
> 
> Here is an addition that I am working with (B, below). But it does
> not matter which new icon name I specify, it is not shown. There are
> a few icons that are, however, displayed e.g. star.svg in the
> subsurface/icons folder. If I take a foreign icon and name it
> star.svg, then this foreign icon IS shown correctly.
> 
...
> 
> This leads me to believe that the problem is that the new icons
> (including satellite.svg) need to be declared as resources. But I
> have no idea where.
> 

qt-models/divetripmodel.cpp:                            retVal = QIcon(":satellite").pixmap(im.sz_small, im.sz_small);
subsurface.qrc:        <file alias="satellite">icons/Emblem-earth.svg</file>

subsurface.qrc is the right file.


Its a bit confusing that we have a icons/Emblem-earth.svg with the alias
satellite, and a satellite.svg which isn't used.


//Anton


-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list