Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3076

QComboBox's listView does not handle VerticalScrollBars Correctly

XMLWordPrintable

      When using a QComboBox of a fixed Width, you may want to use a HorizontalScrollBar in the QComboBox's listView to show its entire contents. HorizontalScrollBarPolicies: ScrollBarAlwaysOn and ScrollBarAsNeeded when set work incorrectly with QComboBox's popUp listView.

      When a QComboBox with fixed width has items longer than the this width, the TextElideMode is set to Qt::ElideNone, and the HorizontalScrollBarPolicy is set to its default(Qt::ScrollBarAsNeeded) the following occurs:

      The first time the QComboBox is clicked the space is allocated in the listViews rect for the HorizontalScrollBar, but no scrollbar shows up. The second time it is clicked it is no longer allocated. This is wrong behavior as the long text is truncated.

      When using the same setup but changing the QHorizontalScrollBarPolicy to Qt::ScrollBarAlwaysOn, The HorizontalScrollBar shows up in the popUp listView, but doesn't scroll. The text is still truncated even with the scrollbar.

      ===============
      With a listView or listWidget of a Fixed Width, the default HorizontalScrollBarPolicy works as it expected to work with the popUp listView of comboBox, that being if the text is too long to be displayed in the view, a Horizontal ScrollBar is displayed and the view is able to be scrolled.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sorvig Morten Sørvig
            janichol Andy Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes