octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: missing icons


From: Patrick Noffke
Subject: Re: missing icons
Date: Fri, 4 Oct 2013 16:35:19 -0500


On Fri, Oct 4, 2013 at 3:49 PM, John W. Eaton <address@hidden> wrote:
There seem to be many missing icons in the GUI.  Can someone help me
understand how Qt icons are supposed to work?  For example, in the
terminal_dock_widget constructor in
libgui/src/terminal-dock-widget.cc, we currently have

  setWindowIcon (QIcon(":/actions/icons/logo.png"));

  What does /actions/ mean in the name that is passed to QIcon?


The ':' character at the start of a filename tells Qt to load a resource.  You have to create a .qrc file and run rcc to generate the resource file, which is just a .cpp file containing static unsigned char arrays, which contain the contents of the files.  Then you compile and link this resource file with the application.

An example .qrc file is attached.

A good time to process the .qrc files (with rcc) would be the same time you process any .ui files.

Patrick

Attachment: TargetGenerator.qrc
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]