mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-28 17:03:07 +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);
|
||||
try
|
||||
GetMem(NewRawImage.Mask, 1); // Creates a dummy mask
|
||||
NewRawImage.Mask := GetMem(1); // Creates a dummy mask
|
||||
|
||||
Pixmap.grabWindow(WinID);
|
||||
|
||||
@ -899,7 +899,7 @@ begin
|
||||
|
||||
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));
|
||||
finally
|
||||
@ -913,9 +913,9 @@ begin
|
||||
end
|
||||
else
|
||||
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.Height := SrcHeight;
|
||||
|
@ -117,7 +117,7 @@ implementation
|
||||
------------------------------------------------------------------------------}
|
||||
class function TQtWSCommonDialog.CreateHandle(const ACommonDialog: TCommonDialog): THandle;
|
||||
begin
|
||||
Result := 1000;
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -143,8 +143,9 @@ begin
|
||||
{------------------------------------------------------------------------------
|
||||
Initialization of the dialog´s options
|
||||
------------------------------------------------------------------------------}
|
||||
|
||||
Parent := TQtWidget(TWinControl(ACommonDialog.Owner).Handle).Widget;
|
||||
if ACommonDialog.Owner is TWinControl then
|
||||
Parent := TQtWidget(TWinControl(ACommonDialog.Owner).Handle).Widget
|
||||
else Parent := nil;
|
||||
|
||||
ReturnText := '';
|
||||
TmpFilter := '';
|
||||
|
Loading…
Reference in New Issue
Block a user