Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    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)

    General and Desktop
    2
    4
    1566
    Loading More Posts
    • 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
      Dolphin last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • D
          Dolphin last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

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

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • First post
              Last post