QComboBox::showpopup stealing focus completely
-
Hi,
I've been trying to reimplement showPopup in order for me to force it not to steal the mouseEvents completely from the other widgets, whenever the popup is open
(cause I need some of the widgets to receive the events even when the popup is still open)However I don't know if I should be going this route
For info, I tried overriding QListView / QComboBox mouse press/release/move events but without success
I hope someone could provide me with some guidance, cause I don't think its really doable to just reimplement the private stuff with the PIMPL idiom and whatnot
-
@JonB well, hovering (so MouseMove) and mousePress are the only ones I care about.
But wait, actually being able to move the listview/popup a bit upper than it is originially without having part of it clipped could solve my issue, if that's a possibility -
@tataeress
Maybe start by explaining what you are trying to achieve and why you want to do this at all? AQComboBox
shows its popup, makes user interact and behaves fine in the first place. What are trying to alter from default behaviour? -
@JonB
My objective was having a custom dropdown that has a starting position from the center of the QComboBox
I thought originally there is no way to move the dropdown anywhere (I was trying that by moving the QListView since I didn't know there was a frame I could move)
So my workaround was : instanciating 2 custom dropdowns and positionning em to look like one dropdown and just connecting the slots etc..However, it seems that overriding the showPopup to let both popups the original one and the copy which is placed on top of the combobox receive events was somehow impossible because I don't understand how that method blocks/let the mouse events pass here or there.
However, now since I was able to move the original dropdown by finding the frame on the QComboBox and moving it, there is no need anymore for this workaround and I reached my objective
Thank you for triggering my brain to rethink about a thread I passed by in stackoverflow which showed the trick to move the dropdown simply without getting it clipped.
link for anyone who needs it : https://stackoverflow.com/questions/10057140/how-to-make-qcombobox-popup-upwards -