Results 1 to 8 of 8

Thread: displaying help text after clicking the pushbutton and lineedit

  1. #1
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default displaying help text after clicking the pushbutton and lineedit

    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 ..

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: displaying help text after clicking the pushbutton and lineedit

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: displaying help text after clicking the pushbutton and lineedit

    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 ....

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: displaying help text after clicking the pushbutton and lineedit

    Is the example in the docs for QWhatsThis not enough for your needs?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: displaying help text after clicking the pushbutton and lineedit

    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:n_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 ..

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: displaying help text after clicking the pushbutton and lineedit

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: displaying help text after clicking the pushbutton and lineedit

    Thankxx a lot .. i got it ....

  8. #8
    Join Date
    May 2012
    Location
    India
    Posts
    51
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: displaying help text after clicking the pushbutton and lineedit

    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 ..
    Last edited by riarioriu3; 26th June 2012 at 10:29.

Similar Threads

  1. Replies: 8
    Last Post: 1st October 2015, 07:23
  2. Clear text of LineEdit
    By stbb24 in forum Qt Programming
    Replies: 7
    Last Post: 12th June 2012, 13:30
  3. How to disable pushbutton after clicking it
    By Cengaver in forum Newbie
    Replies: 12
    Last Post: 19th April 2011, 15:22
  4. Replies: 4
    Last Post: 4th March 2011, 16:15
  5. How to add Treewidget Items when clicking on PushButton
    By mkkguru in forum Qt Programming
    Replies: 7
    Last Post: 11th February 2010, 13:48

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.