Results 1 to 3 of 3

Thread: How to get Canvas

  1. #1
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default How to get Canvas

    In qwt 5.x, I had a code in a class derived from qwtPlot

    Qt Code:
    1. canvas()->setFrameStyle( QFrame::NoFrame );
    To copy to clipboard, switch view to plain text mode 

    This is not working in qwt 6.x as cavas() function now returns a *QWidget. Is there any reason for this change? How can I get QwtPlotCanvas ?

    I need Canvas for two purposes

    (1) to set the frame style as none as in the above code. Is there any other way to remove border from canvas?
    (2) to create a QwtPlotZoomer which accept canvas as a parent in its constructor.

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

    Default Re: How to get Canvas

    Is there any reason for this change?.
    Yes the canvas might be a QwtPlotCanvas or a QwtPlotCanvasGL.
    How can I get QwtPlotCanvas ?
    Like before, but you have to do a cast. Alternatively you could customize the canvas before inserting it - like it is done in the examples.

    Uwe

  3. #3
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to get Canvas

    Thanks Uwe

Similar Threads

  1. canvas
    By leebandemaha in forum Newbie
    Replies: 1
    Last Post: 5th September 2013, 14:39
  2. Canvas in QT
    By chandan in forum Newbie
    Replies: 5
    Last Post: 11th April 2011, 04:46
  3. qwt canvas border
    By stefan in forum Qwt
    Replies: 1
    Last Post: 7th March 2011, 16:10
  4. How to manually pan canvas
    By novackb in forum Qwt
    Replies: 4
    Last Post: 18th February 2011, 17:46
  5. Qwt canvas using QGLWidget?
    By alex_sh in forum Qwt
    Replies: 4
    Last Post: 28th January 2011, 10:36

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.