Commit Graph

6718 Commits

Author SHA1 Message Date
Friedemann Kleint
2503a1e9e7 Fix tst_QComboBox::getSetCheck()
Change 2fd3d8ea9e broke the QCOMPARE()
in there, partially revert.

Change-Id: I8f572b9d82ad1c6b5448504eda7cc2fa53fa3d3d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2016-12-01 12:21:56 +00:00
Dmitry Shachnev
f88f405401 Add a test case for removing a submenu from the menubar
If 5ca9631d3a is reverted, this test
segfaults on Unity most of the times.

Task-number: QTBUG-55966
Change-Id: Ice59842e0a1a7930e3cd10c4c7319ef033fe6a58
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-12-01 07:35:59 +00:00
Friedemann Kleint
0a2759e8f8 tst_QTextStream: Use casts instead of Q_UINT64_C for negative values cast to quint64
Q_UINT64_C appends a literal, which causes warnings:
tst_qtextstream.cpp(2026): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2030): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2031): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2032): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2289): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2309): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2329): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2355): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2381): warning C4146: unary minus operator applied to unsigned type, result still unsigned
tst_qtextstream.cpp(2411): warning C4146: unary minus operator applied to unsigned type, result still unsigned

Change-Id: I69ac87c224b75aff059477362d8a317c7e766ec2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-11-30 10:48:50 +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
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
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
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
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
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
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
Allan Sandfeld Jensen
9204b8c31e Register fonts with preferred names on Windows
Looks up the canonical names of enumerated fonts and register them under
their preferred names if present.

Also changes the logic handling registration of english aliases, so it
is always done, even if it might in rare cases cause a double
registration since that is safe.

Task-number: QTBUG-53458
Change-Id: Ia010774b26072192b55697b717cc37442c852881
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-11-23 10:04:47 +00:00
Edward Welbourne
a32424b46c AreArgumentsNarrowedBase: Correct logic for narrowing connect() casts
The prior test deemed there to be narrowing if source and destination
integral-or-enum types didn't have the same signedness; but all values
of an unsigned source type can be represented in a larger signed
destination type, so there is no narrowing in this case.
Updated QObject test-case to match.

Change-Id: I517a5997adcad70e185d7469a8d26788e463cb75
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-11-23 09:24:40 +00:00
Liang Qi
38c1057f69 Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 0d2f0164f4.

Conflicts:
	header.BSD-NEW
	qmake/Makefile.win32
	src/openglextensions/qopenglextensions.cpp
	src/openglextensions/qopenglextensions.h
	src/winmain/qtmain_win.cpp
	src/winmain/qtmain_winrt.cpp
	tools/configure/configureapp.cpp
	util/glgen/qopenglextensions.cpp.header
	util/glgen/qopenglextensions.h.header

Change-Id: If26c6f4111b342378dd88bbdc657e322d2ab6ad8
2016-11-23 09:24:36 +01:00
Marc Mutz
d6c8fab880 QMutex: make sure we try_lock_for no shorter than the duration passed
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
allowed code such as

   mutex.try_lock_for(10us)

to compile, which is misleading, since it's actually a zero-
timeout try_lock().

Feedback from the std-discussions mailing list is that the
wait_for functions should wait for _at least_ the duration
given, because that is the natural direction of variance
(tasks becoming ready to run might not get a CPU immediately,
causing delays), while an interface that documents to wait
_no more_ than the given duration is promising something it
cannot fulfill.

Fix by converting the given duration to the smallest number
of milliseconds not less than the original duration. If that
is not representable in an int, use INT_MAX, emulating the
effect of a spurious wakeup, which are allowed to happen if
the function returns false in that case.

In the above example, the try_lock_for call is now equivalent
to

  mutex.tryLock(1);

The tryLock() docs state that the actual waiting time does
not exceed the given milliseconds, but fixing that is a
separate issue.

Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-22 11:32:35 +00:00
Friedemann Kleint
7920cfe46a Fix SCTP API according to Qt conventions
inDatagramMode() -> isInDatagramMode()
maxChannelCount -> maximumChannelCount

Change-Id: Ib64bf52cc3b40354927ee11e3f41d47e84c6d9c4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-22 07:13:01 +00:00
Andy Shaw
3cd457bdad Handle RemovePath correctly when calling matches()
Change-Id: Ied324a537df127e676fad26b42e658a9d5aeec9b
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-22 07:05:30 +00:00
Marc Mutz
4bf5a3c885 tst_QFormLayout: Fix UB (invalid enum value) in several functions
The code coerced a -123 into a QFormLayout::ItemFlags, which, however,
being an enum with enumeration values 0..2, only has valid numerical
values 0..3.

