STEPS TO REPRODUCE 1. Open the "Create a new partition" dialogue 2. Tick the "Encrypt with LUKS" check box 3. Press tab OBSERVED RESULT The focus switches to the "label" field. EXPECTED RESULT The focus switches to the newly shown "Enable LUKS2" check box. SOFTWARE/OS VERSIONS KDE Plasma Version: 6.2.0 KDE Frameworks Version: 6.6.0 Qt Version: 6.7.3
Git commit 81fc2370b8121dfe886e516443c72000de81e888 by Andrius Štikonas. Committed on 11/10/2024 at 21:08. Pushed by stikonas into branch 'master'. Improve tab order in partition create dialog. Unfortunately, there doesn't seem to be an easy way to change tab order of KNewPasswordWidget. M +20 -17 src/gui/sizedialogwidgetbase.ui https://invent.kde.org/system/partitionmanager/-/commit/81fc2370b8121dfe886e516443c72000de81e888
"Unfortunately, there doesn't seem to be an easy way to change tab order of KNewPasswordWidget." Does that mean the tab order for the password field will still be wrong? :/ That's really the one I cared about more. Only noticed that the checkbox also has the wrong order while filing this report. Originally I tried to tab to the next text box after typing my password.
(In reply to LaughingMan from comment #2) > "Unfortunately, there doesn't seem to be an easy way to change tab order of > KNewPasswordWidget." > > Does that mean the tab order for the password field will still be wrong? :/ > > That's really the one I cared about more. Only noticed that the checkbox > also has the wrong order while filing this report. Originally I tried to tab > to the next text box after typing my password. Unfortunately yes, but I don't see any way to specify tab order for it. Qt designer didn't have any option to set order on it. I then tried to hack around .ui file manually, by adding tabstop there but it still didn't work (perhaps unsurprisingly).
Have you tried setting it programmatically from the code using QWidget::setTabOrder (https://doc.qt.io/qt-6/qwidget.html#setTabOrder)? If that does not work, you can try to use QObject introspection to get the KPasswordLineEdit embedded in the KNewPasswordWidget: KPasswordLineEdit *passwordLineEdit = m_EditPassphrase->findChild<KPasswordLineEdit *>(QString(), Qt::FindDirectChildrenOnly); and then playing around with that, maybe: m_EditPassphrase->setFocusProxy(passwordLineEdit); setTabOrder(…, m_EditPassphrase); // now that it has a valid focus proxy set I also think this needs to be reported against KNewPasswordWidget. All widgets ought to support setting the tab order.
(In reply to Kevin Kofler from comment #4) > Have you tried setting it programmatically from the code using > QWidget::setTabOrder (https://doc.qt.io/qt-6/qwidget.html#setTabOrder)? > > If that does not work, you can try to use QObject introspection to get the > KPasswordLineEdit embedded in the KNewPasswordWidget: > KPasswordLineEdit *passwordLineEdit = > m_EditPassphrase->findChild<KPasswordLineEdit *>(QString(), > Qt::FindDirectChildrenOnly); > and then playing around with that, maybe: > m_EditPassphrase->setFocusProxy(passwordLineEdit); > setTabOrder(…, m_EditPassphrase); // now that it has a valid focus proxy set > > I also think this needs to be reported against KNewPasswordWidget. All > widgets ought to support setting the tab order. Yeah, I agree. I'll open a bug against KNewPasswordWidget a bit later.
Widgetsaddons bug: https://bugs.kde.org/show_bug.cgi?id=494624 Kevin, I think I tried setting QWidget::setTabOrder yesterday if I remember correctly and it didn't work. I have not tried to use QObject introspection yet, but let's see if #494624 gets some responses.