Important: Please read the Qt Code of Conduct -

Only displaying whole items in a QListView - reduce screen noise by only having whole items visible to the user (e.g. 3 instead of 3 and a bit)

  • My application is for people with visual impairment so it would be good minimise on screen noise e.g. that bit of a QListView item that half hangs off the end because an exact number of items do not fit in the list. I have some code that calculates the item size and resizes the listView to only display whole items but with all the variations of content, styling and font/icon size it is not working perfectly. Before I work on it any more I was wondering if there was a simple trick?

    QListview has settings: uniformItemSizes and wordWrap

    QListView also uses - flow, view mode and wrapping(item wrapping) - set by the user.

  • Moderators

    Ah, it's you again :) Hello.

    Setting the view mode to QListView::Snap should snap things to grid - but it probably won't prevent "bits" from being shown. I've never tried this, so I can't really say much more.

  • Hello :-) How is the weather in Germany????

    In order to use the snap you need a grid which means calculating the size of the grid (not having a grid works everything out nicely just does not remove the extra "bits"). Grid calculation proving tricky, not impossible but it seems sensible to check for a simpler way to reduce possible errors.

  • Moderators

    It's HOT. About 30 degrees centigrade. I know that's not what some people would call scorching, but here it's a lot :)

Log in to reply