×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Post How to display time in QMessage box?

    Hi,
    I am trying to display a message box in which time is to be displayed.

    I have tried to display the time in a string and i had used time edit.It is running and its showing a messagebox with the default time 12.00am.....

    Here is the code which i have tried:

    void MainWindow:n_pushButton_clicked()
    {


    QMessageBox msgbox;
    QTimeEdit timeEdit;

    QString timeInString = timeEdit.time().toString("h:m:s ap");
    msgbox.setText(timeEdit.text());
    msgbox.exec();

    }

    Now what i need is to change the time by showing the current time and not the default 12.00am..

    Can anyone help me out with this?

    Thanks and regards,
    Harish.

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: How to display time in QMessage box?

    Means you want to change message arrival time in the message box. It is property of message and is related with system time.

    Are you getting any warning ?

    Also look at this : http://www.developer.nokia.com/Commu...and_Time_in_Qt
    http://doc.qt.nokia.com/4.7/qdatetim...html#time-prop

    regards,
    rahul
    Last edited by rahulvala; 2011-11-12 at 10:17.

  3. #3
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: How to display time in QMessage box?

    You should try using QTime or QDateTime. Check the reference page.
    Jajal Mehul

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to display time in QMessage box?

    Check this article.

  5. #5
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: How to display time in QMessage box?

    Quote Originally Posted by savaj View Post
    Your link was already suggested in #2 by me.

  6. #6
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to display time in QMessage box?

    Quote Originally Posted by rahulvala View Post
    Your link was already suggested in #2 by me.
    Opps.. Actually i haven't checked link posted by you before replying due to poor internet connectivity. That was my mistake, i apologize for that.

  7. #7
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: How to display time in QMessage box?

    Thank you dude it got worked thank you for your help

  8. #8
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: How to display time in QMessage box?

    Thank You for your help rahul
    It helps me thank you again.

  9. #9
    Regular Contributor
    Join Date
    Nov 2011
    Posts
    104

    Re: How to display time in QMessage box?

    Thank you james

Similar Threads

  1. QMessage - SMS Port numbers
    By dpatricksp in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2011-07-21, 20:48
  2. QMessage::setStatus(QMessage::Read,true); does not work
    By Zedster in forum [Archived] Qt Mobility Project
    Replies: 3
    Last Post: 2011-07-14, 06:34
  3. How to put scrollbar in Qmessage box
    By shaktiqt123 in forum Qt
    Replies: 1
    Last Post: 2010-05-25, 16:22
  4. CAknInformationNote display time
    By Ajmal in forum Symbian
    Replies: 6
    Last Post: 2008-10-06, 13:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×