we should drop the workaround for QTBUG-42503 which is already fixed since Qt 5.5.0.
Disclaimer: I'm not able to test a patch as testing requires retina display.
we should drop the workaround for QTBUG-42503 which is already fixed since Qt 5.5.0.
Disclaimer: I'm not able to test a patch as testing requires retina display.
I keep this PR open since we still use a QPushButton for those icons (rather than a QLabel).
How should a QLabel with an icon work?
Via the html img hack?
QLabel("<html><img src=':/resource.png'></html>")
Or should we use 2 QLabels for each QPushButton (one with an icon, the other with a text)?
AFAIK you can just use QLabel::setPixmap() (along with setText()).
I am fairly sure you need two labels in that case, one with the pixmap one with the text. Otherwise, the label doesn't know how you want to position the icon and text relative to each other.
When it's possible to avoid using HTML that's generally preferable.
I also think it's not possible to set both icon and text for a label.
Here's the trick how to solve it via VBoxLayout containing two labels https://forum.qt.io/topic/64020/settext-and-setpixmap-using
QWidget * container = new QWidget(this);
QVBoxLayout * layout = new QVBoxLayout(container);
QLabel * textLabel = new QLabel(container);
QLabel * imageLabel = new QLabel(container);
layout->addWidget(imageLabel);
layout->addWidget(textLabel);
imageLabel->setPixmap(...);
textLabel->setText(...);
Honestly, I am not so sure that's better than using a QPushButton
Let's keep the QPushButton then. Closing.