✨ Support QT6

This commit is contained in:
2024-11-03 16:32:09 +01:00
parent 23b4ebe214
commit 4d92724f4e
+24
View File
@@ -352,6 +352,8 @@ uses
GLib2, GDK2, GTK2, GTK2Def, GTK2Proc, GLib2, GDK2, GTK2, GTK2Def, GTK2Proc,
{$ELSEIF Defined(LCLqt5)} {$ELSEIF Defined(LCLqt5)}
Qt5, qtobjects, Qt5, qtobjects,
{$ELSEIF Defined(LCLqt6)}
Qt6, qtobjects,
{$ELSEIF Defined(LCLcocoa)} {$ELSEIF Defined(LCLcocoa)}
CocoaGDIObjects, CocoaUtils, CocoaGDIObjects, CocoaUtils,
{$IFEND} {$IFEND}
@@ -916,6 +918,28 @@ begin
end; end;
end; end;
end; end;
{$ELSEIF Defined(LCLqt6)}
var
QImage: TQtImage;
Context: TQtDeviceContext;
begin
if TestImage(ImageData) then
begin
if not (ImageData.Format in [ifA8R8G8B8, ifX8R8G8B8]) then
raise EImagingError.Create(SBadFormatDisplay);
Context := TQtDeviceContext(DstCanvas.Handle);
// QImage directly uses the image memory, there is no copy done
QImage := TQtImage.Create(ImageData.Bits, ImageData.Width, ImageData.Height,
ImageData.Width * 4, QImageFormat_ARGB32, False);
try
QPainter_drawImage(Context.Widget, PRect(@DstRect), QImage.Handle, @SrcRect, QtAutoColor);
finally
QImage.Free;
end;
end;
end;
{$ELSEIF Defined(LCLcocoa)} {$ELSEIF Defined(LCLcocoa)}
var var
CocoaBmp: TCocoaBitmap; CocoaBmp: TCocoaBitmap;