Results 1 to 2 of 2

Thread: Qwt Legend Parent

  1. #1
    Join Date
    Apr 2009
    Posts
    6
    Thanks
    2

    Default Qwt Legend Parent

    Hi,
    I have some trouble with my QwtLegend. Every time I try to add a new QwtPlotCurve the program terminates with the folling error:
    QObject::setParent: Cannot set parent, new parent is in a different thread
    monitor: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int) ((xcb_req) - (dpy->request)) >= 0)' failed.
    Aborted
    Posting Code is not that simple, because it's a quite big project. In general I created a subclass of QwtPlot and in this class i call
    Qt Code:
    1. addCurve( Object* o) {
    2. o->getCurve()->attach(this);
    3. }
    To copy to clipboard, switch view to plain text mode 
    where "Object" is a custom object.

    I hope someone can help me.
    Thanks in advance.

    Jones
    Last edited by BlackFoXX; 17th April 2009 at 15:01.

  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: Qwt Legend Parent

    Sorry, but this is an example of how not to ask for support:

    1) What is o->getCurve() ?
    2) Where is the legend ?
    3) The error text is about threads ?

    I can only guess, but it looks like your call is not executed in the GUI thread and QwtPlotItem::attach inserts a new item into the legend ?

    If true you have two options:

    a) Do the call in the GUI thread ( maybe about using a queued connection).
    b) Disable the QwtPlotItem::Legend flag.

    Uwe

Similar Threads

  1. legend inside qwt plot
    By kaustav98255 in forum Qwt
    Replies: 5
    Last Post: 11th February 2009, 20:39
  2. Step by step Qwt on MinGW
    By Doug Broadwell in forum Qwt
    Replies: 2
    Last Post: 23rd January 2009, 00:19
  3. Qwt Legend
    By maxpayne in forum Qwt
    Replies: 4
    Last Post: 15th October 2008, 17:17
  4. QWT introduction
    By nitriles in forum Qwt
    Replies: 4
    Last Post: 28th September 2007, 10:48
  5. use interesting QWT Library with QT3.X
    By raphaelf in forum Qwt
    Replies: 2
    Last Post: 23rd January 2006, 11:24

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.