Commit Graph

33613 Commits

Author SHA1 Message Date
Simon Hausmann
b75bc0f75c Fix failing network cookie jar tests
The test verifies that a cookie with a date in the future is not
"expired" and will be sent to the server. This test started failing
on August 7th 2017 when the test case "0003" with it's cookie expiring
August 7th 2017 started ... expiring ;-)

Bumped all suspicious cookie test cases by a hundred years.

Change-Id: I7c09069ec4999e2ea0aae7b2a2819cced0fd6a99
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-08-07 19:19:13 +00:00
Simon Hausmann
ea9032ceaa Revert "Ignore thaiZWJ failure on RHEL 7.2"
The blacklisting is not needed anymore as we now use -qt-harfbuzz.

This reverts commit b36e5faad4.

Task-number: QTQAINFRA-1363
Change-Id: I3ae50588204b27e6880416ae2cbc28dda53bb292
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-08-07 07:18:26 +00:00
Thiago Macieira
5a9b1425e1 QFileSystemEngine/Unix: rework the getting of nsec-precision file times
It was working on Linux because _GNU_SOURCE gets us POSIX.1-2008
compatibility, but not on macOS or the BSDs. There, we were still stuck
to full second precision.

This commit uses the template trick introduced by the futimes code
(which itself was inspired by commit 2fb42eb4af
in QtNetwork). Also note how it adds support for birth time, if the
system's stat struct has that information.

Tested to work on MacOS and FreeBSD. The manual filetest produces:
 Name:   .
 Path:   . (/usr/home/tjmaciei/src/qt/qt5)
 Size:   1536    Type: Directory
 Attrs:   readable writable executable hidden nativepath
 Mode:   drwxr-xr-x
 Owner:  tjmaciei (1001) Group:  tjmaciei (1001)
 Access: 2017-07-13T20:03:47.916
 Birth:  2017-07-13T20:03:47.916
 Change: 2017-07-13T20:04:41.648
 Modified: 2017-07-13T20:04:41.648

Linux will require support for statx(2).

Change-Id: I8d96dea9955d4c749b99fffd14cd97d7a8c6d45d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-06 23:14:26 +00:00
Thiago Macieira
04f4d87bda QFileSystemEngine::fillMetaData: simplify and comment the code
Took me a long while to understand what it did. Now that I do, I can
also answer the question left behind during the original implementation
in Qt 4.8 (commit 4fd2aced96d9095254d89f9da9c911bd88f15245 in the old
history): how to know if a file exists?

Change-Id: I8d96dea9955d4c749b99fffd14cdae135499a0d3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-06 23:14:22 +00:00
Thiago Macieira
12339481ea Move Unix code from qfilesystemengine.cpp to qfilesystemengine_unix.cpp
The comment about Symbian no longer applies.

Change-Id: I8d96dea9955d4c749b99fffd14cd966f07d95948
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-06 23:14:18 +00:00
Nico Vertriest
2765b0cf3a Doc: remove linking to internal method
qimage.cpp:2127: warning: Can't link to 'isDetached()'

Change-Id: Ib8f056441bf08e315ed97caf55c510f50ebaf4ed
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-08-06 09:42:04 +00:00
Eskil Abrahamsen Blomfeldt
9342a8b843 Add QTextOption/QTextEdit/QPlainTextEdit::tabStopDistance property
In Qt, we have QTextOption::tabStop, QTextEdit::tabStopWidth and
QPlainTextEdit::tabStopWidth.

Neither are very good names, since the tab stop is neither a
numerical value as in the former, nor does it have any dimensions
that can be measured, as in the latter. Vertical text advances
may also be supported by Qt at some point in the future, at
which point the name would make even less sense.

At the same time, we expose the actual type of the tab stop
distance as floating point in the QTextEdit and QPlainTextEdit
API instead of always rounding it to an int.

To avoid duplicating either of these APIs in Qt Quick, we
introduce tabStopDistance as the common term instead and deprecate
the old names.

