On Thu, 2 Mar 2006 18:19:59 -0300
"Felipe Monteiro de Carvalho" <[EMAIL PROTECTED]> wrote:
> On 3/2/06, Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> > DrawText
> >
> > Well? What does DrawText return under qt?
>
> It wasn't implemented =) This is what I was looking for, thanks.
>
> I did a quick and dirty implementation for DrawText windows API and
> TLabel now works =) (no font, size, etc implemented however)
>
> Here is my code:
>
> function TQtWidgetSet.DrawText(DC: HDC; Str: PChar; Count: Integer;
> var Rect: TRect; Flags: Cardinal): Integer;
> var
> WideStr: WideString;
> begin
> Result := 30;
>
> WideStr := WideString(Str);
>
> if DC = 0 then Exit;
>
> TQtDeviceContext(DC).drawText(Rect.Left, Rect.Top, @WideStr);
> end;
>
> The problem is that the Qt function drawText doesn't return
> information about the size drawn, so I just hardcoded to 30 until a
> better solution arrives.
>
> Another problem, it works, but I think that LCL tryes to paint outside
> the paint event, I receive some messages like this:
>
> QPainter::begin: Widget painting can only begin as a result of a
> paintEvent
Please report such places. The LCL should not do that.
> I think I will do like Den Jean sugested and use that Qt function to
> check if I'm on a paint event.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives