Re: [Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Laszlo Papp
Yep, that is what I ended up doing here myself, too. Thanks for the confirmation! https://codereview.qt-project.org/c/qt/qtbase/+/418684 On Fri, Jun 24, 2022 at 7:31 PM Kai Uwe Broulik wrote: > Hi, > > you cannot reply rely on RTTI in Qt Core. static_cast is fine in this > scenario as we know i

Re: [Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Thiago Macieira
On Friday, 24 June 2022 11:31:22 PDT Kai Uwe Broulik wrote: > Hi, > > you cannot reply rely on RTTI in Qt Core. static_cast is fine in this > scenario as we know it'll be a key event. I don't remember any more what we did in Qt 5, but in Qt 6 RTTI is always enabled. And yet we don't use it direc

Re: [Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Kai Uwe Broulik
Hi, you cannot reply rely on RTTI in Qt Core. static_cast is fine in this scenario as we know it'll be a key event. Cheers Kai Uwe ___ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Laszlo Papp
Ah, I think I found the issue. QKeySequence::event() falls back to QWidget::event() for KeyPress event types and QWidget::event() treats the tabs as special here: https://code.woboq.org/qt5/qtbase/src/widgets/kernel/qwidget.cpp.html#9006 However, this logic should not inherently apply to QKeySeque

Re: [Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Laszlo Papp
I debugged this a bit further. It looks like bool QKeySequence::event(QEvent *e); is hit for the tab key, but then QKeySequence::keyPressEvent(QKeyEvent *e); is not. I also checked all other GUI elements in the above code with My* subclasses and none of those get the tab key under their event hand

Re: [Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Laszlo Papp
The things I have also tried: 1. bool eventFilter(QObject *, QEvent *) override { return false; } in the QKeySequenceEdit class directly -> does not seem to make a difference. 2. Check if keyPressEvent handle is called. It is hit for any other keys than the tab. 3. setFocusPolicy(Qt::NoFocus); on

Re: [Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Jeremy Whiting
Tab is likely being grabbed by the window itself (or maybe the QKeySequenceEdit is ignoring) because it's using the tab as a switch to the next thing in the tab order action. On Fri, Jun 24, 2022 at 9:51 AM Laszlo Papp wrote: > Hi, > > I am unable to assign tab to QKeySequenceEdit. Do you know w

[Development] QKeySequenceEdit: Unable to assign tab

2022-06-24 Thread Laszlo Papp
Hi, I am unable to assign tab to QKeySequenceEdit. Do you know what the issue may be? Is this a Qt bug or am I doing something wrong? You can find the small testbed code below that reproduces the issue. Working version: https://imgur.com/a/Mng0Rpv Non-working version: https://imgur.com/a/tSle7W