[ChangeLog][Text] Introduced tabStopDistance property in
QTextOption, QTextEdit and QPlainTextEdit as replacement for
the inconsistently named tabStop and tabStopWidth properties.
QTextOption::tabStop, QTextEdit::tabStopWidth and
QPlainTextEdit::tabStopWidth have subsequently been deprecated.

Change-Id: Ib7e01387910cddb58adaaaadcd56c0e69edc4bc2
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-06 08:16:06 +00:00
Samuel Gaist
b03706d35f Migrate QStandardPaths to use QRegularExpression
This patch updates the code from the unix implementation of
QStandardPaths to use QRegularExpression in place of the deprecated
QRegExp.

Change-Id: I51fa231dcd70ca55d1bfffb31d8f28f964ac44fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-08-05 16:45:14 +00:00
Samuel Gaist
82fbf97903 Doc: add warning against bulk random data creation to QRandomGenerator
The full documentation explains it well but a more prominent warning
will help avoid the wrong use of that class and encourage user to read
further the documentation.

Change-Id: I3178749f2b1b0350040f81eef253fd85c7ba0a5f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-05 16:44:55 +00:00
Frederik Gladhorn
60bfd6a214 Fix typo
Change-Id: Ie82c0996a7b1112fe6d6d259d765737fc3fb6a22
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-08-05 16:44:36 +00:00
Thiago Macieira
f77117d6ca QFileSystemEngine/Windows: fix setFileTime when input date is UTC
I was getting a weird 7-hour offset when doing:

    QVERIFY(file.setFileTime(before.addSecs(-10), QFile::FileModificationTime));
    mtime = file.fileTime(QFile::FileModificationTime).toUTC();
    QCOMPARE(mtime, before.addSecs(-10));

Change-Id: I35c4da69d754686a43e675b3d215213e448df7cf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-08-05 16:41:47 +00:00
Thiago Macieira
a3c71b71e2 QFileSystemEngine::setFileTime/Unix: remove the fallback to futimesat
The use as in the code:
  futimesat(fd, NULL, &tv)

is not documented to work. The file descriptor should be a directory's
one, not an open file (though the Linux source code seems to handle that
case). This call was done as a fallback to futimes, so it's very
unlikely a system would have futimesat and not futimes.

Both the Linux and the FreeBSD man pages say it's deprecated anyway.

Change-Id: I8d96dea9955d4c749b99fffd14cd94068dc7668a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-05 16:41:42 +00:00
Thiago Macieira
6c3a3d498a Filesystem: Use "birth time" to avoid confusion with Unix ctime
The Unix stat fields "st_ctime" and "st_ctim" mean "change time", the
last time that the file/inode status fields were changed. It does not
mean "creation time". So this commit splits all of the internal API to
"birth" and "metadata change" instead of "creation" to avoid the
conflict.

Change-Id: I149e0540c00745fe8119fffd1463fe78b619649e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-05 16:41:38 +00:00
Thiago Macieira
db433bdf65 Move platform-specific code from QFSFileEngine to QFileSystemEngine
Change-Id: I8d96dea9955d4c749b99fffd14cd9395174ba005
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-05 16:41:35 +00:00
Thiago Macieira
261c6713bd Introduce QFileInfo::birthTime and metadataChangeTime
[ChangeLog][QtCore][QFileInfo] Deprecated created() because it could
return one of three different file times depending on the OS and
filesystem type, without the ability to determine which one is which. It
is replaced by metadataChangeTime() and birthTime().

[ChangeLog][QtCore][QFileInfo] Added QFileInfo::metadataChangeTime(),
which returns the time the file's metadata was last changed, if it is
known, and falling back to the same value as lastModified() otherwise.
On Unix systems, this corresponds to the file's ctime.

[ChangeLog][QtCore][QFileInfo] Added QFileInfo::birthTime(), which
returns the file's birth time if it is known, an invalid QDateTime
otherwise. This function is supported on Windows and on some Unix
systems.

Change-Id: I0031aa609e714ae983c3fffd1467bd8b3e3a593d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-05 16:41:32 +00:00
Borgar Ovsthus
8f03656211 Add flowId to messages when logging in TeamCity format
Added flowId='name' to each message when using TeamCity logging format.
This is necessary to distinguish separate processes running in parallel.

