Results 1 to 3 of 3

Thread: How to remove QwtPlot grey axes background and shadow?

  1. #1

    Default How to remove QwtPlot grey axes background and shadow?

    I am using QwtPlot to plot a load of polygons, and I want the chart to look just like an image, rather than a chart. I have recently worked out how to remove the grey border behind the axes (A in attachment), and here is the code:

    Qt Code:
    1. //set up QwtPlot
    2. QwtPlot *plot = new QwtPlot;
    3. //this code here changes the axis background from grey to white
    4. QPalette pal = plot->palette();
    5. pal.setColor(QPalette::Window, Qt::white);
    6. plot->setPalette(pal);
    To copy to clipboard, switch view to plain text mode 

    However, I am trying to remove the shadow lines on the top and left of my QwtPlot (B in attachment). Does anyone know how to remove these?
    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: How to remove QwtPlot grey axes background and shadow?

    B) is the frame of the canvas. You can disable it f.e by using QFrame::setFrameStyle(QFrame::NoFrame);

    Uwe

  3. #3

    Default Re: How to remove QwtPlot grey axes background and shadow?

    Quote Originally Posted by Uwe View Post
    B) is the frame of the canvas. You can disable it f.e by using QFrame::setFrameStyle(QFrame::NoFrame);

    Uwe
    Hi Uwe,

    Thank you for trying, but I have since worked this out. The solution you gave does not work.

    Here is the solution that works for me:

    Qt Code:
    1. canv.setLineWidth(0);
    2. myPlot->setCanvas(&canv);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Grey out background windows while editing a dialog.
    By Yevgen in forum Qt Programming
    Replies: 5
    Last Post: 4th March 2014, 10:43
  2. size of QWTplot without axes.
    By Gora in forum Qwt
    Replies: 3
    Last Post: 29th May 2013, 11:09
  3. Replies: 2
    Last Post: 20th July 2012, 14:51
  4. Double Buffering on QGLWidget - Background always grey
    By StarShaper in forum Qt Programming
    Replies: 0
    Last Post: 31st March 2012, 17:35
  5. how to remove shadow of QMenu?
    By lonewsj in forum Qt Programming
    Replies: 5
    Last Post: 2nd April 2011, 09:40

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.