Results 1 to 3 of 3

Thread: Qwt right-side legend suddenly went horizontal

  1. #1
    Join Date
    Dec 2011
    Posts
    60
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Qwt right-side legend suddenly went horizontal

    My plot legend (placed on the right-side) suddenly became horizontally aligned.



    My code:
    Qt Code:
    1. // Legend
    2. QwtLegend *legend = new QwtLegend();
    3. legend->setDefaultItemMode( QwtLegendData::Checkable );
    4. insertLegend( legend, QwtPlot::RightLegend );
    5. connect (legend, &QwtLegend::checked, this, &XQwtPlot::slotShowItem);
    To copy to clipboard, switch view to plain text mode 
    Frankly, the only thing I'm aware of changing in the plotting part of my code was that I moved the location of my base plotting library (the code shown above and some more) and created a new .so file for these wrappers. So it makes no sense how this would cause the problem.

    I'm wondering how to fix this and make the two check-buttons vertical again?
    Attached Images Attached Images

  2. #2
    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: Qwt right-side legend suddenly went horizontal

    Have a look at the implementation of QwtPlot::insertLegend and how QwtLegend::setMaxColumns is used.

    Uwe

  3. #3
    Join Date
    Dec 2011
    Posts
    60
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qwt right-side legend suddenly went horizontal

    Thanks Uwe.

    Still not sure what caused the problem all of a sudden, but setting the max columns to 1 fixed the issue.

    legend->setMaxColumns(1);

Similar Threads

  1. Replies: 2
    Last Post: 30th January 2015, 10:29
  2. Manifest / Side by Side configuration.
    By hickscorp in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2010, 06:22
  3. Stack two QMenuBars instead of side by side?
    By killerwookie99 in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2008, 07:27
  4. [QTabWidget] horizontal text on left side
    By Boy in forum Qt Programming
    Replies: 6
    Last Post: 16th May 2008, 09:52
  5. Replies: 5
    Last Post: 15th February 2008, 03:54

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.