[ChangeLog][QtTest] Added flowId to messages when logging in TeamCity
format. FlowId is used to distinguish logging from multiple processes
running in parallel.

Change-Id: I7f5046c1058ff02770404caa2c9b3a5398f97f6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 18:48:48 +00:00
Jan Murawski
230c293f20 Fix iOS shared builds
Building iOS shared failed with link errors to the CoreGraphics framework
when building without harfbuzz-ng.
This patch adds the missing dependency.

Change-Id: If464417039172c2854e455563153057f0cea2a22
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-04 18:48:37 +00:00
Eirik Aavitsland
51edf8a2b2 Fix compilation of manual lance test
Commit 32a94e54 changed the API of the QPS engine (PaintCommands
class). Update the usage accordingly.

Change-Id: Ide57609e636dad0aa434d1049b600b72f731bc30
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-08-04 18:48:29 +00:00
Giuseppe D'Angelo
37af667771 XCB GLX: request OpenGL 4.6 / OpenGL ES 3.2 if possible
Code was lagging a bit behind published standards.

Change-Id: I0fe07c0162a54d9eed8b539887496b9313b37aa4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-04 18:48:16 +00:00
Romain Pokrzywka
02b0f44fab Fix race condition in QDBusAbstractInterfacePrivate::initOwnerTracking()
The current code fetches currentOwner in the constructor, then sets up
a connection between a service watcher and _q_serviceOwnerChanged() in
initOwnerTracking(). But an owner change notification could arrive
after we fetch the current owner and before the connection is made.
In this case the owner change notification will be lost, and the
interface will keep reporting being invalid permanently.

The fix is to delay initializing currentOwner until after the connection
is made.

Task-number: QTBUG-62284
Change-Id: I92b9d61004e14fd2ee2543488740a542dc7a9b7a
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 18:47:55 +00:00
Thiago Macieira
b22b514140 Bump minimum glibc requirement for sys/eventfd.h to glibc 2.8
The file was added to glibc 2.7 along with the functions we need (Added
2007-10-05). But they forgot to install the file until a month and a
half later (2007-11-17), which means it missed the 2.7 release
(2007-10-19).

Note that EFD_CLOEXEC wasn't added until glibc 2.9, so effectively glibc
2.9 is required.

Change-Id: I3868166e5efc45538544fffd14d773ba576fb793
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-04 17:56:34 +00:00
Jake Petroules
8615445835 Fix build error with macOS 10.13 SDK
Several of these variables/macros are no longer defined. We didn't
validate the preconditions on iOS, tvOS, or watchOS, so no
need to bother validating them on macOS either. Nor did we check the
OSStatus result on any platform anyways.

Task-number: QTBUG-62266
Change-Id: Id19ebead5d3a8a08a0a56d798f0173d0d893fc91
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-08-04 17:55:48 +00:00
Thiago Macieira
88c30618d5 QFileSystemEngine::renameFile: use calls that don't overwrite
The renameat2(2) Linux system call, new in 3.16, allows for the atomic
renaming of a file if and only if it won't clobber an existing
file. None of the Linux libcs have enabled this syscall as an API, so we
use syscall(3) to place the call.

If your libc has SYS_renameat2 but your kernel doesn't support it, we'll
keep issuing the unknown syscall, every time. Users in that situation
should upgrade (3.16 is from 2014).

On Darwin, there's a similar renameatx_np (guessing "np" stands for
"non-portable"). I haven't found anything similar on the other BSDs.

Change-Id: I1eba2b016de74620bfc8fffd14ccb4e455a3ec9e
Reviewed-by: David Faure <david.faure@kdab.com>
2017-08-04 17:30:33 +00:00
Thiago Macieira
4934138be2 Allow QSettings to synchronize non-atomically
This is required so that one can use QSettings in situations that
temporary files or renaming may not work.

[ChangeLog][QtCore][QSettings] Added setAtomicSyncRequired(), which
allows one to use QSettings with config files in unwriteable directories
or in Alternate Data Streams on NTFS on Windows. This used to work
before Qt 5.4, but remains a non-default behavior due to the potential
of data corruption.

