Commit Graph

30360 Commits

Author SHA1 Message Date
Lars Knoll
b82650891e Use poll related features properly
And get rid of related DEFINES in the pri file

Change-Id: I54cf25b7cb447af22b410213759044e8018939a6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-30 08:11:12 +00:00
Oliver Wolff
8f2088db17 winrt: Check for removed timers after sending events
After all the check makes sense here. If a timer was removed as a result
of sendEvent and it was not at the end of the list the list is not
shrunk but the timer info's id is just set to INVALID_TIMER_ID.

Additionally the timer's object should be fetched before we unlock the
locker as timerIdToObject is changed in removeTimer and we might access
a nullptr if the timer has been removed.

Reverts c83ba01f7b

Task-number: QTBUG-56756
Change-Id: Ib1a04c02fbfcf4c939b4891d42f954dc9e87149e
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-11-30 07:49:41 +00:00
Marc Mutz
0cdae477e3 QListViewItem: add constexpr
This class is just a record with a bit of functionality on it.
To prevent pessimizing it compared to a C struct with the same
contents, mark all operations constexpr and remove the point-
less copy ctor (the generated one is just fine).

Converge on passing QRect, QSize, QPoint by value. Was mixed
cref and value passing before.

Saves ~1KiB each in text and data size on an UBSan build,
somewhat less, of course, on a normal one.

Change-Id: Ibae16792d822ff183a0c542380501978f2108d93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-30 07:24:52 +00:00
Marc Mutz
2fd3d8ea9e tests/auto/widgets: use QCOMPARE(., nullptr)
.. instead of manually casted 0s.

QCOMPARE(., nullptr) was added for Qt 5.8. Make use of the new API.

In tst_qwidget.cpp, as a drive-by, change
   qApp->focusWidget() -> QApplication::focusWidget()

Change-Id: I1331b8916b026d48e01534d1ed0b3d72f3f3d50c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-30 07:24:47 +00:00
Allan Sandfeld Jensen
97b8fdab7d Fix clipping of fetchTransformed
Bound x and y to the clipping rect instead of the texture rect.

This has minor effects on lancelot, but all within the 5% fuzz.

Change-Id: Ia6141e4f7649dad53211bd959af1bce48372e26d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-29 22:14:14 +00:00
Alexander Volkov
5a1ff37485 QNX: Add missing override
Change-Id: Idb6216a645f7c9791674d16665331a63da46b132
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2016-11-29 21:44:04 +00:00
Alexander Volkov
7d6d70afe7 QtConcurrent: Add missing override
Change-Id: Ib8064a3c7bae68885b1adb78a55c69f7697e10db
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-29 20:37:54 +00:00
Lars Knoll
7d12ef183e Clean up style selection code
Turn styles into proper features and test for them
using qtConfig/QT_CONFIG.

Change-Id: I7e28785a46723364b90d8aa286f4d6e5ab085651
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-29 19:04:48 +00:00
Lars Knoll
e3555fe970 Properly use QT_CONFIG macro to check for ICU
And remove the QT_USE_ICU define.

Change-Id: I8134ee18af7c90ed7070926ca31b3a57b3ec37dd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-29 19:04:37 +00:00
Lars Knoll
0c8f3229de Clean up config handling of logging backends
Turn them into proper private features, and remove setting of
defines in the pri file.

Change-Id: Iafc11e93d4a9349bf15971dc1adac9a828ea03f6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-29 19:04:30 +00:00
Friedemann Kleint
1e303601a7 Fix warnings in tests (MinGW/MSCV)
tst_qtcpsocket.cpp:606:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
tst_qtcpsocket.cpp:670:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
tst_qfile.cpp(2661): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
tst_qarraydata.cpp(760): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
main.cpp:40:33: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]

Change-Id: I80ccef29b71af6a2c3d45a79aedaeb37f49bba72
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-11-29 17:08:46 +00:00
Friedemann Kleint
6aa2d49d5f tst_qchar: Silence deprecation warning
Change-Id: I248d815862a4172ceae6ba45391cba0a30b8e1ae
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-29 16:20:01 +00:00
Edward Welbourne
c1093e2d2a Tweak wording of QNetworkProxy doc for SOCKS5
It was phrased for an out-of-date version of Qt.
Adapt phrasing to be future-proof.  Reflow text.

Change-Id: Ic026a7719ba6fb1de2830358a75cd6f30c5f8897
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-29 15:49:35 +00:00
Allan Sandfeld Jensen
94b83ae142 Fix bilinear sampling of more than 8x rotated transforms
The check for 8x zoom was inverted and checked for 1/8x zoom.

Change-Id: I45156db709bab6b702769c2a70d4d2af51b5533a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-29 15:44:52 +00:00
Albert Astals Cid
1155ca10f8 QSettings: Avoid unneeded sync() on destruction
... if sync() has already been called manually.

Change-Id: I11bd6810aa3c1065a72ffaa2001d1bdbf8bf9c89
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-29 15:42:25 +00:00
Alexander Volkov
4c375f75e0 Android: Use override instead of Q_DECL_OVERRIDE
... for consistency.

Change-Id: I37afaff6f7512a1cd09f0f31996b9bedc6cb3bab
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-11-29 15:42:14 +00:00
Alexander Volkov
e3ad43843a Android: Add missing override
Change-Id: I70b802517d8f7d129ffb71dc3e92cb2458a55acc
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-11-29 15:29:28 +00:00
Friedemann Kleint
c2446cb7df qdbusxml2cpp: Add application name and input file to warnings
Make it possible to identify its warnings in log files, like:
qdbusxml2cpp: Got unknown type `(s)' processing '../org.qtproject.QtDBus.Pinger.xml'
You should add <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description
qdbusxml2cpp: Got unknown type `(s)' processing '../org.qtproject.QtDBus.Pinger.xml'
You should add <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description

Change-Id: I242d9316b317de0164af2725b7836551f2f69037
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-29 15:09:12 +00:00
Friedemann Kleint
33c50e910c Fix tst_QString::sprintf()
Compare to QLatin1String and use reinterpret_cast to fix MSVC warning:
tst_qstring.cpp(1271): warning C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size

Change-Id: I4f26d72f0fad59e09636fe609a2772309a688e5c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-29 14:10:08 +00:00
Alexander Volkov
7adbdddbb6 QtWidgets: Add missing override
Change-Id: I991659db5510acbbb44d0f5987edc213acf62a74
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-29 12:39:24 +00:00
Alexander Volkov
c050a1bdea Examples: Remove more redundant virtual specifiers for overriders
Change-Id: I3e378c656a2651fb7031b6cf6a6939dfc5576519
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-29 10:06:02 +00:00
Oliver Wolff
a103992f49 Fixed build using Visual Studio 2017
As _BitScanForward and friends are not marked constexpr in Visual Studio,
functions using these may not be marked either.

Task-number: QTBUG-57086
Change-Id: I29cfa4459580b5740f1011e7f39309844518ce03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-11-29 10:05:58 +00:00
Anton Kudryavtsev
7eb4be9db8 QStringRef: de-duplicate lastIndexOf code
Change-Id: Id6d804b2ab4c9c763d7ec9cb66c255ed0b4f785d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-28 13:18:45 +00:00
Friedemann Kleint
49cdf51ac9 Fix some warnings in tests
../tst_qfile.cpp: In member function 'void tst_QFile::handle()':
../tst_qfile.cpp:2661:38: warning: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
tst_qstatictext.cpp:862:58: warning: unused parameter 'textItem' [-Wunused-parameter]
../tst_qtcpsocket.cpp: In member function 'void tst_QTcpSocket::abortiveClose()':
../tst_qtcpsocket.cpp:2254:90: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
Test.cpp: In member function 'void My4Socket::read()':
Test.cpp:66:20: warning: 'reply' may be used uninitialized in this function [-Wmaybe-uninitialized]
../tst_qlocalsocket.cpp: In lambda function:
../tst_qlocalsocket.cpp:701:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../tst_qtcpserver.cpp: In member function 'void tst_QTcpServer::linkLocal()':
../tst_qtcpserver.cpp:935:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
../tst_qtcpserver.cpp:940:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Change-Id: Ic315069768bcb63a6b333c28ac65b0b992b0d43f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2016-11-28 13:10:43 +00:00
Thiago Macieira
277208c169 moc: disable deprecated warnings in generated code
Code generated by moc very often calls deprecated functions, like
deprecated slots, signals and property getters and setters. There's no
way around that unless the class in question is willing to break binary
compatibility, so those warnings are actually harmless.

Change-Id: Iaeecaffe26af4535b416fffd1489d1a98ef8b34a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-27 02:31:22 +00:00
Thiago Macieira
40c9e9dc5f Add a macros for disabling deprecated declaration warnings
This is the only warning we disable in a lot of places in Qt 5.8 source
code. If other warnings become common, we can add macros for them too.

Change-Id: Iaeecaffe26af4535b416fffd1489d1968e29c52a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-27 02:31:12 +00:00
Liang Qi
d34be32434 Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8 2016-11-26 10:25:14 +00:00
Alexander Volkov
011aeb131e Examples: Remove a redundant virtual specifier for overriders
It's a good practice to use override without virtual:
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override

Change-Id: I5c2d73600e6c706424589c0487133c03a4ef3629
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-25 22:36:21 +00:00
Oswald Buddenhagen
f91bbd2438 make handling of qml module search path saner
excise knowledge of QTREPOS from qt.prf - this is a private variable of
the qt build system which the public functions should not know anything
about.

instead, move this handling to a function in qt_build_config.prf (where
QTREPOS comes from in the first place), and call it from qt_app.prf and
qt_example_installs.prf (which should be the only consumers within qt).

qt.prf now also checks that the qml install dir actually exists, which
is not the case during a modular prefix build of qtdeclarative.

not really incidentally, this fixes modular static builds of
qtdeclarative.

Task-number: QTBUG-57308
Change-Id: I31465b9cd400483264fc236934c6f9f26a5fdd73
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-25 17:31:02 +00:00
Oswald Buddenhagen
38259594e2 fix use of $$QMAKE_QMAKE, take 2
we can't use $(QMAKE) after all, as this breaks with the visual studio
generator. so massage $$QMAKE_QMAKE into the final form manually
instead.

supersedes 591d9588f in amending 2b6bcd5ff.

Change-Id: I8c7a6c43f9668d88c1cc968dbf5614240f16239a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-11-25 17:30:54 +00:00
Liang Qi
bce25a6340 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/gui/painting/qcoregraphics.mm
	src/gui/painting/qcoregraphics_p.h
	src/plugins/platforms/cocoa/qcocoahelpers.h
	src/plugins/platforms/cocoa/qcocoahelpers.mm

Change-Id: Ibe5efcae73526b3d3931ed22730b13d372dcf54e
2016-11-25 14:41:29 +01:00
Friedemann Kleint
032971af2f tests/manual,auto/qstorageinfo: Use function pointer in print helper
Fix warning about unused variable printer in auto-test and redirects
output to qInfo() as intended.
Amends change a26435d65c.

Change-Id: Ia72a93267a54b9c4f9ef37fa058b95ef586ecc75
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-25 12:44:41 +00:00
Konstantin Tokarev
5cd4001bf2 Use separate Qt5Config.cmake inside build directory
Qt5Config restricts search paths of Qt components to ${_qt5_install_prefix}
to prevent accidentally using system Qt modules in case of restricted Qt
configuration. However this does not work properly when Qt is used without
installation, in particular when building cmake-based QtWebKit as a Qt
submodule, because ${_qt5_install_prefix} resolves to QtBase and does not
contain components from other modules.

This patch changes search path from ${_qt5_install_prefix} to all qt5
subdirectories.

Change-Id: Icf01a256097710889573ad69d847b9c3bffa1449
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-25 10:46:34 +00:00
Friedemann Kleint
8a2f544523 tst_qsql.cpp: Remove deprecated module include
Fix warning:
include/QtSql/qsql.h:4:4: warning: #warning Header <QtSql/qsql.h> is deprecated. Please include <QtSql/qtsqlglobal.h> instead. [-Wcpp]

Change-Id: I254c6ac9ddb0f49a7f4dc8b3de44fd1010f6243e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-11-25 09:55:21 +00:00
Liang Qi
50aeedd86c Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	mkspecs/features/qml_module.prf
	src/corelib/tools/qdatetimeparser_p.h

Change-Id: I5382cee3ddb33107dc61ee20f7a9188c4a68a882
2016-11-25 10:32:29 +01:00
Kai Koehne
600c5a7e1b Document third-party code in Cocoa QPA plugin
Change-Id: I2c30f5da25c83d6129403cb9b745a2f17fd6fd9e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-11-25 08:11:28 +00:00
BogDan Vatra
17d72c7837 Android: All gcc flags should be set for clang too
gcc-base-unix.conf must be included before clang.conf because
clang.conf doesn't set all the needed flags.

Change-Id: I71f95732d0d245096b575c91610800d91c6aa5d7
Reviewed-by: Vyacheslav Koscheev <vok1980@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-25 06:06:57 +00:00
Orgad Shaneh
5bd2d6afec Remove nokia reference in example mimetype
Change-Id: I45c01fd57171f4ba6ea195d7ad3ae988a1797acb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-24 20:03:35 +00:00
Liang Qi
3966ab51ff Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8 2016-11-24 11:18:22 +00:00
Liang Qi
08dea594fe Merge remote-tracking branch 'origin/5.7.1' into 5.7
Change-Id: Ib7b4c3a1d92b93425663014482873742745c210b
2016-11-24 11:47:58 +01:00
Liang Qi
4783de0473 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/network/socket/qnativesocketengine_winrt.cpp
	tools/configure/configureapp.cpp
	tools/configure/environment.cpp

Change-Id: Ieae6f2ee004a87f041751852b687484f91ee4480
2016-11-24 10:31:21 +01:00
Lars Knoll
0861c2176c Use harfbuzz feature to check for HarfBuzz
instead of defining a special macro for it.

Change-Id: I715380717f7d871571f663be30b73f7d95d83d71
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-11-24 08:38:39 +00:00
Lars Knoll
72ed34b792 Don't set platform specific QT_NO_FOO defines in qglobal.h
They should be enabled/disabled through the configuration system.
Remove some unused defines, and move one define from qglobal.h to
a proper feature definition in Qt Gui.

Change-Id: Ie8d5bff9712ba745af60b42ceca3f0440bed2706
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-24 08:37:38 +00:00
Jesus Fernandez
4f896ba34e ICC: Fix MySQL driver build
In function `QMYSQLDriver::formatValue(QSqlField const&, bool) const':
qsql_mysql.cpp:1569: undefined reference to `QString::operator=(
QLatin1String)

Change-Id: I56104cdd53fdc083670510f24b735cf05948f156
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-24 06:22:44 +00:00
Allan Sandfeld Jensen
34be7dc9d0 Optimize fontdatabase fallbacksForFamily
Short-cut the case-insensitive string comparison when lengths doesn't
match.

This reduces the time spend in ucstricmp from 8% during start-up of the
textedit example, to under 1%.

Change-Id: Ib3a92900b330453289ec9eff4830dfac6a9a5da2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-23 23:48:29 +00:00
Simon Hausmann
dc4c647137 Clean up the resource reading code
Instead of doing the conversion from the big-endian data by hand, let's
use the convenience functions from qendian.h.

Change-Id: If3966ca94428afabb1f5c922967fb9970f976622
Reviewed-by: hjk <hjk@qt.io>
2016-11-23 20:50:37 +00:00
Edward Welbourne
7c41ced98c QDateTimeParser: introduce at least some encapsulation
Shuffled its parts to make clear which bits are public, private and
protected.  QDateTimeEditPrivate makes rather heavy use of the last.

Change-Id: Ic5f9d0c5cc85f02e57d3f31e9ac31a17428c5311
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-23 15:02:50 +00:00
Edward Welbourne
0aa3de46ca Fix two leaky uses of realloc()
If it fails, we get NULL back but haven't free()d the old pointer;
saving the NULL return over the old pointer forgets it, leaking the
memory it pointed to.  This is particularly severe in the JSON
parser's grow(), where reading a very large JSON document can lead to
the last successful realloc() in a doubling pattern being very large
indeed; the subsequent failure will leak this very last allocation.

Only worth checking for, however, when the subsequent code takes care
to handle failure: in most cases, if realloc() fails, we're about to
crash anyway.

Change-Id: Icd3a503f169be224f0a058c58e8b7c82a3241ae7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
2016-11-23 15:02:15 +00:00
Edward Welbourne
a4bd635b33 Typo fix in QDateTime::toString() documentation
Text that should simply have been naming days of the week used
Qt::Sunday rather than the simple day name.

Change-Id: I64a3cdacd854c1c9c0fbf2d11826555086d674f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-23 15:01:39 +00:00
Timur Pocheptsov
d3ab4a1ce7 _q_networkSessionClosed - disconnect the correct object
We have:

...
auto networkSession = getNetworkSession();
...

getNetworkSession() can return non-null pointer even if
networkSessionStrongRef is null:

...
    if (networkSessionStrongRef)
        return networkSessionStrongRef;
    return networkSessionWeakRef.toStrongRef();
....

We check the result:
if (networkSession) {

    // here we disconnect signals
}

But we should use the same networkSession when disconnecting,
not start using networkSessionStrongRef suddenly, since it can
be null.

Task-number: QTBUG-57110
Change-Id: I96babb42c2182e741e6eabaf7d1abb88869861f4
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-23 14:04:57 +00:00