[Solved] SetIcon not working for a QPushButton
QML and Qt Quick
7
Posts
4
Posters
7.2k
Views
1
Watching
-
I have the following code snippet for defining a QPushButton and putting it on my window:
@
manAutoButton = new QPushButton(this);
QPixmap pixmap(":/MonitorWindowPix/Manual Icon.png");
QIcon buttonicon(pixmap);
manAutoButton->setIcon(buttonicon);
manAutoButton->move(629, 270);
@
When I try to run it, I get a compilation error saying that QPushButton has no member named SetIcon. Qt documentation verifies that QPushButton has the SetIcon member. What's wrong with this code? -
[quote author="Eddy" date="1319229513"]Line 2 :
@
QPixmap pixmap(":/MonitorWindowPix/Manual Icon.png");
@
Should be
@
QPixmap pixmap(":/MonitorWindowPix/Manual/Icon.png");
@
With the /
[/quote]
Why is that? Since when are spaces in file names not supported anymore?