Task-number: QTBUG-47379
Change-Id: I81480fdb578d4d43b3fcfffd14d4f77112f0402f
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-08-04 17:30:16 +00:00
Thiago Macieira
66500b9d75 Support Alternate Data Streams in QSaveFile
We can't use MoveFile to do atomic commits on an ADS, so QSaveFile needs
to detect when the target name is ADS and then use the direct fallback
mode.

[ChangeLog][QtCore][QSaveFile] Saving to Alternate Data Streams on NTFS
on Windows is now possible, but requires setDirectWriteFallback(true).

Task-number: QTBUG-47379
Change-Id: I81480fdb578d4d43b3fcfffd14d4bc062ae1750d
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2017-08-04 17:30:13 +00:00
Thiago Macieira
9a3ce25f98 QTemporaryFileName: use the random data more wisely
First, instead of getting 32 bits of random for every character, we can
get reasonable randomness with just 10 bits, so we can replace 3
characters per get32() call. A typical template with six X will only
need 64 bits of random data.

Second, using the PID is not random at all. The reason why mktemp used
to use it is irrelevant (probably because applications failed to seed
rand()). Either way, we don't need nor want the PID anymore. And because
the code is completely rewritten, the UCB copyright no longer applies.

Change-Id: I84e45059a888497fb55ffffd14d2d4cfe159abca
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 17:30:10 +00:00
Thiago Macieira
a06fb55dcb QFile::rename: use QTemporaryFileName instead of QTemporaryFile
This means the workaround for Linux's behavior now works even if
QTemporaryFile is disabled. We also avoid the creation of an otherwise
unused temporary file just so we can take its name.

Tested with tests/manual/filetest. Strace shows:
 renameat2(AT_FDCWD, "a", AT_FDCWD, "/var/run/media/tjmaciei/B852-6088/a.EBG705", RENAME_NOREPLACE) = 0
 renameat2(AT_FDCWD, "/var/run/media/tjmaciei/B852-6088/a.EBG705", AT_FDCWD, "A", RENAME_NOREPLACE) = 0

