Commit Graph

25811 Commits

Author SHA1 Message Date
Samuel Nevala
5956d8715c winrt: Make dialog and window behave similarly.
Status bar visibility can be controlled from dialog and
dialog size is screen size.

Change-Id: Ia8e932a9e1e1549a17d12532639391335760f9e0
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-12 06:43:30 +00:00
Oliver Wolff
b91389fef0 winrt: Clean up QNativeSocketEngine
WinRT/Windows Phone "coding guidelines" are now used for the native
socket engine as well.
    - Whenever an operation is expected to succeed
      Q_ASSERT_SUCCEEDED is used.
    - QWinRTFunctions::await is used for waiting for async operations
    - Improved error handling

Change-Id: I6c8d64731da5c94b911a5190231c7c8f68d9c261
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-12 06:43:27 +00:00
Frederik Gladhorn
d7e27e4d26 Fx the mysql configure test on RHEL 6.6
On RHEL 6.6, mysql_config --libs returns "-rdynamic" among other arguments.
The configure test (config.tests/unix/mysql) would end up passing that
to qmake. qmake responds with "***Unknown option -rdynamic ..."

Change-Id: Ib1300e62aec8a5d866359f3eaea88d9648c872b9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-11-11 13:47:43 +00:00
Nico Vertriest
51b19c0d86 Doc: Added more details to QIODevice::readAll()
Task-number: QTBUG-43666
Change-Id: Ibe56a72f9fa7a31a320aceda645fde9b08645271
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-11-09 09:33:59 +00:00
Richard Moe Gustavsen
abf47610c7 iOS: only force-finish start-up from file engine when on main thread
The authorization dialog that grants the application access to the
assets will only show after returning back from
applicationDidFinishLaunching. Therefore, trying to load an asset from
main before qApp->exec() would normally fail. To remedy that, we added
a path that starts a QEventLoop for a split second to force the
application init process to finish. But this can only work if we
start it from the main thread.

A bug with this is seen in QML FileDialog, since it (clumsy enough)
starts to iterate, in a separate thread, all the files in its currently
set directory upon start-up construction (which should be fixed as
well). The result is that the application gets dead-locked on start-up.

Change-Id: I0047272d53314752903960b33f88b33dc0d7e78d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-11-09 08:50:36 +00:00
Edward Welbourne
acb9db32b2 Add spring-forward test
Test that stepping into the missing hour lands us somewhere sane.
Check that raw instance and product of .toLocalTime() agree.

Task-number: QTBUG-49008
Change-Id: I430382ae223bcb43b151d2d6054ecbdd7edc8a47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-11-09 08:41:25 +00:00
Richard Moe Gustavsen
4a2b9e086e Xcode generator: only replace the suffix in the library path
The Xcode generator iterates trought all libraries and replaces
their suffix (e.g "_debug") with a placeholder that lets Xcode
switch between different library versions depending on the target.

The current way we do this fails when the name of a library happens
to contain the string "_debug" (e.g "qmldbg_debugger"). Since we
replace every occurrence of suffix in the path, we end up
replacing that part as well. The result will be linking errors.

This patch ensures that we only replace the last occurrence of the
suffix in the file path.

Task-number: QTBUG-48961
Change-Id: I9fafbe0ea0ad8b9cfd13448d6b28801106e645ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-11-09 08:35:04 +00:00
Maurice Kalinowski
566399937b winrt: Fix filedialog show on Windows 10
The file picker must be used inside the Xaml thread, otherwise execution
will fail without giving any warning or error.

Task-number: QTBUG-48389
Change-Id: I917e88e95993da04be3d7cd34344ffd68ee71cdd
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-09 08:24:07 +00:00
Oliver Wolff
702a98bfb0 winrt: Also list current profile in QNetworkInterface::allInterfaces
GetConnectionProfiles does not list the current profile, so
"allInterfaces" also has to use GetInternetConnectionProfile.

