[Qt] qDrawShadeRect
Den Jean
jan.van.hijfte at gmail.com
Wed Jan 9 14:01:07 CET 2008
Hi,
>
>Can you add qDrawWinPanel?
>
Done: V.159
I added several, not all of qdrawutil.h. Because these functions are not
in a class, I need to do it manually.(Created a header
with a temp class with static functions like the requested ones,
copy pasted the temp result to the scripts that add this to qtpas.cpp)
Both the x,y,w,h and PRect version available:
procedure q_DrawPlainRect(p: QPainterH; x: Integer; y: Integer; w: Integer;
h: Integer; p6: PQColor; lineWidth: Integer = 1; fill: QBrushH = nil);
procedure q_DrawPlainRect(p: QPainterH; r: PRect; p3: PQColor; lineWidth:
Integer = 1; fill: QBrushH = nil);
I added some the PRect functions due to the differences in rectangle
between lazarus/fpc and Qt: "-1". Remember also the Mac OS X
specific stuff needed.
Therefore the functions that use a rect have this code:
void q_DrawPlainRect2(QPainterH p, PRect r, const QColorH p3, int lineWidth
, const QBrushH fill) {
QRect t_r;
copyPRectToQRect(r, t_r);
qDrawPlainRect((QPainter*)p, t_r, *(const QColor*)p3, lineWidth, (const
QBrush*)fi
ll);
}
and:
inline void copyPRectToQRect(PRect pr, QRect &qr)
{
#if defined DARWIN
qr.setLeft(((QRect *)pr)->top());
qr.setTop(((QRect *)pr)->left());
qr.setRight(((QRect *)pr)->bottom()-1);
qr.setBottom(((QRect *)pr)->right()-1);
#else
qr.setLeft(((QRect *)pr)->left());
qr.setTop(((QRect *)pr)->top());
qr.setRight(((QRect *)pr)->right()-1);
qr.setBottom(((QRect *)pr)->bottom()-1);
#endif
}
so carefully choose with x,y,w,h or with rect.
regards,
Den Jean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/qt/attachments/20080109/f078747d/attachment-0001.html>
More information about the Qt
mailing list