Results 1 to 2 of 2

Thread: [QWT] Time Stamp on a QwtPlot

  1. #1
    Join Date
    Jun 2010
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default [QWT] Time Stamp on a QwtPlot

    Hi,

    I'm trying to add a time stamp on the x axis of a qwtPlot like the one used in the CPU example.
    I'm a beginner in Qt and I have difficulties understanding the cpuStat.upTime() function, and basically all the principle used to generate the time stamp in the CPU code.

    For example, ? Does procValues[i] represents the buffer containing all the time data since the start of the programm or just the time data in a timeEvent intervall ?

    Qt Code:
    1. QTime CpuStat::upTime() const
    2. {
    3. QTime t;
    4. for ( int i = 0; i < NValues; i++ )
    5. t = t.addSecs(int(procValues[i] / 100));
    6.  
    7. return t;
    8. }
    To copy to clipboard, switch view to plain text mode 

    Thanks for your help !
    Last edited by gen_mass; 27th June 2010 at 23:39.

  2. #2
    Join Date
    Jun 2010
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [QWT] Time Stamp on a QwtPlot

    ok...never mind...
    with the help of some qDebug()<< it was fairly easy to understand..
    Because I wanted the time axis to show the currentTime(), I simply modified the Cpustat::upTime function like this:

    Qt Code:
    1. QTime CpuStat::upTime() const
    2. {
    3. QTime t;
    4. t=QTime::currentTime();
    5.  
    6. return t;
    7. }
    To copy to clipboard, switch view to plain text mode 

    And, I added the TimeScale class to my code...

Similar Threads

  1. Replies: 2
    Last Post: 12th May 2010, 18:48
  2. qwtplot run time error
    By hamid ghous in forum Qwt
    Replies: 2
    Last Post: 13th August 2009, 14:33
  3. Replies: 6
    Last Post: 14th May 2009, 12:02
  4. Show System Time Stamp ??
    By dheeraj in forum Qwt
    Replies: 3
    Last Post: 21st April 2008, 11:54
  5. file time stamp preservation
    By baray98 in forum Qt Programming
    Replies: 0
    Last Post: 8th April 2008, 00:13

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.