3

I made a special combo box, I used a QTreeWidget to display the drop down context. Now I have a Problem, if the drop down is displayed the scroll bar is always scrolled down. But I want it to be scrolled up. (It should be some history combobox, the newest entries on top)

I tried to overwrote the scrollToTop with:

void MyComboBox::showPopup()
{
    QComboBox::showPopup();
    view()->scrollToTop();
}

This isn't working, the scrollbar is still on the bottom. Does anyone know why this isn't working? Or knows a better solution? Thank you

4

1 回答 1

0

我刚刚解决了。

问题是,在 QTreeWidgets 属性 AutoScroll 默认为 true。禁用此功能可解决问题。

于 2013-07-19T08:21:51.443 回答