Simplest way to set image on the Push Button::
btn = (QPushButton *)ui->btn;
btn->setIconSize((QSize(56,68)));
QPixmap* pixmap1 = new QPixmap(":/images/orange.bmp");
QIcon icon1(*pixmap1);
btn->setIcon(icon1);
I think this might help you..
Simplest way to set image on the Push Button::
btn = (QPushButton *)ui->btn;
btn->setIconSize((QSize(56,68)));
QPixmap* pixmap1 = new QPixmap(":/images/orange.bmp");
QIcon icon1(*pixmap1);
btn->setIcon(icon1);
I think this might help you..
Qt Code:
To copy to clipboard, switch view to plain text mode
Why this cast ? (which is an old C-style cast anyway).
Anyway its works fine. Finding the simplest way to use yet more powerful
ui->btn->setIconSize((QSize(56,68))); isn't work?
and in qt don't use old c-style cast. you have static_cast and object_cast
Try read Qt documentation before ask stupid question.
You shouldn't need any casts here. Be it implicit or explicit, C or C++ style.
btn = (QPushButton *)ui->btn;
btn->setIconSize((QSize(56,68)));
Bookmarks