Results 1 to 9 of 9

Thread: Qwt multiaxis bug - can't set color for OpenGL canvas

  1. #1
    Join Date
    Nov 2019
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Qwt multiaxis bug - can't set color for OpenGL canvas

    Dear Uwe,

    I'm trying to change background color of QwtPlotOpenGLCanvas from black to white but it doesn't seem to work in multiaxis branch. By the way previously I worked with Qwt from trunk and there it worked fine.
    Qt Code:
    1. QwtPlot* plot = new QwtPlot;
    2. QwtPlotOpenGLCanvas *canvas = new QwtPlotOpenGLCanvas(); // NEW OpenGL Canvas
    3. plot->setCanvasBackground( Qt::white );
    4. plot->setCanvas(canvas);
    To copy to clipboard, switch view to plain text mode 
    the canvas is black

  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 multiaxis bug - can't set color for OpenGL canvas

    Call setCanvas before calling setCanvasBackground.

    HTH,
    Uwe

  3. #3
    Join Date
    Nov 2019
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qwt multiaxis bug - can't set color for OpenGL canvas

    That doesn't help (see picture).
    Qt Code:
    1. QwtPlotOpenGLCanvas *canvas = new QwtPlotOpenGLCanvas(); // NEW OpenGL Canvas
    2. upperPlot->setCanvas(canvas);
    3. upperPlot->setCanvasBackground( Qt::white );
    To copy to clipboard, switch view to plain text mode 
    By the way these lines of code invoke the warning:
    DXGI WARNING: IDXGIFactory::CreateSwapChain: Blt-model swap effects (DXGI_SWAP_EFFECT_DISCARD and DXGI_SWAP_EFFECT_SEQUENTIAL) are legacy swap effects that are predominantly superceded by their flip-model counterparts (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL and DXGI_SWAP_EFFECT_FLIP_DISCARD). Please consider updating your application to leverage flip-model swap effects to benefit from modern presentation enhancements. More information is available at http://aka.ms/dxgiflipmodel. [ MISCELLANEOUS WARNING #294: ]
    1.jpg

  4. #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: Qwt multiaxis bug - can't set color for OpenGL canvas

    On my linux box the background is white, when using your code - I don't have any Windows systems available.
    Concerning the warnings: Qwt does not do any native calls, everything is done via Qt APIs.

    But, what happens, when using Qwt from trunk - the code for the opengl canvas is different there and has not yet been ported to the multiaxes branch ?

    Uwe
    Last edited by Uwe; 5th July 2020 at 17:43.

  5. #5
    Join Date
    Nov 2019
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qwt multiaxis bug - can't set color for OpenGL canvas

    I think yes, I've installed Qwt from trunk about two months ago and there is no opportunity to use multiaxes. Everything else is fine with Qwt from trunk I think

  6. #6
    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 multiaxis bug - can't set color for OpenGL canvas

    What about the 6.2 branch - it should have the same OpenGL canvas code as the one from the multiaxes branch ?

    Uwe

  7. #7
    Join Date
    Nov 2019
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qwt multiaxis bug - can't set color for OpenGL canvas

    I've just installed Qwt-6.2.0-svn and there is no neither qwt_plot_opengl_canvas.h or plot->setAxesCount
    Here is the link where I downloaded it: https://sourceforge.net/p/qwt/code/H...nches/qwt-6.2/

  8. #8
    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 multiaxis bug - can't set color for OpenGL canvas

    Ah yes, the opengl canvas code of the multiaxes branch is indeed the same as the one in trunk - 6.2 is an older version. So when your code is working with trunk there is no technical reason why it should not work with multiaxes.

    Uwe

  9. #9
    Join Date
    Nov 2019
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qwt multiaxis bug - can't set color for OpenGL canvas

    it is strange...

Similar Threads

  1. How do i draw to an existing opengl color attachment?
    By PeterVE in forum Qt Programming
    Replies: 0
    Last Post: 26th August 2016, 18:08
  2. Replies: 0
    Last Post: 29th February 2016, 19:12
  3. Replies: 1
    Last Post: 13th March 2014, 09:23
  4. Qt Opengl, Changing objects color
    By bod in forum Qt Programming
    Replies: 4
    Last Post: 2nd July 2008, 14:13
  5. getting color from a pixel on canvas
    By teeshift in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2007, 05:12

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.