Results 1 to 3 of 3

Thread: Finding QwtPlot child item to detach it

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Finding QwtPlot child item to detach it

    Hello!

    I want to attach a QwtPlotCurve into a QwtPlot and later be able to dettach it. One obvious way to do this is to create the QwtPlotCurve as a global pointer and than just call it lather when desired, but I would like to avoid using a global pointer in this situation since such methodology would force me to have a unknown multitude of global pointers.

    So rather what I would like to do is to create a local pointer to a QwtPlotCurve object, configure it, attach to the QwtPlot and when desired find that child object from the QwtPlot and ask it to be dettached and deleted.

    How could I do this?


    Thanks,

    Momergil

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

    Default Re: Finding QwtPlot child item to detach it


  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Finding QwtPlot child item to detach it

    Yeah, I did find theese functions, but I wasn't able to use them. First, the detachItems() is not suitable because as far as I understood, I can't say which of the items I want to detach; and I don't want to detach them all.

    news:

    OK, I managed to use the itemList function this way:

    Qt Code:
    1. graphCandle->itemList().at(0)->detach();
    2.  
    3. //This way wouldn't work:
    4. graphCandle->itemList()[0]
    To copy to clipboard, switch view to plain text mode 

    My last question would be how do I identify which is the object I want; for now I'm using the title.


    Thanks Uwe!
    Last edited by Momergil; 17th January 2013 at 01:03.

Similar Threads

  1. add child item in list view
    By johan07 in forum Newbie
    Replies: 3
    Last Post: 3rd January 2013, 10:54
  2. Replies: 4
    Last Post: 11th September 2011, 02:39
  3. Replies: 1
    Last Post: 13th July 2011, 09:55
  4. Removing child item from QGRaphicsItem
    By mangeshj in forum Qt Programming
    Replies: 1
    Last Post: 17th January 2011, 14:28
  5. QTreeWidget get a text from child item
    By vcp in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 18:36

Tags for this Thread

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.