mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 18:59:10 +02:00
Qt: TQtWidgetSet.GetDC() grab widget to ParentPixmap in QtDefaultContext if GetDC() is asked outside of paint event for widget.
git-svn-id: trunk@30542 -
This commit is contained in:
parent
0abaa5be8e
commit
d9c1364472
@ -2263,6 +2263,7 @@ end;
|
||||
function TQtWidgetSet.GetDC(hWnd: HWND): HDC;
|
||||
var
|
||||
Widget: TQtWidget;
|
||||
B: Boolean;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('Trace:> [WinAPI GetDC] hWnd: ', dbghex(hWnd));
|
||||
@ -2273,7 +2274,16 @@ begin
|
||||
Widget := TQtWidget(hWnd);
|
||||
Result := Widget.Context;
|
||||
if Result = 0 then
|
||||
begin
|
||||
B := QPainter_isActive(QtDefaultContext.Widget);
|
||||
if B then
|
||||
QPainter_end(QtDefaultContext.Widget);
|
||||
QPixmap_grabWidget(QtDefaultContext.ParentPixmap, Widget.Widget,
|
||||
0, 0, Widget.getWidth, Widget.getHeight);
|
||||
if B then
|
||||
QPainter_begin(QtDefaultContext.Widget, QtDefaultContext.ParentPixmap);
|
||||
Result := HDC(QtDefaultContext);
|
||||
end;
|
||||
end else
|
||||
Result := HDC(QtScreenContext);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user