[Development] QRegularExpression -- first round of API review

Oswald Buddenhagen oswald.buddenhagen at nokia.com
Fri Dec 16 12:23:06 CET 2011


On Fri, Dec 16, 2011 at 12:07:26AM +0000, ext Giuseppe D'Angelo wrote:
> On 15 December 2011 19:45, Oswald Buddenhagen <oswald.buddenhagen at nokia.com> wrote:
> >>     void setPatternOptions(PatternOptions options, bool on = true);
> >>
> > i don't like that too much, because *un*setting options en masse sucks -
> > you need to make a "block" of options to set, and a "block" of options
> > to delete.
> I copied the setXXX(flags, bool on = true) from
> QPainter::setRenderHints, I was quite sure it's also used somewhere
> else. So are you suggesting a simple setPatternOptions(options) that
> simply sets (as in *assigns*) the argument as the current option set?
> 
that's not what i meant. the problem with straight setters is that they
are not very forward-compatible: if something else sets some flags we
don't know about yet, we'll inadvertently reset them. therefore, you
need some api to un-/set flags selectively, either with a bool parameter
of a whole mask.
but then, this is not relevant for a regular expression matcher, so i
agree with andreS and thiago that it should be a simple setter.

regards



More information about the Development mailing list