[Uml-devel] Brush vs. Color (QGraphicsView)
Andi Fischer
andi.fischer at hispeed.ch
Wed Feb 15 22:34:29 UTC 2012
Am 15.02.2012 22:12, schrieb Bastian Holst:
> Hello again,
>
> the first thing I noticed in the QGraphicsView port of umbrello was that the
> color of new widgets is not set to the default colour. The reason for this is
> the following:
> In trunk everything works as expected, on a creation of an object, the color
> is set to the color specified in the options. WidgetBase has a property
> “fillColor” which resembles the fillColor attribute in the .xmi-file.
> In the soc-umbrello branch this was substituted with a property “brush” (of
> the type QBrush). Additionally on construction of the WidgetBase object the
> brush is set to a brush called “awesomeBrush” (with a gradient and so on),
> which definately looks better than the original yellow brush, but that's not
> the point here.
>
> Independent of what is painted afterwards I'd like the WidgetBase interface to
> resemble exactly what can be seen in the xmi-file and in the configuration file.
> Basically there are two ways of achieving this.
> 1. Changing the WidgetBase interface back to something taking a fill color
> (remember, you can still add a gradient for painting later)
> 2. Changing the xmi-file-structure and the configuration dialog so that it is
> possible to configure a brush (with a gradient and so on).
>
> At the moment I would prefer changing WidgetBase back to take a fill color, but
> I thought this topic could probably need some discussion (probably somebody
> intended way 2 as she/he changed it). My preference is mostly based on the
> fact that I have no idea what aspects of a brush the user would have to be
> configurable. In the end I think this would result in a more complicated
> configuration dialog without having much benifit.
> What do you think?
>
> Best regards
> Bastian
Hi Bastian,
Good point and well observed.
The user can set only a color and for the moment we should not change that.
(By the way, have a lock at LucidChart.com. They have a very beautiful
and powerful user interface to change a brush.)
On the other hand the API in Qt uses QBrush only. See for example QPaint.
And it is very easy to set or get the color of a QBrush.
So, this is an argument for the QBrush interface of WidgetBase.
I think, that this last point was the reason to change the interface and
to use QBrush.
Regards,
Andi
More information about the umbrello-devel
mailing list