Results 1 to 6 of 6

Thread: QwtPlotGrid

  1. #1

    Default QwtPlotGrid

    I need to draw grid om QPixmap. I did that:
    QwtPlotGrid grid;
    grid.enableX(true);
    grid.enableY(true);
    grid.setMajorPen(QPen(Qt::black, 0, Qt:ashLine));
    grid.setMinorPen(QPen(Qt::blue, 0 , Qt:otLine));
    and then draw :
    grid.draw(&p, *_xMap, *_yMap, r1);

    But nothing was happened. Thought the grid, that was attached to some QwtPlot did work and drew a grid.
    Is there a way to draw QwtPlotGrid without attaching it to QwtPlot?
    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotGrid

    How is your pixmap related to the plot coordinate system ?

    Uwe

  3. #3

    Default Re: QwtPlotGrid

    Well, probably in no way.

    Well, probably in no way. Is there something I can do with it? I mean, I set a pixmap size. isn't that enough?

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotGrid

    Quote Originally Posted by annili View Post
    Well, probably in no way.
    Then why using QwtPlotGrid, when all you want to do is to draw some horizontal/vertical lines. I would use QPainter::drawLine() directly().

    Uwe

  5. #5

    Default Re: QwtPlotGrid

    I'm using QwtPlotGrid because I need to draw exactly the same lines as on my QwtPlot widget. I would use it's grid but i need to draw a larger scale then there is on plot widget. But for some reason grid.draw(...) draw only fixed area that QwtPlot widget show on screen.
    There is the screenshot of my QwtPlot :
    1.jpg
    And there is image from QPixmap where i draw grid and curves:2.jpg

  6. #6
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotGrid

    Code is better than words here: have a look at the implementation of QwtPlotGrid::drawLines. Guess you will see immediately how the scale maps and the canvas rectangle need to be modified.

    Uwe

Similar Threads

  1. Square QwtPlotGrid
    By drunknight in forum Qwt
    Replies: 4
    Last Post: 15th May 2014, 09:02
  2. Problem with QwtPlotGrid
    By wooosh in forum Qwt
    Replies: 2
    Last Post: 5th February 2014, 22:38
  3. qwtplotgrid and qwtscalediv problem
    By tangtao_xp in forum Qwt
    Replies: 9
    Last Post: 15th June 2013, 08:02
  4. Replies: 6
    Last Post: 28th March 2012, 01:11
  5. painting in QwtPlotGrid
    By ready in forum Qwt
    Replies: 2
    Last Post: 18th July 2011, 07:26

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.