mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 15:18:16 +02:00
Qt: fixed crash in TQtWidgetSet.RawImage_FromDevice(), also fixed memleak with created TQtPixmap. issue #19281
git-svn-id: trunk@30540 -
This commit is contained in:
parent
3a9c073d32
commit
fc8550cf53
@ -754,11 +754,10 @@ begin
|
||||
cx := x;
|
||||
cy := y;
|
||||
end;
|
||||
|
||||
Pixmap := TQtPixmap.Create(@DCSize);
|
||||
|
||||
|
||||
if Context.Parent <> nil then
|
||||
begin
|
||||
Pixmap := TQtPixmap.Create(@DCSize);
|
||||
WinID := QWidget_winId(Context.Parent);
|
||||
try
|
||||
// if you have dual monitors then getDeviceSize return
|
||||
@ -779,6 +778,13 @@ begin
|
||||
if Context.vImage <> nil then
|
||||
RawImage_FromImage(Context.vImage.Handle)
|
||||
else
|
||||
if Context.ParentPixmap <> nil then
|
||||
begin
|
||||
Image := QImage_create();
|
||||
QPixmap_toImage(Context.ParentPixmap, Image);
|
||||
RawImage_FromImage(Image);
|
||||
QImage_destroy(Image);
|
||||
end else
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user