Results 1 to 3 of 3

Thread: Time in a xBotton scale

  1. #1
    Join Date
    Apr 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Time in a xBotton scale

    Hello, this is my first post in the forum, and I decided write here because I cant put the hours like scale.

    I have to do temperature plot, I read two types of variables, the time and the temperature.
    I can draw the plot, but using those information:
    xVal yVal
    1 26º
    2 12º
    3 16º
    4 22º

    untitled.jpg

    but I need view the plot like this
    hrs yVal
    10:00 26º
    10:05 12º
    10:10 16º
    10:15 22º
    All the information that I need I have in these arrays
    QwtArray<double> xVal;
    QwtArray<double> yVal;
    QList <QString> tmr

    untitled1.jpg

    I need the information like a picture but I cant put labels or something in xBotton
    anyone can help me?

  2. #2
    Join Date
    Apr 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Time in a xBotton scale

    I resolved the problem.
    I based in a cpuplot example
    I have introduced a variant of TimeScaleDraw class. This class, in this example, calculates the time that passed.
    However, in my application this class returns the QStirng that is in this position.

  3. #3
    Join Date
    Apr 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Time in a xBotton scale

    this the class that I change.

    Qt Code:
    1. class TimeScaleDraw: public QwtScaleDraw
    2. {
    3. public:
    4. TimeScaleDraw(QList<QString> *a)
    5. {
    6. t=a;
    7. }
    8. virtual QwtText label(double v) const
    9. {
    10. while(v>=t->count())v-=t->count();
    11. return t->at(v);
    12. }
    13. private:
    14. QList<QString> *t;
    15. };
    To copy to clipboard, switch view to plain text mode 

    And now I need zoom the plot but only in X axis. I see that in the real-time example used the scrollbar that I need but in both axis. This example is quite complicate and I don't understand all that it do. I like to use one scrollbar , but only in x axis and not move Y scale.
    I have copy the classes that are used to zoom and I create an object to perform the zoom but, how I could disable zoom in the y-axis?

    Could anyone help me? thank you very much
    Last edited by qtprgrmr; 12th April 2010 at 14:08.

Similar Threads

  1. Replies: 0
    Last Post: 6th March 2009, 08:19
  2. Circular scale
    By fruzzo in forum Qwt
    Replies: 1
    Last Post: 6th March 2008, 07:20
  3. check the time of last time keyboard is pressed
    By Aki Tomar in forum General Programming
    Replies: 2
    Last Post: 5th February 2008, 09:10
  4. qwt 5 log scale..
    By halberdier83 in forum Qwt
    Replies: 7
    Last Post: 12th November 2007, 07:21
  5. how to scale an action.
    By hgedek in forum Qt Programming
    Replies: 1
    Last Post: 13th August 2007, 16:58

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.