A
A
Anatoly Medvedev2015-11-03 18:20:01
Qt
Anatoly Medvedev, 2015-11-03 18:20:01

How to make QComboBox pop up when user input starts?

In the default variation, when you start searching for an element in the box (from the keyboard), the element is selected, but the box does not open without calling Ctrl + Down - which is unacceptable and will create discomfort for the user (we do not use the mouse according to the technical specifications). Is there any way to fix this?
I would also like to know how to make the focus designation on the box more explicit, there are several boxes and when the window is opened there is no indication that the first box is now under focus, the indication appears only after the tab, and under some DE under Linux it is completely absent.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Snytkin, 2015-11-03
@dima11221122

Alternatively, inherit from QComboBox and pull QCombobox::showPopup in the FocusIn event and / or KeyPress event. With FocusOut, on the contrary, do hidePopup. In general, it is worth playing around with events.
Regarding focus designation - use styles or palettes (qss/qstylesheet or qpalette). Then you will kill two birds with one stone - and make the focus the way you want, and your application will look the same on all platforms.

J
Jacob E, 2015-11-04
@Zifix

Maybe just QLineEdit + QCompleter?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question