Before it was:
 open("/var/run/media/tjmaciei/B852-6088/a.VuL412", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = 4
 fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
 lseek(4, 0, SEEK_SET)                   = 0
 rename("a", "/var/run/media/tjmaciei/B852-6088/a.VuL412") = 0
 stat("A", 0x7fff13260f00)               = -1 ENOENT (No such file or directory)
 close(4)                                = 0
 renameat2(AT_FDCWD, "/var/run/media/tjmaciei/B852-6088/a.VuL412", AT_FDCWD, "A", RENAME_NOREPLACE) = 0

(the absolute path comes from fd61059d35
and it seems it was needed for Symbian)

Change-Id: I1eba2b016de74620bfc8fffd14ccc7c4ded009c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 17:30:07 +00:00
Thiago Macieira
3d6cbe3409 Long live QTemporaryFileName!
So we can use it in QTemporaryFile, QTemporaryDir and QFile::rename()

[ChangeLog][QtCore][QTemporaryDir] The class now supports the "XXXXXX"
replacement token anywhere in the template, not just at the end. This
behavior is similar to what QTemporaryFile supports.

Change-Id: I1eba2b016de74620bfc8fffd14ccb645729de170
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-04 17:30:03 +00:00
Thiago Macieira
3981a1f440 QTemporaryFile: split the template parsing and generation
This makes the code more reusable by the unnamed file feature.

This commit removes the backwards compatibility in using sequential file
names if the first one failed. Since 5483b30868,
there are at least three random characters, so the chance of collision
is 1 in 52³ = 140608.

That commit also did not take a system failure into account. If we ended
up getting EEXIST for all attempts, we'd attempt on average 26³*53³ file
creations. For that reason, I've added an upper limit in the number of
attempts to create a file.

Change-Id: I1eba2b016de74620bfc8fffd14cc7e31c6e50558
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-04 17:30:01 +00:00
Thiago Macieira
3766265602 QTemporaryFile: give the engine access to the template name
Instead of storing it in d->fileEntry. The QFSFileEngine methods may try
to use it before the file entry is filled with the actual file name and
that's no good. This change is using a reference to avoid keeping an
extra QString reference and to avoid going out of sync.

Change-Id: I1eba2b016de74620bfc8fffd14cca9e340e4b1e2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-04 17:29:57 +00:00
Thiago Macieira
38bc95aece QTemporaryFile: add a simpler rename() (non-virtual) override
Calling the parent version is still ok, but if you call the new one you
get a bit of benefit. Since we control the file name, we don't have to
worry about a case-changing renaming (by choice). We also know that the
file is a regular one, because we created it.

[ChangeLog][Important Behavior Changes][QTemporaryFile] rename() no
longer attempts to do block copying, as that usually indicates a mistake
in the user's code. Instead, either create the temporary file in the
same directory as the new name to be, or use QSaveFile.

Change-Id: I1eba2b016de74620bfc8fffd14ccaac0cdb9fe87
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-04 17:29:54 +00:00
Thiago Macieira
363dc9146e QFSFileEngine: make rename() on Unix not overwrite
The rename(2) system call overwrites, so instead of using it, we try to
use the link/unlink pair. This works for regular cases, but can fail if
trying to change case in case-insensitive filesystems, if we're
operating on a non-Unix filesystem (FAT) or, on Linux, if the file
doesn't belong to the calling user (BSDs permit this). For those cases,
we fall back to rename(2).

That means there's a race condition if a new file is created there. But
we at least reduce the likelihood of that happening for regular files.

Change-Id: I1eba2b016de74620bfc8fffd14ccb38fd929e5aa
Reviewed-by: David Faure <david.faure@kdab.com>
2017-08-04 17:29:52 +00:00
Eskil Abrahamsen Blomfeldt
569171f620 Android: Fix push button label duplication with stylesheets
In the Android style, we matched both the full CE_PushButton,
and the individual, decomposed CE_PushButtonBevel and
CE_PushButtonLabel (and similar for other controls) to the
same drawing code which draws both the label and the bevel.
When used together with the style sheet style, this caused
the label of the button to be drawn multiple times in
different locations.

For labels, we now skip the part which draws the actual control,
and for the non-textual parts of the controls, we skip drawing
the label.

[ChangeLog][QtWidgets][Android] Fixed label duplication for
buttons when using style sheets with the Android style.

Task-number: QTBUG-48639
Change-Id: I1a1cdb0a82870cebd0438c5c72199afc3192938c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-08-04 12:19:45 +00:00
Allan Sandfeld Jensen
74197140be Implement conversion from nullptr QVariant to QString and QByteArray
A nullptr QVariant should become a null QString or QByteArray,
since null strings have previous in our APIs represented the null value
in the absence of a dedicated null metatype.

Change-Id: I3b8f6386ece314d7c196959fbcf042c4fe0508a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 11:19:44 +00:00
Edward Welbourne
fbe84a1a19 Add a test that we can read SQL time-stamps
Based on a test-case from Israel Lins Albuquerque, that my planned
fixes to our parsing of ISODate date-times would break.

Change-Id: I5658df9c7daed59d43aa5574df25d4d9eac4677d
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 11:19:39 +00:00
Edward Welbourne
a9c111ed8c Clean-up in QDateTime's parsing of ISODate{,WithMs}
Actually check that there's a T where ISO 8601 wants it (instead of
just skipping over whatever's there), with something after it; move
some declarations later; add some comments; and use the QStringRef API
more cleanly (so that it's easier to see what's going on).  Simplify a
loop condition to avoid the need for a post-loop fix-up.

This incidentally prevents an assertion failure (which brought the
mess to my attention) parsing a short string as an ISO date-time; if
there's a T with nothing after it, we won't try to read at index -1 in
the following text.  (The actual fail seen had a Z where the T should
have been, with nothing after it.)

Add tests for invalid ISOdate cases that triggered the assertion.

Change-Id: Ided9adf62a56d98f144bdf91b40f918e22bd82cd
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 11:19:35 +00:00
Kevin Ottens
b6c3f55b93 GLSL 1.00 ES must be selected using "#version 100"
I was mistaken before, the "es" part for that version isn't optional, it
*must* be omitted.

Change-Id: I9e83d2317523fb0a905e40b95a56033cf693b93b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-08-04 11:19:30 +00:00
Allan Sandfeld Jensen
f2c6e10ad5 QVariants of null pointers should be null
Changes the QVariant::isNull() implementation for
pointer types so they return true if null.

[ChangeLog][QVariant] QVariants containing pointers will now return
true on isNull() if the contained pointer is null.

Change-Id: I8aa0dab482403837073fb2f376a46126cc3bc6b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 11:19:25 +00:00
Gatis Paeglis
341bfcd1ea glib dispatcher: ensure all window system events are flushed
... when QCoreApplication::processEvents() returns. This is the expected
behavior according to the documentation. Checked also the QUnixEventDispatcherQPA
dispatcher, which did work according to the documentation.

The sequence of events that causes the bad behavior:

1) XCB plugin sends a signals whenever there are new XCB events available
for processing. This signal is connected to QXcbConnection::processXcbEvents,
which will cause XCB events to be added to the QWindowSystemInterface (QWSI) event
queue.

