Commit Graph

23504 Commits

Author SHA1 Message Date
David Faure
ae8406d82f Deprecate ItemIsTristate in favor of ItemIsAutoTristate.
This makes the behavior much more clear. You can get a tristate checkbox
just by setting the CheckStateRole to PartiallyChecked, no tristate flag needed.

The flag, on the other hand, enables the automatic-tristate behavior in
QTreeViews (and only there), hence the new name for it.

Change-Id: I18d292a8b8294c863eab806f3874d15dfb72556c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-05-07 09:14:18 +00:00
Marc Mutz
87155a8d65 Add qHash(QRegExp) and qHash(QRegularExpression)
QReg*Exp*s can be compared for equality,
so qHash should be overloaded, too.

There was a (poor) private implementation of qHash(QRegExpEngineKey)
already, which has now been replaced with a better one (the old one
didn't take into account all the fields that make up equality,
producing unnecessary collisions).

[ChangeLog][QtCore][QRegExp] Added qHash(QRegExp).
[ChangeLog][QtCore][QRegularExpression] Added qHash(QRegularExpression).

Change-Id: I1d22fbcc0508018a3f94b4c24571b13ba6e07df2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-05-05 13:59:31 +00:00
Tobias Koenig
85d9403a12 Haiku: Enable FreeType2/FontConfig support
Pass the correct include path to the config test, otherwise compilation
will fail.

Change-Id: I6723cad41ec289b051dcc9c47b3b1d67af7c5879
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-05-04 14:52:00 +00:00
Tobias Koenig
8a51ca0918 Haiku: Fix compilation after QPA API change
Remove the calls to QWindowSystemInterface::setSynchronousWindowsSystemEvents
in the Haiku QPA plugin, because the method was renamed in latest QPA API and
we do not really have to call them anyway (was a copy&paste leftover from QNX QPA).

Change-Id: I67db43e89c093e5679f11d967d609846008cad0d
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-05-04 14:19:35 +00:00
Simon Hausmann
862cceb6d2 Merge "Merge remote-tracking branch 'origin/5.5' into HEAD" into refs/staging/dev 2015-05-04 13:58:47 +00:00
Valery Kotov
a5890fbcd8 qnetworkreplyfileimpl: set attributes if file was sent
Set status code and status text if file was sent with reply.

Change-Id: Ie6acadc5c1d06538449262ffd8486e8de573b931
Task-number: QTBUG-45581
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-05-04 11:20:40 +00:00
Simon Hausmann
7f8719e663 Merge remote-tracking branch 'origin/5.5' into HEAD
Change-Id: I487a4b7c05687a10c498ac219c31367d4db6fbc0
2015-05-04 13:19:31 +02:00
Thiago Macieira
eb82959d66 Fix undefined behavior in left-shifting into negative
It's undefined behavior to left or right-shift a signed integer such
that the sign changes. Since SymbolCsbBit is 31, make sure we use
unsigned numbers.

Found by ICC
qplatformfontdatabase.cpp(614): error #68: integer conversion resulted in a change of sign

Change-Id: Idf715b895bac4d56b4afffff13da78d294b1248e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-05-04 06:00:39 +00:00
Jake Petroules
af851c290b Use macros for the OS X enums in QSysInfo::MacVersion.
This is consistent with how the iOS enums are defined.

Change-Id: I3a07be1bf1d70bddb8bcfea61f09f2a97bd39077
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-05-03 01:52:15 +00:00
Jake Petroules
ca1077ce4b Update for the newest Darwin-family operating systems.
Change-Id: I72ba0554eb9e1201ce3844d6420f253c51750de3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-05-03 01:52:03 +00:00
Laszlo Agocs
9ae7e33f28 Use stdint.h in qopengl headers on MSVC too
Task-number: QTBUG-45774
Change-Id: I1505b4ebeb99371ec2099657c9ce05418dd54224
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-05-02 11:38:32 +00:00
Giuseppe D'Angelo
36919ef1bd QRegularExpression: add error strings from PCRE 8.37
Change-Id: Id62abd91c1584e4e63b95afec0520995125fe807
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-01 11:01:10 +00:00
Giuseppe D'Angelo
70b085c465 QSortFilterProxyModel: improve formal argument naming for lessThan
Make it clear (just like the other methods) that the indexes refer
to the source model, not the proxy model. There was already a note
in the documentation, but it was at the end of it; instead, change
the formal arguments names.

Change-Id: Ia9592f2b080ff276a62de1713a9623e0f3a50cf6
Reviewed-by: Tobias Koenig
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2015-05-01 09:12:19 +00:00
Konstantin Ritt
985e7d8094 [QTextStream::read.*] Return earlier when nothing has been read
There is no any sense in detecting the encoding of an empty string ;)

