Problem with ContextMenu
-
@Brad1111 I don't have any apple related env stuff here (and I will never have).
wrote on 30 Oct 2024, 19:29 last edited by@Christian-Ehrlicher The real question is whether you're testing this on a mobile environment, Android or IOS, no matter. Or desktop? If it works on Desktop I wouldnt be surprised.
I need someone to test it on mobile, because it could be the issue imo. -
wrote on 30 Oct 2024, 20:36 last edited by CPPUIX
Yeah, it doesn't work on mobile, I still get a context menu. Android, Qt 6.7.1. You need a solution specific to mobile.
Used Christian's MRE:
int main(int argc, char* argv[]) { QApplication a(argc, argv); QTextEdit edit; edit.setContextMenuPolicy(Qt::NoContextMenu); edit.show(); return a.exec(); }
-
You should create a bug report if it's still reproducable with Qt6.8
-
Yeah, it doesn't work on mobile, I still get a context menu. Android, Qt 6.7.1. You need a solution specific to mobile.
Used Christian's MRE:
int main(int argc, char* argv[]) { QApplication a(argc, argv); QTextEdit edit; edit.setContextMenuPolicy(Qt::NoContextMenu); edit.show(); return a.exec(); }
wrote on 30 Oct 2024, 21:39 last edited by Brad1111@Abderrahmene_Rayene thanks. Im a bit surprised theres such a 'bug' , but I couldnt understand how to fix it.
Do you guys think this could be fixed by QT team within, say, a couple of months or is it most likely to take much longer ?
@Christian-Ehrlicher I know its a stupid question, but where can I report a bug ?
-
wrote on 30 Oct 2024, 22:09 last edited by
Try to work around it, perhaps through the event system, idk, just shooting in the dark here. It's probably native stuff (also shooting in the dark).
And since this is Qt Widgets on mobile, that will probably make it very low priority, because it's not QML/Qt Quick. I'm also shooting in the dark here. Sorry.
You can report bugs here (not shooting in the dark): https://bugreports.qt.io/
But test with Qt 6.8 first, as Chrisitan suggested. I doubt it's "fixed" there.
-
Try to work around it, perhaps through the event system, idk, just shooting in the dark here. It's probably native stuff (also shooting in the dark).
And since this is Qt Widgets on mobile, that will probably make it very low priority, because it's not QML/Qt Quick. I'm also shooting in the dark here. Sorry.
You can report bugs here (not shooting in the dark): https://bugreports.qt.io/
But test with Qt 6.8 first, as Chrisitan suggested. I doubt it's "fixed" there.
wrote on 30 Oct 2024, 22:25 last edited by@Abderrahmene_Rayene I posted here because I didnt succeed working around it :D
I would need more details if I am to try another way to get my results i.e. get rid of the contextmenu, because I am not that good with QT.I currently have qt 6.7 so yea highly doubt it works with 6.8
-
wrote on 30 Oct 2024, 22:39 last edited by
See if you could make something with this:
Try to check if context menu events get called. If not, there's probably nothing you could do. Like you said here:
I tried everything and literally nothing works, it looks like it calls some other function or I dunno.
Except by Android, not other functions.
-
See if you could make something with this:
Try to check if context menu events get called. If not, there's probably nothing you could do. Like you said here:
I tried everything and literally nothing works, it looks like it calls some other function or I dunno.
Except by Android, not other functions.
wrote on 31 Oct 2024, 21:51 last edited by@Abderrahmene_Rayene I tried to filter and identify events but couldnt find something to make it work, without breaking the whole textedit functionality.
I submitted a bug report. -
wrote on 1 Nov 2024, 06:40 last edited by
Yeah, figured.
Could you link to the bug report here? I can't find it.
-
wrote on 3 Nov 2024, 20:45 last edited by
@Abderrahmene_Rayene QTBUG-130712
-
wrote on 4 Apr 2025, 10:27 last edited by
cant get any news on this in more than 5 months. Any idea how long this usually takes to get an update on a bug with
Priority set as : P2: Important ?
https://bugreports.qt.io/browse/QTBUG-130712 -
wrote on 9 Apr 2025, 08:21 last edited by
It's a mobile Qt Widgets bug...I think that would be very low priority, because Qt Widgets for mobile is very rare, AFAIK.
Porting to QML would be faster, probably. Perhaps consider that?
Just a suggestion ofc, because I do not know the details. -
wrote on 10 Apr 2025, 07:39 last edited by
@Brad1111 Did you try overriding QWidget::contextMenuEvent?
-
@Brad1111 Did you try overriding QWidget::contextMenuEvent?
wrote on 10 Apr 2025, 16:28 last edited by@Kevin-Hoang That event does not get fired. See the comments above.