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. QTableWidget images not drawing properly in MacOS- partly resolved
Forum Updated to NodeBB v4.3 + New Features

QTableWidget images not drawing properly in MacOS- partly resolved

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 164 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    donquibeats
    wrote on last edited by
    #1

    Re: QTableWidget images not drawing properly in MacOS

    This was a thread I started four months ago, but I've finally managed to get somewhere with it, so I thought I'd post here in case anyone else encounters the same issue in the future.

    In a PyQt5 application using a QTableWidget, I was having problems with images not displaying properly in cells, as shown in the screenshots in the previous thread.

    My new discovery is that this only happens if the pixel size of the image is greater than or equal to the pixel size of the cell.

    If you try and display a 160x90 image in a 160x90 QTableWidget cell on Windows, it works fine- but on a Mac, it gives terrible results, not painting properly and giving very odd results when scrolled.

    However if you put a 160x90 image into a 161x91 cell- just adding a pixel in each direction- then it displays absolutely fine on both Windows and Mac.

    I guess this might qualify as a Mac bug (either in Qt or PyQt, I'm afraid I don't know which), but of course the workaround of adding an extra pixel is very straightforward.

    I hope this helps somebody in the future. Hello the future!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi again,

      Glad you found a workaround. You should check if there's something related on the bug report system. If not, please consider creating a new issue providing a minimal compilable example.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

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