PDA

View Full Version : Change Title of toolbox's page. How?



hakermania
7th November 2010, 20:30
You can call every page of a toolbox separately by calling ui->page_2->setblabla
but there is no option to setTitle of the page or something. So, how can I change the title of a page of the toolbox?:confused:

hakermania
8th November 2010, 09:14
*bump* *bump*

wysota
8th November 2010, 09:18
Come on, man. Bumping up a question after 12 hours?

tbscope
8th November 2010, 09:32
I found this in 5 seconds:
http://doc.qt.nokia.com/4.7/qtoolbox.html#setItemText

hakermania
11th November 2010, 16:26
Thanks for the answer. Sorry for the bumping

time
26th November 2016, 18:01
Hi, sorry for refreshing, but the page with answer isn't available or I don't have access.
So how to change the name of qtoolbox?
The best title will be name of menu position which user clicked.
For example I have a qtoolbox named SCOPE and in menu is in day, week, year. And if user will choose week, the title of qtoolbox from SCOPE will change to WEEK.
So i need to know two things. How to return the QString Which user clicked, and how to change the name of qtoolbox.

The second problem I think I can solve just like that:



QString userScope;

userScope= ... //here we get what user clicked
ui->toolButton->setText(userScope);

d_stranz
26th November 2016, 19:29
Hi, sorry for refreshing, but the page with answer isn't available or I don't have access.

Try this link. (http://www.lmgtfy.com/?q=Qt5+QToolBox)

time
26th November 2016, 19:52
Yea... you can answer for 90% questions like that. Don't be unpleasant. This is the newbe section.
Of course I tried to find answer in Google, but it faild, so I wrote here. I don't think this question is stupid.

d_stranz
26th November 2016, 21:34
This is the newbie section.

Yes it is, but it isn't substitute for reading the documentation. If you already know you want to use QToolBox to achieve some GUI feature, then reading its documentation (especially the Detailed Description section) would have revealed that the signal QToolBox::currentChanged() together with the method QToolBox::itemText() will tell you which string the user clicked. And don't forget to also look at the documentation for the base class(es) if you don't see a method or signal that does what you need.

All of us were Qt newbies once. I'm still a newbie in many areas of Qt I have not had need to use. The way I advance beyond newbie stage in the areas I don't know is to study the Qt documentation and examples, work through the tutorials, read some of the many Qt books, and use Google to find more examples, videos, and tutorials. Almost always I find something to answer the question or at least point me in the direction I need to go.

time
27th November 2016, 01:08
You are right (in the some parts).
But keep in mind, that not everyone is egg-headed in programming. I read the documentation, or better to say I browsed it to find something what can be connected with my problem. I can not read every single part, every single class, because I do not have sufficed for that time. Documentation is written is specific language and people need time to get use to it. Really.
I did not think that QToolBox :: currentChanged () can be the way to solve it. And I think for that is this forum. People is giving some advises where to look. Now you gave me the clue where to search and this is good answer for my question. Really sir, documentation is very big piece of cake for newbie. We need to even learn how to search. So do not be mad That sometimes questions are too general or very simple.
Once more, thank you for help and giving and showing the way

d_stranz
27th November 2016, 01:26
Once more, thank you for help and giving and showing the way

Yeah, sorry for being so tough. I shouldn't give answers on the forum when I'm tired and grumpy. Don't take it personally - I also struggle with Qt documentation, and English is my first language. Qt is so big that sometimes you don't even know what to ask for, much less know which classes or subsystem will do what you want. And it just keeps getting bigger.