[Qt] qt tshapes arm

Terry Kemp klc at klc.net.nz
Thu Jun 19 03:37:40 CEST 2008


> Actually it is any TControl- TGraphicControl descendant that does this -
> not just shape. I see there is no specific implementation for these so
> they are drawn on the parent DC yes. 
> Everything looks OK except that in qtwinapi.inc,
> TQtWidgetSet.SetWindowOrgEx the call to
> TQtDeviceContext(DC).translate(-NewX, -NewY) seems to have no effect. 
> I need some way of checking what the device translations are before and
> after this call, QPainter::deviceTransform or QPainter::deviceMatrix?
> 
> I wonder if this is some limitation in the paintengine capabilities for
> LinuxFB vs X11.
> 
> I will keep at it.
> 
> Thanks
> 
> Terry
>    

The problem is with the matrix...


I added this in function TQtWidgetSet.SetWindowOrgEx(DC : HDC; NewX,
NewY : Integer; OldPoint: PPoint) : Boolean;

  matrix := TQtDeviceContext(DC).getworldmatrix;
  WriteLn('[WinAPI SetWindowOrgEx] MATRIX dx: ',
floattostr(qmatrix_dx(matrix)));
  WriteLn('[WinAPI SetWindowOrgEx] MATRIX dy: ',
floattostr(qmatrix_dy(matrix)));
  WriteLn('[WinAPI SetWindowOrgEx] MATRIX m11: ',
floattostr(qmatrix_m11(matrix)));
  WriteLn('[WinAPI SetWindowOrgEx] MATRIX m12: ',
floattostr(qmatrix_m12(matrix)));
  WriteLn('[WinAPI SetWindowOrgEx] MATRIX m21: ',
floattostr(qmatrix_m21(matrix)));
  WriteLn('[WinAPI SetWindowOrgEx] MATRIX m22: ',
floattostr(qmatrix_m22(matrix)));

and on X11 machine I get this...

TQtWidget.SlotPaint GroupBox1:TGroupBox
Trace:> [WinAPI BeginPaint] Handle=75C1B0
TQtDeviceContext.Create ( WidgetHandle: DDA570 FromPaintEvent:-1 )
AWidget = DDA570
TQtFont.Create CreateHandle: False
TQtBrush.Create CreateHandle: False
TQtPen.Create CreateHandle: False
TQtRegion.Create CreateHandle: False
TQtBrush.Create CreateHandle: False
Trace:< [WinAPI BeginPaint] Result=1815D0
[WinAPI SetWindowOrgEx] DC: 1815D0 NewX: -2 NewY: -23
[WinAPI SetWindowOrgEx] MATRIX dx: 0
[WinAPI SetWindowOrgEx] MATRIX dy: 0
[WinAPI SetWindowOrgEx] MATRIX m11: 1
[WinAPI SetWindowOrgEx] MATRIX m12: 0
[WinAPI SetWindowOrgEx] MATRIX m21: 0
[WinAPI SetWindowOrgEx] MATRIX m22: 1
Trace: > [WinAPI GetWindowOrgEx]
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DX 0
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DY0
Trace: < [WinAPI GetWindowOrgEx] Result=(x=0,y=0)
[WinAPI SetWindowOrgEx] DC: 1815D0 P.X: 0 P.Y: 0
[WinAPI SetWindowOrgEx] OldPoint: 0
TQtDeviceContext.drawRect() x1: 2 y1: 23 w: 10 h: 10
TQtDeviceContext.translate() 
TQtDeviceContext.drawRect() x1: 0 y1: 0 w: 12 h: 12
[WinAPI RectVisible] 
Trace:> [WinAPI SaveDC] DC=1815D0
TQtDeviceContext.CreateDCData() 
Trace:< [WinAPI SaveDC] result=1
Trace: > [WinAPI GetWindowOrgEx]
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DX 2
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DY23
Trace: < [WinAPI GetWindowOrgEx] Result=(x=-2,y=-23)
[WinAPI SetWindowOrgEx] DC: 1815D0 NewX: -64 NewY: -24
[WinAPI SetWindowOrgEx] MATRIX dx: 2
[WinAPI SetWindowOrgEx] MATRIX dy: 23
[WinAPI SetWindowOrgEx] MATRIX m11: 1
[WinAPI SetWindowOrgEx] MATRIX m12: 0
[WinAPI SetWindowOrgEx] MATRIX m21: 0
[WinAPI SetWindowOrgEx] MATRIX m22: 1
Trace: > [WinAPI GetWindowOrgEx]

