Commit Graph

34841 Commits

Author SHA1 Message Date
Mårten Nordheim
b14934547a Use TESTDATA for QSsl* tests
Apparently this (undocumented) TESTDATA feature creates resource files,
but lets you use wildcards as well, which is very handy.

The reason I didn't know/realize this when adapting the tests to use a
".qrc"-file* was because some of the test-cases were using relative
paths instead of the 'testDataDir' variable.

This commit fixes the remaining uses of relative paths, removes a
usage of QDir::setCurrent, and adapts QSslSocket to use TESTDATA.

* in now-reverted commit e1600c1a73

Change-Id: Iee6d88f1e0810eeaadac90e7d44bc6db84bfeabf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-01-12 11:43:55 +00:00
Martin Smith
6b012a30d9 doc: Add template clause to \fn commands in qmenu.cpp
clang-qdoc requires the template clause in \fn commands
for template functions.

Change-Id: I5719f39ebca6064e6480e873a1d4f339f41df436
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 11:42:39 +00:00
Martin Smith
b426e00ebf doc: Add template clause to \fn commands in qtoolbar.cpp
clang-qdoc requires the template clause in \fn commands
for template functions.

Change-Id: I838bae74102e99b64f04960ad88f192e45d901ba
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 11:42:25 +00:00
Martin Smith
485c21dcc9 doc: Remove <CR> from \fn commands
clang fails for \fn commands that contain CR.

Change-Id: I4ece5110437cf358e408731f93993bf2d9702381
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 11:41:51 +00:00
Kai Koehne
42cb74aa81 MinGW: Remove workaround that disabled strict_c++
The workaround was needed in older versions of MinGW-w64 headers that
did disable some common functions for -std=c++1z. Anyhow, this is not
reproducable anymore with any recent MinGW-w64.

Change-Id: I8e34a2e055f8e2356696dd4fe131a757c1527574
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-12 11:41:37 +00:00
Liang Qi
c81966c39e Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2018-01-12 08:00:04 +00:00
Martin Smith
e6c089ae28 doc: Remove unneeded \fn commands
Removed unneeded \fn commands from two qdoc comments and
moved one of the comments to the file where its function
definition is located.

Change-Id: I4c4371f0541d2995398b0d32e1df409433061226
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-12 07:20:36 +00:00
Friedemann Kleint
9031069e12 Add more Q_FALLTHROUGH()
Silence g++ 7.X warnings.

Change-Id: Id06d06e7e3b5be2cf3934d81f1891da58dea2649
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-12 07:10:25 +00:00
Gabriel de Dietrich
cf7a4016a1 QMacStyle: Draw CE_MenuItem text using AppKit
We seem to induce QCoreTextFontEngine to draw text the
wrong way in non-native QMenu popups. Here, we just
delegate menu items' text rendering to AppKit.

This is only a workaround pending a proper fix or better
understanding of the aforementioned issue.

Change-Id: I71088ebe2a534bebca2ad396b1ea6754be093f55
Task-number: QTBUG-65653
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-01-11 23:37:34 +00:00
Liang Qi
f4d8cafc1b Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/3rdparty/harfbuzz-ng/src/hb-private.hh
	src/sql/doc/snippets/code/doc_src_sql-driver.cpp
	src/sql/doc/src/sql-driver.qdoc

Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
2018-01-11 18:10:41 +01:00
Rainer Keller
b03133231b qtlite: Skip building examples when configured with no-feature-udpsocket
Compiling the default examples should be possible without compile errors.

Task-number: QTBUG-46857
Change-Id: Ie323798df09cdbebc67eb617a7e0ec4c66cb2357
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-11 12:37:50 +00:00
Jani Heikkinen
a6514ddd33 Fix license headers
Remove usage of outdated header.LGPL21 and replace those with proper
one (header.LGPL in src, header.GPL-EXCEPT in tests)