Task-number: QTBUG-49121
Change-Id: I80a3ea1bfddfe502c84376ca90a7e1fe5d3020c3
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-09 08:24:04 +00:00
Oliver Wolff
20208225ee winrt: Enable generic bearer management plugin
Task-number: QTBUG-48738
Change-Id: Ic3698ca1e95aa90083295bf7c41a5f4f66b36f1d
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-09 08:23:58 +00:00
Alex Trotsenko
9ffbc139d1 QNativeSocketEngine: fix build in debug mode under Unix
Change-Id: I197e4853cd3ddd7543bbdb12cecc19c0ed2c9ee2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-11-09 05:58:23 +00:00
Adam Strzelecki
9daef8a54c QComboBox: Disable wheel events on OS X & iOS
This is follow-up for QTabBar fix ea47d152b3.

In native OS X applications using mouse wheel on combo boxes have absolutely no
effect. We should bring the same behavior to Qt based OS X apps too, as users
are complaining of unexpected behavior, eg. randomly switching Qt Creator
sidebar mode when scrolling file list and moving mouse pointer little bit
above. Moreover inertial mouse behavior on OS X makes combo box usually move
several indexes, rather than single one on slight finger slide.

This also applies to iOS apps so the change affects all Apple platforms.

Task-number: QTBUG-10707
Change-Id: I6582265039198707ad8c2f54de96ee2a0b0e0b47
Reviewed-by: Adam Strzelecki <ono@java.pl>
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-09 03:51:32 +00:00
Lorn Potter
e996d68f61 Make UnknownAccessibility not block requests
This allows requests to proceed without needing bearer plugins.

Task-number: QTBUG-49267
Change-Id: Ie5ce188ddefebd14d666bb5846e8f93ee2925ed1
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2015-11-06 19:52:38 +00:00
Andy Shaw
bf517c22f6 Fix tst_QPrinter::doubleSidedPrinting() test and remove from blacklist
Change-Id: If96471ed3324795086c5ff951d9332a0e82870ea
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-11-06 18:44:04 +00:00
Friedemann Kleint
7a42c8c15c Testlib: Replace linked lists in QTestTablePrivate by std::vector.
This speeds up tests/auto/corelib/tools/qchar which spends a lot
of time in QTestTablePrivate::elementAt(), QTestTablePrivate::dataAt()
from 6s to 500ms on an average Linux machine.

Task-number: QTBUG-38890
Change-Id: I16b75819f88ca7974a581affd8409f7b4038a712
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-11-06 18:24:24 +00:00
Allan Sandfeld Jensen
9f66b1dd71 Set private inline QRgba64 methods always inline
By setting them always inline we ensure they will never generate symbols.

Change-Id: I2c815c4fe2cb498187656e0b25ef4499258885ff
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-06 16:59:04 +00:00
Friedemann Kleint
73b7096822 Fix build of PostgreSQL plugin with -Werror on Windows/64bit.
Fix MSVC warning:
sql\drivers\psql\qsql_psql.cpp(452): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data

Change-Id: I44a902a9169efa568dcd82bdc08c5b97e661d65a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-11-06 16:48:17 +00:00
Oswald Buddenhagen
a9fba41463 unbreak tool invocation in prefix builds again
the statement order was wrong since c23a086e - we can't use
MODULE_DEPENDS before we define it.

