[Development] Proposal: Make QPen non-cosmetic by default

Samuel Rødal samuel.rodal at digia.com
Mon Oct 15 21:07:52 CEST 2012


On 10/15/2012 08:30 PM, Uwe Rathmann wrote:
> On Mon, 15 Oct 2012 07:32:52 +0000, Knoll Lars wrote:
>
>> to make it really logical would probably also require to
>> make 0 width pens invisible
>
> You are hitting the point: obviously setting a pen width of 0 enables a
> special mode and doesn't really set a pen width:
>
> - disabling the hardware accelerated path ( on systems that have one )
> - making the pen cosmetic
> - ... ?
>
> In opposite to Samuel I see this hardware accelerated mode as important -
> even so important that it should stay the default mode. And when this
> mode only works for cosmetic pens ( ? ) I strongly argue for not changing
> the default setting.

The point about hardware acceleration is a bit moot at the moment since 
Qt 5 doesn't include an X11 paint engine. In any case, instead of having 
the "0" value magically be rendered differently from a 1-width pen it 
would probably be nicer to have that as a RenderHint if we should at 
some point re-introduce an X11 paint engine in the 5.x series. 
Alternatively, always use the fastest available line rendering for 
1-width cosmetic pens.

> IMO a clean API should offer all attributes explicitly - not hidden
> behind an invalid width of a pen. So after reading Samuels explanations I
> would see the proposal of Jens as an improvement for the API - but not
> enough to clean up the API.

Right :)

> So when you really want to introduce an incompatibility like this now,
> please clean up the "pen width 0" API completely.

Indeed, the idea would be that 0-width pens get treated the same as pens 
with style Qt::NoPen.

--
Samue



More information about the Development mailing list