PDA

View Full Version : QT, Is there a method that cancel an icon on a QPushButton, setted with setIcon?



anotherjoe
17th January 2011, 18:12
Hi to all guys,

I'm moving the first steps on QWidget programming. I have setted a icon on a QPushButton, but I can't remove it when I emit a particular signal. In the assigned slot I don't know what method I must use to clean the QPushButton from the icon I have setted.

Another little help: If I need to create a new window in a QWidget class, how can I do? I've seen that in QWidget there is no chance to make new QWindows, the only window I can use and I must refer to is the QMainWindow. If someone could post a little example I'll be very grateful!!

Thanks very much for attention!! :)

AJ

stampede
17th January 2011, 18:32
Have you tried

button->setIcon(QIcon());
?

wysota
17th January 2011, 18:43
Another little help: If I need to create a new window in a QWidget class, how can I do? I've seen that in QWidget there is no chance to make new QWindows, the only window I can use and I must refer to is the QMainWindow. If someone could post a little example I'll be very grateful!!

QWidget *w = new QWidget;
w->show();

rahuldas
24th July 2011, 22:13
Have you tried

button->setIcon(QIcon());
?

Works! Thank you