Results 1 to 2 of 2

Thread: [solved] How to activate a QPainter::beginNativePainting, Painter inactive QGLWidget?

  1. #1
    Join Date
    Jul 2015
    Posts
    6
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default [solved] How to activate a QPainter::beginNativePainting, Painter inactive QGLWidget?

    Hello,

    I got a *.dll file with follwing class signature

    Qt Code:
    1. class Render_WidgetGL: public QGLWidget {
    2. Q_OBJECT
    3. //..
    4. }
    To copy to clipboard, switch view to plain text mode 

    I created such a Render_WidgetGL object and set that to a layout object

    Qt Code:
    1. Render_WidgetGL* renderWidget = new Render_WidgetGL(resources);
    2. QGridLayout* gridLayout = new QGridLayout;
    3. gridLayout->addWidget(renderWidget, 0, 1);
    4. ui->horizontalLayout_5->addLayout(gridLayout);
    To copy to clipboard, switch view to plain text mode 

    When I start and execute my application I got following message:

    RenderProject|nderBackendOpenGlES2|Using GLEW 1.12.0
    RenderProject|nderBackendOpenGlES2|OpenGL 2.0: 1
    QPainter beginNativePainting: Painter not active
    QPainter setRenderHint: Painter must be active to set rendering hints
    QPainter beginNativePainting: Painter not active
    QPainter beginNativePainting: Painter not active

    I do not have such a Painter object in my code, so I assume it comes within the *.dll library. So how can I activate the Painter ? (By the way: The Qt docssay, that QGlWidget is obsolete)

    Thnx in advance! Regards
    Last edited by ralfwickum; 13th July 2015 at 13:35. Reason: fixed

  2. #2
    Join Date
    Jul 2015
    Posts
    6
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: How to activate a QPainter::beginNativePainting , Painter inactive QGLWidget?

    Replacing
    Qt Code:
    1. painter.beginNativePainting();
    2. painter.endNativePainting();
    To copy to clipboard, switch view to plain text mode 
    through
    Qt Code:
    1. painter.begin(this);
    2. painter.end();
    To copy to clipboard, switch view to plain text mode 
    fixed it for me!

Similar Threads

  1. QPainter::setPen() painter not active
    By tesmai4 in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2013, 21:18
  2. QPainter *painter vs. QPainter painter
    By gebbissimo in forum Newbie
    Replies: 6
    Last Post: 5th September 2012, 01:58
  3. Replies: 9
    Last Post: 13th September 2011, 03:04
  4. Replies: 8
    Last Post: 9th November 2010, 22:11
  5. use Qpainter to draw lines + problem in my painter
    By ReSu in forum Qt Programming
    Replies: 4
    Last Post: 5th March 2008, 16:44

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.