Commit Graph

26937 Commits

Author SHA1 Message Date
Marc Mutz
afc7da09ec QRegion: add move ctor
After this change, this was the distribution of calls in
QtGui and QtWidgets when the patch was developed for 5.4:

      QtGui  QtWidgets
move  23     63
copy  23     36

Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-13 18:18:32 +00:00
Andre Somers
0df5c366e5 Use QFlags::setFlag where prudent in qtbase
QFlags::setFlag is most useful to replace explicit constructs like

if (condition) {
   someFlags |= TheConditionFlag;
} else {
   someFlags &= ~TheConditionFlag;
}

with

someFlags.setFlag(TheConditionFlag, condition);

Change-Id: Ie4586681c83e0af812d5bbf14965aad51941a960
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-12 19:32:05 +00:00
Paolo Angelelli
c5d4972577 Fix for deferredDelete() bug when calling the glib loop directly
This patch makes sure that all events posted using Qt on top of the
GLib event loop have the loopLevel counter incremented.
This is done since Qt depends on the fact that all deleteLater() calls
are issued within the scope of some signal handler (in other words,
triggered by the chain sendEvent() -> notifyInternal2()).
There is a side effect though: in the conditions affected by this
patch, that is deleteLater()s issued within a glib event handler for
example, manually calling processEvents() or sendPostedEvents() with
or without the QEvent::DeferredDelete flag has the same effect, and
deferred deleted events are always processed.
While this is not a currently working feature which the patch breaks,
this side effect seems to be difficult to avoid without separating
sendPostedEvents() and processEvents() into a public and a private
method, in order to detect when they are manually called.
Such change could perhaps be done for Qt6.
An autotest for QTBUG-36434 is also included.
Autotesting for QTBUG-32859 seems to be more challenging in this
respect, due to its dependency on GLib.

Task-number: QTBUG-18434
Task-number: QTBUG-32859
Task-number: QTBUG-36434
Change-Id: Ib89175aa27c9e38bca68ae254d182b2cd21cf7e9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-12 19:06:11 +00:00
Tor Arne Vestbø
9daeb6fe9d Generalize iOS simulator and device exclusive build
Preparation for Apple tvOS support, which shares a lot with the iOS
platform.

Change-Id: I543d936b9973a60139889da2a3d4948914e9c2b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-12 18:43:31 +00:00
Marc Mutz
7f48655fb8 QTextFrame::iterator: restore nothrow move special members
The user-defined copy assignment and copy constructors
inhibit the move special member functions.

We cannot do something about it in Qt 5, because the
class is exported (which it shouldn't be), and because
making it trivially-copyable might change how it is
passed to functions by value, so we need to supply all
the missing member functions manually.

Change-Id: Ic710b449f6abd386449fa6df71e8bc9bd0f98d2b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-12 18:29:54 +00:00
Marc Mutz
6ffb0bdf60 QXmlStream*: make nothrow move assignable and -constructible
Unfortunately, we cannot rely on Q_DECL_EQ_DEFAULT, so I
needed to code the special member functions by hand.

The 'reserved' field is pretty useless, since the
existing ctors didn't initialize it, but just in
case someone finds a way how to store information
in there, deal with the field in the usual way:
set to nullptr in the move ctor and swap in the
move assignment operator.

Also schedule all this for removal again come Qt 6
(then without the reserved field).

This amends a83be780ae,
which only dealt with QXmlStreamAttribute.

Change-Id: I6898e5d0423c9519f7c07d23e2c6d2700508151e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-12 18:29:50 +00:00
Marc Mutz
d06b4ca9a1 QBitmap: restore nothrow move special members
The user-defined dtor inhibits the move special member
functions.

We cannot do something about it in Qt 5, because the
class is exported (which it shouldn't be), and because
it's polymorphic (which it also shouldn't be), so we
need to supply all the missing member functions manually.

Add a note to remove the inheritance from QPixmap in Qt 6.

Change-Id: I86a1a3fe7b84247b3e604cb008aa17bb673c8468
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-12 18:29:46 +00:00
Timur Pocheptsov
22d075fef0 Cocoa integration - suppress excessive dragginUpdated messages
Our abstract item views are using a timer before starting autoscroll.
Constant dragginUpdated (re)starts this timer again and again and it
actually never times out (== no autoscroll). It looks like  a bug in Cocoa since 10.11,
they test: respondsToSelector:@selector(wantsPeriodicDraggingUpdated:) with
':' at the end, though they need a method without parameters; as a result
QTBUG-32761 was re-introduced.

Let's make them happy and respond to this selector also (never gets called
actually).

