Results 1 to 3 of 3

Thread: QwtPlot - What is it made of?

  1. #1
    Join Date
    Mar 2014
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default QwtPlot - What is it made of?

    Hello.

    I want to resize the plot itself, and the legend part of the plot.
    To do this i think it would be nice to know how a qwtPlot is constructed (what widgets and layouts are contained and how they are arranged)
    What i mean is something like this:
    Unbenannt.png
    This is a screenshot out of the Qt-Creator.
    Its easy to see how this Group is constructed. If i want to change spacing or what ever, i just do so by changing the atributes of a layout.

    But i have absolutly no idea whats inside a qwtplot. So its hard to change anything.

    What i actually want to do is this:
    Unbenannt2.jpg
    Legend width depends on names. i want to change the width myself.
    and: qwtPlot->legend()->setFixedWidth(200); does not help.

  2. #2
    Join Date
    Jul 2015
    Posts
    87
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QwtPlot - What is it made of?

    1) look at qwt/playground/plotmatrix
    That is an example to manage the alignment of two plots.

    2)
    If you need a fixed size for your legend, you need to put the widget itself into your layout
    (see QwtLegend::legendWidget() ) and check the width of both containers where you put
    the legendWidget

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

    Default Re: QwtPlot - What is it made of?

    QwtPlot::insertLegend() does 2 things:


    1. inserting the legend into the layout system of the plot
    2. connecting the QwtPlot::legendDataChanged() signal with the QwtAbstractLegend::updateLegend() slot


    As you don't want (1) I would simply do (2) in application code. Then you can use a QGridLayout with 2 columns putting the plots in the left and the legends in the second one.
    ( Don't forget to set QwtLegend::setMaxColumns() to set up the number of entries per row inside of the legend ).

    Uwe

Similar Threads

  1. Replies: 9
    Last Post: 25th October 2012, 20:55
  2. Packaging resources into already made exe
    By zzz9 in forum Installation and Deployment
    Replies: 0
    Last Post: 23rd August 2012, 13:37
  3. How can I made an App without the big dll-s
    By krisztiantobias in forum Qt Programming
    Replies: 1
    Last Post: 20th August 2012, 11:01
  4. Replies: 6
    Last Post: 14th May 2009, 13:02
  5. Table made from QLabels
    By T4ng10r in forum Qt Programming
    Replies: 1
    Last Post: 25th April 2007, 07:58

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.