Qt Resources or Directory Structure for icons?

Tomaz Canabrava tcanabrava at kde.org
Fri Apr 12 09:12:43 PDT 2013


I have a branch readh for this as soon as anyone helps me doing the
following makefile rule:

1 - run rcc on `resources.qrc` ( rcc resources.qrc -o resources.cpp )
2 - compile the result ( resources.o )
3 - add it to the list of compiled things.

( sorry for asking this silly question, by my Makefile skills are rather
limited. )



2013/4/12 Tomaz Canabrava <tcanabrava at kde.org>

> Heya People.:
>
> while trying to hack on the Qt version I tried to set the icon for the
> main application. The code for Qt , with the resource system, is this:
>
> window->setWindowIcon(QIcon(":/icons/subsurface"));
>
> While the current code, in gtk, is as follows:
>
>     screen = gdk_screen_get_default();
>     if (screen)
>         icon_theme = gtk_icon_theme_get_for_screen(screen);
>     if (icon_theme) {
>         if (gtk_icon_theme_has_icon(icon_theme, "subsurface")) {
>             need_icon = FALSE;
>             gtk_window_set_default_icon_name ("subsurface");
>         }
>     }
>     if (need_icon) {
>         const char *icon_name = subsurface_icon_name();
>         if (!access(icon_name, R_OK))
>             gtk_window_set_icon_from_file(GTK_WINDOW(win), icon_name,
> NULL);
>     }
>
> the Qt resource system gets the contents of a XML file and includes it on
> the binary ( by passing to a xml -> cpp compiler ), so if we use it another
> rule on the Makefiles needs to be written.
>
>
> Tomaz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130412/b82b009c/attachment.html>


More information about the subsurface mailing list