Display icon into QLabel [SOLVED]
-
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.
-
Hi,
You can use QIcon::pixmap to get one for your QLabel.
-
I am not sure how to write it.
label->setPixmap(QIcon::())
I am not sure what do after that. Please help me. -
Something like:
QIcon icon = style()->standardIcon(QStyle::SP_DialogOkButton); QPixmap pixmap = icon.pixmap(QSize(64, 64));