all good, and on arm I get this...

TQtWidget.SlotPaint GroupBox1:TGroupBox
Trace:> [WinAPI BeginPaint] Handle=40F14860
TQtDeviceContext.Create ( WidgetHandle: 212778 FromPaintEvent:-1 )
AWidget = 212778
TQtFont.Create CreateHandle: False
TQtBrush.Create CreateHandle: False
TQtPen.Create CreateHandle: False
TQtRegion.Create CreateHandle: False
TQtBrush.Create CreateHandle: False
Trace:< [WinAPI BeginPaint] Result=40F91380
[WinAPI SetWindowOrgEx] DC: 40F91380 NewX: -2 NewY: -19
[WinAPI SetWindowOrgEx] MATRIX dx: 4.05408993460549E-308
[WinAPI SetWindowOrgEx] MATRIX dy: 4.05408993460549E-308
[WinAPI SetWindowOrgEx] MATRIX m11: 4.0540904609599E-308
[WinAPI SetWindowOrgEx] MATRIX m12: 4.05408993460549E-308
[WinAPI SetWindowOrgEx] MATRIX m21: 4.05408993460549E-308
[WinAPI SetWindowOrgEx] MATRIX m22: 4.0540904609599E-308
Trace: > [WinAPI GetWindowOrgEx]
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DX 4.0425293015363E-308
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DY4.05408993460549E-308
Trace: < [WinAPI GetWindowOrgEx] Result=(x=0,y=0)
[WinAPI SetWindowOrgEx] DC: 40F91380 P.X: 0 P.Y: 0
[WinAPI SetWindowOrgEx] OldPoint: 0
TQtDeviceContext.drawRect() x1: 2 y1: 19 w: 10 h: 10
TQtDeviceContext.translate() 
TQtDeviceContext.drawRect() x1: 0 y1: 0 w: 12 h: 12
[WinAPI RectVisible] 
Trace:> [WinAPI SaveDC] DC=40F91380
TQtDeviceContext.CreateDCData() 
Trace:< [WinAPI SaveDC] result=1
Trace: > [WinAPI GetWindowOrgEx]
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DX 4.0425293015363E-308
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DY4.05409046510443E-308
Trace: < [WinAPI GetWindowOrgEx] Result=(x=0,y=0)
[WinAPI SetWindowOrgEx] DC: 40F91380 NewX: -62 NewY: -1
[WinAPI SetWindowOrgEx] MATRIX dx: 4.05408993460549E-308
[WinAPI SetWindowOrgEx] MATRIX dy: 4.05409046510443E-308
[WinAPI SetWindowOrgEx] MATRIX m11: 4.0540904609599E-308
[WinAPI SetWindowOrgEx] MATRIX m12: 4.05408993460549E-308
[WinAPI SetWindowOrgEx] MATRIX m21: 4.05408993460549E-308
[WinAPI SetWindowOrgEx] MATRIX m22: 4.0540904609599E-308


Where has my matrix gone??????
I tried creating one and setting worldmatrix etc but it always returns
these negative numbers.  

doesn't this look like some sort of an integer overflow type of problem?

I have run the Qt mainwindow demo on the arm (which uses
qpainter.translate) from the qt-embedded-linux-opensource-src-4.4.0 arm
build I am using and there are no problems so its not a Qt prob.

Terry (smacking head against brick wall) Kemp 










More information about the Qt mailing list