0 like 0 dislike
245 views
asked in C plus plus (C++) by (5.6k points)

How to I can in designer (Qt Designer) set label text in certain tab of Qt tab widget (QTabWidget)? I.e. how to in designer set tab title in QTabWidget?

qt designer tab title

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

0 like 0 dislike
answered by (5.6k points)

Make active tab you want to rename, but in "Qt Object browser" should be select exactly all QTabWidget (not specific tab), then in the Property Editor (if you can't find it make sure it's visible by using the View->Property Editor menu item) scroll down to the bottom and look for the currentTabText property. You can change the tab's name right there.

In Qt Creator Designer, if you can't seem to find the currentTabText property, you have probably selected the tab itself in the the object tree. Make sure to select the QTabWidget, which should happen automatically when selecting the tab in the form preview.

Also you can use this at runtime:

ui->tabWidget->setTabText(index, "New tab title");

Related questions

0 like 0 dislike
1 answer 2 views
0 like 0 dislike
1 answer 36 views
0 like 0 dislike
1 answer 29 views
0 like 0 dislike
1 answer 44 views
0 like 0 dislike
1 answer 17 views
0 like 0 dislike
1 answer 6 views
0 like 0 dislike
1 answer 25 views
0 like 0 dislike
1 answer 31 views
0 like 0 dislike
1 answer 27 views
0 like 0 dislike
1 answer 9 views
...