mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 16:19:21 +02:00
Qt5, Qt6: removed unused code.
This commit is contained in:
parent
7be8c31b7b
commit
91fe3cc4bc
@ -2519,39 +2519,14 @@ function TQtWidgetSet.GetCapture: HWND;
|
|||||||
var
|
var
|
||||||
w: QWidgetH;
|
w: QWidgetH;
|
||||||
Widget: TQtWidget;
|
Widget: TQtWidget;
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
AWin: HWND;
|
|
||||||
{$ENDIF}
|
|
||||||
begin
|
begin
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
AWin := Windows.GetCapture;
|
|
||||||
if AWin <> 0 then
|
|
||||||
w := QWidget_find(AWin)
|
|
||||||
else
|
|
||||||
w := nil;
|
|
||||||
|
|
||||||
if (w = nil) and (QGUIApplication_mouseButtons() > 0) then
|
|
||||||
w := QApplication_focusWidget()
|
|
||||||
else
|
|
||||||
if (w <> QWidget_mouseGrabber) and (QWidget_mouseGrabber <> nil) then
|
|
||||||
w := QWidget_mouseGrabber;
|
|
||||||
|
|
||||||
{$ELSE}
|
|
||||||
w := QWidget_mouseGrabber();
|
w := QWidget_mouseGrabber();
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
if w <> nil then
|
if w <> nil then
|
||||||
begin
|
begin
|
||||||
// Capture widget can be child of complex control. In any case we should return TQtWidget as result.
|
// Capture widget can be child of complex control. In any case we should return TQtWidget as result.
|
||||||
// So we will look for parent while not found apropriate LCL handle.
|
// So we will look for parent while not found apropriate LCL handle.
|
||||||
Widget := GetFirstQtObjectFromWidgetH(w);
|
Widget := GetFirstQtObjectFromWidgetH(w);
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
if Widget <> nil then
|
|
||||||
begin
|
|
||||||
if Widget is TQtCustomControl then
|
|
||||||
Widget := TQtCustomControl(Widget).Viewport;
|
|
||||||
end;
|
|
||||||
{$ENDIF}
|
|
||||||
Result := HWND(Widget);
|
Result := HWND(Widget);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -5462,16 +5437,7 @@ begin
|
|||||||
w := TQtWidget(GetCapture);
|
w := TQtWidget(GetCapture);
|
||||||
Result := w <> nil;
|
Result := w <> nil;
|
||||||
if Result then
|
if Result then
|
||||||
begin
|
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
if (w is TQtMainWindow) then
|
|
||||||
w.releaseMouse()
|
|
||||||
else
|
|
||||||
windows.ReleaseCapture;
|
|
||||||
{$ELSE}
|
|
||||||
w.releaseMouse();
|
w.releaseMouse();
|
||||||
{$ENDIF}
|
|
||||||
end;
|
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI ReleaseCapture] Capture = ', TLCLHandle(w));
|
WriteLn('[WinAPI ReleaseCapture] Capture = ', TLCLHandle(w));
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -5910,13 +5876,6 @@ begin
|
|||||||
ReleaseCapture;
|
ReleaseCapture;
|
||||||
if IsValidHandle(AHandle) then
|
if IsValidHandle(AHandle) then
|
||||||
begin
|
begin
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
if TQtWidget(AHandle) is TQtCustomControl then
|
|
||||||
begin
|
|
||||||
Windows.SetCapture(QWidget_winID(TQtCustomControl(AHandle).Viewport.Widget))
|
|
||||||
end else
|
|
||||||
Windows.SetCapture(QWidget_winID(TQtWidget(AHandle).Widget));
|
|
||||||
{$ELSE}
|
|
||||||
if qtwsInsideMouseDoubleClickEvent in TQtWidget(AHandle).WidgetState then
|
if qtwsInsideMouseDoubleClickEvent in TQtWidget(AHandle).WidgetState then
|
||||||
// issue #27384
|
// issue #27384
|
||||||
{$IFDEF DebugQtFocus}
|
{$IFDEF DebugQtFocus}
|
||||||
@ -5924,7 +5883,6 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
else
|
else
|
||||||
TQtWidget(AHandle).grabMouse();
|
TQtWidget(AHandle).grabMouse();
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI SetCapture] Capture = ', Result, ' New capture = ', AHandle);
|
WriteLn('[WinAPI SetCapture] Capture = ', Result, ' New capture = ', AHandle);
|
||||||
|
@ -2516,39 +2516,14 @@ function TQtWidgetSet.GetCapture: HWND;
|
|||||||
var
|
var
|
||||||
w: QWidgetH;
|
w: QWidgetH;
|
||||||
Widget: TQtWidget;
|
Widget: TQtWidget;
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
AWin: HWND;
|
|
||||||
{$ENDIF}
|
|
||||||
begin
|
begin
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
AWin := Windows.GetCapture;
|
|
||||||
if AWin <> 0 then
|
|
||||||
w := QWidget_find(AWin)
|
|
||||||
else
|
|
||||||
w := nil;
|
|
||||||
|
|
||||||
if (w = nil) and (QGUIApplication_mouseButtons() > 0) then
|
|
||||||
w := QApplication_focusWidget()
|
|
||||||
else
|
|
||||||
if (w <> QWidget_mouseGrabber) and (QWidget_mouseGrabber <> nil) then
|
|
||||||
w := QWidget_mouseGrabber;
|
|
||||||
|
|
||||||
{$ELSE}
|
|
||||||
w := QWidget_mouseGrabber();
|
w := QWidget_mouseGrabber();
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
if w <> nil then
|
if w <> nil then
|
||||||
begin
|
begin
|
||||||
// Capture widget can be child of complex control. In any case we should return TQtWidget as result.
|
// Capture widget can be child of complex control. In any case we should return TQtWidget as result.
|
||||||
// So we will look for parent while not found apropriate LCL handle.
|
// So we will look for parent while not found apropriate LCL handle.
|
||||||
Widget := GetFirstQtObjectFromWidgetH(w);
|
Widget := GetFirstQtObjectFromWidgetH(w);
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
if Widget <> nil then
|
|
||||||
begin
|
|
||||||
if Widget is TQtCustomControl then
|
|
||||||
Widget := TQtCustomControl(Widget).Viewport;
|
|
||||||
end;
|
|
||||||
{$ENDIF}
|
|
||||||
Result := HWND(Widget);
|
Result := HWND(Widget);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -5505,16 +5480,7 @@ begin
|
|||||||
w := TQtWidget(GetCapture);
|
w := TQtWidget(GetCapture);
|
||||||
Result := w <> nil;
|
Result := w <> nil;
|
||||||
if Result then
|
if Result then
|
||||||
begin
|
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
if (w is TQtMainWindow) then
|
|
||||||
w.releaseMouse()
|
|
||||||
else
|
|
||||||
windows.ReleaseCapture;
|
|
||||||
{$ELSE}
|
|
||||||
w.releaseMouse();
|
w.releaseMouse();
|
||||||
{$ENDIF}
|
|
||||||
end;
|
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI ReleaseCapture] Capture = ', TLCLHandle(w));
|
WriteLn('[WinAPI ReleaseCapture] Capture = ', TLCLHandle(w));
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -5953,13 +5919,6 @@ begin
|
|||||||
ReleaseCapture;
|
ReleaseCapture;
|
||||||
if IsValidHandle(AHandle) then
|
if IsValidHandle(AHandle) then
|
||||||
begin
|
begin
|
||||||
{$IFDEF MSWINDOWSQT4}
|
|
||||||
if TQtWidget(AHandle) is TQtCustomControl then
|
|
||||||
begin
|
|
||||||
Windows.SetCapture(QWidget_winID(TQtCustomControl(AHandle).Viewport.Widget))
|
|
||||||
end else
|
|
||||||
Windows.SetCapture(QWidget_winID(TQtWidget(AHandle).Widget));
|
|
||||||
{$ELSE}
|
|
||||||
if qtwsInsideMouseDoubleClickEvent in TQtWidget(AHandle).WidgetState then
|
if qtwsInsideMouseDoubleClickEvent in TQtWidget(AHandle).WidgetState then
|
||||||
// issue #27384
|
// issue #27384
|
||||||
{$IFDEF DebugQtFocus}
|
{$IFDEF DebugQtFocus}
|
||||||
@ -5967,7 +5926,6 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
else
|
else
|
||||||
TQtWidget(AHandle).grabMouse();
|
TQtWidget(AHandle).grabMouse();
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI SetCapture] Capture = ', Result, ' New capture = ', AHandle);
|
WriteLn('[WinAPI SetCapture] Capture = ', Result, ' New capture = ', AHandle);
|
||||||
|
Loading…
Reference in New Issue
Block a user