Results 1 to 5 of 5

Thread: Hiding the title of a plot

  1. #1
    Join Date
    Feb 2013
    Posts
    38
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Hiding the title of a plot

    Hi,

    I am trying to hide the title of a QwtPlot.

    Qt Code:
    1. QwtPlot *plot = new QwtPlot();
    2. // ...
    3. plot->titleLabel()->setVisible(false)
    To copy to clipboard, switch view to plain text mode 

    The title "blinks" but is not hidden.

    I am on linux. It does not work on Windows XP.
    The QwtTextLabel works fine.

    Thanks.
    Last edited by moijhd; 18th July 2013 at 15:26.

  2. #2
    Join Date
    Oct 2008
    Location
    Aachen
    Posts
    20
    Thanks
    5
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Hiding the title of a plot

    You could try to set an empty text to your plot title like this:

    Qt Code:
    1. plot->setTitle("");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2013
    Posts
    38
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Hiding the title of a plot

    Yes ofc but as I want to show it later it means that I have to keep a copy of the title before removing it.

    The question is more about why it does not work as expected.

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

    Default Re: Hiding the title of a plot

    Quote Originally Posted by moijhd View Post
    The question is more about why it does not work as expected.
    Because your expectation is not how it works.

    But, being more serious: hiding/showing of the plot title widget is under control - depending on an empty title or not - of the layout system of the plot widget. When you hide a not empty title widget manually it will be shown by the next replot. That's why it is blinking.

    Uwe

  5. #5
    Join Date
    Feb 2013
    Posts
    38
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Hiding the title of a plot

    Okay, thank you !

    (and I wanted to mean "as I expected...")

    That leaves me with two solutions I guess :
    - The one we talked about (removing the string)
    - And overloading the replot function.

    I'll go with the first one which is fair enough for me
    Last edited by moijhd; 22nd July 2013 at 16:00.

Similar Threads

  1. Replies: 3
    Last Post: 12th April 2013, 06:18
  2. Replies: 1
    Last Post: 17th April 2012, 10:10
  3. Replies: 2
    Last Post: 8th July 2011, 00:06
  4. Qwt Plot title word wrap
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 27th June 2010, 14:06
  5. Replies: 0
    Last Post: 9th December 2009, 08:34

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.