Drop workaround for fixed QTBUG-42503 #101

issue hebasto opened this issue on October 8, 2020
  1. hebasto commented at 10:38 AM on October 8, 2020: member

    In the code https://github.com/bitcoin-core/gui/blob/9dd4de2832e298398436b957375d62de67f0a928/src/qt/overviewpage.cpp#L128

    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.

  2. prusnak referenced this in commit a2a3f4cd8d on Jan 19, 2021
  3. prusnak commented at 3:39 PM on January 19, 2021: contributor
  4. jonasschnelli closed this on Jan 26, 2021

  5. jonasschnelli closed this on Jan 26, 2021

  6. jonasschnelli referenced this in commit 5f65f13597 on Jan 26, 2021
  7. remyers referenced this in commit adac0c6f04 on Jan 26, 2021
  8. sidhujag referenced this in commit d72a209295 on Jan 26, 2021
  9. jonasschnelli reopened this on Jan 26, 2021

  10. jonasschnelli commented at 4:23 PM on January 26, 2021: contributor

    I keep this PR open since we still use a QPushButton for those icons (rather than a QLabel).

  11. prusnak commented at 4:34 PM on January 26, 2021: contributor

    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)?

  12. jonasschnelli commented at 6:54 PM on January 26, 2021: contributor

    AFAIK you can just use QLabel::setPixmap() (along with setText()).

  13. fanquake closed this on Jan 27, 2021

  14. fanquake reopened this on Jan 27, 2021

  15. laanwj commented at 5:09 PM on January 27, 2021: member

    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.

  16. prusnak commented at 5:39 PM on January 27, 2021: contributor

    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

  17. jonasschnelli commented at 8:33 PM on January 27, 2021: contributor

    Let's keep the QPushButton then. Closing.

  18. jonasschnelli closed this on Jan 27, 2021

  19. bitcoin-core locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-01 13:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me