Results 1 to 2 of 2

Thread: Any way to disable the whole plot (gray-out)?

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

    Default Any way to disable the whole plot (gray-out)?

    As the title suggests, I have a long operation where I read file data from a thread to plot. During this, I disable the UI so the user can't click. However, I'm unable to disable my Qwt plot.

    I've tried:

    QwtPlot->setEnabled(false);
    QwtPlot->canvas()->setEnabled(false);

    Neither disable (aka gray-out) the plot area.

    Is there a way to disable the plot area?

    Thanks )

  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: Any way to disable the whole plot (gray-out)?

    "plot->setEnabled( false );" should be fine, but you need to assign a palette to the plot canvas, where the brush is different for QColorGroup::Disabled.

    Qt Code:
    1. pal.setBrush( QPalette::Window, Qt::blue );
    2. pal.setBrush( QPalette::Disabled, QPalette::Window, Qt::gray );
    3. plot->canvas()->setPalette( pal );
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    alketi (12th April 2020)

Similar Threads

  1. Replies: 3
    Last Post: 20th March 2014, 08:44
  2. Replies: 2
    Last Post: 3rd September 2013, 11:26
  3. Disabling does not gray-out buttons
    By lotek in forum Newbie
    Replies: 4
    Last Post: 13th October 2010, 11:48
  4. dark gray style
    By gjaegy in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2010, 00:39
  5. dark gray widgets/background
    By momesana in forum Qt Programming
    Replies: 8
    Last Post: 17th June 2007, 10:39

Tags for this Thread

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.