Change-Id: Ia4d1c0d84b77f09787fe7c30670747a1fe2aff29
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-01-11 11:40:36 +00:00
Liang Qi
1759510201 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2018-01-11 11:40:34 +00:00
Kai Uwe Broulik
e5b422382a QGuiApplication: Add fontChanged signal
This removes the need to install an event filter on qApp just for this.
A similar thing was done with setPalette to reduce the number of event filters
in e.g. SystemPalette and Quick Controls.

[ChangeLog][QtGui][QGuiApplication] Added fontChanged signal

Change-Id: Ifa843aa42b91ac63ab17c3b064ac0e764aac77d3
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-01-11 10:25:05 +00:00
Liang Qi
d51dde6c67 Blacklist tst_QNetworkInterface::localAddress(linklocal-ipv4) in ci
To unblock qt5 5.10->dev merge.

Task-number: QTBUG-65667
Change-Id: Iffd3648913efb52ad5be9dc5310a9f836fab3de1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-10 21:26:20 +00:00
Friedemann Kleint
8247ce9766 SQL plugins: Fix warnings about deprecated constructor of QSqlError
Use the constructor taking a string and convert number unless
it is -1.

Change-Id: I18d1ba2c8e0d3f4af01b7955863967f75051746b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-10 21:18:26 +00:00
Alex Trotsenko
344acfb9fe QRingBuffer: replace some checks with asserts
To avoid the silent exits and potentially dangerous output values, the
caller must supply the correct parameters on input.

Change-Id: Ia9c56940adbf4ad34605a002dfc5c86b32c4658c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-10 20:21:31 +00:00
Paul Wicking
1623f66989 Doc: Swap unresolved variables with actual function names
Original documentation commit included unresolved link target names.
This fix replaces them with the actual OpenGL function names.

Change-Id: I36a24eb237ef35d7207f3bae0771dc96476d7b19
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-10 14:13:05 +00:00
André Klitzing
e56eb33cf8 Enable brainpool curves in qsslkey tests
Change-Id: Ibdc0a045e0b0469bfb4dc362e3bc3e6b7940d783
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-10 13:25:25 +00:00
Rainer Keller
56e00bf6c0 qtlite: Fix compilation of QWidgetLineControl when configured with no-feature-itemviews
Task-number: QTBUG-53141
Change-Id: I00d9d7fc43a4531c9213281f529b2d0f3164a5c6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-01-10 09:08:01 +00:00
Giuseppe D'Angelo
ff25a7ec05 QAbstractItemModelTester: fix the autotests
Move the modeltest autotest in the right place, and fix the
other autotests that were using it to use the version now in QtTestLib.

Change-Id: Ic6838945f616d580f357c872ce0956c341be3b16
Reviewed-by: David Faure <david.faure@kdab.com>
2018-01-09 21:12:58 +00:00
Liang Qi
9bee6712fc Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I840849c072075a69819eb185b20bc42c3de0f825
2018-01-09 21:27:30 +01:00
Martin Storsjö
74118a4784 moc: Initialize staticMetaObject with the highest user-settable priority
The referenced static meta object for the superclass might be in a
different DLL. In this case, the whole QMetaObject can't be initialized
all via preinitialized data in the data section of the binary, but must
run code at runtime to fill in the value of the dllimported pointer.

In these cases, both GCC and MSVC initialize as much as possible statically,
while only filling in the dllimported values (QMetaObject::d::superdata)
at runtime. Clang, on the other side, initializes the whole struct
at runtime if some part of it needs runtime initialization, leaving
the struct completely uninitialized before constructors are run.

In C++, there are no guarantees for in what order constructors in
different translation units are executed. This in particular means
that there are no guarantees as to whether qRegisterWidgetsVariant()
in qwidgetsvariants.cpp runs before or after the runtime initialization
of QWidget::staticMetaObject.

