Home > Mobile >  QPainter error
QPainter error

Time:09-23

I draw QImage in one thread, function performs the first time is no problem, but when performing a second time will pop up error signal SIGSEGV
Signal a fancy: Segmentation fault.
Debuger function call is parked in QPainterPrivate: : attachPainterPrivate (QPainter, QPaintDevice *)
The code is as follows:
The QRect target;
Pait. The begin (g_GE - & gt; GetDrawBuffer ());
Pait. SetRenderHint (QPainter: : Antialiasing, true);
G_GE - & gt; SetisDraw (true);
While (g_GE - & gt; GetImageArray () - & gt; The size ()) {
ImageInfo * pInfo=g_GE - & gt; GetImageArray () - & gt; At (0);
G_GE - & gt; GetImageArray () - & gt; Pop_front ();
If (pInfo - & gt; Type=={_gedraw)
Target=pInfo - & gt; The rect.
Pait. DrawImage (target, * (pInfo - & gt; PImg), pInfo - & gt; The rect);
}
}
Pait. End ();
G_GE - & gt; SetisDraw (false);
return 0;

32 bit Version is Qt 5.14.1 MinGW 7.3.0
OS: Windows 10

CodePudding user response:

I tried MSVC2015 don't have the mistake, but is constantly play
22:46:08: was Debugging starts
QPainter: : begin: A paint device can only be made by one painter at A time.
QPainter: : end: Painter not active, aborted
QPainter: : begin: A paint device can only be made by one painter at A time.
QPainter: : setRenderHint: Painter must be active to set rendering hints
QPainter: : setBackgroundMode: Painter not active
QPainter: : end: Painter not active, aborted
QPainter: : begin: A paint device can only be made by one painter at A time.
QPainter: : setRenderHint: Painter must be active to set rendering hints
QPainter: : setBackgroundMode: Painter not active
QPainter: : end: Painter not active, aborted

But the MainWindow paintevent is an empty function, and which can adjust QPainter?
  •  Tags:  
  • Qt
  • Related