Python Forum
Qpainter Error - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: Qpainter Error (/thread-28037.html)



Qpainter Error - GMCobraz - Jul-02-2020

Dear all,

I faced a bug that happen sometime in my program.

It is not occur everytime, but show up randomly.

QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted

Is anyone have any idea how to solve?

Thanks.


RE: Qpainter Error - Knight18 - Jul-02-2020

I suggest you post your code here.


RE: Qpainter Error - GMCobraz - Jul-02-2020

(Jul-02-2020, 11:39 AM)Knight18 Wrote: I suggest you post your code here.

Hi Knight18,

The code is generated from Pyside2 Designer.
It is about 1000 lines


RE: Qpainter Error - deanhystad - Jul-02-2020

According to the docs QPainter::begin returns True if successful, else False. Reasons for failure are the provided QPaintDevice is 0 (your problem), a provided paint image is null (None), or there is more than one painter.

I am confused about the type. The docs say type 3 is macOS's Quartz2D (CoreGraphics).
What did you use to get the Paint device (engine 0)? I think that is where you should be looking for the problem.

Getting a peek at the code would be interesting. Could you snip the part that is creating/initializing the argument that is passed to QPainter.begin(arg)?


RE: Qpainter Error - GMCobraz - Aug-19-2020

The error as show in figure in attachment.

They are not looking nice, but once I double click on those not complete display box, the value will come out.

Could you snip the part that is creating/initializing the argument that is passed to QPainter.begin(arg)?
I did not see anything related to Qpainter.begin, so I am not sure where to snip my code.

I suspect that, when I insert more Qlineedit boxes, this error will be more often.

Thanks.


RE: Qpainter Error - deanhystad - Aug-20-2020

I'm pretty sure this is an error in your program. Please provide code.


RE: Qpainter Error - GMCobraz - Aug-26-2020

Dear all,

I suspect there is an error in my code.

I use combobox to have more than one data.
When I switch from first to another, I did not do a proper reset, and cause error.
This is what I suspect so far, I am working on proper reset function and see whether problem solved or not.

Thanks.