Results 1 to 2 of 2

Thread: Insert QwtPlot in QTextDocument

  1. #1
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Insert QwtPlot in QTextDocument

    Hi.
    I would like to insert a QwtPlot inside a QTextDocument.
    I know that I can do it by calling something like that:

    Qt Code:
    1. m_cursor.insertImage(image)
    To copy to clipboard, switch view to plain text mode 
    where image is the QwtPlot.
    But: how can I grab the qwtplot into an image?

    I tried
    Qt Code:
    1. QPixmap* MyPlot::getImage()
    2.  
    3. {
    4.  
    5. int options = QwtPlotPrintFilter::PrintAll;
    6. options |= QwtPlotPrintFilter::PrintBackground;
    7. options |= QwtPlotPrintFilter::PrintFrameWithScales|QwtPlotPrintFilter::PrintMargin;
    8. filter.setOptions(options);
    9. print(image,filter);
    10.  
    11.  
    12.  
    13.  
    14. return ℑ
    15. }
    To copy to clipboard, switch view to plain text mode 
    but the debug said that the image is empty. image is a member variable (QPixmap image)
    Any idea?

  2. #2
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Insert QwtPlot in QTextDocument

    Moreover, I would like to insert an high resolution plot in my document.

Similar Threads

  1. QwtPlot - promote to custom widget
    By MrGarbage in forum Qwt
    Replies: 7
    Last Post: 10th February 2011, 10:12
  2. how to insert items in tableWidget
    By roncriss in forum Newbie
    Replies: 3
    Last Post: 24th July 2010, 17:10
  3. Replies: 3
    Last Post: 26th March 2008, 11:04
  4. Bulk insert into SQLite
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 19th November 2007, 03:56
  5. QTextDocument stinks
    By elcuco in forum Qt Programming
    Replies: 4
    Last Post: 24th July 2007, 12:30

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.