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. listwidget Scrollbar isvisble
Qt 6.11 is out! See what's new in the release blog

listwidget Scrollbar isvisble

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 451 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    If you insert more than a few items into the list widget, the scrollbar appears.

    this->ui.listWidget->verticalScrollBar()->isVisible();
    

    It seemed to tell us how it was after it appeared.

    I want to know the status of the scrollbar before it appears in the view, is there any way?

    jsulmJ 1 Reply Last reply
    0
    • I IknowQT

      If you insert more than a few items into the list widget, the scrollbar appears.

      this->ui.listWidget->verticalScrollBar()->isVisible();
      

      It seemed to tell us how it was after it appeared.

      I want to know the status of the scrollbar before it appears in the view, is there any way?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @IknowQT Not sure what you mean.
      isVisible() tells you whether the scroll bar is visible or not.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply
      1
      • jsulmJ jsulm

        @IknowQT Not sure what you mean.
        isVisible() tells you whether the scroll bar is visible or not.

        I Offline
        I Offline
        IknowQT
        wrote on last edited by
        #3

        @jsulm

        When I put more than 10 items in my list widget, the scrollbar appears, and every time I insert an item, I check isvisible() and false in the 10th, false in the 11th, and then scrollbar appears in the view, and then the invisible status is true.

        jsulmJ 1 Reply Last reply
        0
        • I IknowQT

          @jsulm

          When I put more than 10 items in my list widget, the scrollbar appears, and every time I insert an item, I check isvisible() and false in the 10th, false in the 11th, and then scrollbar appears in the view, and then the invisible status is true.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @IknowQT Still not sure I understand you correctly (it is hard to understand your descriptions) - isn't that exactly what should happen? The scroll bar appears then >10 entries are added. As long as you have <=10 entries it is not shown, so isVisible() returns false, which is correct. If you add more than 10 items the scroll bar is shown and isVisible() returns true.
          If my understanding is wrong then please try to explain better.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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