4

I'm working on an application wherein a QComboBox is located at the bottom of the window. From my limited understanding, I believe Qt should automatically calculate the direction of the drop down list based on the amount of space available for the popup. However, in my case, the drop down direction is still in the default state (displayed below the box) and hence hidden and inaccessible. Could someone help me understand why this might be happening or perhaps if there is a way to force Qt to display the popup above the QComboBox?

--EDIT--

Image below shows the problem, and my fix. I am still not sure if there is a method to set the direction manually, but in this case, I don't need it anymore. Dropdown direction error

jSmith
  • 53
  • 8
  • 1
    What platform are you on, and what version of Qt are you using? A screenshot might also be helpful. – ekhumoro Oct 03 '12 at 20:50
  • I am on Windows 7, using Qt-4.8. – jSmith Oct 04 '12 at 16:24
  • Works fine here with same specs. `QComboBox` expands up if there is not enough space below. Maybe you did something to change the default behavior. Can you show us your code? Or at least a small example that shows the behavior? – Avaris Oct 05 '12 at 00:28
  • I fixed the problem, its similar to this other [question](http://stackoverflow.com/questions/12736688/pyqt-pyside-qspinbox-flickering-issue) I had, I was attempting to add `QComboBox` to a `QGraphicsScene` and the calculation was all wrong, however, as mentioned in the other post I reverted to adding `QComboBox` to `QGridLayout` and now the issue is solved. – jSmith Oct 09 '12 at 18:32

1 Answers1

1

This thread was discussing the same topic , have a look .http://qt-project.org/forums/viewthread/9111 . And yes with re-implementing showPopup() you can do this I think.

Achayan
  • 5,720
  • 2
  • 39
  • 61
  • I have seen this post earlier, wasn't helpful though. On more scrutiny however, I came across this post with supposedly the solution to this situation. http://stackoverflow.com/a/10073243/1718027 Unfortunately, I am not familiar with C++ and am unable to translate this. Could you help? – jSmith Oct 04 '12 at 16:15