How can I control the focus of tabs on a tab widget through code?
-
wrote on 5 Dec 2019, 00:20 last edited by
How can I control the focus of tabs on a tab widget through code? I mean, so that the focus of the tabs follows the tabulation sequence of the fields. I've tried everything and can't.
-
How can I control the focus of tabs on a tab widget through code? I mean, so that the focus of the tabs follows the tabulation sequence of the fields. I've tried everything and can't.
wrote on 5 Dec 2019, 00:49 last edited by@Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:
I've tried everything and can't.
that's too generic... please show what you've tried
-
@Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:
I've tried everything and can't.
that's too generic... please show what you've tried
wrote on 5 Dec 2019, 13:58 last edited by@Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:
that's too generic... please show what you've tried
Ok, Pablo.
I will try to explain further:
(detail: I am Brazilian and this text was translated by google translator. So forgive me if some passages get a little incomprehensible).
.
.
Since my form has many fields, I split them into a four-tabbed widget and arranged the tab order of all these fields.But...
For example, when I finish filling the last field of the first tab, the focus goes to the next field (which is on the second tab), but the second tab is not activated. That way, I need to click the second tab with my mouse to continue filling in the remaining fields.
I already tried to use:
ui-> tabwidget-> setFocus;
ui-> tab-> setFocus;
ui-> tabwidget-> setFocus;
ui-> tabwidget-> activateWindow ();
ui-> tabwidget-> activateWindow ();I tried to place these commands in the "returnPressed" slot of the last field of the first tab. Since I don't know if this is the correct slot, I also tried placing the commands on a Push Button. But none of the trial combinations worked.
I hope I could be clear.
Can you help me?
Thank you!
-
How can I control the focus of tabs on a tab widget through code? I mean, so that the focus of the tabs follows the tabulation sequence of the fields. I've tried everything and can't.
@Alexandre-Camelo what you're looking for is probably
https://doc.qt.io/qt-5/qwidget.html#setTabOrder -
@Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:
that's too generic... please show what you've tried
Ok, Pablo.
I will try to explain further:
(detail: I am Brazilian and this text was translated by google translator. So forgive me if some passages get a little incomprehensible).
.
.
Since my form has many fields, I split them into a four-tabbed widget and arranged the tab order of all these fields.But...
For example, when I finish filling the last field of the first tab, the focus goes to the next field (which is on the second tab), but the second tab is not activated. That way, I need to click the second tab with my mouse to continue filling in the remaining fields.
I already tried to use:
ui-> tabwidget-> setFocus;
ui-> tab-> setFocus;
ui-> tabwidget-> setFocus;
ui-> tabwidget-> activateWindow ();
ui-> tabwidget-> activateWindow ();I tried to place these commands in the "returnPressed" slot of the last field of the first tab. Since I don't know if this is the correct slot, I also tried placing the commands on a Push Button. But none of the trial combinations worked.
I hope I could be clear.
Can you help me?
Thank you!
wrote on 5 Dec 2019, 14:16 last edited by@Alexandre-Camelo it looks to me that you need to use QTabWidget::setCurrentIndex()
-
@Alexandre-Camelo it looks to me that you need to use QTabWidget::setCurrentIndex()
wrote on 5 Dec 2019, 14:26 last edited by@Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:
it looks to me that you need to use
WOOOOOOOOOOOOWWWWWW !!!!!
GOT SURE !!!!!!!!!!
VERY VERY VERY VERY THANK YOU, PABLOOOOOO !!!!!
:-D :-D :-D :-D :-D :-D
As I realize that you know QT well, I will send another horrible problem that has taken my time, too.
I will send in the next post.
Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu !!!!!
-
@Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:
it looks to me that you need to use
WOOOOOOOOOOOOWWWWWW !!!!!
GOT SURE !!!!!!!!!!
VERY VERY VERY VERY THANK YOU, PABLOOOOOO !!!!!
:-D :-D :-D :-D :-D :-D
As I realize that you know QT well, I will send another horrible problem that has taken my time, too.
I will send in the next post.
Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu !!!!!
wrote on 5 Dec 2019, 14:32 last edited by@Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:
I will send in the next post.
Before rushing into that :-) please read the signature of my posts and proceed as stated there...
-
@Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:
I will send in the next post.
Before rushing into that :-) please read the signature of my posts and proceed as stated there...
wrote on 5 Dec 2019, 14:43 last edited by J.Hilk 12 May 2019, 14:48@Pablo-J-Rogina
Ok, Pablo.
I tagged the topic as SOLVED and posted the image on postimage.org.
Did I follow the instructions correctly?
[j.Hilk] Removed user E-Mail for security reasons
-
I took the liberty and removed your E-Mail address, don't post such a thing openly please.
1/9