[SOLVED] Error while trying to add Icon to QPushButton
General and Desktop
3
Posts
2
Posters
2.0k
Views
2
Watching
-
Hi there,
I have the following simple codemicon=new QIcon(QIcon::fromTheme("arrow-down")); button->setIcon(micon);Where
QPushButton *button; QIcon *micon;are described in the header file.
And when I'm trying to compile the compiler gives me an error messageERROR: no matching function for call to 'QPushButton::setIcon(QIcon*&)But it is ok for the compiler to write
button->setIcon(QIcon::fromTheme("arrow-down"));and don't use "micon" variable.
I am totally new to Qt so if someone can explain this to me I'll be really grateful.
Thanks :) -
Hi there,
I have the following simple codemicon=new QIcon(QIcon::fromTheme("arrow-down")); button->setIcon(micon);Where
QPushButton *button; QIcon *micon;are described in the header file.
And when I'm trying to compile the compiler gives me an error messageERROR: no matching function for call to 'QPushButton::setIcon(QIcon*&)But it is ok for the compiler to write
button->setIcon(QIcon::fromTheme("arrow-down"));and don't use "micon" variable.
I am totally new to Qt so if someone can explain this to me I'll be really grateful.
Thanks :)