Fix by using 3 as the value to represent the invalid enum value, and
store this in a constant so as not to distribute this magic number
all around the test class.

Change-Id: Ie5e93a69ef5a3acdde43030b022e0cce8aec484d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-22 05:38:45 +00:00
Friedemann Kleint
ad788c1014 tst_qstandardpaths: Disable WOW64 redirection on Windows
The logo (microsoft.windows.softwarelogo.showdesktop.exe) is otherwise
not found.

Change-Id: Ic52329462612a027e2928922a1f9a541dcbc67a3
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-22 05:29:11 +00:00
Simon Hausmann
d207738245 Fix missing last modification time stamp in qrc content
The time stamp is added at the end of the node information and
consequently this also bumps the version.

Task-number: QTBUG-57182
Change-Id: Ia10e006f28c0b168b2bcd74ed8b7098f84d10af3
Reviewed-by: hjk <hjk@qt.io>
2016-11-22 04:57:02 +00:00
Mitch Curtis
f817a995b2 tst_qhooks: test that it's possible to chain multiple hooks together
Chaining hooks together was mentioned by Ossi in the comments of
d953d9a4. This patch justs add a test that verifies that it works, and
also serves as an informal example for developers looking how to do it.

Change-Id: I53a014d5663c289ea0559e0926ed301f4e5110e6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-18 15:22:32 +00:00
Edward Welbourne
a56dd0b828 tst_QDateTimeEdit: Use base method, not direct member access
A test was directly accessing the .text member of QDateTimeParser
(which presently has nothing private).  Use the virtual .displayText()
method of this base instead, to let the base have some hope of
data-hiding (maybe, some day).

Change-Id: I8b6e39fba130de56f117bffb2aec346197969c5b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-18 05:03:43 +00:00
Allan Sandfeld Jensen
ac384524c8 Speculative fix for tst_QThread::wait2() flakiness
This test fails on Windows occasionally with values just short of 800, the lowest
observed being 791. It is probably rounding somehow to 10ms segments, so allow
it to be up to 10 ms too fast.

Change-Id: Ie28e9f61588b68a9060a006f78eedc3a26d05155
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-17 14:23:19 +00:00
Andy Shaw
bd591064be Use QPersistentModelIndex for storing a model index
QModelIndex is not safe to be used to store an index as it is designed
to be discarded right after use as the index information can change.

Therefore a QPersistentModelIndex should be used instead to store the
index. Subsequently the m_index does not need to be updated whenever
the model changes anymore as this is already done for us.

