Add a new optimization flag to QGraphicsItem.

The new flag ItemContainsChildrenInShape is similar to the existing
flag ItemClipsChildrenToShape. Setting the new flag makes QGraphicsScene
assume that children are drawn within the shape of the current item
but this is not enforced by clipping. When an application manually
ensures this clipping boundary, setting the new flag removes the
overhead of enforcing the clip with ItemClipsChildrenToShape, while
still allowing other routines to behave more optimially by assuming
children are within the shape of the current item.

[ChangeLog][QtWidgets][QGraphicsItem] Added the
ItemContainsChildrenInShape flag that enables using optimizations
of ItemClipsChildrenToShape without the overhead of enforcing the clip.

Change-Id: I5496fe1ca331b77fd51e0df8a3ace2b8e939eaf2
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
QCUPSSupport: Extract Method jobHoldToString() from setJobHold()

The new function just calculates the job-hold-until cups option argument,
reducing the number of setCupsOption() calls down to one.

Effects on a stripped Linux AMD64 GCC 4.7 c++11 release build:
  text:  -552B
  data:   +-0B
  relocs: +-0

Change-Id: I4aa4118c3493cd302dd8fd7f4985c7e0f70ef071
Reviewed-by: Martin Klapetek <mklapetek@kde.org>
Reviewed-by: John Layt <jlayt@kde.org>
QCUPSSupport: Extract Method bannerPageToString() from setBannerPages()

The new function just converts the job-sheets cups option argument,
reducing the number of almost-identical switch statements to one.

Effects on a stripped Linux AMD64 GCC 4.7 -std=c++11 -O2 build:
  text: -1008B
  data:   +-0B
  relocs: +-0

Change-Id: I56843fa963e098e5c8ae203584f34bf5798667e6
Reviewed-by: Martin Klapetek <mklapetek@kde.org>
Reviewed-by: John Layt <jlayt@kde.org>
QStringList: remove copy ctor

The compiler-generated one is just fine, and enables the move constructor
inherited from QList, too.

This is BC and SC since QStringList isn't exported.

Change-Id: Ic49000d9feb66504d7ec7e5d519e7a13ca9e5d9e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QStringList: add op<< overload for QList<QString>

QStringList << QList<QString> already compiled, but was interpreted as
QStringList << QStringList(QList<QString>), which involves the QList
copy ctor. Adding the overload saves that copy.

Cannot use a using declaration here, since the return type is different.

Change-Id: I119cc98e7e2df24549a1abb158543b729edc30ef
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
QStringList::join: micro-optimization

Don't call that->size() if we have already saved its value in a local temp.

Surprisingly, this saves 56B in text size even on a -O3 GCC build, proving
that the compiler does _not_ have enough context to const-fold the repeated
size() evaluation.

Change-Id: I2c41ddc4376f4e1534fc2f0d4789e42b984d3ba6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QStringList: use a functor instead of a function pointer for std::sort

A function pointer requires aggressive optimization to inline. A function object
otoh is inlined by compilers two decades old.

Even shaves off 544B in text size off of a -O3 GCC 4.7 QtCore build.

Change-Id: Ibfd41654257360fa0f118701f502e6c23a6c28b3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
tst_QStringList: add more checks for removeDuplicates

Check whether a detach happened, and also check that non-consecutive duplicates
are properly removed.

Change-Id: Iac7a3d8fe5ed5a69a9a0b55ddbf95308f11122c2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QStringList: use QList:.swap(int,int) in removeDuplicates instead of assignment

This is faster because it just swaps the pointers stored instead of touching
the refcounts. It's the same as qMove()ing the right-hand-side, but benefits
C++98, too.

Change-Id: I6b7e3d0e5c7eb81f88fe9069d6662335d24aa86c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>