mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 13:40:29 +02:00
LCL-QT5: Better debugging for Invalid handle in TQtWSWinControl.SetText.
git-svn-id: trunk@62716 -
This commit is contained in:
parent
45ba784bd8
commit
2b84e231a5
@ -309,10 +309,19 @@ begin
|
||||
Exit;
|
||||
Wdgt := TQtWidget(AWinControl.Handle);
|
||||
Assert(Assigned(Wdgt), 'TQtWSWinControl.SetText: AWinControl.Handle=Nil');
|
||||
DebugLn(['TQtWSWinControl.SetText: Widget.ClassName=', Wdgt.ClassName]);
|
||||
Wdgt.BeginUpdate;
|
||||
Wdgt.setText(GetUtf8String(AText));
|
||||
Wdgt.EndUpdate;
|
||||
try
|
||||
DebugLn(['TQtWSWinControl.SetText: Widget.ClassName=', Wdgt.ClassName]);
|
||||
if not QtWidgetSet.IsValidHandle(AWinControl.Handle) then
|
||||
DebugLn(['TQtWSWinControl.SetText: "', Wdgt.ClassName,
|
||||
'" has invalid handle=$', IntToHex(AWinControl.Handle,SizeOf(HWND)*2)]);
|
||||
Wdgt.BeginUpdate;
|
||||
Wdgt.setText(GetUtf8String(AText));
|
||||
Wdgt.EndUpdate;
|
||||
except
|
||||
on E: Exception do
|
||||
DebugLn(['TQtWSWinControl.SetText: "', E.Message, '" with "',
|
||||
Wdgt.ClassName, '", handle=$', IntToHex(AWinControl.Handle,SizeOf(HWND)*2)]);
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TQtWSWinControl.SetChildZPosition(const AWinControl,
|
||||
|
@ -27,6 +27,8 @@ uses
|
||||
qtobjects, qtwidgets, qtproc,
|
||||
// LCL
|
||||
SysUtils, Classes, types, Controls, LCLType, Forms,
|
||||
// LazUtils
|
||||
LazLoggerBase,
|
||||
// Widgetset
|
||||
InterfaceBase, WSForms, WSProc, WSLCLClasses;
|
||||
|
||||
@ -1041,8 +1043,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
class function TQtWSCustomForm.CanFocus(const AWinControl: TWinControl
|
||||
): Boolean;
|
||||
class function TQtWSCustomForm.CanFocus(const AWinControl: TWinControl): Boolean;
|
||||
var
|
||||
Widget: TQtWidget;
|
||||
begin
|
||||
@ -1069,15 +1070,19 @@ end;
|
||||
class procedure TQtWSHintWindow.ShowHide(const AWinControl: TWinControl);
|
||||
var
|
||||
AWidget: TQtHintWindow;
|
||||
ToBeVisible: Boolean;
|
||||
begin
|
||||
DebugLn(['TQtWSHintWindow.ShowHide: Enter.']);
|
||||
if not WSCheckHandleAllocated(AWinControl, 'ShowHide') then
|
||||
Exit;
|
||||
|
||||
AWidget := TQtHintWindow(AWinControl.Handle);
|
||||
|
||||
ToBeVisible := AWinControl.HandleObjectShouldBeVisible;
|
||||
DebugLn([' TQtWSHintWindow.ShowHide: Handle is ', AWidget.ClassName,
|
||||
', Visible=', ToBeVisible]);
|
||||
AWidget.BeginUpdate;
|
||||
AWidget.setVisible(AWinControl.HandleObjectShouldBeVisible);
|
||||
AWidget.setVisible(ToBeVisible);
|
||||
AWidget.EndUpdate;
|
||||
DebugLn([' TQtWSHintWindow.ShowHide: End.']);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user