With GCC and MSVC, this doesn't seem to have mattered since only the
superdata pointer of the staticMetaObject was uninitialized - everything
else was initialized, and the superdata pointer doesn't seem to be
accessed during qRegisterWidgetsVariant.

With clang, the whole staticMetaObject is uninitialized, unless the
staticMetaObject has been initialized before (and the initialization
order is undefined).

By setting a manual priority (which is a GCC extension that also
clang supports) for the staticMetaObjects, we can be sure that
these are initialized before the actual explicit constructor
invocations (without any explicit initialization priority) that
can access the staticMetaObjects.

Change-Id: I64a82f12d690528567509791bae088b6304e189b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-01-09 18:36:46 +00:00
Christian Ehrlicher
81566ca9aa QHeaderView: fix visualIndexAt() in rtl-mode
QHeaderView::visualIndexAt() did not calculate the correct position in
right-to-left mode. This lead e.g. to missing vertical grid lines in
QTableView/Widget when scrolling horizontally.

Change-Id: Ia50e5cfd7830a6ad8abd17ff79d9fbb33dc4097c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-09 17:54:43 +00:00
Christian Ehrlicher
a40e2c7d98 Avoid useless casts to/from uint
Remove some c-style casts from int to uint which were needed in Qt3 (or
earlier?) but nowadays the values are all int.

Change-Id: Iecd739c450873adf952a17f635d7fb6825537907
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-09 17:54:22 +00:00
Joachim Puhr
50deb8cf70 doc: Hints for using SAP HANA database
As the HANA ODBC driver does not provide scrollable
results per default, the connection has to be established
with a specific option.

Change-Id: I14751a94f61d6fffd6d56c39076c24ec4d1f88ef
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joachim Puhr <jpuhr@gmx.de>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-09 16:35:58 +00:00
Giuseppe D'Angelo
b3e4be2d8b Long live QAbstractItemModelTester!
AKA the model tester, living in QtTestLib now.

Underwent some significant refactoring from the original modeltester:
in particular, it will stop testing illegal indices.

[ChangeLog][QtTestLib] Added QAbstractItemModelTester, a class
to help testing item models.

Change-Id: I0e5efed7217330be11465ce3abb3590f3f2601a4
Reviewed-by: David Faure <david.faure@kdab.com>
2018-01-09 15:57:58 +00:00
Alex Trotsenko
2d260eada8 Micro-optimize QRingBuffer::free()
Change the condition to strong equal, as 'bytes' was checked against
wrong value on the start of the function.

Change-Id: I4ec4768b9fff3292af233417c4a5862d72d4eeac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-09 15:52:18 +00:00
Albert Astals Cid
c1aaa13939 Fix custom page size handling in the Unix print dialog
There were several problems that i've fixed in a single commit since they are very interwinded

 * The dialog used QPageSize::Custom for two things, the custom sizes coming from
   the printer and the "user can write whatever size they want" size. Now only
   the printer custom sizes use QPageSize::Custom and we use m_realCustomPageSizeIndex
   for the "user can write whatever size they want" one.

 * The dialog stored the QPageSize id as the combo userData, that doesn't work
   when the printer has multiple custom sizes since they all share QPageSize::Custom
   so now it stores the QPageSize itself

Task-number: QTBUG-58733
Change-Id: Ie640a07bb5e24b753db83c091c836e8af4ff126c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-09 15:42:33 +00:00
Albert Astals Cid
bc632bc2bf QUnixPrintWidgetPrivate::_q_printerChanged: Update state correctly
We need to update the printer output format and the current print device
when changing the printer so that if the user opens the properties dialog
for that printer it reflects correctly the selected printer.

Change-Id: Ib6767a74b74b8eebe43ff17006b6105c483a08b6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-09 15:42:25 +00:00
Renato Araujo Oliveira Filho
f6fd3f18d3 Validate printer duplex mode
Disable unavailable duplex options
Remove redundant option on advanced tab