but actually use a bigger cannon and partially revert the patch, to
include .depends unconditionally again. the idea is that this should
override a possibly included other .pri file from a previous
build/install. (the same argument would sort of apply to .envvars as
well, but we assume that its presence won't vary between builds.)

Change-Id: I95e9743e367a3d1f45d603d1bb5b31c4875f39a2
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-11-06 12:35:16 +00:00
Robin Burchell
df757a2e62 generate_expected_output: Open the file as binary.
Otherwise write() for my python (OS X 2.7) wants strings, which is incorrect.

Change-Id: Ibd9d050646d1039ba8370d121dd25756ceffdb7a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-11-06 11:40:24 +00:00
Robin Burchell
9626baaea9 Fix QCOMPARE with enum classes.
As these are strongly typed, they won't implicitly convert to int, so make sure
to cast explicitly.

Change-Id: Ic8daa31c528bbd8f399ab401d0963e13db191312
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-11-06 11:40:15 +00:00
Edward Welbourne
e9b051f0ca Fix false claim in comment.
Given that % and / have a defined consistency relation, neither is any
better defined for -ve operands than the other.  The code is in fact
avoiding using -ve operands, not preferring "well-defined" / over
(allegedly less so) %, as it claimed.

Change-Id: I666690872f078c0f21f9af7a227c2bbf291704e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-11-06 08:49:45 +00:00
Konstantin Ritt
cd0a125123 Minor optimization to QWidgetPrivate::naturalWidgetFont()
When inheritedMask is 0, the font inherits just everything; in this case
`inheritedFont.resolve(baseFont)` could be replaced with `baseFont`.

Change-Id: Ic3ed8ef174493544ada32037e7bdded46eb4bd43
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-11-05 20:53:33 +00:00
Friedemann Kleint
0d14cdd30e QWindowsEGLContext: Fix overly specific EGL include path.
Allow for using other EGL implementations besides ANGLE.

Change-Id: I64ceca477912150425e4a9328001cc911bd351bf
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-11-05 18:56:11 +00:00
Thiago Macieira
110a8c339f Remove qatomic_mips.h: the 3-operand testAndSet is broken
The "previous" value is always 1 when the compare-and-swap succeeded,
instead of the previous value.

Instead of fixing this, let's just remove this file a bit earlier than
the rest. All of them will be removed in Qt 5.7 anyway, so let's leave
MIPS atomics to the compiler.

Task-number: QTBUG-49168
Change-Id: Idba8c29717f34c70a58fffff14133304595165f5
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
2015-11-05 16:54:16 +00:00
Marc Mutz
491ccf3b85 Mark qt_from_latin1() as nothrow
It's used from a different TU, too, so we can't rely on the
compiler to inspect it to draw this conclusion itself.

This function has technically not a wide contract, because
the output buffer needs to be large enough to hold the result.
However, this precondition cannot be checked from within the
function, therefore no assertion can ever be added and the
nothrow marker becomes acceptable (even desireable).

Change-Id: I2dc6c4f3d9d8147c6483865c5c4bbc8e9af291b7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-11-05 14:38:05 +00:00
Marc Mutz
4d76352ae0 QUtf8: remove an unused variable
'need' was never anything but zero, so drop it.

Change-Id: I4b52107afc7ed47c19ae1942cef0c92cbd0e1a36
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-11-05 13:57:40 +00:00
Friedemann Kleint
d482a92858 Polish the HTTP example.
- Remove unneeded member variables.
- Use new connection syntax.
- Streamline code.
- Add a QCheckBox for launching the file after download
  and make the default file name and download directory configureable.
- Make status messages more verbose.
- Set Password echo mode on authentication dialog.
- Extract the progress dialog to a separate class
  that is directly connected to the QNetworkReply, which
  is created on demand. Set set minimum  and duration on it.
  This fixes a crash that currently occurs when clicking "Abort"
  on the SSL error dialog and "Cancel" on the progress dialog that is
  then re-shown due to its internal force timer/minimum duration handling.
- Resize according to screen size.

Task-number: QTBUG-48332
Change-Id: Ia2611e63fe96d6f49e4cdd06049a206ddb2c2864
Reviewed-by: David Faure <david.faure@kdab.com>
2015-11-05 13:54:13 +00:00
Friedemann Kleint
f13d8163ec tst_qdatetime: Fix compiler warning about uninitialized variable.
warning: 'typemsg1' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: Ie68d279eccb003a2ca5a0116eea336cbc8776660
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-11-05 13:53:59 +00:00
Friedemann Kleint
3c50f459c6 QMessageBox test: Refactor closing dialogs.
Introduce class ExecCloseHelper which runs a timer
timer checking for the test candidate to become
the active modal window and closing it either
by key event or calling close.

The test then runs in 4s as opposed to 45s before.

Task-number: QTBUG-38890
Change-Id: I610fb09e6b8269d218cddc8d11abae2bd3317f9d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-11-05 13:53:50 +00:00
Ulf Hermann
7aba75ffc5 Don't let closed http sockets pass as valid connections
A QAbstractSocket can be close()'d at any time, independently of its
current connection state. being closed means that we cannot use it to
read or write data, but internally it might still have some data to
send or receive, for example to an http server. We can even get a
connected() signal after close()'ing the socket.

We need to catch this condition and mark any pending data not yet
written to the socket for resending.

(cherry picked from commit 0df5d07929)
Task-number: QTBUG-48326
Change-Id: I67d9ad36f7288c9c6bef51aa6253d7b187737601
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2015-11-05 08:40:57 +00:00
Jędrzej Nowacki
d8f41bdc2e Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2015-11-05 08:27:56 +00:00
Konstantin Ritt
56c1755c3d Re-generate Unicode data tables
Change-Id: I53fb254709764e56e9889531655fe6046f15b251
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-11-05 08:25:06 +00:00
Konstantin Ritt
0e1f3aab11 Update Unicode data & algorithms up to v8.0
* Georgian lari currency symbol
* A large collection of CJK unified ideographs
* Emoji symbols and symbol modifiers
* Letters to support the Ik language in Uganda, Kulango in
  the Côte d’Ivoire, and other languages of Africa
* A set of lowercase Cherokee syllables, forming case pairs
  with the existing Cherokee characters
* The Ahom script for support of the Tai Ahom language in India
* Arabic letters to support Arwi—the Tamil language written in the Arabic script

For more details, see http://www.unicode.org/versions/Unicode8.0.0/

[ChangeLog][QtCore] Unicode data updated to v.8.0

Change-Id: If255f95c9c45655b721369a116299da3cabbba0a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-11-05 08:25:02 +00:00
Konstantin Ritt
a98b541f26 Update Unicode data files to v8.0
Change-Id: I0aa368cb07353924031a9af4f0bdc33692eb1053
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-11-05 08:24:58 +00:00
Marc Mutz
c69f75426d QStyleOption*V<N>: mark as \obsolete
Change-Id: I6e4857bcfa7792bec4d38f6c65bfec15a52b4d30
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-11-05 05:39:10 +00:00
Marc Mutz
c78fec01f8 [docs] QStyle: remove remaining references to QStyleOption*V<N>
They are all obsolete since Qt 5.0.

Change-Id: Ief9111057137c3bd091630430a23681095b73510
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-05 05:39:03 +00:00
Joni Poikelin
d894cfa863 Fix QImage::setDotsPerMeterX/Y for images with some orientations
Rotation of images with orientation of 90 and 270 degrees dropped DPM
values from rotated image.

Task-number: QTBUG-49220
Change-Id: I9c23153c49dd63b5f6958fdde72f466873b0a407
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-11-05 05:33:37 +00:00
Andy Nichols
40ace7af59 RaspberryPi: Enable building with OpenVG support
Change-Id: Ib803e1d98b5d81d142b20d18e92d88942b9c4af5
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-11-04 23:27:18 +00:00
Andy Nichols
16a9c0feb8 RaspberryPi2: Support building Qt for Raspbian/Debian
Raspbian/Debian require a toolchain with the multiarch patches so we
need to add deb-multi-arch to the DISTRO_OPTS variable for pkgconfig to
work correctly.  The Raspberry Pi 1 mkspec has this already and can be
used to build Qt for both versions of the Pi, but the Raspberry Pi 2
mkspec is missing this, and would not be usable in its current state for
building for Raspbian/Debian which is the most popular distro for the
Raspberry Pi.

Change-Id: I6a7a08059f9f91da524b5f51e0697115ef684f30
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-11-04 23:25:44 +00:00
Jake Petroules
f7f55c0b29 Add Objective-C specific type converters to QUuid.
This patch adds the Objective-C NSUUID/CFUUIDRef converters to QUuid

[ChangeLog][QtCore][Objective-C] Added NSUUID/CFUUIDRef converters for
QUuid

Change-Id: Ifebf6fd5ce9f46dcdc06f221e189cb1fd9079e18
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-04 21:23:06 +00:00
Timur Pocheptsov
9cb92d106d Cocoa integration - do not send move events while in -draggingUpdated:
Looks like it's not a good idea to send constant 'fake' mouse move events while
mouse is actually moving (mouseDragged/rightMouseDragged) + we're receiving
-dragginUpdated:.

Change-Id: Ibed5def3d8f06b764dea6c2cd196e37ca19ce967
Task-number: QTBUG-49204
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
2015-11-04 20:12:53 +00:00
Liang Qi
4159ee8405 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	config.tests/unix/ptrsize.test
	configure
	src/corelib/global/qnamespace.h
	src/network/socket/qabstractsocket.cpp
	tests/auto/other/networkselftest/networkselftest.pro

Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
2015-11-04 20:18:14 +01:00
Ulf Hermann
59dbf1786f QLocale: Return overflowing numbers from asciiToDouble()
The behavior from before libdouble-conversion is that in case of an
overflow the OK flag is set to false, but the returned number is still
infinity, rather than 0. Also, the number of processed characters is
always set to the number of characters actually processed, unless
garbage is found.

There is an important distinction between an overflow and garbage. The
client code may accept overflows and infinity may be a valid result.
Garbage is most certainly not acceptable. Having an infinity/false result
in addition to 0/false allows the client code to distinguish those.

One application where this is useful is parsing JavaScript.

Change-Id: I4b8581568144b44fca3353c4bd9685c702762af9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-11-04 17:32:12 +00:00
Marc Mutz
c8c39ecc37 QWindows*Style: remove use of obsolete QStyleOption*V<N>
They are obsolete since Qt 5.0.

Change-Id: I59f8b30ec877c5124922ab12ef38fbe33a1ae6b8
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-04 14:17:41 +00:00
Marc Mutz
01284f3886 [docs] QVector: don't scare people away from reserve()
reserve() is a good thing, and key to getting top performance out
of any data structure that provides them, yet the existing docs
scared people away by claiming that "you will rarely ever need to
call this function".

Change-Id: I88e30d96960443c0ed759a79c6fa9ee6af0d1e07
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-11-04 14:17:33 +00:00
Marc Mutz
18bd4453ce QMacStyle: remove use of obsolete QStyleOption*V<N>
They are obsolete since Qt 5.0.

Change-Id: If62187e39bf18dcd6d019ae4bca58c54c6a241ca
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-04 14:17:20 +00:00
Marc Mutz
765362db78 QtWidgets: remove use of obsolete QStyleOption*V<N>
They are obsolete since Qt 5.0.

Change-Id: I3a1ee314126bd245a3c788ac7af49905ab50945f
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-11-04 14:17:14 +00:00
Marc Mutz
5c57c66d98 QtConcurrent: Use Q_NULLPTR instead of 0 in all public headers
This is in preparation of adding -Wzero-as-null-pointer-constant (or similar)
to the headers check.

Since QtConcurrent is basically all-templates, not all uses of 0 as nullptr
might have been detected by the headersclean check.

Task-number: QTBUG-45291
Change-Id: Iffcabdbab26b56597700346cd039d0c32c4fddca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-11-04 14:17:08 +00:00
Marc Mutz
a926f675be QCalendarWidget: replace a QVector by std::vector
This allows to drop the default ctor and isNull() method of
SectionToken again, and reduces text size on optimized
AMD64 / GCC builds by a further 456 bytes.

Change-Id: I7109c9a138dcc27c478c0827d6216a043f592992
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-11-04 14:14:50 +00:00
Marc Mutz
9a07ab9234 QCalendarWidget: replace a QMap<Qt::DayOfWeek,.> with a static assoc array
Since Qt::DayOfWeek has such a limited range, it doesn't really make sense
to use it as a key in a QMap, which is optimized for much larger key spaces.

Replace by a C array of the value type, and, since the value type in question
(QTextCharFormat) doesn't have an invalid state, use a bool array to track
whether any of the seven possible keys has been inserted.

Wrap that in a small helper class which provides only the subset of QMap API
that QCalendarModel needs.

Saves 1352 bytes of text size on optimized GCC AMD64 builds.

Change-Id: Ie51390825d5933739659c4ea8e8da0af68577a9d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-11-04 14:14:49 +00:00