3

I created a .qrc file in Qt 5.0.1:

<RCC>
<qresource>
    <file>105.ico</file>
</qresource>
</RCC>

and I edited my .pro file:

RESOURCES += \
Icons.qrc

when I use the code below in my class constructor icon doesn't appear

 this->setWindowIcon(QIcon(":105.ico"));

but when I give a local file address instead of ":105.ico" icon shows up. what is the problem?

Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
Aidin.T
  • 731
  • 3
  • 10
  • 25

1 Answers1

4

It should be:

this->setWindowIcon(QIcon(":/105.ico"));

(Note the slash)

cmannett85
  • 21,725
  • 8
  • 76
  • 119