Change-Id: Ie09c9ffd637b521210e3d7d4f15300792f910996
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2018-01-09 15:42:17 +00:00
Robert Szefner
ca4a76350a Small optimalization for NULL values
No need to call PQgetvalue() before PQgetisnull().

Change-Id: Ie83ee577b082dbe9d9ca2e86212a281abebdde6e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-09 14:13:52 +00:00
Ryan Chu
a5ad605dfe QFtp: only use fall-back password for anonymous access
The code used to fall back to anonymous login independently for username
and password; however, it should only use a fall-back password if the
username is missing or (case-insensitive) "anonymous".  When a
non-anonymous username is given without password, we should simply skip
he PASS message to FTP.

If the FTP server requests a password, in the latter case, QFtp will
signal authenticationRequired; in all cases, if the server rejects the
given credentials, QFtp signals authenticationFailed.  Either way, the
client code can then query the user for credentials as usual.

Task-number: QTBUG-25033
Change-Id: I2a4a3b2725819ab19c8a7e4baa431af539edcd8d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-09 13:31:55 +00:00
Kavindra Palaraja
6ff8d8173d Clarify behavior of setData in QListWidget, QTableWidget, and QTreeWidget
setData()'s default implementation for QListWidget, QTableWidget, and
QTreeWidget treats Qt::EditRole and Qt::DisplayRole as referring to the
same data. Used the same sentence from QStandardItem::setData for
consistency.

Task-number: QTBUG-11549
Change-Id: I41d06bdaaa8e7d4a86e24147b3d8222ad7823a6c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-09 13:22:15 +00:00
Kevin Funk
43e444d1ff CMake: qt5_add_binary_resource: re-run if needed
qt5_add_binary_resources() macro did not recompile for CMake generated
input before this patch.

Adding the input files to the DEPENDS option corrects this issue:

Task-number: QTBUG-60714
Change-Id: I0f46918c6f1079fed7ee1b21305b18ff38f863f8
Reviewed-by: David Faure <david.faure@kdab.com>
2018-01-09 13:21:46 +00:00
d3fault
43f2d43e8f Add doc explaining the gotcha when connecting a signal to qApp->exit
Change-Id: I981e4bfdf679bf755665748e9d3b389a94561e55
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-09 13:21:21 +00:00
Eskil Abrahamsen Blomfeldt
02557c07da Fix ZWJ and ZWNJ when fallback font is in use
When applying fallback fonts to characters that are joined by
ZWJ or ZWNJ, we also have to set the same font for the control
characters, otherwise we will split the text and the necessary
shaping will not take place. This was reported for emojis, but
will probably also happen for Indic scripts where joiners are
used predominately.

[ChangeLog][QtGui][Text] Fixed ZWJ and ZWNJ control characters
when fallback fonts are in use.

Task-number: QTBUG-65519
Change-Id: Ia37233f3319b95af68ae6053c29997eac65448e0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-09 12:16:57 +00:00
Eskil Abrahamsen Blomfeldt
12687ccfd5 CoreText: Order fallback fonts based on writing system support
After we stopped sanitizing the fallback font list (with change
6ca48a847a), we now need to make
sure it is ordered so that the fonts that support the writing
system in question are always tested first, otherwise we can end up
loading a lot of fonts that will never be used.

Task-number: QTBUG-65605
Change-Id: Id2a65bbff3e64e6d6e6b4f72500778ee3e811e84
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2018-01-09 12:17:34 +00:00
Friedemann Kleint
fcbaa8ec38 QFileSystemModel/Windows: Make file name checking case-insensitive
Introduce a special hash modeled on the one used for QFileSystemWatcher
on Windows.

Task-number: QTBUG-31103
Task-number: QTBUG-64147
Change-Id: I69ebabe841716e4957ae3fb04fa5c43d233a3552
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-09 12:01:17 +00:00
Allan Sandfeld Jensen
d196036024 Avoid providing bad pixelDeltas on X11
With libinput we now get a hardcoded resolution that is unrelated to
the hardware. So avoid using that as a real pixel delta and document
pixel deltas as being driver specific and unreliable on X11.

