Results 1 to 4 of 4

Thread: making plot window smaller

  1. #1
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default making plot window smaller

    Hi,
    I am using QSplitter and have added plot window to splitter. Then I can change size of plot window manually. I found limitation of making plot window smaller depends on maxMajor in setAxisMaxMajor(). I need to set maxMajor equals to 15. But I need to make plot window smaller than also. for example when maxMajor is set to 7, I can change size of plot window 1/2 smaller than when it is set to 15. How can this limitation be going to disappear?

  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: making plot window smaller

    The minimum size hint depends on the tick labels, that should not overlap. For having 15 labels on the x axis it probably has some size.

    Now you have some options:


    • Reimplement sizeHint/minimumSizeHint and accept, that the labels overlap
    • Try to get rid of labels
    • Rotate the labels f.e like in the cpuplot example
    • Use smaller fonts
    • ...


    In the end this is not a software problem in the first place - you have the same problem, when drawing the plot on paper.

    Uwe

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

    Alex22 (26th August 2016)

  4. #3
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: making plot window smaller

    Quote Originally Posted by Uwe View Post
    *Try to get rid of labels
    Uwe
    I used this code but removing ticks and labels have no effect for making more smaller. only thing that has effect is maxMajor value
    Qt Code:
    1. axisScaleDraw(QwtPlot::xBottom)->enableComponent(QwtAbstractScaleDraw::Ticks, false);
    2. axisScaleDraw(QwtPlot::xBottom)->enableComponent(QwtAbstractScaleDraw::Labels, false);
    3. setAxisMaxMajor(QwtAxisId(QwtAxis::xBottom, 0),15);
    To copy to clipboard, switch view to plain text mode 

  5. #4
    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: making plot window smaller

    Maybe because of caches, that need to be invalidated - don't know. The calculation is done in QwtScaleDraw::minLength. Maybe use the debugger to check, when it gets called and if the sizeHint had been called before.

    Uwe

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

    Alex22 (26th August 2016)

Similar Threads

  1. making tab width size smaller
    By Alex22 in forum Newbie
    Replies: 1
    Last Post: 15th December 2015, 10:57
  2. Difficulty in making a window
    By rezas1000 in forum Newbie
    Replies: 1
    Last Post: 31st August 2014, 15:00
  3. Replies: 4
    Last Post: 10th October 2009, 18:59
  4. making an application window non resizable
    By aegis in forum Qt Programming
    Replies: 16
    Last Post: 13th May 2007, 20:14
  5. Making some part of window transparent
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2006, 21:36

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.