Results 1 to 2 of 2

Thread: QGraphicsView & QwtScaleWidget

  1. #1
    Join Date
    Dec 2007
    Qt products
    Qt3 Qt4

    Default QGraphicsView & QwtScaleWidget

    I've implemented something like s gantt through a QGraphicsView/QGraphicsScene but now I want to insert under the QGraphicsView a time scale using a QwtScaleWidget, draw data and grid inside the scene according to this scale...How can I reach this task? Some tutorials/examples?

  2. #2
    Join Date
    Feb 2011
    Thanked 28 Times in 27 Posts
    Qt products
    Unix/X11 Windows

    Default Re: QGraphicsView & QwtScaleWidget

    Subclass QwtScaleDraw class, override label function. Depending on some base time(1970-01-01 or something) send time axis values as seconds to this date. Then have this class as the scaledraw in your subclassed qwtscalewidget. Meanwhile in the label function, return qstring depending upon value sent. For a more detailed scale axes, you have to implement QwtScaleEngine. But for specific purposes, the above mentioned trick works. Search the forum qwtscaledraw, there are many threads.

Similar Threads

  1. QwtScaleWidget title wrap problem
    By Arcadi in forum Qwt
    Replies: 1
    Last Post: 16th September 2011, 09:42
  2. Replies: 1
    Last Post: 19th July 2011, 08:32
  3. QGraphicsView transparent over another QGraphicsView
    By evergreen in forum Qt Programming
    Replies: 0
    Last Post: 30th May 2011, 11:22
  4. Replies: 1
    Last Post: 26th October 2008, 19:39
  5. qwtscalewidget: setting scale to the widget..
    By halberdier83 in forum Qwt
    Replies: 3
    Last Post: 4th December 2007, 09:08


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.