Display icon into QLabel [SOLVED]
marlenet15 last edited by marlenet15
I would like to use @standardIcon(QStyle::SP_DialogOkButton)@ for a QLabel. However, QLabel does not have setIcon like QPushButton. Is it possible to set it as a Pixmap? Also, I would prefer not to download any image and just get it from QStyle. Thank you.
You can use QIcon::pixmap to get one for your QLabel.
marlenet15 last edited by
I am not sure how to write it.
I am not sure what do after that. Please help me.
QIcon icon = style()->standardIcon(QStyle::SP_DialogOkButton); QPixmap pixmap = icon.pixmap(QSize(64, 64));