mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 22:18:24 +02:00
Fixes a crash on qt when the owner of a common dialog isn't a TWinControl.
git-svn-id: trunk@10103 -
This commit is contained in:
parent
f6026e16c4
commit
ddb0dca64d
@ -889,7 +889,7 @@ begin
|
|||||||
|
|
||||||
Pixmap := TQtPixmap.Create(PScreenSize);
|
Pixmap := TQtPixmap.Create(PScreenSize);
|
||||||
try
|
try
|
||||||
GetMem(NewRawImage.Mask, 1); // Creates a dummy mask
|
NewRawImage.Mask := GetMem(1); // Creates a dummy mask
|
||||||
|
|
||||||
Pixmap.grabWindow(WinID);
|
Pixmap.grabWindow(WinID);
|
||||||
|
|
||||||
@ -899,7 +899,7 @@ begin
|
|||||||
|
|
||||||
NewRawImage.DataSize := QImage_numBytes(Image);
|
NewRawImage.DataSize := QImage_numBytes(Image);
|
||||||
|
|
||||||
GetMem(NewRawImage.Data, QImage_numBytes(Image));
|
NewRawImage.Data := GetMem(QImage_numBytes(Image));
|
||||||
|
|
||||||
Move(QImage_bits(Image)^, NewRawImage.Data^, QImage_numBytes(Image));
|
Move(QImage_bits(Image)^, NewRawImage.Data^, QImage_numBytes(Image));
|
||||||
finally
|
finally
|
||||||
@ -913,9 +913,9 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
GetMem(NewRawImage.Mask, 1); // Creates a dummy mask
|
NewRawImage.Mask := GetMem(1); // Creates a dummy mask
|
||||||
|
|
||||||
GetMem(NewRawImage.Data, 1); // Creates a dummy data
|
NewRawImage.Data := GetMem(1); // Creates a dummy data
|
||||||
|
|
||||||
NewRawImage.Description.Width := SrcWidth;
|
NewRawImage.Description.Width := SrcWidth;
|
||||||
NewRawImage.Description.Height := SrcHeight;
|
NewRawImage.Description.Height := SrcHeight;
|
||||||
|
@ -117,7 +117,7 @@ implementation
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
class function TQtWSCommonDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;
|
class function TQtWSCommonDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;
|
||||||
begin
|
begin
|
||||||
Result := 1000;
|
Result := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -143,8 +143,9 @@ begin
|
|||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Initialization of the dialog´s options
|
Initialization of the dialog´s options
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
if ACommonDialog.Owner is TWinControl then
|
||||||
Parent := TQtWidget(TWinControl(ACommonDialog.Owner).Handle).Widget;
|
Parent := TQtWidget(TWinControl(ACommonDialog.Owner).Handle).Widget
|
||||||
|
else Parent := nil;
|
||||||
|
|
||||||
ReturnText := '';
|
ReturnText := '';
|
||||||
TmpFilter := '';
|
TmpFilter := '';
|
||||||
|
Loading…
Reference in New Issue
Block a user