I created an editable QCombobox storing the last inputs by:
QComboBox* input = new QComboBox();
input->setEditable(true);
input->completer()->setCompletionMode(QCompleter::PopupCompletion);
input->setMaxCount(5);
Now I got 2 issues:
I want to limit the size of the dropdown-menu to the last 5 input-strings.
These 5 old inputs shall all be displayed under the editable line on the top. Currently, the old inputs hide the editable line.
For the first aspect, calling ’setMaxCount(5)’ makes the QComboBox display the first 5 items inserted but I want it to display the last 5 items.
For the second aspect, I somehow need to change the style as I think. So changing sth. like these parameters:
setStyleSheet("QComboBox::drop-down {\
subcontrol-origin: padding;\
subcontrol-position: bottom right;\
}");
But I got no idea which parameters here to change s.t. only the last 5 entries are all shown under the input-line of the QComboBox.
EDIT
Here are two pictures of how the dropdown-menu appears. I entered 5 entries as you can see but the edit-line gets hiden by the popup:
In the 2nd picture, the edit-line is right behind the marked entry "5".