Icons from resource file not showing
-
I am in linux.And i am using Qt 5.9
I found this app's source code from git hub.
Creator of this app, include icon from the system theme .
In this app i included a resource file and select a push button's icon from the resource file that i include.
It shows in Qt creator ,but shwoing blank Pushbutton after build.I deleted every code that named theme and icon,but no change.
Icon from system theme shows after build .But icon selected from resource file are not showing.
What i can do to show icon from my resource file??
What code do i remove to not show icon from system theme? -
Delete your build folder. Clean your project, qmake and build and then run your project.
-
@saber ,
Show me your code -
@saber ,
Show me your code@Vinod-Kuntoji
thanks for help.
as a new user in the forum ,i can't upload a zip folder.
here is the cmake file of it.
https://forum.qt.io/topic/85016/convert-cmake-file-to-qmakeand here is the original code.from github
https://github.com/lxde/lximage-qt -
Hi,
Please show the content of your .qrc file and the part of the code where you load the icons.
-
Here is the qrc file
I use this code first
QPixmap iu("<:/icons/before.png>"); ui.cNext->setIcon(iu);
But not showing the icon.
so i apply the icons from designer
and also see the output .the icon is not showing in after build.
thanks. -
as i am using qt 5 i used
ui.cPrevious->setIcon(QIcon("qrc:/icons/left.ico"));but no result.I don't understand .It should work with code and designer.
i think writer of this code made something to take only select the icone from system theme.@saber hi, you use
cmake
. maybe some error incmake
. like source path not set right.if use
qmake
, my snippet code is ok. you can check the the path incmake
.or To try the
absolute path
. like following snippet:QPixmap pix; if(pix.load("absolute icon path")){ qDebug("icon load ok"); QIcon ico(pix); ui->btn->setIcon(ico); }
-
@saber hi, you use
cmake
. maybe some error incmake
. like source path not set right.if use
qmake
, my snippet code is ok. you can check the the path incmake
.or To try the
absolute path
. like following snippet:QPixmap pix; if(pix.load("absolute icon path")){ qDebug("icon load ok"); QIcon ico(pix); ui->btn->setIcon(ico); }