View Full Version : displaying help text after clicking the pushbutton and lineedit

21st June 2012, 06:31
I have a pushbutton and a lineedit , and what i want is , when i click that pushbutton or lineedit a help text(the purpose of that component) shall be shown besides the respective component.
Please give reply soon , i need it urgently ..
Thankx in advance ..

21st June 2012, 08:59

21st June 2012, 09:52
Could you please give a small example on QWhatsThis , so that i can know how to implement this for pushbutton ?? .. I am new to Qt . so please ....

21st June 2012, 10:04
Is the example in the docs for QWhatsThis not enough for your needs?

21st June 2012, 11:42
My button object is ResPg38_FEA_pshBtn .
I am using ui.ResPg38_FEA_pshBtn->setWhatsThis(tr("This button helps for creating a new file")); . This line get executed when the user click the ResPg38_FEA_pshBtn button . so it should show the above mentioned help text ..
but its not showing anything .
Here is my code .
void CTQResS38_SaveData::on_ResPg38_FEA_pshBtn_clicked( )
ui.ResPg38_FEA_pshBtn->setWhatsThis(tr("This button helps for creating a new file."));
What should i do ?
Thankx in adv ..

21st June 2012, 11:43
It's not how it works. "whatsthis" is a property that you can set at any time. If you want to display the advice, you need to QWhatsThis::enterWhatsThisMode() and then click on a widget that has a whats this text set on it. Read the manual, please.

21st June 2012, 11:56
Thankxx a lot .. i got it ....

26th June 2012, 10:24
1---In my tool bar one button is there . When i am clicking that button it calls QWhatsThis::enterWhatsThisMode() .
2-- The cursor changes to some red circle kind of thing .
3--I have used lineedit->setWhatsThis(tr("Hello")) . so when the cursor is moving over that lineedit the cursor again changes (arrow +Question)and after clicking that lineedit one helpbox will pop up and the help box disappears once the user perform some action on that UI or press ESC .Then the cursor changes to simple arrow .

NB- lineedit is a object present in that ui file

In between step - 2 to step 3 (mentioned above ) i dont want that red circle cursor . i want my own cursor . but once it passes step 3 the cursor should again changes to simple arrow mark cursor .

or else how to change that red color cursor to a transparent one .

Please do reply soon ..
Thankxx in adv ..