Task-number: QTBUG-59261
Change-Id: I9fe86d80e7ccd290ed2e4091d7eafa52cb537d34
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-01-09 11:53:28 +00:00
Andy Shaw
f2b802f923 Add HAVE_USLEEP define to give better performance where possible
Change-Id: I6fa68a7eac9001cabceabf846bc11e9ed1001d2c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-09 09:51:56 +00:00
Mårten Nordheim
21c9b6fc58 QSsl* tests: Ensure trailing slash on directory path
Then we don't need to add a leading slash. (minor clean-up)

Change-Id: I86af224841009fda838e7cb89d47d324963328c9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-09 08:52:46 +00:00
Mårten Nordheim
a5c58d503d Revert "Adapt the QSsl* tests to use the resource system"
This reverts commit e1600c1a73.

The commit missed the fact that TESTDATA exists. Which supports
wildcards and then can automatically pick up new files when added (as
long as they match a wildcard) and then you don't need to maintain a
giant qrc file.

Change-Id: Ie31fadb5ef6e8dfe6105f4f9764292f78cffb512
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-09 08:52:41 +00:00
Sérgio Martins
a79d9da8e0 Fix build due to missing QDebug include
The build just passes on Qt CI by chance.

Change-Id: I3bfef12b48df22fa64d92af9cd345bfc984c9923
Reviewed-by: David Faure <david.faure@kdab.com>
2018-01-09 08:04:07 +00:00
Jani Heikkinen
907a99f65b Fix license headers
Old header.LGPL21 header was used at some files. Replase those with
new header.LGPL one

Remove old header.LGPL21

Task-number: QTBUG-57147
Change-Id: I650e39024ed4876bba27e954c7d61fdb025b46ef
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-09 07:47:20 +00:00
Friedemann Kleint
da3a600824 QWindowsXPStyle: Speed up level window loop in helper winId()
Rewrite the loop using QGuiApplication::allWindows() to avoid
the creation of temporary containers by
QApplication::topLevelWidgets() and expensive checks.

Task-number: QTBUG-64072
Change-Id: I56ef29b12f7bcbe274f3e00a6007d75d33f22b10
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-01-09 07:20:23 +00:00
Martin Smith
a473103734 doc: Remove undef of Q_GADGET
Someone, almost certainly this writer, undefed Q_GADGET for
qdoc, but this was a mistake that caused clang to report a
lot of errors for undefined variable. The undef of Q_GADGET
is now removed.

Change-Id: I39fb09443110b60bbcb16cf350f38c1eac773d8a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-09 06:40:21 +00:00
Martin Smith
49e2746e16 doc: Correct clang parsing errors in qvariant.h
Some old uses of Q_QDOC to prevent the old qdoc C++ parser
from seeing declarations it didn't need to see were preventing
clang from seeing declarations it did need to see. These have
been removed, and some internal documentation has been added to
account for some declarations that suddenly became public but
should not be seen in the Qt API.

Change-Id: Iccf423e5cf8767f0a271150ab59bea54cf90ac46
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-09 06:40:14 +00:00
Martin Smith
32c942ce85 doc: Move use of Q_CLANG_QDOC that caused compile-time assert
It caused a compile-time assert in clang that should not have occurred.
It is now moved passed the assert macro.

Change-Id: I8311992617de7837ca4604fcc3e5afb17dcda65d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-09 06:40:05 +00:00
Martin Smith
643290e49b doc: Remove Q_QDOC declarations that are no longer needed
clang-qdoc understands Q_OBJECT, so it sees the declarations
that appear there.

Change-Id: I669be13af59269a0e108e0988d9b4f7779274c7c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-09 06:39:54 +00:00