Change-Id: I1c7af07bd7c3e7e7cf67421a2cb3a1123ca57650
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-05-01 08:49:11 +00:00
Friedemann Kleint
315b359bc1 QFileDialog: Stabilize tests.
The init()/cleanup() code in tst_qfiledialog and tst_qfiledialog2
currently differs and fails to clean up the settings file
since it only removes the legacy settings under the Qt group
and instantiates a new QFileDialog while the QSettings class
is still in scope. Also, it has no means of clearing the
setLastVisitedDirectory(), which causes the
tst_QFiledialog::completer() and tst_QFiledialog::history() tests
to interfere, leaving the settings in an invalid state.
tst_qfiledialog2 does not use QStandardPaths::setTestModeEnabled(().

- Ensure the last visited URL is always clean by
  making QFileDialogPrivate::setLastVisitedDirectory()
  static and calling it from init().
- Introduce a cleanupSettingsFile() function to the tests that
  cleans both groups and call it from initTestCase() and cleanup()
  to ensure a clean state.
- Add QStandardPaths::setTestModeEnabled() to tst_qfiledialog2.

Fixes sporadic test fails when executing
tst_QFiledialog::completer() and tst_QFiledialog::history()
in a sequence.

Task-number: QTBUG-45764
Change-Id: I24de3caabf77be067b385d64ff11b7a07fe12b72
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-01 06:03:10 +00:00
Konstantin Ritt
3ce2dd391e [QFontDatabase] Get rid of QtFontEncoding
This one has not been unsed for ages (since Qt3?).

Change-Id: Iaf514db1b698b34a303f34c150b72db989eb176c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-01 05:36:11 +00:00
Konstantin Ritt
a77dc1a669 [QFontDatabase] Drop QtFontDesc's familyIndex member
Many times set but never used.

Change-Id: I297f21d4b9878e5f9559a2dfdb2d3de34107bb7d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-01 05:36:09 +00:00
Konstantin Ritt
9bf6ea7fde [QFontDatabase] Get rid of some dead code
1. Checking if `db->count == 0` inside the
`for (int x = 0; x < db->count; ++x)` loop makes absolutely no sense;
2. The family gets loaded just a line above (ensurePopulated()).

Change-Id: I72dbd42565c4f5a5d9ff8879f10ee0ece7298fa7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-01 05:36:04 +00:00
Konstantin Ritt
af217e67fa Minor optimization to QWidgetPrivate::setFont_helper()
There is no sense in comparing fonts with different resolve_mask-s.

Change-Id: Icfdaf494fce8a59b7138d96fdf7354cc0514ca6a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-01 05:35:56 +00:00
Konstantin Ritt
7443b3c949 Optimize QFont::resolve(const QFont &other)
When resolve_mask is 0, the font inherits just everything, and there is
no need in checking for any resolved attributes;
the resolved font always inherits dpi, so do not check it either.

Change-Id: Ie5d7ced0859d46a9237447e29051a22569480a51
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-01 05:35:53 +00:00
Konstantin Ritt
a37daf99ad [DiagLib] Sync QChar enums
These values were added as part of upgrading to Unicode 7.0

Change-Id: Ib208828a7685ba4f89f0e2f06033f74c8ff13532
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-05-01 05:35:46 +00:00
Romain Pokrzywka
6c4b0e443f Move QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO definition to gcc-base.conf
The flags are the same across all GCC flavors so put the definition
in the common gcc-base.conf instead of duplicating it in g++-base.conf
and clang.conf

Change-Id: I1ba2c3c314d3a02b559c384aecef74240f69f659
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-30 20:19:14 +00:00
Allan Sandfeld Jensen
041cbe4b38 Add missing RGB32 <-> RGB30 convertions
Completes the inplace converters so that we can rely on inplace
conversions to succede as long as the image depth is the same.

Change-Id: Ia1ae34b5de1bc16e87ff5403bdacfcae44a22791
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 19:27:39 +00:00
Martin Smith
78a10bb8dc doc: Add missing documentation for QXcbWindowFunctions
This update adds documentation for member functions of QXcbWindowFunctions.

Change-Id: I358ac502c5dc180a92d6157d3972a44baeebf2c0
Task-number: QTBUG-45756
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-04-30 18:21:56 +00:00
Allan Sandfeld Jensen
68faf3a9bb Fix QImage format after inplace conversion
Some inplace conversions would not set the requested image format in
the returned image, due to the same conversion being used for several
destination formats.

This patch ensures all inplace conversions return the right format,
and adds testing infrastructure to easily test iterate over all formats
so that they all can be tested.

Change-Id: I68ab17a713ddb2aa8ed6aaf0a0a1ec8bbcb56090
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 15:26:26 +00:00
Simon Hausmann
8272f5415b Fix crashes when accessing environment variables concurrently
We've seen crashes with QThreadPrivate::start using qgetenv during the creation
of the event dispatcher, while another thread (for example the gui thread)
called qputenv. This is inherently thread-unsafe and there are many places
where we make the assumption that using the environment is safe. However access
to the environment is inherently unsafe in the C runtime and the best that we
can do is add a mutex around the Qt environment access functions, to at least
protect ourselves and our users.

Change-Id: Ie9a718d9f7ce63c423c645f0be3e3f4933e1cb08
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-04-30 14:21:46 +00:00
Friedemann Kleint
4e88f1aaea Windows QPA plugin: Fix debug formatting.
- Introduce QDebugStateSaver for all debug operators.
- Remove the "Flags=" from enumerations since their type is now output
  by default.
- Added some spaces since the previous formatting relied on space=true
  as a result of some debug operators erroneously returning debug.space(),
  which is now fixed in qtbase.
- Fixed formatting, added noquote() where necessary, added some newlines,
  used stream modifiers instead of QString::number(n, 16) to output
  hex numbers.
- Fix indentation.

Change-Id: I64123a4262916e21448cda2aa61ae1100f07291a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-04-30 10:27:37 +00:00
Allan Sandfeld Jensen
52ddfb36c8 Fix two errors in RGB30 conversions
The one converters from RGB30 was misplaced in the method table, and
the unpremultiplication from A2RGB30 to RGB30 had an underflow mistake
when alpha was 2.

Change-Id: I92c11ede28611a3dbdce72aca1898845c120c209
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 10:00:21 +00:00
Alexander Volkov
fe086ddb9e xcb: Fix updating physical screen size
X server may return an empty physical screen size, for example
on VNC, Xephyr or some not very well supported hardware.
In this case it's possible to use the size of the virtual desktop,
but until now it was done only in the QXcbScreen constructor.

Move it to QXcbScreen::updateGeometry() and calculate physical screen
size using the DPI of the virtual desktop.

Task-number: QTBUG-45564
Change-Id: I6b757818a2fcefdd7b2c0aa31b840a88d625d6ae
Reviewed-by: Daniel Vrátil <dvratil@redhat.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-04-30 09:55:07 +00:00
Alexander Volkov
4b9cf0379f xcb: Export RootWindow to QXcbNativeInterface::nativeResourceForScreen()
Change-Id: I0ad74de8aef7d8a3cb707b61438096c67cd7626e
Reviewed-by: David Faure <david.faure@kdab.com>
2015-04-30 07:51:35 +00:00
Frederik Gladhorn
631eb12dd2 The qpluginloader machtest needs Q_AUTOTEST_EXPORT
Doing a build on OS X without -developer-build fails.

Change-Id: I49c178ab2428177d9dd94f84620595a4bc132244
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-30 06:32:23 +00:00
Morten Johan Sørvig
795400d1e5 Clean up qt_on_cocoa manual test.
Focus the test on embedding QWindow: Remove the
NSToolBar code. Use standard NSApplication startup
code. Use winId() to access the NSView instead of
QPlatformNativeInterface (which is gui-private).
Rename Window -> RasterWindow.

Change-Id: Ie98cb73020d2721743bb665b89b17f07f2bf984b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-04-30 05:04:07 +00:00
Katja Marttila
2596f95b3b Fix QTreeView ending up in wrong state when drag
Changed state in MouseRelease so that QTreeView
does not end up in wrong state if drag is started
but not completed.

Task-number: QTBUG-44773
Change-Id: I0b665d2944f2b696bc4b7e79689d110aefa3f194
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2015-04-29 15:21:43 +00:00
Allan Sandfeld Jensen
7f8da2179b Convert opaque indexed images over RGB32
There is no reason to use the more expensive ARGB32 conversions when
there is no alpha channel involved.

Change-Id: Ifcb325352b8c806ef755db385121a2939c5825b2
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 21:43:50 +00:00
Alex Trotsenko
737eccf1ef QNativeSocketEngine: add sendmsg(), recvmsg() wrappers on unix
These functions are useful to pass ancillary data such as extended
errors, IP options, protocol control information.

Change-Id: I27574f73a60909c7199027160ca4689511e56b72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-28 19:35:58 +00:00
Bjoern Breitmeyer
05f8c8c719 Fix WEC2013 build of zlib.
Change-Id: I4d1908f1175ed39e2df8717fb0b5a17befe88744
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-28 15:16:17 +00:00
Erik Verbruggen
fc51e86ca4 QStateMachine: optimize conflict calculation.
Done by using in-place removal from the list of transitions using
iterators.

Change-Id: I6dced4b214b49b3dcd3ba19ca4cd81a601f81bb6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-04-28 12:54:08 +00:00
Marko Kangas
0abf5ec7c4 Add support to set text/uri-list mimedata via setData()
Fixed issue that text/uri-list mimedata got from QMimeData::data()
was corrupted after setting it back via QMimeData::setData()

Change-Id: I2377523a9286519402ab9127ed7f3fa66e39a679
Task-number: QTBUG-45486
Reviewed-by: David Faure <david.faure@kdab.com>
2015-04-28 12:46:35 +00:00
Allan Sandfeld Jensen
f15d6c3fa9 Preserve QImage metadata in image transforms
Some QImage methods were not preserving image metadata, or only
preserving some of it. This adds the missing parts and adds a test for
metadata.

Change-Id: Ib5892a23e49dfde5ea26074d3deaa887fa930c6b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 12:42:12 +00:00
Caroline Chao
1576f62eaf Tests: Use blacklist for failing tst_qfilesystemwatcher tests
Remove the insignificant_tests CONFIG option in favor of a BLACKLIST
file. The tests blacklisted have been found using CI builds logs.

Change-Id: I34374ed7269f941c330c65d97fe083c83d3df461
Task-number: QTBUG-33574
Task-number: QTBUG-30943
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-28 12:35:21 +00:00
Liang Qi
a6f7dc521b Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev 2015-04-28 09:16:06 +00:00
Marc Mutz
84b739158d QIODevice: fix data loss when reading large amounts from sequential devices
In certain situations, when reading a large amount of data from
sequential devices with QIODevice::readAll(), content was lost when
passing a qint64 value > QByteArray::MaxSize into QByteArray::resize(),
which takes an int. The result of the conversion to int is either negative or
calculated mod 2^32. In any case, it will at some point be < QByteArray::size(),
which prompts QByteArray to truncate, losing already-read content.

Fix by adding an explicit size check before calling QByteArray::resize().

This shows once more that an API that uses int for sizes is dangerous.
Esp. on 64-bit platforms.

Change-Id: I30fbfad0bf37476c34141b6f3786e7e0fc8e1e74
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-28 07:15:51 +00:00
Liang Qi
1c8451bdbb Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/tools/qdoc/tree.cpp
	tests/auto/gui/painting/qcolor/tst_qcolor.cpp

Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
2015-04-27 21:36:32 +02:00
Alexander Volkov
39683b2980 QSystemTrayIcon: Fix the placement of title and message in a balloon
Swap title and message parameters in the QBalloonTip::showBalloon() call.
It was wrong in f277c07467 on xcb platform.

Task-number: QTBUG-43428
Change-Id: I18e354703d9fa9c196b2789e6df263debdb7ce06
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-04-27 19:32:06 +00:00
Oswald Buddenhagen
0823e3f746 make headers-only modules work for framework builds
Change-Id: I00125883335c5b8cc556b4e4c964e11c55aa989b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-27 18:58:50 +00:00
Oswald Buddenhagen
6cb495dee3 make QMAKE_FRAMEWORK_VERSION work independently of TEMPLATE
QMAKE_BUNDLE_DATA itself does as well, and it can refer to versioned
resources.

Change-Id: I3d9bf23c2ff81dbb1cd929f3f0e0ce1e67f3258a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-27 18:58:47 +00:00
Simon Hausmann
73a48c1618 Add support for stack traces in testlib on Mac
Use lldb to generate a stack trace.

Change-Id: I30b0ab656dda66b6aaa05841df641bee004702f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-04-27 17:03:51 +00:00
Jacek Całusiński
0635b1a69d Moc: test if superclass list is not empty before accessing first()
Accessing QList().first() with an empty superclassList caused assertion
fail. Added check to fix it.

Change-Id: I1aff35e0d267fc0e670beadba1bd196b175a4da8
Co-authored-with: Olivier Goffart <ogoffart@woboq.com>
Task-number: QTBUG-45790
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-27 16:14:17 +00:00
Stephen Kelly
2886935f96 cmake: Don't mark header-only frameworks with the FRAMEWORK property.
CMake INTERFACE targets may only have whitelisted properties, and
FRAMEWORK is not in the whitelist in released CMake versions.

Change-Id: I27cd0cfbe1b52f25c91bf1b3c0d55879bed91bdf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2015-04-27 13:52:53 +00:00
Friedemann Kleint
d1e4ba0692 Windows: Add "Segoe UI Emoji" and "Segoe UI Symbol" as fallback fonts.
This enables rendering of Emoji symbols.

Task-number: QTBUG-45811
Change-Id: I7cb128dab717870929e02ea9ec253f36fef29804
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-04-27 13:31:15 +00:00