QTabWidget: How to move to another page using keypoard instead mouse?
Hi guys,
can anybody point me to a way, to switch from one page to another inside a QTabWidget using the keyboard instead the mouse? Something similar to
Quote:
int n;
n = currentIndex ();
++n;
tabWidget->setCurrentIndex( n );
but using PgUp / PgDown or something similar instedt?
I have tried it with QKeyEvent and QKeySequence, but I guess the problem is, that my tabWidget don't has a focus.
Thanks in advance.
Re: QTabWidget: How to move to another page using keypoard instead mouse?
Install an event filter and check there for key events.
Re: QTabWidget: How to move to another page using keypoard instead mouse?
Maybe one way would be to add ampersand (&) to tab label as described in the documentation http://doc.trolltech.com/latest/qtabwidget.html#addTab i.e. to add shortcut to each tab, but if you have some issues with the focus then this might not help.
Re: QTabWidget: How to move to another page using keypoard instead mouse?
Hi,
I use QTabWidget a lot - on Windows XP I use Control/Tab to flit between tabs - I assume this works with other Windows variants.
SteveH
Re: QTabWidget: How to move to another page using keypoard instead mouse?
Thanks to all of you for helping me.
Quote:
Originally Posted by
tsp
I have tried to install an eventFilter. It's working well but I will use the shortcuts now, like tsp has told me. I don't no, that I can use shortcuts in a tabWidget because it's not included in the settings for a tabWidget in the designer.
Ctrl-Tab, like Steve has advised is working too, but in some cases I have many pages so it's really faster to use shortcuts.
Thanks again to everybody.