1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Added QT6 support
Some checks failed
Make / build (ubuntu-latest) (push) Has been cancelled

Added SimpleBrowser for Lazarus and QT6
This commit is contained in:
Salvador Díaz Fau
2025-09-14 19:25:12 +02:00
parent ce571c5674
commit 435cfe8cae
13 changed files with 664 additions and 8 deletions

View File

@@ -59,6 +59,12 @@ type
/// Updates the size of the child windows created by the browser.
/// </summary>
procedure UpdateSize; virtual;
{$IF DEFINED(LCLQT) OR DEFINED(LCLQT5) OR DEFINED(LCLQT6)}
/// <summary>
/// Set this widget as native with a native window handle.
/// </summary>
procedure SetQTWidgetAsNative;
{$IFEND}
/// <summary>
/// Handle of the first child window created by the browser.
/// </summary>
@@ -101,6 +107,9 @@ type
implementation
uses
{$IFDEF LCLQT}qtwidgets, qt4,{$ENDIF}
{$IFDEF LCLQT5}qtwidgets, qt5,{$ENDIF}
{$IFDEF LCLQT6}qtwidgets, qt6,{$ENDIF}
uCEFMiscFunctions, uCEFClient, uCEFConstants;
function TCEFWinControl.GetChildWindowHandle : {$IFNDEF MSWINDOWS}{$IFDEF FPC}LclType.{$ENDIF}{$ENDIF}THandle;
@@ -118,6 +127,14 @@ begin
inherited CreateHandle;
end;
{$IF DEFINED(LCLQT) OR DEFINED(LCLQT5) OR DEFINED(LCLQT6)}
procedure TCEFWinControl.SetQTWidgetAsNative;
begin
TQtWidget(Handle).setAttribute(QtWA_NativeWindow); // This widget becomes native...
TQtWidget(Handle).setAttribute(QtWA_DontCreateNativeAncestors); // ...but not the ancestors.
end;
{$IFEND}
procedure TCEFWinControl.InvalidateChildren;
begin
if HandleAllocated then