Results 1 to 4 of 4

Thread: How to add contents into a QDialog or QMessageBox and display it?

  1. #1
    Join Date
    Nov 2011
    Posts
    45
    Qt products
    Qt4
    Platforms
    Symbian S60

    Post How to add contents into a QDialog or QMessageBox and display it?

    Hi all,
    I am new to Qt and i am trying to write click event for the QPushbutton.
    In which when the user clicks on the push button it must display some contents in a dialog box.

    for example: i am trying for: if the user clicks the button for the first time it should display 1 and when the button is clicked for the second time it should display 2 and so on.

    It means whenever the user clicks on the push button the number should increase by 1.

    Is there any sample coding or anyone can help me to come with the answer?

    Regards,
    Harish.M

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to add contents into a QDialog or QMessageBox and display it?

    That is basic c++! Use a static variable which is increased when clicking the button. Use signal and slots and show the message box.

  3. #3
    Join Date
    Nov 2011
    Posts
    45
    Qt products
    Qt4
    Platforms
    Symbian S60

    Post Re: How to add contents into a QDialog or QMessageBox and display it?

    Thank you for your reply


    Added after 1 14 minutes:


    Could you help me with the code?
    Last edited by harish; 19th December 2011 at 09:46.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to add contents into a QDialog or QMessageBox and display it?

    Could you help me with the code?
    Answering this question is one or two lines of code. It is not going to help you to learn Qt if we write your code for you - you should study examples so you can learn how to write the code yourself.

    Have you looked at any of the tutorials in the Qt Docs? Such as this one? Have you read any books that talk about Qt programming?

Similar Threads

  1. Replies: 1
    Last Post: 11th June 2010, 06:15
  2. Display contents of .txt file
    By karmo in forum Newbie
    Replies: 17
    Last Post: 23rd January 2010, 20:39
  3. Replies: 0
    Last Post: 9th April 2009, 06:35
  4. Display row Number in QMessageBox
    By arunvv in forum Newbie
    Replies: 6
    Last Post: 1st May 2008, 23:24
  5. Replies: 4
    Last Post: 10th December 2006, 09:04

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.