2) When QCoreApplication::processEvents() is called, glib event dispatcher does
one iteration on all attached event sources. First it checks which sources are
ready, and after that starts dispatching events from each source that reported
to be ready.

3) In the case when there are no events in QWSI event queue, the source that handles
QWSI event dispatcing returns 'false'; If at the same iteration the source that
sends posted events (via QCoreApplication::sendPostedEvents()) has returned 'true'
and one of the posted events is to call QXcbConnection::processXcbEvents (due to
signal from step 1) then we get an assert in the following code:

QCoreApplication::processEvents();
Q_ASSERT(QWindowSystemInterface::windowSystemEventsQueued() == 0);

This happens because QXcbConnection::processXcbEvents has posted new events, but
they were not dispatched in this iteration. They would be dispatched in the next
iteration. Events being dispatched on subsequent iteration doesn't really matter
for Qt application, but is inconsistent from API point of view. If we were
populating QWSI queue from non-Gui thread, then it would be possible that
windowSystemEventsQueued() != 0, but that is not the case on XCB (don't know
about other platforms).

The issue could be fixed by always returning true from "check source" and then
simply dispatch 0 events at "dispatch" step if there isn't any in the queue. But
a better solution is to remove the event source all together. It is completely
unnecessary to have this indirection, when we can handle QWSI event dispatch
directly from Qt (like we do, for example, in QUnixEventDispatcherQPA and
QWinRTEventDispatcher). Not having Glib event source for QWSI events would have
also avoided issues that were fixed by fbb485d4f6.

Note, after this re-factoring QWindowSystemInterface::nonUserInputEventsQueued is
now unused, but I left it in as the API by itself is all right.

Task-number: QTBUG-62297
Change-Id: Ia245b835676bd87e63bf02b67036b42a3b1593cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 11:19:19 +00:00
Thiago Macieira
b12fd1fa9d Long live qEnvironmentVariable()
[ChangeLog][QtCore] Added qEnvironmentVariable, which returns the value
of an environment variable in a QString, while qgetenv continues to be
used to return it in a QByteArray. For Unix, since most environment
variables seem to contain path names, qEnvironmentVariable will do the
same as QFile::decodeName, which means NFC/NFD conversion on Apple OSes.

I opted not to #include <qfile.h> from qglobal.cpp to implement that
QFile::decodeName functionality, so qglobal.cpp doesn't depend on
corelib/io and to avoid possible recursions.

Task-number: QTBUG-41006
Change-Id: I14839ba5678944c2864bffff141794b8aaa7aa28
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-04 11:19:13 +00:00
Simon Hausmann
1f4fd599a8 Ignore thaiZWJ failure on RHEL 7.2
The test fails when the system harfbuzz (version 1.3.2) is installed.

Change-Id: Id18a5a3c503f64ef56567d71655e433a46908b3f
Task-number: QTQAINFRA-1363
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-08-04 11:18:50 +00:00
Simon Hausmann
b36e5faad4 Ignore thaiZWJ failure on RHEL 7.2
The test fails when the system harfbuzz (version 1.3.2) is installed.

