Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. High DPI support for custom image in QComboBox::down-arrow

High DPI support for custom image in QComboBox::down-arrow

Scheduled Pinned Locked Moved Unsolved General and Desktop
qcomboboxpixelratiohighdpi
1 Posts 1 Posters 392 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jammin44fm
    wrote on 3 Aug 2021, 06:37 last edited by
    #1

    Hi all,

    I'm struggling to get a good result when a custom QComboBox::down-arrow image and a high DPI screen.
    I'm using Application::applicationPixelRatio(2) to draw elements of my GUI in higher quality.

    But my custom QComboBox drop-down icon, scales correctly, but not smoothly.
    That is, it is drawn the correct size, but clearly using the original low resolution image and not scaled up smoothly.

    I have tried a number of different things to get the QComboBox down-arrow drawing correctly in the 2x High DPI mode, but none of them worked correctly.

    So what is the correct / recommended / best, way to get a clean looking down-arrow for my QComboBoxes in both normal and High DPI ( ie 2x) application Settings?

    I'm currently using a style sheet with the following line to specify the custom image for my down-arrow
    QComboBox::down-arrow { image: url(:/MyCustomDownArrow.png); width: 9px; height: 9px; }

    I've also tried using a higher res PNG, but that does not seem to work either?
    I would be happy to replace the style sheet with a runtime created Pixmap or icon, But I have not seen any docs that indicate that is possible.

    Thanks in advance,

    James

    1 Reply Last reply
    0

    1/1

    3 Aug 2021, 06:37

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved