Results 1 to 3 of 3

Thread: Problem with Drag Drop for QWT Graph

  1. #1
    Join Date
    Oct 2006
    Location
    Bangalore
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Problem with Drag Drop for QWT Graph

    Hi,

    I am trying to drag the graph which is plotted on a widget using QWT to a word document.

    canvas->paintCache returns pointer to QPixmap.
    I am using this pixmap to set as Image data to QMimeData.

    When I actually drop the QMimeData to the word document, I can see only the curves. Axis ,Labels and Legends are not dragged/copied at all from my qwt graph to the word document!.

    I have not implemented this feature before, hence I am wondering whether my logic is right with respect to Drag and Drop of QWT graphs.

    Kindly let me know.

    Regards,
    Ankitha

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

    Default Re: Problem with Drag Drop for QWT Graph

    Tha paint cache of the canvas is for the content of the plot canvas. So no surprise, that is doesn't contain axes, legend and plot title.

    You can render to a QPixmap using QPixmap::grabWidget(). You can also use QWidget::render() if you like to have someting different as a QPixmap. F.e. a scalable vector graphics format like PDF or SVG makes a lot of sense in a text document.

    Finally you can also use QwtPlot:rint, that also renders to any specific type of QPaintDevice. In opposite to QWiget::render you can render the plot in a different geometry than the widget is. F.e you can align your plot to your paper geometries without any scaling effects.

    HTH,
    Uwe

  3. #3
    Join Date
    Oct 2006
    Location
    Bangalore
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Problem with Drag Drop for QWT Graph

    Hey!
    Thanx
    It works with grabwidget

Similar Threads

  1. Drag and Drop problem
    By ScoOteR in forum Qt Programming
    Replies: 16
    Last Post: 19th May 2010, 14:57
  2. Problem with a cursor during Drag and Drop
    By mtrpoland in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2007, 15:46
  3. Drag n Drop problem
    By ScoOteR in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2007, 10:52
  4. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41
  5. Drag 'n Drop problem
    By kiker99 in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2006, 16:35

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.