Now that the resource mechanism has been added to the project, actions can now be added to the tool bar with appropriate icons. Contrary to what was said at the beginning of the last post, tool bar items can be text and are text if no icon has been assigned to them. In any case, icons will be used here for the tool bar. Also, when an action has an assigned icon, the icon also appears on the menu item in the menus.
First icons need to be assigned to the actions. The easiest way to do this is with Designer inside QtCreator. The icons can be assigned the same as with the MainWindow object, but it is easier to add the icons from the Action Editor tab at the bottom of Designer. Double-clicking on the action brings up the Edit Action dialog. The icon is added by clicking the ... button on the Icon: field line. Appropriate icons were added to all of the actions. To add the actions to the tool bar, the actions are simply dragged from the Action Editor to the tool bar.
Note: The icons will not be available on the Select Resource dialog until the program has been built after the icons have been added to the resource file.
The icons were obtained from the KDE Oxygen icon set (found in the /usr/share/icons/oxygen/32x32/actions/ directory on Linux) except for the Qt icon, which was obtained from the Qt SDK. All of the icon file names were renamed to match the menu and menu item the icon was assigned to. The Oxygen icons can be distributed with the source code and embedded within the program as long as the program is under the LGPL (Lesser GNU Pulbic License) version 3, which this program is being developed under.
[commit a2d2675627]
Monday, December 31, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)