[Interest] Shift+Tab Shortcut

Daniel Otto Bolognani daniel.bolognani at totvs.com.br
Tue Sep 24 19:20:55 CEST 2013


Mitch,

This is exactly what is happening in our project, anyway, I have done it with EventFilter and now it's working.

Thanks!
Daniel

-----Original Message-----
From: Mitch Curtis [mailto:mitch.curtis at digia.com] 
Sent: terça-feira, 24 de setembro de 2013 11:00
To: Daniel Otto Bolognani; Interest at qt-project.org
Subject: Re: [Interest] Shift+Tab Shortcut

On 09/20/2013 09:13 PM, Daniel Otto Bolognani wrote:
> Hello list!
>
> We ported our software from QT3 Support to Pure QT4 and now we are facing some different behaviour on the shortcuts, we have managed almost all of the problems, unless the Shift+Tab shortcut that we need to intercept.
>
> When it was Qt3 Support we had this:
> Q3Action *q3act = new Q3Action(this);
> QKeySequence *ks = new QKeySequence(Qt::Key_Backtab);
> q3act->setAccel(*ks);
> connect(q3act,SIGNAL(activated()),this,SLOT(keypress()));
>
> And when pressed, the SLOT keypress was called and everything was working like it should.
>
> To port to QT4 we did this:
> QAction *act3 = new QAction(this);
> QKeySequence *ks = new QKeySequence(Qt::Key_Backtab);
> act3->setShortcut(*ks);
> addAction(act3);
> connect(act3,SIGNAL(triggered()),this,SLOT(keypress()));
>
>
> All the other shortcuts worked unless the backtab (shift+tab)! We have tried to use this on the keypress event too:
> void keyPressEvent( QKeyEvent * e )
> {
>    // Even if I test Qt::Key_Tab it doens't work either
>    if ((e->modifiers()==Qt::ShiftModifier && e->key() == Qt::Key_Backtab) || e->key()==Qt::Key_Backtab)
>    {
>      QMessageBox msgbox;
>      msgbox.setText("backtab");
>      msgbox.exec();
>    }
> }
>
> It hadn't worked either.
>
> The only thing that resolved this was to grab the FocusOut event and test if it was a backtab reason, but in my personal opinion it is an horrible solution!
> Aren't these 2 other methods supposed to work? What are we doing wrong?
>
> Thanks in advance,
> Daniel

Do you also have Tab assigned as a shortcut? It could be that 
https://bugreports.qt-project.org/browse/QTBUG-1206 is still valid.



More information about the Interest mailing list