✨ Support QT6
This commit is contained in:
@@ -352,6 +352,8 @@ uses
|
||||
GLib2, GDK2, GTK2, GTK2Def, GTK2Proc,
|
||||
{$ELSEIF Defined(LCLqt5)}
|
||||
Qt5, qtobjects,
|
||||
{$ELSEIF Defined(LCLqt6)}
|
||||
Qt6, qtobjects,
|
||||
{$ELSEIF Defined(LCLcocoa)}
|
||||
CocoaGDIObjects, CocoaUtils,
|
||||
{$IFEND}
|
||||
@@ -916,6 +918,28 @@ begin
|
||||
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)}
|
||||
var
|
||||
CocoaBmp: TCocoaBitmap;
|
||||
|
||||
Reference in New Issue
Block a user