Change-Id: Id18a5a3c503f64ef56567d71655e433a46908b3f
Task-number: QTQAINFRA-1363
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-08-04 08:36:36 +00:00
Raschbauer, Reinhard
52c66e8515 QAbstractItemView: fix nullptr violation
If in a slot connected to QAbstractItemView::clicked
QAbstractItemView::setModel(nullptr) is called the method
QAbstractItemView::mouseReleaseEvent will cause a segmentation fault.
The problem is that the method QAbstractItemView::model used in
QAbstractItemView::mouseReleaseEvent will return a nullptr if a null
model was set. The solution is to used d->model since it is always a
valid model. (See line d->model =
(model ? model : QAbstractItemModelPrivate::staticEmptyModel());
in method QAbstractItemView::setModel)

Change-Id: I6f01bdeac64495ee4a76adcc7bf8da8a7719ef4d
Reviewed-by: David Faure <david.faure@kdab.com>
2017-08-04 08:36:29 +00:00
André Klitzing
5169d588a5 Update bundled zlib to version 1.2.11
Also clean up some unused files.
The remaining diff to clean 1.2.11 is archived in the qtpatches.diff file.

[ChangeLog][Third-Party Code] zlib was updated to version 1.2.11.

Task-number: QTBUG-31020
Change-Id: I89f890904af48c6e9ba6eabc5d58f5adbe2c53f0
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-08-04 08:36:22 +00:00
Friedemann Kleint
959cc53b61 tst_NoQtEventLoop: Pass with High DPI scaling active
- Determine window sizes according to screen size and turn off
  scrolling.
- Center the window to get it out of the way of taskbars.
- Make the window top-most.
- Turn off scaling so that coordinates passed to the QWindow
  child match device coordinates and the child is positioned
  correctly.
- Make the child window a yellow raster window for easier
  debugging.

Task-number: QTBUG-45956
Change-Id: I05864770f8ed638d0a36f3e3f2afed73d2952436
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-08-04 08:36:16 +00:00
Laszlo Agocs
51446c3c6f Fix Q(Quick)Window on eglfs
The call to QPlatformWindow::setRect (for storing into d->rect) was
in the wrong place. It has to be the potentially-overridden value.

Amends 3a31c70879

Task-number: QTBUG-57608
Change-Id: Id3c35e2dc178f7bd2f9643e8ae4754c8f2f39240
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-08-03 11:23:41 +00:00
Alexander Volkov
d12d2949d1 uic: Add -no-stringliteral option
... and use it when building shared libraries and plugins.
It prevents application crashes in cases when libraries and
plugins are unloaded and their strings are still used by
the main application.

Task-number: QTBUG-51602
Change-Id: I4af79183f18c5ed6142d55af02a36fe4334f3fee
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-08-03 09:59:15 +00:00
Eirik Aavitsland
8ba373361d Support all QImage formats in native pixmap conversion
The conversion fallback did not catch all the more recently added
QImage formats, leading to corrupt pixmaps or crashes. Also alpha
channels were needlessly thrown away if present.

Change-Id: I38588035aa9bf37b77398489981df65201cf0340
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-03 09:43:12 +00:00
Laszlo Agocs
4f515815ef Change EDID parsing qCWarnings to qCDebugs
Avoid polluting the output by default. Unfortunately there are various
systems (modern Fedora with XWayland, VMWare) where parsing will fail
for some not yet known reason. Showing warnings on each and every Qt
application startup is not desirable, especially since not having the
EDID data available is far from being critical.

Change-Id: Ibaca7db4d897e705819f7c359f8de41b9be862a6
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-08-03 09:30:30 +00:00
Frederik Gladhorn
e5cdb966bf Ignore tests that fail on OpenNebula
These tests need fixing, but they are already partially blacklisted
and need investigation once the switch is completed.

Task-number: QTQAINFRA-1292
Task-number: QTQAINFRA-1355
Task-number: QTQAINFRA-1362
Change-Id: Ic50d0c4a01ee7e72be1129d418eff244ba783185
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-03 09:30:06 +00:00