Results 1 to 5 of 5

Thread: How to move the plot legend item around by mouse?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2013
    Posts
    56
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default How to move the plot legend item around by mouse?

    Hi,
    I want to move the plot legend items on the plot by mouse events:
    To select a legend item by press event and then move it around.
    When the mouse button is released, the legend item will be displayed at the position of the mouse.
    I have coded sth. according to the example 'itemeditor'.
    But it doesn't work.
    I guess the reason is:
    I have reimplemented the QwtPlotLegendItem::draw().
    Just add a judgement about whether the item is visible.
    But the QwtPlotLegendItem::geometry() is not a virtual one.
    I can not calculate the new geometry of the item which is used by draw() function.

    IN conclusion,
    FOR the QwtPlotLegendItem,it can be aligned by 8 types .
    My question is how to display a legend item at any position.
    How could I do?

    Thanks .

    Nicho
    Last edited by Nicho; 22nd July 2013 at 16:05. Reason: updated contents

Similar Threads

  1. Move the Legend widget using MouseEvent
    By umulingu in forum Qwt
    Replies: 4
    Last Post: 16th June 2010, 14:33
  2. Replies: 5
    Last Post: 27th November 2009, 13:57
  3. Replies: 1
    Last Post: 24th February 2009, 18:35
  4. Remove Legend items, move legends
    By giusepped in forum Qwt
    Replies: 0
    Last Post: 11th February 2009, 02:35
  5. how to display full tree item name on mouse move ?
    By rajesh in forum Qt Programming
    Replies: 5
    Last Post: 15th November 2006, 08:41

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
  •  
Qt is a trademark of The Qt Company.