-2

I'm creating a QComboBox in an app with just 2 items in it. This should appear without a scroll bar, but it seems to be creating the drop-down list very fractionally too small for the information in it, causing it to create a vertical scroll bar.

It feels as though it's slightly mis-read the text size when calculating the size of the created list.

Any idea how to get around this?

demonplus
  • 5,613
  • 12
  • 49
  • 68
Hugh
  • 726
  • 1
  • 6
  • 25

2 Answers2

1

One of the ways to adjust width and height of drop down list of QComboBox is to use css:

http://www.qtcentre.org/threads/13496-CSS-QCombobox-setting-min-height-for-drop-down-list

demonplus
  • 5,613
  • 12
  • 49
  • 68
0

I've tried to add long items into my dropdown list. It appears to me that there is no scroll bar.

self.symbol = QtGui.QComboBox(GoogleFinance)
self.symbol.setGeometry(QtCore.QRect(150, 40, 200, 21))
self.symbol.setObjectName(_fromUtf8("symbol"))
self.symbol.addItem("Helloooooooooooooooooooooooooooooooooooooooooo")
self.symbol.addItem("what's upppppppppppppppppppppppppppppppppppppp")

enter image description here

Bun S.
  • 111
  • 1
  • 10
  • 1
    I just edited my question a little - it's a vertical scroll bar rather than a horizontal one. – Hugh May 01 '15 at 16:19