Answer the question
In order to leave comments, you need to log in
Why are icons not showing in qt Creator?
Hello.
In qt Creator I created a resource file and put icons there but when compiling they don't show
up Here is the qrc file
<RCC>
<qresource prefix="/icons">
<file>images/delete.ico</file>
<file>images/folder.ico</file>
<file>images/plus.ico</file>
<file>images/save.ico</file>
<file>images/tick.ico</file>
</qresource>
</RCC>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>485</width>
<height>380</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<widget class="QWidget" name="centralWidget"/>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>485</width>
<height>18</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>Файл</string>
</property>
<addaction name="action"/>
<addaction name="action_2"/>
<addaction name="action_3"/>
<addaction name="action_4"/>
<addaction name="action_5"/>
</widget>
<widget class="QMenu" name="menu_2">
<property name="title">
<string>Редактировать</string>
</property>
<addaction name="action_6"/>
<addaction name="action_7"/>
</widget>
<addaction name="menu"/>
<addaction name="menu_2"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<property name="movable">
<bool>false</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="action"/>
<addaction name="action_2"/>
<addaction name="action_3"/>
<addaction name="action_5"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="action">
<property name="icon">
<iconset resource="resurses.qrc">
<normaloff>:/icons/images/plus.ico</normaloff>:/icons/images/plus.ico</iconset>
</property>
<property name="text">
<string>Новый</string>
</property>
<property name="shortcut">
<string>Ctrl+N</string>
</property>
</action>
<action name="action_2">
<property name="icon">
<iconset resource="resurses.qrc">
<normaloff>:/icons/images/folder.ico</normaloff>:/icons/images/folder.ico</iconset>
</property>
<property name="text">
<string>Открыть</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
</action>
<action name="action_3">
<property name="icon">
<iconset resource="resurses.qrc">
<normaloff>:/icons/images/tick.ico</normaloff>:/icons/images/tick.ico</iconset>
</property>
<property name="text">
<string>Сохранить</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="action_4">
<property name="icon">
<iconset resource="resurses.qrc">
<normaloff>:/icons/images/save.ico</normaloff>:/icons/images/save.ico</iconset>
</property>
<property name="text">
<string>Сохранить как</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
</property>
</action>
<action name="action_5">
<property name="icon">
<iconset resource="resurses.qrc">
<normaloff>:/icons/images/delete.ico</normaloff>:/icons/images/delete.ico</iconset>
</property>
<property name="text">
<string>Закрыть</string>
</property>
<property name="shortcut">
<string>Ctrl+W</string>
</property>
</action>
<action name="action_6">
<property name="text">
<string>Копировать</string>
</property>
</action>
<action name="action_7">
<property name="text">
<string>Вставить</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="resurses.qrc"/>
</resources>
<connections/>
</ui>
Answer the question
In order to leave comments, you need to log in
What could be wrong?
www.ex.ua/196341105639
Here is a project, well, just a frame with icons)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question