Are you sure the QIcon you pass in QPushButton has its image loaded? The following code should work:
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
pushButton->show();
return app.exec();
}
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton *pushButton = new QPushButton(QIcon("path_to_your_icon"), "text", 0);
pushButton->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Please check that the path to the icon is valid (or better use the resource system of Qt). Next you may try it without the text and set the QPushButton's flat-property to true (might look better with icon-only buttons).
Bookmarks