Help to make tab key work in kcurrencycalculator and in budget window

José Arthur Benetasso Villanova jose.arthur at gmail.com
Mon Feb 25 12:52:05 GMT 2019


Hi Thomas

Like this?

diff --git a/kmymoney/dialogs/kcurrencycalculator.cpp
b/kmymoney/dialogs/kcurrencycalculator.cpp
index bf5874d2e..ed3135fb0 100644
--- a/kmymoney/dialogs/kcurrencycalculator.cpp
+++ b/kmymoney/dialogs/kcurrencycalculator.cpp
@@ -143,6 +143,10 @@ public:
       ui->m_amountButton->hide();
       ui->m_toAmount->hide();
     }
+    q->setTabOrder(ui->m_amountButton, ui->m_toAmount);
+    q->setTabOrder(ui->m_toAmount, ui->m_dateEdit);
+    q->setTabOrder(ui->m_dateEdit, ui->m_updateButton);
+    q->setTabOrder(ui->m_updateButton, ui->buttonBox);
   }

   void updateExample(const MyMoneyMoney& price)


Still not working :-(

On Mon, Feb 25, 2019 at 9:37 AM Thomas Baumgart <thb at net-bembel.de> wrote:

> Hi José,
>
>
>
> On Montag, 25. Februar 2019 13:14:15 CET José Arthur Benetasso Villanova
> wrote:
>
>
>
> > Hi.
>
> >
>
> > I'm trying to make the tab key work properly in kcurrencycalculator and
> in
>
> > budget windows, specially in the budget, that I'm using heavily those
> days.
>
> >
>
> > I tried to put code this code in KCurrencyCalculatorPrivate or some
>
> > variation of this, but without any effect:
>
> >
>
> > diff --git a/kmymoney/dialogs/kcurrencycalculator.cpp
>
> > b/kmymoney/dialogs/kcurrencycalculator.cpp
>
> > index bf5874d2e..19eb744b9 100644
>
> > --- a/kmymoney/dialogs/kcurrencycalculator.cpp
>
> > +++ b/kmymoney/dialogs/kcurrencycalculator.cpp
>
> > @@ -73,6 +73,11 @@ public:
>
> > m_date(date),
>
> > m_resultFraction(resultFraction)
>
> > {
>
> > + qq->setTabOrder(ui->m_amountButton, ui->m_toAmount);
>
> > + qq->setTabOrder(ui->m_toAmount, ui->m_dateEdit);
>
> > + qq->setTabOrder(ui->m_dateEdit, ui->m_updateButton);
>
> > + qq->setTabOrder(ui->m_updateButton, ui->buttonBox);
>
> > +
>
> > }
>
> >
>
> > ~KCurrencyCalculatorPrivate()
>
> >
>
> >
>
> > How can I achieve this? Thanks in advance.
>
>
>
> You are calling the setTabOrder too early. The widgets already exist at
> this point but are not yet 'setup'.
>
>
>
> Try to drop your code sequence into init() after the call to
>
>
>
> ui->setupUi(q)
>
>
>
> Make sure to replace 'qq' with a simple 'q' at this point. It is the same
> thing and provided by Q_Q(KCur ...).
>
>
>
> In setupUi (it's the generated code from the Qt-Designer ui file), the
> taborder will be setup according to the instructions made in Qt-Designer
> and since they are executed *after* the ctor - where you try to setup the
> order - they will override what you have done.
>
>
>
> You can find this generated file in the build directory as
>
>
>
> ui_kcurrencycalculator.h
>
>
>
>
>
> Hope this helps. I know, it's not obvious if you have little knowledge
> about the underlying (Qt-) mechanisms.
>
>
>
> --
>
>
>
> Regards
>
>
>
> Thomas Baumgart
>
>
>
> https://www.signal.org/ Signal, the better WhatsApp
>
> -------------------------------------------------------------
>
> The Unix Guru's View of Sex:
>
> ============================
>
> # unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep
>
> -------------------------------------------------------------
>
>
>


-- 
José Arthur Benetasso Villanova
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20190225/658ae476/attachment-0001.html>


More information about the KMyMoney-devel mailing list