Change-Id: I3b7bb0a455124f84c97fc350f69486bf0fc5d5fc
Task-number: QTBUG-32761
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-02-12 16:46:48 +00:00
Anton Kudryavtsev
94f5ed11a1 QStringListModel: optimize container usage.
- don't call QList::removeAt() in loop. Just call erase() with two iterators.
- don't re-evaluate QList::count() because of result is already cached.

Change-Id: I4b3596df4a388f1d39b523c27decad612044cec6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-12 14:15:10 +00:00
J-P Nurmi
5be4f95d95 Fix QFileSelectorPrivate::addStatics()
It must clear the previously cached sharedData->staticSelectors,
or else QFileSelectorPrivate::updateSelectors() does nothing and
the newly added static selectors end up being ignored.

Change-Id: If6997664629199be9f00de64c5dd01de2bf0a044
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-02-12 14:10:29 +00:00
Marc Mutz
10742cf894 QtGui: eradicate Q_FOREACH loops [const-& returns]
... by replacing them with C++11 range-for loops.

The function QObject::children() returns by const-reference,
so they can be passed to range-for without further changes.

Change-Id: I8cd2921165c45020914dd3a23b1f18b519fe7900
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 23:18:44 +00:00
Marc Mutz
37a933c2b1 QtGui: eradicate Q_FOREACH loops [needing qAsConst()]
... by replacing them with C++11 range-for loops.
To avoid detaches of these mutable Qt containers,
wrap the container in qAsConst().

Change-Id: I90fd517ad542ef92034403c15ebb8300a56ac693
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-02-11 23:18:39 +00:00
Marc Mutz
d09cfe04b8 QtGui: eradicate Q_FOREACH loops [already const]
(or trivially marked const) ... by replacing them
with C++11 range-for loops.

Change-Id: I3cce92b9d77a3ff96fad877d1d989145e530646f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 23:18:35 +00:00
Marc Mutz
257cc69bed Optimize string building in QImage::text()
- Don't iterate over QMap::keys(), but directly
  over the map, saving a temporary QList and
  double lookups.
- Always append the item separator, and chop
  it off once at the end, which allows to
  fold the separator into the existing string
  builder expression.

Change-Id: Ibd20ea292695098e0fc575025b1827a75aabfd1e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:26:11 +00:00
Marc Mutz
4bc923b628 QMatrix, QTransform: restore nothrow move special members
The user-defined copy assignment and (on QMatrix) copy
constructors inhibit the move special member functions.

