[Qt-qml] Rendering of rectangle borders with odd-numbered widths
Nigel.Hietala at nokia.com
Nigel.Hietala at nokia.com
Thu May 6 18:57:47 CEST 2010
In most of my QML apps I check the sizes of things and react. This goes out the window when you use a border that can grow outside of the Rectangle. I would rather they just grew inwards so that a 100x100 Rectangle really is that size. I cannot think of a single reason to support more than this.
- Nigel
Hi,
I agree with Kai, it would be much easier to understand the rendered result if the border just grew outwards or inwards. A suggestion (I don't know if it is feasible) is to have this configurable on each Rectangle. Something like this:
border.alignment: "centered" (eventually default)
border.alignment: "grow_inwards"
border.alignment: "grow_outwards"
Regards,
Stefan
From: <kai.koehne at nokia.com<mailto:kai.koehne at nokia.com>>
To: <bea.lam at nokia.com<mailto:bea.lam at nokia.com>>, <qt-qml at trolltech.com<mailto:qt-qml at trolltech.com>>
Date: 2010-05-06 11:07
Subject: Re: [Qt-qml] Rendering of rectangle borders with odd-numbered widths
Sent by: qt-qml-bounces at trolltech.com<mailto:qt-qml-bounces at trolltech.com>
________________________________
Hi,
qt-qml-bounces at trolltech.com<mailto:qt-qml-bounces at trolltech.com> wrote:
> Currently if a Rectangle has an odd-numbered width, part of
> the bottom and right-hand borders are rendered outside the
> rectangle's boundaries, not inside. This is consistent with
> Qt's border rendering, as documented at
> http://doc.qt.nokia.com/4.7-snapshot/qrectf.html (under "Rendering").
I'm still wondering what the reasoning behind this is ... Rendering the border both inside and outside the item boundaries seems to me to just combine the disadvantages of rendering it completely inside (item content is hidden) and outside (render area outside of area specified by x, y, with, height). Anyway, I guess it's not an option to change this in the foreseeable future.
> This behaviour means that if a Rectangle is drawn inside
> another Rectangle that has clipping enabled, the inner
> Rectangle's borders are clipped on the bottom and right-hand
> sides. If the border width is 1, you will only see the top
> and left borders of the inner Rectangle.
>
> This can be easily fixed with the attached patch, but
> obviously it would change the appearance of existing apps.
> For example if a ListView delegate renders bordered Rectangle
> elements for each item like this:
If I got the patch right it's just fixing the (arguably most common) case of a one pixel sized border ... Can't the ListView just use the delegates boundingRect() (which is AFAIK also including the border) for calculating the size of an item?
Regards
Kai
--
Kai K?hne
Software Engineer
Nokia, Qt Development Frameworks
Nokia gate5 GmbH
Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443B
Umsatzsteueridentifikationsnummer: DE 812 845 193
Gesch?ftsf?hrer: Dr. Michael Halbherr, Karim T?htivuori
_______________________________________________
Qt-qml mailing list
Qt-qml at trolltech.com<mailto:Qt-qml at trolltech.com>
http://lists.trolltech.com/mailman/listinfo/qt-qml
<ATT00001..txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100506/d2401077/attachment.html
More information about the Qt-qml
mailing list