Task-number: QTBUG-49907
Change-Id: Icc93e410de2821c503ea15a7a1dd9ae32634914e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2016-11-17 06:48:31 +00:00
Lars Knoll
03c1a6ac71 Remove last traces of opengl es 1 support
Change-Id: I3f86d4892ec3235003d34fdcf3f093f1513c821f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-11-16 22:00:46 +00:00
Marc Mutz
bebbaa43fd Fix warnings in tst_q{table,list}widget
GCC warned:

  tst_qtablewidget.cpp:30:
  tst_qtablewidget.cpp: In member function ‘void tst_QTableWidget::mimeData()’:
  qtestcase.h:66:52: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
       if (!QTest::qVerify(static_cast<bool>(statement), #statement, "", __FILE__, __LINE__))\
                                                      ^
  tst_qtablewidget.cpp:1523:5: note: in expansion of macro ‘QVERIFY’
       QVERIFY(data = table.mimeData(tableWidgetItemList));
       ^~~~~~~

Fix by adding the extra parentheses, as usual.

Change-Id: I2826d7a865b4113b468d5a958ede06e03aa0e278
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-16 20:21:50 +00:00
Liang Qi
90c425642d Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	mkspecs/common/linux-android.conf
	src/gui/opengl/qopengl.h
	src/network/socket/qnativesocketengine_winrt.cpp
	src/network/socket/qnativesocketengine_winrt_p.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
	src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
	sync.profile

Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
2016-11-16 12:35:36 +01:00
Oswald Buddenhagen
c05f0a83fd qmake: make discard_from() patch up QMAKE_INTERNAL_INCLUDED_FILES as well
when the file's effects are discarded, the mention of the file should be
as well.

Change-Id: I894b7e2b887dd34d18533b197bfa9d0d84d647e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-15 22:44:27 +00:00
Oswald Buddenhagen
965e861e61 qmake: let discard_from() discard function definitions as well
for completeness.

Change-Id: I3ffc14e041408c773e277442828170e3df04ec8d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-15 22:44:23 +00:00
Allan Sandfeld Jensen
887e260a93 Improve QMake JSON error
We can not improve the result from JSON parsing without changing API,
so instead recalculate the line and column based on input and offset.

Change-Id: I54149233f71023aa5d30deff854d6f3406c5c48c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-15 17:27:01 +00:00
Allan Sandfeld Jensen
e133f0cca4 Improve error offset in JSON parsing
Do not consume white-space after a token before the token has been
parsed, otherwise we end up with misleading offsets. This also fixes
a wrong error of illegal number in several cases.

Change-Id: I492ca4de0346a1d0ab73b1c23d7a72dba812664c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-15 14:19:23 +00:00
Friedemann Kleint
628d367a9d Stabilize tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()
The test relied on the file created being automatically selected,
which sometimes does not happen when executing the entire test.
Explicitly select the file and check the selection.

Use the temporary directory for testing.

Change-Id: Ia58641c1ac32ba21effa8a5ace9623eb5d48a1c2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-11-15 09:56:31 +00:00
Liang Qi
9808b53fde Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	configure
	src/plugins/platforms/eglfs/qeglfsintegration.cpp
	src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp

Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
2016-11-15 09:58:16 +01:00
Lars Knoll
94f9ee79a6 Clean up some conditions in our pro files
Change qtConfig(opengl(es2)?) to qtConfig(opengl) as that covers
the case without any regular expression.

Change-Id: I935e3150f87e195e8bd3d0e55b4ed43572b131cf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-14 19:22:17 +00:00
Friedemann Kleint
d91bf00c43 tst_QFileSystemModel::specialFiles(): Remove Windows parts
The test created a Windows shortcut (.lnk) and checked on its existence.
It was not found in the first test since QFileSystemModel returned
the resolved file name (linktarget.txt). When fixing this by querying
QFileSystemModel::fileInfo()::fileName(), the 2nd test failed since
shortcut files are not considered system files.
Amends change 3b093034b6.

Task-number: QTBUG-53890
Task-number: QTBUG-20968
Task-number: QTBUG-29403
Change-Id: Iec58b52532b44d12759eaa6c8d63a8a4dc8d1bc3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-11-14 15:26:32 +00:00
Oswald Buddenhagen
8db556d299 fix $$section()'s bad argument count error message
the autotest was also broken, because it was created by pasting the
bogus message into the result ...

Change-Id: I02b8663b96c7d96cdb3c19639e2213e49fd2bcec
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-11-14 12:18:56 +00:00
Maurice Kalinowski
dffde23a0a Fix writing into application directory
Tests are not supposed to write into the build/application directory,
but rather should output to the temp directory.

Change-Id: Idcdf51226a2d547514aea2fbb2054998d8a3437e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-11 15:36:10 +00:00
Lars Knoll
bfaa8925d5 Improve the validation algorithm for binary JSON
Add better boundary checks and catch (hopefully all)
cases where invalid binary JSON could cause crashes.

Change-Id: I206510b7c5e3ba953802a5f46645878e65704ecc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-11 12:34:27 +00:00
Gabriel de Dietrich
5cff7d2b67 QComboBox: Prioritize the model font for popup items
On Mac, we use QComboMenuDelegate specifically as
item delegate for the popup list. It happens that
the order of resolving the font for each item
individually would prioritize QComboBox's font
instead of whatever the assigned model's FontRole
would specify.

The fix only requires checking whether FontRole is
valid before falling back QComboBox's properties.

Change-Id: I7208ad1911b30cc52c826c1884a1e19f5acd9fb4
Task-number: QTBUG-56693
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-11-10 05:40:29 +00:00
Eskil Abrahamsen Blomfeldt
15414257b3 Don't count no-break spaces as trailing spaces
No-break-spaces should not be counted in the space data, but rather
be treated as any other non-breakable character. We were already
taking care of this in the loop we reach if the item starts with
a character which isn't whitespace, but there is a second loop for
items that begin with whitespace characters.

The result of this was that in certain circumstances where you gave
the nbsp its own format and made the line wrap, the previous line
would count an extra trailing space and it would swallow the first
character in its following line.

[ChangeLog][QtGui][Text] Fixed a bug where a no-break space would
sometimes cause the first character of the containing line to not be
displayed.

Task-number: QTBUG-56714
Change-Id: Idd760a389052e6de70f6cc397122b217987fa5f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-09 16:24:46 +00:00
Kai Koehne
615270a300 Rename QtPrivate::is_[un]signed to QtPrivate::Is[Un]signedEnum
Any other use than for enums should use std::is_[un]signed. Make this
explicit by renaming the type traits.

Change-Id: I494158563c95c710e710d0d337f4e547006df171
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-09 09:13:29 +00:00
Kai Koehne
5c3b16706f Remove compiler-specific implementations of Q_IS_ENUM
Since the macro is now just a wrapper for std::is_enum,
its use is also deprecated.

[ChangeLog][QtCore][Global] Q_IS_ENUM is deprecated.
Use std::is_enum<>::value instead.

Change-Id: I09b9f4559c02c81f338cace927873318f2acafde
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-09 09:13:01 +00:00
Daniel Vrátil
9de3b15d07 QLabel: take DPR of QMovie in account when calculating sizeHint
QLabel already does that for QPixmap, so just do the same for
QMovie's current pixmap.

Task-number: QTBUG-48157
Change-Id: I7b26460f778e56ff017a5efd433f8929f30e4b41
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-11-09 09:09:26 +00:00
Kai Koehne
ed7f77071d Replace custom type traits with std one's
Remove most type traits from qtypetraits.h, but keep the custom
implementation of is_signed/is_unsigned. This gets rid of
BSD-3 licensed code from Google in a public header (hugh!).

The custom implementations for is_signed/is_unsigned are kept
because the implementations in gcc's standard headers do not
work as we expect for enums - both is_signed and is_unsigned
always returns false there - see also
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027

[ChangeLog][QtCore][General] Qt now relies on type traits from
the C++ standard library.

Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-08 15:31:17 +00:00
Allan Sandfeld Jensen
baebb6aa26 QVariant to QJsonValue::Null conversion
Adds a few missing parts of the conversion from QVariant to QJsonValue
after the introduction of the nullptr QVariant. The conversion the other
way is already implemented.

Change-Id: I8b25dec4b476c4761c5098a60944ff11c36f8bec
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-08 09:50:32 +00:00
Eskil Abrahamsen Blomfeldt
95d1273548 Windows: Don't claim bitmap fonts support all standard sizes
We were throwing away important information by claiming that all
fonts support all the standard sizes in QFontDatabase on Windows
This caused the font dialog to list unsupported sizes for bitmap
fonts, unlike the native font dialog.

We would also claim to support creating bitmap fonts at
unsupported sizes, which would lead to
1. QFontInfo(font).pointSize() would return the requested size,
not the actual rendered size.
2. Bitmap fonts created at 64 pixels and higher would be invisible.

On Mac, there are no system bitmap fonts, and the use is not very
common, but installing some bitmap fonts on the system, it does
seem to ignore the sizes supported in the font and just displays
the standard list instead, so we keep the current behavior there.

[ChangeLog][QtGui][Text] Fixed list of supported sizes for
bitmap fonts on Windows.

Task-number: QTBUG-56672
Change-Id: Idbec2db9eb3381ab5ddf6259bd2befcba9b93564
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-07 08:32:37 +00:00
Liang Qi
a732576a66 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	config.tests/win/msvc_version.cpp
	configure.pri
	mkspecs/macx-ios-clang/features/default_post.prf
	mkspecs/macx-ios-clang/features/resolve_config.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/uikit/resolve_config.prf
	src/corelib/io/qsettings_mac.cpp
	src/corelib/json/qjsondocument.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.h
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/ios.pro
	src/plugins/platforms/ios/kernel.pro
	src/plugins/platforms/ios/qiosintegration.h
	src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
	tests/auto/gui/painting/qpainter/tst_qpainter.cpp
	tools/configure/environment.cpp

Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
2016-11-01 06:02:55 +01:00
Liang Qi
8e20daae9f Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/minimalegl/qminimaleglintegration.cpp

Change-Id: Ia6ab42a6daadbf8abc085c971545904d49ea4b56
2016-10-31 09:26:35 +01:00
André Somers
4c00246fea Fixed crash taking null central widget
When no central widget has been set, calling takeCentralWidget should
just return a null pointer instead of crashing.

[ChangeLog][QtWidgets][QMainWindow] Fixed crash using takeCentralWidget when
the central widget was not set.

Task-number: QTBUG-56628
Change-Id: I240ccf4caa41d2716a78851571fbfbf444a4922e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-10-28 14:11:42 +00:00
Liang Qi
af0d0b9c06 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/ios/ios.pro
	src/plugins/platforms/ios/kernel.pro
	src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h
	src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
	src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h
	src/plugins/platforms/ios/qiosintegration.h
	src/widgets/widgets/qcombobox.cpp
	tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
	tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp

Change-Id: Ibaee7cbbba99e7c4b1d8926e55932ffa6030ce45
2016-10-27 10:23:39 +02:00