QRegularExpression: add ways to force an immediate optimization

The fact that we kick in a pattern study and possibly a JIT compilation
after an undocumented number of usages is suboptimal, for a number
or reasons: users may want to JIT compile a pattern immediately,
and at the same time they may not want a random delay in the program
(due to the pattern getting optimized at a random usage).

So: add an optimize() call to force an immediate pattern optimization,
and a pattern option to force an optimization on the first usage.

Change-Id: I95efdecfd31f11ca7cceb9c05037df613601a11c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QRegularExpression: add an option to prevent automatic optimization

If a user doesn't like that QRegularExpression might do an
uncontrolled CPU/memory spike when it decides to optimize a pattern,
offer a way to disable the automatic optimization.

Change-Id: I38a98a3bfb239cfad9f977b0eeb75903268e747f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QRegularExpression: lock a mutex only if there's actual work to do

We can do the (atomic) test of studyData before locking the mutex
protecting the entire function body.

Change-Id: I3006e3a0028608f21668ddaebe8a799aed56362f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QRegularExpression: remove a boolean trap in private API

Small improvement to the code by using an enum instead of a boolean.

Change-Id: Ib792cf97224b5204fd36ca215387fc7be34f2c32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add QUrl::fromUserInput overload with a cwd argument.

Useful for any application that can take URLs on the command-line, so that
full paths and relative paths can also be accepted.

Change-Id: I8a2c50f36d60bdc49c065b3065972fd5d45fa12a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Include the duplicated attribute name in the error message

Task-number: QTBUG-36467
Change-Id: Ic2610bd7c8df12fce4ec2ce14bd96f4595bd38af
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>