We cannot do something about it in Qt 5, because these
classes are exported (which they shouldn't be), and
because making them trivially copyable might change
how they are passed to functions by value, so we need
to supply all the missing member functions manually.

Change-Id: I59e480d7ba02cac7e3d654cb3345f541e0701f4c
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:26:05 +00:00
Sérgio Martins
d55b685d23 Suppress memory allocation due to temporary container
Change-Id: I337c3f7ed63444ac0950a30298eb619f462b7a16
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-11 19:26:01 +00:00
Marc Mutz
588338b65b QtGui: replace a Q_FOREACH loop with qDeleteAll()
Change-Id: Ibb26338809ffccc3a736a7c53ac4f5877cac34a8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:25:55 +00:00
Marc Mutz
02204239a0 QtGui: replace a Q_FOREACH loop with QList::op+=
Change-Id: I071705d6fdb4cec5bc357bda034c249b400147a9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:25:51 +00:00
Marc Mutz
bcd7d223f0 QtGui: eradicate Q_FOREACH loops [rvalues]
... by replacing them with C++11 range-for loops.

This is the simplest of the patch series: Q_FOREACH took a
copy, so we do, too. Except we don't, since we're just
catching the return value that comes out of the function
(RVO). We can't feed the rvalues into range-for, because
they are non-const and would thus detach.

Change-Id: I457942159015ff153bdfc6d5f031a3f0a0f6e9ac
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:25:47 +00:00
Marc Mutz
276d6cf239 QImage: split strings with splitRef() in convertWithPalette()
Optimize the string splitting by using splitRef(),
avoiding the creation of lots of substrings. Twice.

While touching the for loop, port to C++11 range-for.

Change-Id: Ia666896bc5b96c4b6973498cc4a9eeb24cadba6d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:25:43 +00:00
Marc Mutz
3ff5251740 QtGui: eradicate Q_FOREACH loops [QVarLengthArray]
Q_FOREACH over a QVarLengthArray is a partcularly
bad idea.

Use C++11 range-for (without qAsConst(), because
QVLA isn't CoW).

Change-Id: I5ee55557577f183151d3871e4518382c4adf0237
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:25:38 +00:00
Marc Mutz
2523f62939 QPainter: replace an inefficient QList with QVector
QPainterClipInfo is larger than a void*, so holding it in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by marking it movable and holding it in a QVector instead.

Port from op<< to append() to reap rvalue push_back().

Change-Id: I3af17eca2443d26a795381635510b8b9a5795e5f
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-02-11 19:25:31 +00:00
Marc Mutz
612e082fe2 uic: replace an inefficient QList with QVector
Buddy is larger than a void*, so holding it in QLists is
needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by marking it movable, and holding it in a QVector instead.

Since QVector requires a default ctor, drop the pointless
existing ctor and use aggregate initialization instead.

Use QVector's rvalue append.

Change-Id: I696ca4f03dbe362a5438be209debbcd966fe8130
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-11 19:25:27 +00:00
Laszlo Agocs
ba08832a4e Move waylandfunctions from qtwayland to qtbase
The only place such headers can live is qtbase. Exporting headers
under QtPlatformHeaders from other modules would conflict.

Change-Id: I13d78fe54b50c5eaccc29bb166efdaafba70e6e2
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
2016-02-11 12:58:29 +00:00
Liang Qi
321658d288 Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-02-11 12:57:10 +00:00
Andreas Holzammer
7e85e7ced7 Add initial clang-cl support to Qt
This adds the functionality to build Qt with clang under Windows against
the Microsoft Visual Studio 2015 runtime.

In order to replicate this, a Clang 3.8 build with Visual Studio 2015
Update 1 is needed.

Adds compiler detection to Qt to distinguish correctly the clang compiler
and Windows with Visual Studio.

Clang has some built-in numeric functions, there is no need to use the
Microsoft versions, which also conflict here.

Task-number: QTBUG-50804
Change-Id: Ia4b267a298310ac7d73edf473b12792991249d8a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-11 12:54:06 +00:00
Liang Qi
d456f87ece Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/corelib/io/qfilesystemwatcher_win.cpp
	src/corelib/plugin/plugin.pri
	src/plugins/platforms/cocoa/qcocoaaccessibility.mm
	tests/auto/corelib/tools/qlocale/tst_qlocale.cpp

Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
2016-02-11 08:25:04 +01:00
Gabriel de Dietrich
9e8c84aa14 Add SH_ItemView_ScrollMode style hint and use it in QMacStyle
On OS X, the default scrolling mode of item views should be
per pixel instead of per item. We enforce this through a new
style hint. On all other platforms, the behavior remains the
same.

It's still possible to override the style hint by using the
regular scroll mode setters. Any subsequent style change will
result in a no-op once the setters have been called and until
the properties are reset.

Some auto-tests had to be update to to take the new behavior
into account.

[ChangeLog][QtWidgets][Styles] Added SH_ItemView_ScrollMode
style hint.

[ChangeLog][QtWidgets][Item Views] Item views scroll per pixel
on OS X now.

[ChangeLog][QtWidgets][Item Views] QAbstractItemView::verticalScrollMode
and QAbstractItemView::horizontalScrollMode are now resettable.

Change-Id: I3f923275c99aa4389323b52fc1c5455fe71f8d73
Task-number: QTBUG-50102
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-02-11 04:50:36 +00:00
Sérgio Martins
4fc070a419 QLocale: Use QVariant::toStringList() instead of template instantiation
Avoids (binary) code duplication.

Change-Id: I57a23e2f6e151963163d8073b309b3562f8e8684
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-10 20:36:05 +00:00
Sérgio Martins
2c9f6b1a18 Fix usage of QMutexLocker, destroy it only at end of scope
Change-Id: I87f2c433c987b5f7b4680639cae51cdf6ce9ddc6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-10 20:35:52 +00:00
Marc Mutz
cc2938b5b6 moc: replace inefficient QLists with QVectors
These types are larger than a void*, so holding them in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by marking them movable, and holding them in a QVector instead.

Change-Id: I42f494ed87854eadc33d78db4479203ff5e0370f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-10 16:00:46 +00:00
Friedemann Kleint
e395bda9a5 Windows accessibility: Add override declaration.
Change-Id: I982c91a9316f10a5e6d88abd60c028664ed3e28e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-02-10 12:43:59 +00:00
Friedemann Kleint
d145929fd7 Windows accessibility: Remove some cruft.
Change-Id: I5cb35bdd5441a8dd7a51193048b32a6feccba2b2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-02-10 12:43:56 +00:00
Friedemann Kleint
5cf6a8a50c QWindowsVistaStyle: Suppress animation when QLineEdit's base color is set.
Introduce utility function to check using
QWindowsXPStylePrivate::isLineEditBaseColorSet().

Task-number: QTBUG-40634
Change-Id: Iaa6962a17217352aa59d0c54421b764ad47d3bf8
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2016-02-10 12:43:45 +00:00
Friedemann Kleint
6cb462d7aa QWindowsXPStyle: Introduce utility function for QLineEdit's palette.
Introduce QWindowsXPStylePrivate::isLineEditBaseColorSet() checking
whether the base color has been set in the widget's palette taking
into account the QSpinBox special case and simplify the code
accordingly.

Task-number: QTBUG-40634
Change-Id: I0e7527031b333d71727fbd30db6dd80aa715c9ab
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2016-02-10 12:43:40 +00:00
Aleix Pol
8b4ac65e29 Provide QCss with the correct font for <pre> blocks
Labels would use a statically defined font for <pre> blocks.
Use the one defined by the QPlatformTheme instead, through
QFontDatabase::systemFont(FixedFont)

Task-number: QTBUG-50564
Change-Id: I5491bd0defce651bdf809bcbc6a529a900f4959b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-02-09 21:24:46 +00:00
Marc Mutz
3e63a58a96 Mark QHash/QMap as relocatable and movable-come-Qt 6
They were forgotten from the movable containers for Qt 5.0.
Make sure we don't forget for 6.0, either.

Until then, mark with new Q_RELOCATABLE_TYPE.

Change-Id: I279a96c02a718a1432040303bb0d001739f59a17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-09 18:19:55 +00:00
Dmitry Shachnev
488cf78e44 dbusmenu: Use proper toggle-type for items that are part of group
To achieve that, add a new virtual setHasExclusiveGroup() method to
QPlatformMenuItem class (optional because we don't want to break existing
platform themes), call it when converting QActions into platform menu items,
and use it when exporting the menu items over D-Bus.

Also, send ActionChanged event for actions when their group is changed, so
that the platform menus are updated too.

Change-Id: I8d951ace8c4097decec2a0154163e3672214effb
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-09 16:54:58 +00:00
Edward Welbourne
22c262d2d7 Readability fix for MS isRelative, isAbsolute.
The layout and phrasing of these two QFileSystemEntry methods was such
as to obscure what they actually test.  (Overlong lines, extraneous
parentheses, spurious conditions and poor line-breaking.)  Rewrote to
make both clearer; and, in particular, to make it obvious that they
are *not* mutually complementary.  Behavior is not changed.

Change-Id: If748e48d41fe3a76bab3a1f840c7b7ca62442f8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-09 16:12:12 +00:00
Maurice Kalinowski
2ddd11dde2 Cleanup testcase for platforms without QProcess support.
Change-Id: Ib56c90262605ad975772f6b26c6232020e308ca6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-09 15:45:17 +00:00
Friedemann Kleint
42f788ffe2 QWindow::setMask(): Apply High DPI scaling.
Move code from QWidget::setMask() and reimplement QWidget::setMask()
using QWindow::setMask().

Task-number: QTBUG-50938
Change-Id: I040688d6b18df91368fa6ab6392a3b4cd80f2683
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2016-02-09 15:40:56 +00:00
Friedemann Kleint
ab3e2f66e9 Standarddialogs example: Remove horizontal spacer from fullscreen layout.
It does not work as expected since the QLineEdits do not expand.
Amends b880b7e1ac.

Change-Id: I0b3b3822cca7fc6442a7155eecd46bd3d134d069
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-09 15:24:54 +00:00
Eskil Abrahamsen Blomfeldt
51f29b88da Don't force antialiasing when it is turned off
In the gray antialiasing code path for text on Windows, we
check whether Cleartype is enabled in the system and,
if it is, we forcibly enable gray antialiasing instead. But in
this logic we did not consider the case where antialiasing
is turned off entirely, i.e. when the style strategy is
QFont::NoAntialias. We should never override
no-antialias with antialias.

[ChangeLog][Windows][Text] Made it possible to disable
antialiasing for text when drawing into images.

Task-number: QTBUG-47141
Change-Id: Ieb2beba8c2d02295abe6d9a98d2e63a2d39c9e6a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-02-09 14:39:25 +00:00
Dmitry Shachnev
a4fac65938 dbustray: Support late registering of tray icon menu
If a menu is added to the tray icon after the icon itself has been registered,
we need to register the menu properly.

Change-Id: I19a6d78848142d66c2cd882746d8d55c0b9a2818
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-09 07:22:21 +00:00
Dmitry Shachnev
7ad930987d dbustray: Do not change m_menu in QDBusTrayIcon::createMenu()
This method can be called for a submenu after it's called for the top-level
menu, and we should not replace it with a submenu.

Change-Id: I8e180ee074287cfcdc76dfe77c6c7aa7d5891741
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-09 07:22:16 +00:00
Marc Mutz
b30edc5153 QKeySequence: replace an inefficient QList with QVector
QShortcutEntry is larger than a void*, so holding it in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by marking it movable, and holding it in a QVector instead.

Change-Id: I4ab3399a8036827631b7fbdfdc60b4206305e1c9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-08 22:07:53 +00:00
Marc Mutz
8a54950646 Optimize QSslSocketPrivate::isMatchingHostname()
- Lowercase 'peerName' only once instead of each
  time though the loop
- Use C++11 range-for instead of Q_FOREACH
- Use QMap::equal_range instead of values(Key),
  saving the creation of a QList.

Change-Id: I1229f62d706d1478960b08bb63ee9fb894364f87
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-08 22:06:42 +00:00
Marc Mutz
b034a14dc5 Replace some QList<int> with QVector<int>
On 64-bit platforms, QVector<int> uses only 50% of QList<int>
per-element memory.

Change-Id: I3057781e7fb58007ea2619cc91965a626d01473b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-08 19:58:01 +00:00
Marc Mutz
f049546d95 QGraphicsItemAnimationPrivate::linearValueForStep(): pass vector by const-&
It's only read from.

Avoids detach attempts in the many uses of front()/back().

Change-Id: I0fd5df77a6d3a9a37872e0ce28f5a2354aa8f957
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-08 19:57:56 +00:00
Marc Mutz
dcd79eebdb QToolBarAreaLayout: replace inefficient QLists with QVector
QToolBarAreaLayout{Item,Line} are larger than a void*, so holding
them in QLists is needlessly inefficient. Worse, the code could
come to depend on the fragile property of (inefficient) QLists
that references to elements therein never are invalidated.

Fix by marking the types primitive and movable, resp., and
holding them in QVector instead.

Change-Id: I4e68d4bee41040bf84302b8ce8295a11debded70
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-08 19:57:52 +00:00