Qt: make TQtImage.FHandle private, introduce Handle readonly property. issue #21235

git-svn-id: trunk@35203 -
This commit is contained in:
zeljko 2012-02-07 07:38:40 +00:00
parent 7111abfa8d
commit 7a324ede40
6 changed files with 19 additions and 19 deletions

View File

@ -664,11 +664,11 @@ begin
end
else begin
WorkImage := TQtImage.Create;
WorkImage.CopyFrom(Image.FHandle, R.Left, R.Top, Width, Height);
WorkImage.CopyFrom(Image.Handle, R.Left, R.Top, Width, Height);
if Mask <> nil then
begin
WorkMask := TQtImage.Create;
WorkMask.CopyFrom(Mask.FHandle, R.Left, R.Top, Width, Height);
WorkMask.CopyFrom(Mask.Handle, R.Left, R.Top, Width, Height);
end
else
WorkMask := nil;
@ -695,13 +695,13 @@ begin
InvertPixels := False;
if WorkImage <> nil then
begin
Px := QImage_pixel(WorkImage.FHandle, 0, 0);
Px := QImage_pixel(WorkImage.Handle, 0, 0);
InvertPixels :=
not QImage_hasAlphaChannel(WorkMask.FHandle) and
not QImage_hasAlphaChannel(WorkImage.FHandle) and
not QImage_hasAlphaChannel(WorkMask.Handle) and
not QImage_hasAlphaChannel(WorkImage.Handle) and
// invert only if WorkImage is RGB32 fmt and allGray
(WorkImage.getFormat = QImageFormat_RGB32) and
QImage_allGray(WorkImage.FHandle) and
QImage_allGray(WorkImage.Handle) and
((Px = 0) or (Px = $FF))
end;
if InvertPixels then
@ -796,7 +796,7 @@ begin
end else
begin
if Context.vImage <> nil then
RawImage_FromImage(Context.vImage.FHandle)
RawImage_FromImage(Context.vImage.Handle)
else
if Context.ParentPixmap <> nil then
begin

View File

@ -840,7 +840,7 @@ begin
if (TQtDeviceContext(CanvasHandle).vImage <> nil) then
begin
Color := QColor_create(QImage_pixel(TQtDeviceContext(CanvasHandle).vImage.FHandle, X, Y));
Color := QColor_create(QImage_pixel(TQtDeviceContext(CanvasHandle).vImage.Handle, X, Y));
Result := RGBToColor(QColor_red(Color), QColor_green(Color), QColor_blue(Color));
QColor_destroy(Color);
end;

View File

@ -140,7 +140,6 @@ type
private
FData: PByte;
FDataOwner: Boolean;
public
FHandle: QImageH;
public
constructor Create;
@ -163,6 +162,7 @@ type
function bytesPerLine: Integer;
procedure invertPixels(InvertMode: QImageInvertMode = QImageInvertRgb);
function getFormat: QImageFormat;
property Handle: QImageH read FHandle;
end;
{ TQtFont }

View File

@ -431,7 +431,7 @@ begin
BS_PATTERN, // Pattern brush defined by a memory bitmap.
BS_PATTERN8X8: // Same as BS_PATTERN.
begin
QtBrush.setTextureImage(TQtImage(LogBrush.lbHatch).FHandle);
QtBrush.setTextureImage(TQtImage(LogBrush.lbHatch).Handle);
QtBrush.Style := QtTexturePattern;
end;
else
@ -605,7 +605,7 @@ begin
if IsValidGDIObject(IconInfo^.hbmColor) then
begin
APixmap := QPixmap_create();
QPixmap_fromImage(APixmap, TQtImage(IconInfo^.hbmColor).FHandle);
QPixmap_fromImage(APixmap, TQtImage(IconInfo^.hbmColor).Handle);
{$IFDEF DARWIN}
AImgFmt := TQtImage(IconInfo^.hbmColor).getFormat;
if (AImgFmt in [QImageFormat_Mono, QImageFormat_MonoLSB,
@ -614,7 +614,7 @@ begin
if IconInfo^.hbmMask <> 0 then
begin
ATemp := QPixmap_create();
QPixmap_fromImage(ATemp, TQtImage(IconInfo^.hbmMask).FHandle);
QPixmap_fromImage(ATemp, TQtImage(IconInfo^.hbmMask).Handle);
AMask := QBitmap_create(ATemp);
QPixmap_setMask(APixmap, AMask);
QPixmap_destroy(ATemp);
@ -649,7 +649,7 @@ begin
if ABitmap = 0 then
exit;
QtBrush := TQtBrush.Create(True);
Image := QImage_create(TQtImage(ABitmap).FHandle);
Image := QImage_create(TQtImage(ABitmap).Handle);
try
QtBrush.setTextureImage(Image);
finally
@ -848,7 +848,7 @@ begin
// we must stop paintdevice before destroying
APaintEngine := QImage_paintEngine(TQtImage(AObject).FHandle);
APaintEngine := QImage_paintEngine(TQtImage(AObject).Handle);
if (APaintEngine <> nil) and QPaintEngine_isActive(APaintEngine) then
begin
@ -2396,7 +2396,7 @@ begin
if (Bitmap = 0) or (Count <= 0) then
Exit;
Image := QImage_create(TQtImage(Bitmap).FHandle);
Image := QImage_create(TQtImage(Bitmap).Handle);
try
Result := (QImage_width(Image) * QImage_height(Image) * QImage_depth(Image) + 7) div 8;
if Count < Result then
@ -6273,7 +6273,7 @@ begin
Exit;
end
else
Image := SrcQDC.vImage.FHandle;
Image := SrcQDC.vImage.Handle;
QTransform_map(SrcMatrix, XSrc, YSrc, @XSrc, @YSrc);
// our map can have some transformations
@ -6315,7 +6315,7 @@ begin
//DstQDC.CorrectCoordinates(SrcRect);
//DstQDC.CorrectCoordinates(MaskRect);
if Mask <> 0 then
QMask := TQtImage(Mask).FHandle
QMask := TQtImage(Mask).Handle
else
QMask := nil;

View File

@ -111,7 +111,7 @@ begin
begin
AValue.GetImageIndexAndEffect(IconModeToButtonState[Mode], AIndex, AEffect);
AValue.Images.GetBitmap(AIndex, AGlyph, AEffect);
QPixmap_fromImage(APixmap, TQtImage(AGlyph.Handle).FHandle);
QPixmap_fromImage(APixmap, TQtImage(AGlyph.Handle).Handle);
QIcon_addPixmap(AIcon, APixmap, Mode, QIconOn);
end;
QPixmap_destroy(APixmap);

View File

@ -668,7 +668,7 @@ begin
end;
Result := TQtWidgetset(Widgetset).DragImageList_BeginDrag(
TQtImage(ABitmap.Handle).FHandle, ADragImageList.DragHotSpot);
TQtImage(ABitmap.Handle).Handle, ADragImageList.DragHotSpot);
if Result then
TQtWidgetset(Widgetset).DragImageList_DragMove(X, Y);
ABitmap.Free;