On 3/2/06, Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> Please report such places. The LCL should not do that.
I was wrong, by the way. My TLabel isn't showing. Is DrawText the only
function utilized to make TLabel work? I also implemented TextOut, but
that one isn't used at all.
Here is the order on which events occur:
[EMAIL PROTECTED] test]$ ./qttest
OnCreate
QPainter::begin: Widget painting can only begin as a result of a paintEvent
QPainter::begin: Widget painting can only begin as a result of a paintEvent
Start OnPaint
End OnPaint
OnDestroy
DrawText is being called twice before the paint event.
The Paint message comes from Qt and is processed like this by my widgetset:
procedure TQtCustomForm.SlotPaint; cdecl;
var
Msg: TLMessage;
begin
FillChar(Msg, SizeOf(Msg), #0);
Msg.Msg := LM_PAINT;
try
LCLObject.WindowProc(TLMessage(Msg));
except
Application.HandleException(nil);
end;
end;
Is this a correct way?
Here is the stack trace for the first call (I added a exception so I
can see the stack trace):
QPainter::begin: Widget painting can only begin as a result of a paintEvent
[FORMS.PP] ExceptionOccurred
Sender=Exception
Exception=Error
Stack trace:
$080CB53D TQTWIDGETSET__DRAWTEXT, line 147 of qtwinapi.inc
$08116897 DRAWTEXT, line 181 of ./include/winapi.inc
$080F88CC TCUSTOMLABEL__CALCSIZE, line 43 of ./include/customlabel.inc
$080F89E8 TCUSTOMLABEL__DOAUTOSIZE, line 68 of ./include/customlabel.inc
$080D9893 TCONTROL__ADJUSTSIZE, line 50 of ./include/control.inc
$080D1226 TWINCONTROL__RESIZEDELAYEDAUTOSIZECHILDREN, line 1685 of ./include
/wincontrol.inc
$080D2A42 TWINCONTROL__UPDATESHOWING, line 2528 of ./include/wincontrol.inc
$0808BB94 TCUSTOMFORM__UPDATESHOWING, line 1813 of ./include/customform.inc
$080D5C0F TWINCONTROL__UPDATECONTROLSTATE, line 4174 of ./include/wincontrol
.inc
$080D8F2B TWINCONTROL__CMVISIBLECHANGED, line 5801 of ./include/wincontrol.i
nc
$080528EB
$080DCB32 TCONTROL__WNDPROC, line 1542 of ./include/control.inc
$080D456D TWINCONTROL__WNDPROC, line 3347 of ./include/wincontrol.inc
$08089E9D TCUSTOMFORM__WNDPROC, line 918 of ./include/customform.inc
$080DBA48 TCONTROL__PERFORM, line 1014 of ./include/control.inc
$080DFD1C TCONTROL__SETVISIBLE, line 2977 of ./include/control.inc
$08088F0F TCUSTOMFORM__SETVISIBLE, line 337 of ./include/customform.inc
And now for the second:
[EMAIL PROTECTED] test]$ ./qttest
OnCreate
QPainter::begin: Widget painting can only begin as a result of a paintEvent
QPainter::begin: Widget painting can only begin as a result of a paintEvent
[FORMS.PP] ExceptionOccurred
Sender=Exception
Exception=Error
Stack trace:
$080CB54D TQTWIDGETSET__DRAWTEXT, line 157 of qtwinapi.inc
$081168A7 DRAWTEXT, line 181 of ./include/winapi.inc
$080F88DC TCUSTOMLABEL__CALCSIZE, line 43 of ./include/customlabel.inc
$080F89F8 TCUSTOMLABEL__DOAUTOSIZE, line 68 of ./include/customlabel.inc
$080D98A3 TCONTROL__ADJUSTSIZE, line 50 of ./include/control.inc
$080D1236 TWINCONTROL__RESIZEDELAYEDAUTOSIZECHILDREN, line 1685 of
./include/wincontrol.inc
$080D8F4B TWINCONTROL__CMVISIBLECHANGED, line 5803 of
./include/wincontrol.inc
$080528EB
$080DCB42 TCONTROL__WNDPROC, line 1542 of ./include/control.inc
$080D457D TWINCONTROL__WNDPROC, line 3347 of ./include/wincontrol.inc
$08089E9D TCUSTOMFORM__WNDPROC, line 918 of ./include/customform.inc
$080DBA58 TCONTROL__PERFORM, line 1014 of ./include/control.inc
$080DFD2C TCONTROL__SETVISIBLE, line 2977 of ./include/control.inc
$08088F0F TCUSTOMFORM__SETVISIBLE, line 337 of ./include/customform.inc
$0808B273 TCUSTOMFORM__SHOW, line 1460 of ./include/customform.inc
thanks,
--
Felipe Monteiro de Carvalho
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives