Commit Graph

42 Commits

Author SHA1 Message Date
Alexander Shevchenko
4d20485474 set attribute specifier before namespace name
That is correct C++. GCC (and apparently Clang) accept it after the name
for compatibility with the old __attribute__ syntax.

Change-Id: Ie7f3adaaed83198ca1c61bc0efdf51634e457b07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-09 05:23:26 +00:00
Friedemann Kleint
5af4cb5a5a Tests: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs.

Task-number: QTBUG-51673
Change-Id: If456567691538b1a1f452111814c5f9eba401c43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-04 20:23:25 +00:00
Thiago Macieira
19b0ce5daa Change almost all other uses of qrand() to QRandomGenerator
The vast majority is actually switched to QRandomGenerator::bounded(),
which gives a mostly uniform distribution over the [0, bound)
range. There are very few floating point cases left, as many of those
that did use floating point did not need to, after all. (I did leave
some that were too ugly for me to understand)

This commit also found a couple of calls to rand() instead of qrand().

This commit does not include changes to SSL code that continues to use
qrand() (job for someone else):
  src/network/ssl/qsslkey_qt.cpp
  src/network/ssl/qsslsocket_mac.cpp
  tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-08 09:14:03 +00:00
Liang Qi
d892e6f721 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	mkspecs/features/qt_common.prf
	src/plugins/platforms/windows/qwindowsdialoghelpers.cpp

Change-Id: I03b92b6b89ecc5a8db7c95f04ebb92ed198098a8
2016-09-05 18:47:27 +02:00
Liang Qi
657c2bfbec Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	tests/auto/testlib/selftests/generate_expected_output.py

Change-Id: If856162abf9a24ae2c9946d336a7d1da03520fa7
2016-09-05 13:57:12 +02:00
Marc Mutz
2a6bea7a55 qcompilerdetection.h: retract Q_COMPILER_DEFAULT_MEMBERS for MSVC < 2015
Earlier versions of the compiler cannot default
move special member functions, even though we
also define Q_COMPILER_RVALUE_REFS for them.

Fix by retracting the less-often-used of the
two compiler feature defines.

Q_COMPILER_DEFAULT_MEMBERS is not used outside
QtBase in neither 5.6 nor 5.7 (5.8 is not
released at this time, so wasn't considered).
The same is true of the dependent macros
Q_COMPILER_DEFAULT_DELETE_MEMBERS and
Q_DECL_EQ_DEFAULT.

In QtBase, the three uses are:
1. in QAtomic*, where the user also requires
   Q_COMPILER_CONSTEXPR, which is not defined
   for any MSVC at this time,
2. for QEnableSharedFromThis, which is a class
   template with an alternative {} implementa-
   tion of the default constructor, and uncon-
   ditional user-defined copy special member
   functions.
3. The test of the corresponding functionality
   in tst_compiler, which this commit amends.

That means that neither of these two only uses
of the macro in Qt libraries are affected by
the change.

The reason we do this change, then, is that in
the future, we want to be able to more easily
restore move special member functions for
classes for which they are suppressed due to
user-defined dtors or copy special member
functions.

Change-Id: I6f88cad66d6b87a758231f16355c3bddae697b86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-03 05:11:40 +00:00
Lars Knoll
60985aa42b Use qtConfig throughout in qtbase
Use the new qtConfig macro in all pro/pri files.

This required adding some feature entries, and adding
{private,public}Feature to every referenced already existing entry.

Change-Id: I164214dad1154df6ad84e86d99ed14994ef97cf4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-19 04:28:05 +00:00
Liang Qi
57057f76ad Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	.qmake.conf
	config.tests/unix/nis/nis.cpp
	mkspecs/unsupported/freebsd-g++/qplatformdefs.h
	src/corelib/tools/qdatetime.cpp
	src/corelib/tools/qsimd.cpp
	src/corelib/tools/qsimd_p.h
	src/network/access/access.pri
	src/network/access/qnetworkreplynsurlconnectionimpl.mm
	src/network/access/qnetworkreplynsurlconnectionimpl_p.h
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/printsupport/windows/qwindowsprintdevice.cpp
	tests/auto/corelib/kernel/qobject/tst_qobject.cpp
	tests/auto/network/access/qnetworkreply/BLACKLIST
	tests/auto/widgets/widgets/qopenglwidget/BLACKLIST

Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
2016-06-06 09:04:55 +02:00
Thiago Macieira
0f559a2d99 Force the use of the C++11 alignof keyword instead of an extension
If the compiler supports C++11 alignof, let's use it. No point in
perpetuating the use of __alignof__ or __alignof.

There's a fallback implementation in qglobal.h that works even without
compiler extensions. We can't drop it just yet (alignas is not a
required C++11 feature), but at this point I doubt that fallback is used
anywhere anymore.

The tst_compiler test was wrong to use alignof(variable). That's not
permitted by the standard nor would it work with our fallback
implementation. MSVC 2015 enforces this, but ICC, GCC and Clang don't.

Change-Id: Ifea6e497f11a461db432ffff1448abfa86672c63
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-29 18:45:13 +00:00
Liang Qi
b894a8def5 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	mkspecs/features/qml_module.prf
	mkspecs/features/qt_common.prf
	src/gui/text/qzip.cpp
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/windows/array.h
	src/testlib/qtestcase.cpp
	src/widgets/dialogs/qfilesystemmodel.h

Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
2016-04-29 17:55:20 +02:00
Thiago Macieira
adac71c044 tst_compiler: Expand the attribute test
This is not exhaustive, but was enough to discover ICEs.

Change-Id: Ib60be1d298a66b72e3eb9b75ad538f0bf15b5f62
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Simo Fält <simo.falt@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-28 02:45:49 +00:00
Thiago Macieira
23bd4651c7 Update the Intel copyright year
Not that we require it, but since The Qt Company did it for all files
they have copyright, even if they haven't touched the file in years
(especially not in 2016), I'm doing the same.

Change-Id: I7a9e11d7b64a4cc78e24ffff142b4c9d53039846
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-21 22:44:16 +00:00
Jani Heikkinen
f776595cc1 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-21 18:55:18 +00:00
Liang Qi
72f5867f14 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/corelib/kernel/qcoreapplication.cpp
	src/corelib/kernel/qeventdispatcher_blackberry.cpp
	src/network/bearer/qnetworkconfiguration.cpp
	src/plugins/bearer/blackberry/qbbengine.cpp
	src/plugins/platforms/android/androidjnimain.cpp
	src/plugins/platforms/android/qandroidplatformtheme.cpp
	src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
	src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp
	src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
	src/plugins/platforms/qnx/qqnxintegration.cpp
	src/plugins/platforms/qnx/qqnxnavigatorbps.cpp
	src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
	src/plugins/platforms/qnx/qqnxwindow.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	src/widgets/styles/qwindowsvistastyle.cpp
	src/widgets/styles/qwindowsxpstyle.cpp
	src/widgets/widgets/qtoolbararealayout.cpp
	tests/auto/corelib/global/qflags/qflags.pro
	tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
	tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
	tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp

Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
2015-12-02 23:33:06 +01:00
James McDonnell
d76be5530a Use correct test to add C++14 to the project configuration
Only add C++14 to the project configuration when C++14 support is
available on the platform.  Adding it because the platform supports
C++11 doesn't work when the platform _only_ supports C++11 (e.g.,
QNX 6.6.0).

Task-number: QTBUG-49491
Change-Id: I15de38bb06d912a314b9dd18c80b513cc06a855e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-01 15:46:31 +00:00
Liang Qi
1ed7a67a4c Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/corelib/kernel/qcoreapplication.cpp
	src/corelib/thread/qthread_unix.cpp

Change-Id: Ia08d613c3f0bd08cb6dc3e3a57257207dfd4a099
2015-11-23 07:13:00 +01:00
Marc Mutz
5660ce6004 tst_compiler: check more cases for RVALUE_REFS
Check that we can use std::forward, and that the compiler
synthesizes move special member functions when it should.

MSVC only supports the latter since the Nov 2013 CTP,
which, for our intents and purposes, means VC2015.

Change-Id: I8d8e4ae064abce90076a05b3b637950ab7d21dac
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-11-22 12:26:20 +00:00
Marc Mutz
e002a55355 tst_compiler: check more cases for RANGE_FOR
Check that it works on C arrays, with auto type deduction
and with types that only provide free begin()/end()
functions that can only be found through ADL.

Change-Id: I760722a0f56c9ebe967070ff68af90b96ed77e66
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-11-20 20:18:07 +00:00
Marc Mutz
912df566d0 tst_compiler: make the check for C++14 return type deduction harder
Recurse into self must work, e.g.

Change-Id: I2cccd3d40d2ab5c75a18bf4425b790d30b4d7af0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-11-19 07:43:34 +00:00
Liang Qi
c7934f2489 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/corelib/io/qprocess.cpp
	src/corelib/io/qprocess_unix.cpp
	src/network/kernel/qnetworkinterface_winrt.cpp
	tools/configure/configureapp.cpp

Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
2015-11-18 09:01:51 +01:00
Thiago Macieira
e8d9bb906b tst_compiler: Silence MSVC 2015 warning about unused variable
tst_compiler.cpp(639): warning C4101: 'c': unreferenced local variable

Change-Id: If0101953ceb66bc8e8f5ab969d54f4e1c25dd414
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-11-18 00:30:43 +00:00
Friedemann Kleint
51e501fa8d Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.
Change-Id: I1955320e7639760b4383a53f37a506c8055933ef
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-01 16:57:46 +00:00
Friedemann Kleint
569785cb00 Various tests: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0)  by
          Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by  Q[TRY]_COMPARE(a, b) and
  add casts where necessary. The values will then be logged
  should a test fail.

in tests/auto/other, tests/auto/printsupport and tests/auto/xml.

Change-Id: I28cbdc89d36791f179425f17f90b697c60660938
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-28 13:18:55 +00:00
Friedemann Kleint
c067c012dc Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).
Preparing the replacement of Q[TRY]_VERIFY(a == b) by
Q[TRY]_COMPARE(a, b) for non-boolean types.

Change-Id: Iab6ec2f0a89a3adc79e18304573994965013dab5
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-07-27 12:09:19 +00:00
Jani Heikkinen
83a5694dc2 Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Outdated header.LGPL removed (use header.LGPL21 instead)

Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)

Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination

Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
2015-02-11 06:49:51 +00:00
Tomasz Olszak
8ddaf5c741 Gcc 4.5.* build fix.
Q_COMPILER_DEFAULT_MEMBERS and Q_COMPILER_DELETE_MEMBERS are now set
starting from gcc 4.6. Pre-4.6 compilers implement a non-final snapshot
of N2346, hence default and delete functions are supported only if they
are public. Starting from 4.6, GCC handles final version - the access
modifier is not relevant. Compiler error:

  qsharedpointer_impl.h:717:31: error:
  'QEnableSharedFromThis<T>::QEnableSharedFromThis()' declared with non-public access cannot be defaulted in the class body

Change-Id: If1d3d4696f91912a09ca72bd4aa1fb07f491a0cb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-10 13:20:30 +02:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Thiago Macieira
eab7ec586d Expand the compiler test with C++11 and C++14 compiler tests
This allows us to quickly test if a compiler actually supports what it
claims to support.

Change-Id: Ia32212a11774aa7947ddffae30837c53665374f3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-27 08:27:03 +02:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
Jędrzej Nowacki
60d096ff6d QMetaType build fix with Q_NO_CURSOR and friends.
QMetaType has a way to "switch off" some types from the build.
QtMetaTypePrivate::TypeDefinition<T>::IsAvailable is defined as false
for all unaccessible types. Sadly that information was never used by
gui and widget handlers. The patch implements it.

Change-Id: Ie5835be4c88cfbbca8a4e9199e31ddfc20cae190
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jing Bai <jing.bai@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-27 02:37:19 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00
Thiago Macieira
672b5b7ab6 Set the Qt API level to compatibility mode in all tests.
Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.

Task-number: QTBUG-25053
Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-01 15:37:46 +02:00
Bradley T. Hughes
d964981252 Remove ARMFPA support and Q_DOUBLE_FORMAT detection
Remove the -armfpa option the config.tests/unix/doubleformat*
detection. The places where we used QT_ARMFPA and Q_DOUBLE_FORMAT
has been removed as well.

Rationale: ARM FPA with GCC does not work with EABI. Qt currently
does not support compiling without EABI, making ARM FPA an
impossibility. It is unknown whether other compilers provide ARM FPA
support with EABI. Support for ARM FPA can be re-added in the future
should the need arise, but since ARM VFP is available for ARMv5 and up,
we should encourage implementors to instead use soft-floats or VFP.

Change-Id: I3671aba575118ae3e3e6d769759301c8f2f496f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-01 16:26:55 +01:00
Jędrzej Nowacki
beab403d9f Reduce QtCore lib binary size by around ~3KB, by removing template code
Reusing a template is much better then creating a new one, even if it
should inline the same code.

For some reason replacing T* by void* force gcc to remove a few bytes
per template instantiation too, it is not really significant, but it
alows us to simplify the code.

Benchmarks don't show any regressions.

Change-Id: I4fdf1e4dc311b23021eb5758605602937d05b183
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-27 12:57:02 +01:00
Jason McDonald
5635823e17 Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.

Change-Id: I311e001373776812699d6efc045b5f742890c689
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-30 03:54:59 +01:00
Jason McDonald
629d6eda5c Update contact information in license headers.
Replace Nokia contact email address with Qt Project website.

Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-23 04:04:33 +01:00
Jason McDonald
1fdfc2abfe Update copyright year in license headers.
Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 06:36:56 +01:00
Jason McDonald
a8fd0c3654 Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are
compiler builtins) and does not correctly evaluate others that depend
on compiler builtins, such as Q_OS_FOO.

This commit reverts parts of the following commits, but is not a
complete fix as there were many instances of this problem in the tests
prior to those commits:
    924d810dbd
    8aaff67510
    338d3f1197
    a55034062b
    253497b744
    7cfad460c5
    9d2ff58f36
    0cf6baa2d6

Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 01:51:57 +01:00
Jason McDonald
238c304613 Remove obsolete MSVC workarounds from autotests.
Qt5 doesn't support MSVC versions before 2008, so workarounds for
earlier versions are no longer required.

Change-Id: I429feff99fe61d286637b960d92fd58962f8aefa
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-27 06:12:09 +02:00
Rohan McGovern
d04bf8f407 all remaining tests: eliminated usage of qttest_p4.prf
qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4.
It enables various crufty undocumented magic, of dubious value.
Stop using it, and explicitly enable the things from it which we want.

Change-Id: I02fe27b2c1800f929250fa8694ca2976c9661a12
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-10-25 08:42:23 +02:00
Jason McDonald
338d3f1197 Avoid QSKIP in lieu of compile-time checks.
Change compiler autotest to omit inapplicable functions at compile-time
in preference to skipping at run-time.

Change-Id: I8a221cadbb7b59d926754862332c0665673b8a56
Reviewed-on: http://codereview.qt-project.org/6011
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-06 05:28:32 +02:00
Jo Asplin
0a208dd413 Moved autotests in category 'other' into new directory structure
Task-number: QTBUG-21327

Change-Id: I296063b665809e0411a7546fc9b41a287317ecb7
Reviewed-on: http://codereview.qt-project.org/4326
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-09 09:36:41 +02:00