Unsolved QComboBox as editor in QStyledItemDelegate
-
- The combobox editor has to be created wehn user presses enter/ mouse double click
- The combo box is editable, So i should allow the user to change item of combo box using up/down arrow keys. and should close it when he presses enter
- for mouse click i should close is when user selected any index.
Now i tried to handle currentChangedIndex for mouseclick. But this has an issue. when i changes item using arrow key the current changed Index is getting triggered and the ediotor is getting closed on currentChangedIndex signal... ANy Suggessions plzzz
-
Hi,
Can you show the code you are currently using ?
-
@DonCoder said in QComboBox as editor in QStyledItemDelegate:
- for mouse click i should close is when user selected any index.
Now i tried to handle currentChangedIndex for mouseclick. But this has an issue. when i changes item using arrow key the current changed Index is getting triggered and the ediotor is getting closed on currentChangedIndex signal... ANy Suggessions plzzz
QComboBox::activated()?
-
@ChrisW67 : Same with QComboBox::activated() , it is coming upon pressing up/down arrow
-
Looks like QComboBox::textActivated is what you want for the user selection part.
For the editing part, you should connect the QComboBox line edit editingFinished signal.
-
@SGaist Yes, But that is available from Qt 5.14. My Application is using 5.9 version. So is there an alternative that can mimic QComboBox::textActivated in Qt 5.9 ?
-