Results 1 to 2 of 2

Thread: Legend in plot area - picker mouse events blocked

  1. #1
    Join Date
    Jan 2009
    Posts
    17
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Legend in plot area - picker mouse events blocked

    Hello,

    I placed a legend within the plot area like this at initialisation:
    Qt Code:
    1. // create legend
    2. QwtLegend* lLegend = new QwtLegend(plot()->canvas());
    3. // set transparent background
    4. lLegend->setStyleSheet(QString::fromUtf8("background-color: rgba(255, 255, 255, 0);"));
    5. // set policy
    6. lLegend->setDisplayPolicy(QwtLegend::NoIdentifier, QwtLegend::ReadOnlyItem);
    7. lLegend->setFocusPolicy(Qt::NoFocus);
    8. // add to plot
    9. plot()->insertLegend(lLegend, QwtPlot::ExternalLegend);
    To copy to clipboard, switch view to plain text mode 
    Then somewhere else I set the extent:
    Qt Code:
    1. plot()->legend()->setGeometry(lGeometry);
    To copy to clipboard, switch view to plain text mode 
    In addition I have a plot picker with the implementation of widgetMouseDoubleClickEvent(QMouseEvent *pMouseEvent).

    Now the legend widget blocks the double click event of the picker.
    Any idea how to deal with that?

    Best regards
    Stefan

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

    Default Re: Legend in plot area - picker mouse events blocked

    Qt Code:
    1. legend->setAttribute(Qt::WA_TransparentForMouseEvents);
    To copy to clipboard, switch view to plain text mode 

    Never tried it myself, but maybe it helps.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    StefanK (25th February 2009)

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.