Commit Graph

24520 Commits

Author SHA1 Message Date
Edward Welbourne
424d9e9e56 Add byte-based units to CLDR data
Scan CLDR for {,kilo,mega,giga,tera,peta,exa}byte forms and their IEC
equivalents, providing SI and IEC defaults when missing (which all of
IEC are) in addition to the usual numeric data.  Extrapolate from any
present data (e.g. French's ko, Mo, Go, To imply Po, Eo and, for IEC,
Kio, Mio, etc.), since CLDR only goes up to tera.  Propagate this data
to QLocale's database ready for use by QLocale::formattedDataSize().

Change-Id: Ie6ee978948c68be9f71ab784a128cbfae3d80ee1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-06-13 11:28:09 +00:00
Edward Welbourne
536b918eca QTimeZone: make UTC offset range available for other code to reuse
When QDateTimeParser learns to parse zones, it'll need to know the
valid range of offsets.

Change-Id: I44cd88a140ebaf6a2b98b0f9a1be0cbc7a35bae4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-13 11:27:57 +00:00
Edward Welbourne
748d87f28f Tidy implementation and use of QDateTimeParser::setDigit()
The implementation did a validity check on data it then gave to
constructors that repeat the validity checks; so do the construction
first and use the cheaper instance isValid() methods instead.

Fixed local callers (but not QDateTimeEditPrivate::stepBy, the only
other caller) to actually attend to the return value; if the attempt
to set a field fails, it probably means the min is too low, or max too
high; and comparing the modified date-time against global min and max
makes no sense if it hasn't been revised anyway.

Change-Id: If4505c43c92e247445dcd10ac436b775c3ead4da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-13 11:27:49 +00:00
Kimmo Ollila
9bd01b9618 Remove message of integrityfb from config summary
This cleans the config summary output

Change-Id: I4e78f00c722e646a730906d462f7632d6012a6d8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tero Alamaki <tero.alamaki@qt.io>
2017-06-13 11:24:15 +00:00
Friedemann Kleint
4b63565bbc Native Windows file dialog: Observe Windows Explorer "Show hidden files" setting
Extract a helper function to read the setting and use that
in file dialogs and tray icon.

Task-number: QTBUG-60593
Change-Id: I03cf1e45611690a128bf2cc17eba5dff23b86969
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-13 07:04:32 +00:00
Jarek Kobus
73f8b605e3 uic: Fix possible crash when reading the size hint property
It may crash on (probably a bit broken)
qtbase/src/printsupport/dialogs/qpagesetupwidget.ui

Change-Id: Ibca95a3d8aa4899adbc952aee7b46621ac888c6a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-13 06:56:10 +00:00
Oliver Wolff
3e1a7251b4 ANGLE: Fix crash with ltcg on Visual Studio 2015 Update 3
Release builds of applications that used Qt configured with "link time
code generation" crashed (memory access violation), when calling
GetInternalFormatInfo in Context::initCaps.

It looks like this is a compiler problem that can be avoided by not
using a reference for the return value.

Task-number: QTBUG-55718
Change-Id: Ic1fb95d7b518a49859f41c819e860864387a8d3c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-13 06:55:27 +00:00
Orgad Shaneh
9a73b7ac96 QLogging: Fix unused static function warning
Detected by clang

Change-Id: Ia7d1bf085d838d19319ee1060dcb3c0086a510e4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-06-13 06:32:50 +00:00
Friedemann Kleint
b05d1c2ebf QPlatformCursor: Add functions for setting/clearing override cursors
QPA is modeled on the assumption that the cursor is a property
of the window and therefore sets the override cursors on all windows.
However, on macOS and Windows, the cursor is set per application (or
screen). On these platforms, the per window cursor setting needs
to be emulated which is a source of bugs especially for override
cursors.

Add new virtuals to QPlatformCursor allowing to set override
cursors which can be implemented by directly setting the cursor
on those platforms.

Task-number: QTBUG-40122
Task-number: QTBUG-61133
Change-Id: I31d6a927128d22bb1620a8ace35988c0e126236e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-13 06:13:39 +00:00
Thomas Sondergaard
65a317e674 Use QMap in QProcessEnvironment so variables are sorted
The motivation for this change is to make it simple to pass a
correctly sorted environment block to Win32 CreateProcess(). It is
also nice in other contexts that the environment variables are
sorted. The change is made for all platforms. This keeps it simple and
the only ill effect is slightly slower lookups.

Concerning the environment block passed to Win32 CreateProcess:

The environment block that is passed to CreateProcess() must be sorted
case-insensitively and without regard to locale. See
 https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx

The need for sorting the environment block is also mentioned in the
CreateProcess() documentation, but with less details:
 https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

Task-number: QTBUG-61315
Change-Id: Ie1edd443301de79cf5f699d45beab01b7c0f9de3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-13 06:09:40 +00:00
Thomas Sondergaard
b438110028 Rename QProcessEnvironmentPrivate::hash to vars
Also use auto for iterators to vars. This is a small refactoring in
preparation for changing type of vars to QMap.

Task-number: QTBUG-61315
Change-Id: I5731d7916b6f54a0da5be2da378c09a7688bd870
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-13 06:09:36 +00:00
Thiago Macieira
8b23133e50 Move QTextFormatPrivate::Property out of the class
This allows us to have the Q_DECLARE_PROPERTY before the
QVector<Property> use. Not important for Qt 5, but it helps me.

The operator!= function is never called, so it can be dropped (caught by
ICC 17 beta).

Change-Id: I149e0540c00745fe8119fffd1463c9bc1b356ec6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-13 05:43:51 +00:00
Timur Pocheptsov
96955dbe10 qsslsocket_mac - check that SecCertificateRef is not null
That's the only place there we can potentially pass a null pointer
to CFArrayAppendValue (all other calls are conditionally-protected).
This results in (surprise! ... ?) Objective-C exception (while we call
something that is a pure-C API). So far we cannot reproduce this crash and
can only speculate: probably this happens with invalid (can be either
really invalid or the result of our generic QSslCertificate's failure to read/
parse)) custom CA certificates appended to a QSslConfiguration object by
applications  using QSslSocket/QNAM. The fix will probably make a handshake to
fail, but this seems to be better than a crash anyway.

Task-number: QTBUG-58213
Change-Id: Ie4f9ab2138bc383adc9f9ed55ed61be2d3cf7020
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-13 04:33:54 +00:00
Andy Shaw
26fd805f50 macOS/iOS: Correctly ignore punctuation in QCollator
When punctuation is ignored then the kUCCollatePunctionSignificantMask
should not be set. This was originally thought to not be working due to
a bug on the Apple platforms, but this is not the case.

[ChangeLog][Platform Specific Changes][macOS][iOS] QCollator now
respects the ignorePunctuation property on Apple based platforms
correctly.

Task-number: QTBUG-41978
Change-Id: I62044076387d6e4479f4aaef3c2f48f49dbd160e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-13 04:08:56 +00:00
BogDan Vatra
ea568c310d Android: Fix RTL selection handles directions
Invert the selection handles icons when the selected text is rtl.

Task-number: QTBUG-61073
Change-Id: I8339a14d1e4d9e79d218516daf3ac783911f6026
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-13 04:00:16 +00:00
Gabriel de Dietrich
b91d37a600 QNSView: Remove tracking area on deallocation
Ultimately, the tracking areas seem to be managed by the
NSWindow (or at least somewhere else than the NSView itself).
So, it can happen that we involuntarily leave dangling pointers
in the system after the QNSView is released. This has shown to
crash applications creating and deleting many native views on a
single QNSWindow, e.g. calling winId() on a complex and dynamic
QWidget hierarchy. The crash would happen when the QNSWindow
receives a native enter event, which results on Cocoa trying to
invoke the owner of a previously deallocated NSTrackingArea.

Change-Id: I3ca7a39ee5f1ec51c2215639f61ba907de3d8659
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-06-13 01:30:53 +00:00
Thiago Macieira
57d16c12cc qsimd_p.h: Don't set the __xxx__ variables with Clang and GCC
Commit 418184c2a0 set some extra defines
that Clang and GCC do set so that MSVC and ICC builds would properly get
the features detected. But that meant we set them with Clang and GCC
(technically, set them again, but to the same value so no warning was
printed).

Don't do that. This commit allows me to use "-march=native -mno-rdrnd"
to disable the unconditional use of RDRAND instruction. That's required
to valgrind any applications, as the current version (3.12) does not
have support for that instruction.

 vex amd64->IR: unhandled instruction bytes: 0x48 0xF 0xC7 0xF0 0x48 0x8B 0x55 0xE8 0x48 0x89
 vex amd64->IR:   REX=1 REX.W=1 REX.R=0 REX.X=0 REX.B=0
 vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
 vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
 ==78321== valgrind: Unrecognised instruction at address 0x4ef159c.
 ==78321==    at 0x4EF159C: _rdrand64_step (immintrin.h:208)
 ==78321==    by 0x4EF159C: qt_random_cpu(void*, long long) (qrandom.cpp:95)

Change-Id: Ia3e896da908f42939148fffd14c6884501de4fa4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-06-12 16:18:11 +00:00
Thiago Macieira
71090f0950 JSON doc: update the RFC we link to
RFC 4627 is obsoleted by RFC 7159.

Change-Id: Ia53158e207a94bf49489fffd14c6ab1ae0a19a72
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-06-12 16:17:01 +00:00
Stephan Binner
aad21102e9 Convert features.columnview to QT_[REQUIRE_]CONFIG
Side effect: fix of QT_NO_COLUMNVIEW <-> QT_NO_QCOLUMNVIEW inconsistency.

Change-Id: I42702ea7b362a4b6fb5dad78ee105e6cbbf8bcf6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-06-12 16:11:31 +00:00
Stephan Binner
1645bdcbce Drop dead qfiledialog_embedded.ui
Change-Id: Ia20fe65d08a8a477dc1c56ad5dcd3db5144c25a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-12 15:07:31 +00:00
Kai Koehne
107343c8f4 Doc: Tweak documentation about a default QHostAddress
Change-Id: I78deb7156900a3a0e79890062a40752b5d2561c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-12 14:53:06 +00:00
Kai Koehne
adc7257141 Document QHostAddress::swap
Change-Id: I0f47ffeb1a7dbda7dadbd78b2ea04167c42a503d
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-06-12 14:52:38 +00:00
Jarek Kobus
d6d76df9e0 Remove ancient embedded pixmaps and scripts from uic
Change-Id: Iec06e1af91a6d61226ae484325b1ec82810d634d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-12 12:04:42 +00:00
hjk
350698da99 QDialog: Fix typo in documentation
Change-Id: I0cbcd007976a974d7491595b59cc463f6443d4b0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-06-12 10:19:52 +00:00
Oswald Buddenhagen
e53a1c8bed prune obsolete use_libmysqlclient_r feature
it's not used since d5dc46d31.

Change-Id: I853aec26acddea52da419bd1b517c2fbe31203ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-12 09:55:43 +00:00
Thiago Macieira
d57bf5e8aa QRandomGenerator: mix the Linux AT_RANDOM random bytes in the fallback
The Linux kernel gives us 16 bytes of random data and sets a pointer to
it in the ELF AuxV (the same one that allows us to get HWCAP on ARM
systems). So if we end up in the fallback generator, at leat we'll get a
good amount of entropy to seed the Mersenne Twister.

This could happen if the application is run in a chroot(2) or container
without /dev/random or /dev/urandom. That is probably an installation
mistake, so we don't optimize this case for performance.

With this commit, we have now good, high-quality fallbacks for Windows
(rand_s), for BSDs (arc4random) and for Linux. The only missing,
supported OS without a good entropy source is QNX.

Change-Id: Ia3e896da908f42939148fffd14c5b1084051f1a8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:15:01 +00:00
Thiago Macieira
629f3c0277 QRandomGenerator: improve the fallback seeding in emergencies
If we've never read any samples from hardware RNG or from /dev/urandom,
then there are no stored samples for us to seed the Mersenne Twister. In
that case, attempt to obtain an emergency sample that consists of some
random bits from the variable addresses (ASLR should help) and from the
clock (using nanosecond quality, instead of seconds).

There's still the possibility that we'll get poor entropy: very close to
boot, if the kernel entropy pool is empty, ASLR could be poor and the
monotonic clock value could be consistent from boot to boot. There's
nothing we can do about that.

Change-Id: Ia3e896da908f42939148fffd14c5b0c7b608371b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:56 +00:00
Thiago Macieira
ec63fcb314 QRandomGenerator: use arc4random as fallback on BSDs (including Darwin)
This function works even in chroots where /dev is not available. Since
it's part of the OS, it may have better ways of gathering entropy even
when we don't.

Change-Id: Ia3e896da908f42939148fffd14c5afedc8569dbc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:53 +00:00
Thiago Macieira
0c355e78f0 QRandomGenerator: add support for hardware-based random generators
This commit adds support for the x86 RDRAND instruction for
QRandomGenerator. This is the same that libstdc++-v3 uses for
std::random_device() by default. If it fails because the hardware does
not have enough entropy collected, we fall back to the operating system
generator, which often has more entropy collected from other sources.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5167214e1ea3f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:51 +00:00
Thiago Macieira
dfdc466dc1 Add proper detection of x86 RDRAND instruction
The instruction is "RDRAND", but the feature name, according to GCC, is
RDRND, so I had to change some macros in qsimd_p.h.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5166779137e63
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:48 +00:00
Thiago Macieira
f17095653e QUuid, QHttpMultipart and QHash: use QRandomGenerator
QRandomGenerator can produce more than 31 bits of data. And it uses
/dev/urandom for us on Unix, so QHash does not need to duplicate that
part.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b52a0d91f179eb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:46 +00:00
Thiago Macieira
5483b30868 QTemporaryFile: fix the generation of names from templates
First and most importantly, let's not use more than half of the template
for the application's PID. With over 71% of all PIDs on a typical Linux
system and 90% of those on a Darwin system having 5 decimal digits,
using them all in a template that is usually 6 characters long is
wasteful. That leaves only 1 character for the random part, thereby
reducing the number of temporary files possible to only 52. So limit the
PID to half the characters of the template.

Second, let's use QRandomGenerator::bounded to create the the random
part, instead of qrand (which is often unseeded at this point).

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b52eda5e467395
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:43 +00:00
Thiago Macieira
7697227781 Use QtPrivate::FunctionPointer to get the type of srand's first arg
Avoids #ifdefs and guesswork.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5210efaea7d00
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:40 +00:00
Thiago Macieira
030782e1a8 Move qrand() & qsrand() to qrandom.cpp
Now that we have the file, may as well consolidate

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b51d3e701c6a94
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:37 +00:00
Thiago Macieira
593f022515 Long live QRandomGenerator
This class provides a reasonably-secure random number generator that
does not need seeding. That is quite unlike qrand(), which requires a
seed and is low-quality (definitely not secure).

This class is also like std::random_device, but better. It provides an
operator() like std::random_device, but unlike that, it also provides a
way to fill a buffer with random data, not just one 32-bit quantity.
It's also stateless.

Finally, it also implements std::seed_seq-like generate(). It obeys the
standard requirement of the range (32-bit) but not that of the algorithm
(if you wanted that, you'd use std::seed_seq itself). Instead,
generate() fills with pure random data.

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b4e3ba9ea04da8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-12 06:14:34 +00:00
Edward Welbourne
03a1675eac Reduce code duplication in writing of string data for locales
Each StringData object got its own block, of common form, to output
its C array; give each object a name so that we can automate this as
an iteration over StringData objects.  One (endonyms_data) gains a
blank line that the others all had but it lacked.

Change-Id: I96c014728a58343c82304c5117b474fee980d9c7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 08:24:15 +00:00
Leena Miettinen
237c867a00 Doc: Update widget style gallery topic
To avoid repetition, remove the individual style gallery topics.
Add images of the Styles and Calendar widget examples and use
them instead of individual images of each widget.

Task-number: QTBUG-5894
Change-Id: I1231824df60e39e8fb89ac2a764e12151636c019
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-06-09 06:58:02 +00:00
Frederik Gladhorn
98057fc6c5 Use upstream at-spi 2
Move at-spi dbus xml definitions into platformsupport, these files
simply describe the DBus protocol and should not be in 3rdparty.

The header files can just as well be picked up by pkg-config.

Change-Id: I326d9b3cb69223bf2c8646099f211d9a9f3fa0af
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-09 06:09:45 +00:00
Christian Strømme
da104aa308 Android: Remove no-op call to processEvents()
The call does nothing as it's always called from the Android thread,
meaning there are no events, or even eventloop.

Change-Id: I6c03b6ebe74bc52af45bc295b42aa01ad6d51157
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-06-08 22:34:59 +00:00
Christian Strømme
235b4cac1d Android: Remove unused struct
Change-Id: Iddb4fec951c4dfa8c1052fb18ed62504d28a4792
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-06-08 22:34:52 +00:00
Christian Strømme
b684ed6bd7 Android: Properly update geometry once the platform plugin is ready
This is amends commit 9091a058bc to make sure we don't drop
geometry updates that are set before the platform plugins is ready.

Task-number: QTBUG-60963
Change-Id: I4489eb9329bb8983458ad328a43b85382bba3cf6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-06-08 15:44:21 +00:00
Edward Welbourne
3a569573b2 Clean up the output code for the big table of CLDR data
Include headers for all fields (several were missing).
Make field widths explicit to headers can line up with content.
Use the same format for the (common part of the) all-zeros line.
Document and lay-out headers and format string, to make them easier to
keep in sync.  Make a pair of comments clearer.

Re-ran the script to regenerate the table: the result is best viewed
with git show -w, to ignore the spacing changes (or git show -b to
notice only the one harmless discrepancy exposed in old all-zeros
data).  Aside from spacing, locale_data[] has gained some missing
columns in its header comment, which now lines headings up properly
above actual data.

Change-Id: I44242f38391353f2ec8e144cb7e8b54b0a359341
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-06-08 13:37:38 +00:00
Edward Welbourne
9df60df12a Made the "do not edit generated code" notice clearer
Say where to find the scripts and make clear what to update to get
changes.

Change-Id: I424b7fdf846f7141c6df81eef90eb1ca0378bcf8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 13:37:21 +00:00
Edward Welbourne
08cfd02312 Use python more competently in CLDR/qLocaleXML scripts
Make the python2 dependency explicit (sooner or later, python3 shall
be the default /bin/env python), make time-zone script executable (it
had a shebang).  Use triple-quoted strings, or single quotes, to avoid
extra backslashes, remove some simply spurious backslashes.  Use
generators rather than map or filter with lambdas and iterate rather
than duplicating code.  Clarify some comments.

Regenerated headers: this upates the date of generation, cuts back a
double-blank-line to single and skips a spurious trailing
comma-newline on an array's data.

Change-Id: I54439f0dec132865991fe5147d509cea0f9419a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 13:37:06 +00:00
Edward Welbourne
0caaf33d2f Document the ci key in the BLACKLIST file format
Rearranged existing top-level example to let the ci example make some
kind of sense.

Change-Id: I0a5dd6270aef419c8a33d390c801460f23e10667
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-06-08 13:36:25 +00:00
Edward Welbourne
3e0bf04d7b Typo-fix: s/looses/loses/g
When an archer lets go of the bow-string, she looses an arrow; when
the hounds are straining at their leashes and the handler lets go, he
looses the dogs.  It's archaic usage now; we'd normally say "lets
loose", "lets go" or "releases".  In any case what was meant here was
that something got lost; a widget loses focus or a network loses its
connection.

Change-Id: Ic1fbe9e1f76185bcb7caf034d6be97ebfeb2e270
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-06-08 13:36:18 +00:00
Edward Welbourne
d3e73b4f6b Fix typo in QMutex's free-list's Sizes[3]
A QFreeList's MaxIndex is clearly meant to be the sum of its Sizes;
but the parentheses in MaxIndex - (16 - 128 - 1024) doesn't give the
same as without the parentheses.  Noticed while reviewing a copy of
this code now used by QReadWriteLock (which has this fix).

Change-Id: I9f68171475b3c6edc18896056b5532183fee92b2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-08 13:36:00 +00:00
Laszlo Agocs
2ea90c56f2 Start supporting purely offscreen QOpenGLWidget
Due to popular demand. It does have it benefits (especially when
it comes to convenience) to allow grabbing QOpenGLWidgets even
when they are not part of an actual window and are not actually
visible.

Does not involve much more than dropping the warnings and bailouts
when there is active native window (because the QOpenGLWidget/its
parents are still hidden).

In addition the device pixel ratio from metric() has to be fixed
as well.

[ChangeLog][Qt Widgets] QOpenGLWidget is now able to render and
return its content via grabFramebuffer(), QWidget::grab() or
QWidget::render() even when the widget has not been made visible.

Task-number: QTBUG-47185
Task-number: QTBUG-61280
Change-Id: Icc2b0b3ce9778a3eb6409d54744238568abb0f0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-06-08 13:34:54 +00:00
Gatis Paeglis
41ae544c40 xcb,evdevmouse: don't use qpa compatibility functions
Change-Id: If3f474dcb6ee117c6dd26cd56fd4ad8d39e60e1f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-06-08 12:40:46 +00:00
Tor Arne Vestbø
c3a115b90d json: Add operator[] to QJsonDocument for implicit object and array access
Makes it easier to pull out data from a document when the structure is
known up front, while still supporting default values if the structure
does not match the expectation, eg:

 int age = QJsonDocument::fromJson(ba)["users"][0]["age"].toInt(-1);

Change-Id: Ief0899bbb81610f6f22a56e2ac846121bffe77a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 11:23:55 +00:00
Tor Arne Vestbø
a7823b4878 json: Add operator[] to QJsonValue for implicit object and array access
Saves a lot of manual toArray() and toObject() calls when the
JSON structure is usually known anyways. Read only access for now.

Change-Id: I5fd787144198e0443e4da285a11ce2597b66f99f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-08 11:23:46 +00:00
Marc Mutz
2db0531a57 QKeySequence: remove a clause guarding an impossible condition
All code paths leading up to this line unconditionally dereference the pointer,
so it cannot be nullptr.

Remove the check. It only confuses readers of the code and probably will trigger
warnings with tomorrow's compilers.

Change-Id: I31a643738e951da9c04f0091645016276b047761
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-06-08 09:36:34 +00:00
Chris Wilson
147aa29162 Fix sending UTC-offset QTimeZones through QDataStream
QTimeZone("UTC") should be valid, as "UTC" appears in the list of
availableTimeZoneIds(), and tst_QTimeZone::dataStreamTest() constructs
timezones like this, which are considered valid.

The internal representation of a QTimeZone("UTC") as created by
QTimeZone::QTimeZone(const QByteArray &ianaId) is a QUtcTimeZonePrivate
which isValid(), so the containing QTimeZone isValid() too.

When QTimeZone is serialized into a QDataStream, it calls
tz.d->serialize(ds) which is QUtcTimeZonePrivate::serialize. This
writes QStringLiteral("OffsetFromUtc") followed by the IANA ID and
the offset (etc.) to the datastream.

When QTimeZone is deserialized it looks for this marker string, and if
present, it passed all of the parameters to the QTimeZone constructor
(not just the name). However, that constructor does not support standard
IANA timezones (only custom ones), and when it detects that the supplied
IANA ID is actually listed in availableTimeZoneIds(), it leaves the
pointer to the QTimeZonePrivate uninitialized (NULL), which leaves
the QTimeZone invalid (isValid() returns false).

Thus, a valid timezone which was serialized and then deserialized has
become invalid. This also affects serialization of QDateTimes with
timezones.

Fixed by calling the name-only constructor first, which works (only) for
IANA standard timezones and leaves the QTimeZone invalid (isValid()
returns false) otherwise. In which case, we can call the many-argument
contructor to create a custom timezone with the same offset as the one
which was originally serialized.

[ChangeLog][QtCore][QTimeZone] Fixed sending IANA standard UTC-offset
QTimeZones through QDataStream, which previously came out invalid after
deserialization.

Task-number: QTBUG-60595
Change-Id: Id9c47e8bda701faae4d800e012afb6db545b2fe9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-08 08:34:31 +00:00
Kai Koehne
86a948fc0f Document that QLoggingCategory is thread-safe
Task-number: QTBUG-60475
Change-Id: Idced5e1a8ad1d2d28839fd23126a7bf084141eca
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-06-08 08:05:05 +00:00
Marc Mutz
0793dd90d6 QKeySequence: fix size mismatch
'accel' is 'str.toLower()' and as such may have a different size, so don't
use str.size() to index into 'accel'.

Change-Id: I6a140ded45ecedd811b9618e1facb63d522eb235
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-08 07:39:48 +00:00
Friedemann Kleint
df32c9a112 Windows QPA: Port to new feature system
Replace all checks for DEFINES in windows.pri by proper
configure system checks as they no longer seem to work.

Task-number: QTBUG-61192
Change-Id: I625c9de0812fd376d06eacb065d3a32a499b6b00
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-06-08 07:39:00 +00:00
Liang Qi
e1a0730448 QPlainTextEdit: not show place holder when having preedit string
Task-number: QTBUG-61210
Change-Id: I4891c21fc4e1923b5929defeacab26114c00a7e3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-06-08 04:05:10 +00:00
Albert Astals Cid
f78a189da5 QSSLSocket::readData return -1 when socket is not connected
As QAbstractSocket::readData does and as the documentation of QIODevice says
"this function returns -1 in those cases (that is, reading on a closed
socket..."

Change-Id: I1e64673f6a6d792a640bd6cb28b2bb5a0f18dc36
Reviewed-by: Aleix Pol
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-08 04:00:54 +00:00
Liang Qi
678ff94ff2 Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-06-07 20:45:28 +00:00
Jake Petroules
510d18d7ae Update for the newest Darwin-family operating systems
Change-Id: Id6533c8a444854f6215f6e47000875ef9751905b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-07 17:45:41 +00:00
Allan Sandfeld Jensen
dd8313d5be Translate the adjusted deviceWindowRect with an adjusted offset
Otherwise the mismatched device pixel ratio will lead to incorrectly
offset blitting.

Task-number: QTBUG-59017
Change-Id: Iccbe9cd9704bccbceda4c8dafe87435b68b5cf3e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-06-07 17:23:51 +00:00
Thiago Macieira
d254d8c197 Use the C++ [[nodiscard]] attribute
Change-Id: I7814054a102a407d876ffffd14b6a285c70b21de
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-07 15:54:31 +00:00
Thiago Macieira
6ae801875e Re-fix the detection of CPU architecture on an Apple OS
Commit d56c6cf7a4 was incorrect. It was a
nice try, but on a 64-bit Mac machine (x86_64 CPU), it returned
hw.cputype = 7, which is CPU_TYPE_X86. CPU_TYPE_X86_64 is only used in
Mach-O slices for fat binaries and does not reflect hw.cputype.

Task-number: QTBUG-61205
Change-Id: Ia3e896da908f42939148fffd14c54b3050b8e64b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-06-07 15:54:14 +00:00
Thiago Macieira
bc93ee060a Help GCC understand that variable is never used unintialized
qformlayout.cpp:1982:14: error: ‘role’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

The variable role is never used uninitialized because the access is
protected by the check for row != -1. The only condition under which
QFormLayout::getItemPosition will leave role unset is if it sets row to
-1. Since row == -1 ←→ col == -1 ←→ storageIndex == -1, we can simply
change the variable that we check here and the warning goes away.

Change-Id: Ia3e896da908f42939148fffd14c4ace6e40a808e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-06-07 15:54:03 +00:00
Sérgio Martins
0265a23bb0 Fix crash when calling QWidget::grab() on a QOpenGLWidget
By avoiding unneeded nested QPainters.

Crash was:
ASSERT: "s" in file /data/sources/qt/qt5/qtbase/src/gui/painting/qpaintengine_raster.cpp, line 2239

s was nullptr because the inner QPainter had called updateState(0), which is then dereferenced by the outer QPainter.

Task-number: QTBUG-61036
Change-Id: I7aad648f805f1abac4d38dfbefa2292da8b52af4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-06-07 14:49:13 +00:00
BogDan Vatra
e8ea1edd89 Android: Fix deadlock when calling requestPermission
The hang happend when using QtAndroidPrivate::requestPermissions before
the QApplication::exec. Android UI calls "sendRequestPermissionsResult"
which was blocking until the event is delivered, but the qt main loop is
blocked and waits for the main surface to be created by the Android UI
thread which is already blocked.

With this patch sendRequestPermissionsResult won't block for the result
to be delivered.

Change-Id: I48ada65fe9ea63471ab46d8a9d839ba1b91d17b3
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2017-06-07 13:01:40 +00:00
Eirik Aavitsland
d31deab632 Fix QImageReader::supportedSubTypes()
Because of inverted test logic, this function would always return an
empty list.

Task-number: QTBUG-61048
Change-Id: If1529f2c567069ab4b672f309268b4edaf84c42f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-06-07 12:31:21 +00:00
Tor Arne Vestbø
744fd39e66 xcb: Don't destroy foreign windows
We can't rely on virtual dispatch in the destructor.

Task-number: QTBUG-61140
Change-Id: Ib1026caf126095778c24254775cb5a0bfecf3a38
Reviewed-by: Fabian Vogt
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-06-07 12:06:27 +00:00
Liang Qi
7cbee56296 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/widgets/widgets/qmenu.cpp

Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
2017-06-07 14:02:43 +02:00
Allan Sandfeld Jensen
0169edf6fd Implement remaining porter-duff compositions for rgb64
Gets rid of debug output when they are used, which is more common now
that we use it for unpremultiplied ARGB32.

Task-number: QTBUG-60549
Change-Id: I14b2eb34d1d08612916e2b69b188f33dbe1b525c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-06-07 11:29:54 +00:00
Olivier Goffart
94a2aec05b moc: Don't error out when defining a keyword
Normaly, in C++ It's not valid to define a keyword, but it turns out that some
system header do, so we just silently accept it.

[ChangeLog][moc] moc no longer errors out if a C++ keyword is #define'ed

Task-number: QTBUG-61204
Change-Id: Ia4d3ff9c77b6ff261b6140c220cfb81bd13f1d6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-06 22:53:07 +00:00
Jesus Fernandez
e400b7e326 Ensure QDBusConnectionPrivate pointer initialization
Change-Id: Id7ca5b412462b5d7a18d12f9a227fdf9ef7b2344
Coverity-Id: 180869
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-06 20:26:23 +00:00
Jesus Fernandez
5b24f0a6bb Add QLocalServer::socketDescriptor
Adds a function to return the native socket descriptor. It allows
threaded or forked applications to reuse a previously created socket.

[ChangeLog][QtNetwork][QLocalServer] Added a function to retrieve
the socket descriptor.

Task-number: QTBUG-55043
Change-Id: I556e97000d2c02ad2bdd636984de6c7564381c6a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-06 17:46:50 +00:00
Jesus Fernandez
3a072f354f More info in QLocalSocket::socketDescriptor
Documents the returned type of values depending on the platform.

Change-Id: I0659ae8a0a4c5aafd368a25564eca29973702b1e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-06 17:46:39 +00:00
Marc Mutz
1e8e79d71e QScopedArrayPointer: document the most important ctor
The ctor that everyone would want to use was marked as \internal,
probably because of the SFINAE expression appearing in its signature.

Move the SFINAE to the template argument list, which QDoc hides from
the user, and drop the \internal. While at it, drop the home-grown
std::is_same re-implementation and use the real deal.

Change-Id: Ia357fe65f94e10ac9eeccb3490aa8b3e68114cbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-06 07:30:30 +00:00
Jani Heikkinen
934235e967 Revert "moc: remove _MSC_EXTENSIONS #define"
It seems this change is preventing us to integrate qt5.git in '5.9'

This reverts commit c3030d7163.

Task-number: QTBUG-61204
Change-Id: Id98afaa23be0a8dd6f2c54a899f46542c65436aa
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-05 09:00:54 +00:00
Thiago Macieira
d56c6cf7a4 Work around uname(2) on Apple mobile OSes not returning the proper arch
Task-number: QTBUG-61205
Change-Id: Ia3e896da908f42939148fffd14c46fc991650f6f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-06-05 06:33:52 +00:00
Elvis Angelaccio
04eba7b538 QStyle: deprecate SH_Widget_Animate in favor of SH_Widget_Animation_Duration
This change introduces a new SH_Widget_Animation_Duration style hint
that applications can query instead of manually hardcoding the duration
of an animation.

As default value we use 200, which is the value that was already used in
QWidgetAnimator. A value equal to 0 means that the animations will be
disabled. This also implies that the SH_Widget_Animate style hint is
superseded and can be deprecated.

The new style hint is configurable with style sheets.

[ChangeLog][QtWidgets][Styles] Added SH_Widget_Animation_Duration style
hint which deprecates SH_Widget_Animate.

Change-Id: Ic3f5e4f7145a89697f28666aeaecabb1f3c5c96f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-06-04 12:30:08 +00:00
R.J.V. Bertin
6e97d091e4 define QT_NO_EXCEPTIONS reliably when using Clang
Clang's definition of the __EXCEPTIONS macro is inconsistent across
platforms. When compiling for Darwin, Clang 3.6 and newer will set the
token when exceptions are enabled in either C++ or ObjC. This change
adds the reliable check described in the Clang 3.6 release notes to
ensure that QT_NO_EXCEPTIONS is defined when required.
The check requires the use of the Clang-specific __has_feature()
syntax for which a new proxy macro QT_HAS_FEATURE(x) is added in
qcompilerdetection.h

Task-number: QTBUG-61034
Change-Id: Ie7b482dfa1a4a5b700a6b97562c26b626be1fc04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-03 07:22:06 +00:00
Thiago Macieira
e4eaa62943 Disable bogus GCC 7 warning about string op overflow
Analysis proves this is a false positive:

 qarraydataops.h:69:17: error: ‘void* memset(void*, int, size_t)’: specified size between 18446744056529682436 and
 18446744065119617024 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]

Change-Id: I7814054a102a407d876ffffd14b6ab0be9e222fc
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-06-03 03:35:54 +00:00
Shawn Rutledge
c379719607 QTesselator: disable for-loop analysis on Clang
Caught by Clang 4:
error: variable 'k' is incremented both in the loop header and in the loop body [-Werror,-Wfor-loop-analysis]

But we don't want to change behavior unless we can prove that it's wrong
or that there's a way to refactor this without changing it.

Change-Id: Iecee112b0cd96bec8d975430a74ca548ee2f470f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-06-02 20:31:03 +00:00
Gatis Paeglis
ab8ea993b3 qpa: start using QT_DEPRECATED_SINCE to increase visibility
... when platform plugins are using compatibility APIs.

Even though QPA is not a public API and does not promise source/binary
compatibility, we still try to not break things when possible. Eventually
deprectated APIs will be dropped  (e.g between major Qt versions). Having
deprecation warnings here would help maintainers to notice API changes even
before their code stops compiling due to removed QPA APIs. This will also
ensure that we won't forget to remove compatibility APIs.

Change-Id: If13786eb7d42a595708ace00b2ddea5209df18db
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-06-02 20:19:08 +00:00
Joerg Bornemann
ea57a23d7a Remove QWinOverlappedIoNotifier
This class in unused in qtbase since Qt 5.6.1.

The only outside usage was in qtserialport, which got its own copy of
QWinOverlappedIoNotifier in commit qtserialport/65dba188.

Change-Id: I7668e67a1cc49c4418c66141784b180cd5f9d479
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-06-02 20:01:43 +00:00
Friedemann Kleint
b04b4ae4f6 QWindowsXPStyle: Do not draw some opaque theme parts directly
Drawing directly using GDI32 can produce colors that are invalid in the
premultiplied alpha format which is used for the backing store. Exclude part
ids which are known to be opaque.

Task-number: QTBUG-60571
Change-Id: I0863d030acf79f317f5e82a5ee954c9cb507c449
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-06-02 14:04:58 +00:00
Timur Pocheptsov
4fb1745639 Ssl socket - fix broken certificate verification
On iOS QSslConfiguration always has an empty list of system CA certificates.
Calling SecTrustSetAnchorCertificatesOnly(.., TRUE) on iOS  results in
SecTrustEvaluate failing to verify a valid certificate, since there
are no 'anchors' at all. We can use SecTrustSetAnchorCerificatesOnly(.. TRUE)
on macOS only, where we do extract/copy system certificates using
SecTrustSettingsCopyCertificates and save them in a QSslConfiguration's
list.

Task-number: QTBUG-61053
Change-Id: I70d4e46273d78414baaac8531273def707c3eebc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-06-02 12:34:22 +00:00
Oliver Wolff
91ef71b7bf winrt: Get rid of one deferral when handling socket data
Instead of defering one more time by emitting the signal, we can add
the data to the list of available data/pending datagrams. For TCP
readNotification can be invoked directly so that emission of the
readyRead signal is tightly coupled to the availability of new data.
For UDP sockets calling readNotification directly stops handling of
more data and thus cannot be done.

With the old approach it was possible, that the last bit of TCP data
was lost, because the socket was closed while the data was still being
processed/transferred from the worker to the engine.

Task-number: QTBUG-61078
Change-Id: I9330b87876be853d310dc9e8e817ab344939d5dd
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-02 12:30:25 +00:00
Marc Mutz
61ea8f243e uic: re-flow a line
The body of an if statement should not be on the same line
as the condition.

Change-Id: I45614e16d8f0f860824daff9f7b5ba7776535d99
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-06-02 10:30:53 +00:00
Marc Mutz
5b99ac4ead uic: standardize property lookups on QHash::value()
This is the pattern used throughout the rest of the uic codebase,
and is both more efficient (one lookup instead of two with an
additional contains() call) and will allow porting to another
container.

In writeSpacerItem(), also gently optimize string handling.

Change-Id: I20c7914089a699d2161d648b16d938e3a001ace3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2017-06-02 10:30:47 +00:00
Marcel Krems
f68e4b8c31 XCB platform plugin: add missing include
89870a35bd introduced an
usage of std::free without including cstdlib.

Change-Id: I9b7ae1caf90bf22aae99cc0407347350c83181a2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-06-02 10:30:13 +00:00
Gatis Paeglis
7f2def3e57 xcb: don't use C-style cast in qxcbnativepainting.cpp
Change-Id: Ifb61ca142a77ed89686a54e0827c136613a36e52
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-06-02 10:30:08 +00:00
Gatis Paeglis
dff3c0f14f xcb: remove CREATE_VISUALINFO_FROM_DEFAULT_VISUALID macro
It was added by d605883 and become unused after 5f39a0e.
The patch that added this macro used it only in one place,
which rarely is a good reason for introducing a macro.

Change-Id: If7065956fc79daf9b2d535527beaa42dbe0243a2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-06-02 10:30:04 +00:00
Gatis Paeglis
f28d78df48 xcb: remove duplicate QXcbConnection::supportsThreadedRendering()
It is unused and it duplicates QXcbConnection::threadedEventHandling():

bool supportsThreadedRendering() const { return m_reader->isRunning(); }
bool threadedEventHandling() const { return m_reader->isRunning(); }

"threadedEventHandling" is more appropriate name by looking at the body
of the function.

Change-Id: I99733e9c1ddb3ff75444d61d28eca54dcd6b0418
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-06-02 10:29:59 +00:00
Gabriel de Dietrich
0e3d6214df QStyleAnimation: Go down to 15 fps
The new implementation of CE_ProgressBarContents in
QMacStyle uses NSProgressIndicator, which is noticeably
heavier than the previously used HITheme API. Setting
the animation frame rate to 20 fps improves things
significantly compared to the default 30 fps, but
Cocoa seems to update the animation at 15 fps for
indeterminate NSProgressIndicator. Going down to 12
or 10 fps may be an option in the future, but it's
not compatible with NSProgressIndicator.

Change-Id: Ie1e18d7d78d1bd7ea38a12d715a6a7db0e175a29
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-06-01 17:56:24 +00:00
Gabriel de Dietrich
83cbb31460 QMacStyle: Remove HITheme APIs to render QProgresssBar
We use NSProgressIndicator in a similar fashion as we do
with NSScroller for transient scrollers.

Also changed the signature of QCocoaDrawRectBlock.

Change-Id: I0fef8e327494fb557af2c2bab2aafa57c2e69564
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-06-01 17:56:12 +00:00
Alexey Chernov
8b6d6d4832 Do its best in QComboBox to map completer's index
Add additional code paths to map the index passed by QCompleter in its
activated() signal in case when QCompleter's model isn't the same as
QComboBox's one.

Task-number: QTBUG-52027
Change-Id: I1d74037fccbe19962bb7f242aa7b1c2441aa5d54
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-06-01 17:09:21 +00:00
Allan Sandfeld Jensen
8c620d24bb Fix semi-opaque linear gradient on ARGB32
The qt_gradient_argb32 routine optimizes linear gradients with the solid
blend routines that is ARGB32PM only. If the gradient is not solid, it
will not get unpremultipled on write like it should for ARGB32.

Covered by lancelot, but the change is less than 5%.

Change-Id: Id99f2fa125cc091f3b5b29ec2d06618785d628fa
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-06-01 12:00:59 +00:00
Giuseppe D'Angelo
49fc750ee4 QStringLiteral/QByteArrayLiteral: fix/add documentation
Various editorial fixes. Also, in 5.9 QStringLiteral does
not fall back to fromUtf8 any longer, but guarantees
a compile-time construction.

Change-Id: Ida4698cf8e32a6e3de97b2c16b997fc9630c9db9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-06-01 10:21:48 +00:00
Leena Miettinen
22a52d1d64 Doc: Remove references to screenshots illustrating different styles
... from widget class descriptions.

Use one screenshot from Windows instead.

The styles change and the screenshots become outdated very fast, so
it is easier to update just one screenshot now and then. The styles
can still be seen in the style gallery topics.

The image files will be removed in a follow-up commit after all
references to them have been removed.

Change-Id: Id326c141f4884a2e4f67a4fe8681d8c65f8b24ba
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-06-01 10:08:36 +00:00
Leena Miettinen
96d6e03163 Doc: Fix a typo in QVariant::toPoint docs
Task-number: QTBUG-61050
Change-Id: I517f95df9d1019d37b6484e00220e8e325ee2ecf
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-06-01 10:08:12 +00:00
Oliver Wolff
61f67c12fa winrt: Use styleHint as clue for fallbacks for font families
Similar on how it is done for Windows desktop we also use the given
style hint when building the list of fallbacks a font family.

Change-Id: I71378581d07f20ebe5bf0bc757bba919cc70e118
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-06-01 08:23:51 +00:00
Thiago Macieira
c214c000cc qEnvironmentVariableIntValue: fix the case of a non-numeric value
The documentation says that it's equivalent to
    qgetenv(varName).toInt()

But the implementation wasn't. QByteArray::toInt() verifies that the
entire string was consumed, so QByteArray("1a").toInt() == 0, but
qstrtoll alone doesn't. That is, qstrtoll("1a", ...) == 1.

The implementation also detected the base, a behavior I kept. Instead, I
updated the documentation.

Change-Id: I0031aa609e714ae983c3fffd14676ea6061a9268
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-06-01 06:02:10 +00:00
Liang Qi
e3bc01b0e3 Merge "Merge remote-tracking branch 'origin/5.9.0' into 5.9" into refs/staging/5.9 2017-05-31 18:54:04 +00:00
David Faure
f33cf18d88 QAbstractItemModel::supportedDragActions: fix regression
This method now returns -1 by default, due to commit 6255cb893d
which mistakenly replaced -1 with Qt::IgnoreAction (0x0).

As a result, dropping is forbidden in a number of applications
(I detected this in zanshin).

Change-Id: I4922451216e08d5d3fe36f8ba87364a361b691bf
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-05-31 18:54:00 +00:00
Friedemann Kleint
c76b0c87b0 Revert "Win: If the combined key is unknown then fall back to the original key pressed"
The change has been found to break Ctrl+C/V shortcuts when
using a Russian keyboard layout.

This reverts commit c6ecbd4762.

Task-number: QTBUG-61086
Change-Id: I0dce708b1a65b08ea10317d723c38b0414cbac7f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-05-31 18:53:53 +00:00
Oswald Buddenhagen
09e2fc43ab fix configure PSQL_*= being ignored
make qtConfLibrary_psqlEnv() fall back to qtConfLibrary_inline() if
$PSQL_LIBS is not set.

Task-number: QTBUG-59521
Change-Id: Ie293e8bfaa3e113ede166243b345833973cc66f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-05-31 12:57:19 +00:00
Liang Qi
7ee80242de Merge remote-tracking branch 'origin/5.9.0' into 5.9
Change-Id: I2d7a3f3a80e6287e135e55b650f74f9a540332bc
2017-05-31 08:11:37 +02:00
Tero Alamäki
27f0d8db91 Fix qpa/kms test with Vibrante 4.1.6.0 on INTEGRITY for Drive CX
Change-Id: I44ae001dc9f96ea8819a56a87be9322326dbbb4b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-31 05:13:05 +00:00
J-P Nurmi
46b8997b52 Expose QFont enums to the meta object system
Qt Quick Controls 2 needs configurable and toolable fonts for the
upcoming image-based style. Exposing these enums to the meta object
system allows the font weights, styles, etc. being specified as
enum value string names.

Change-Id: I024793656dd1af3a47d4edb5e27563a13c3b4c08
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-05-31 04:30:30 +00:00
Thiago Macieira
fa3940cc4b QStorageInfo: Pass MNT_NOWAIT to getmntinfo
This forces the API not to wait for synchronous I/O from the filesystems
and get the information, but instead just use the cached information
directly. It's a good idea if we have an unresponsive FS, like NFS with
an unreachable server.

Task-number: QTBUG-61096
Change-Id: Iddeeffb6f4ad4a2894a2fffd14c32f6e90664a63
Reviewed-by: Tobias C. Berner
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-30 17:29:21 +00:00
Stephan Binner
dbeb748de3 Convert features.printdialog to QT_[REQUIRE_]CONFIG
Change-Id: Ifb016ae2a0986b436f788b34513c81ea91f3804a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:26 +00:00
Stephan Binner
f209215c0d Convert features.printpreviewwidget to QT_[REQUIRE_]CONFIG
Change-Id: I7e38179acd93bf8c7c48c79ff5e304d893460758
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:17 +00:00
Stephan Binner
e0b39313b0 Convert features.printpreviewdialog to QT_[REQUIRE_]CONFIG
Change-Id: If38d70b1e098c0cc680b913b2c4087681ad2a41e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:12 +00:00
Stephan Binner
18e5d10426 Convert features.cups to QT_[REQUIRE_]CONFIG
Change-Id: I189134b41c4f6e4ac42b5e47ae79338c744b581d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:07 +00:00
Jüri Valdmann
8632614947 QSslCertificate: don't init() if SSL is not supported
QSslCertificate used SSL without checking if SSL is available.

This patch adds such checks to the constructors.

Change-Id: Iea298aded5966641327e22e41ad4665a3d0ec5d3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-05-30 17:12:59 +00:00
Olivier Goffart
c70c1d54f4 QStackedLayout: Fix UB (invalid cast) in qt_wasDeleted()
Fixup of commit b4995eb749.
We can't call QWidgetPrivate::get(w) on a deleted QWidget, because of
the call to the member function QWidget::d_func. We can however call
QObjectPrivate::get since we still are in the QObject destructor.

tst_qstackedlayout now pass without ubsan Warnings.

Change-Id: I4e839a97ddbd1cf21435a8fca76523b98a1f7d9b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-05-30 16:57:30 +00:00
Jesus Fernandez
395ef25353 Use modern C++ keywords
Unifies the usage of modern C++ keywords with the previous commit.

Change-Id: I2dbcf3774634cbd3a24eb1cac58f34bae241cfea
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-30 16:03:42 +00:00
Joerg Bornemann
c3030d7163 moc: remove _MSC_EXTENSIONS #define
Because we obviously don't support Microsoft's extensions in C++. This
is required because some MS headers have code that isn't proper C++,
like iso646.h:
 #if !defined(__cplusplus) || defined(_MSC_EXTENSIONS)
  #define and    &&

Do not pass /Za to MSVC to generate moc_predefs.h, because this option
is incompatible with compiler options like /fp:fast that may be
user-specified.

This reverts commit e1a70ce4 and re-fixes the issue similarly to commit
d72ac3f3.

Task-number: QTBUG-58391
Change-Id: I5c0143283afed09f98200806c87259c039c00ae1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-30 15:34:26 +00:00
Liang Qi
4f9c53d351 Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-05-30 15:22:30 +00:00
Mitch Curtis
c25ad981a3 QWidgetWindow: don't give focus to windows that are being destroyed
In the referenced bug report, dismissing a QFileDialog while the
Qt Virtual Keyboard was in use would result in a crash.

Dismissing a file dialog created with
e.g. QFileDialog::getOpenFileName() causes it to eventually be
destroyed. When this happens, it starts deleting its children. Each
child widget's destructor calls clearFocus(). In clearFocus(), there is
a block of code that emits QWindow::focusChanged(), passing the result
of focusObject() called on that widget's window.
QWidgetWindow::focusObject() could end up using itself as a fallback
focus object if it had no other focus objects (e.g. children) to use
instead, even though it was in the process of being destroyed; as were
all of its children. The Qt Virtual Keyboard plugin would then try to
use the focus object, even though it was in an invalid state.

To fix this problem, we return early from QWidgetWindow::focusObject()
if the window is in the process of being destroyed.

Task-number: QTBUG-57193
Change-Id: I137cf9415812ce2e0419c0afe8076ce150f248cb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-05-30 10:49:36 +00:00
Marc Mutz
dc72ff7b97 QXmlStream: don't create QStrings just to look up entities in a hash
Move the entity's name into the Entity struct and use a QStringView
into Entity::name as the hash key, instead of a QString.

This avoids having to create a QString from QStringRefs every time an
entity is looked up.

Only costs 280B in text size on optimized GCC 6.1 Linux AMD64 builds.

Change-Id: I8dbd04c90c1ff684b794685025204abc89f68a84
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-30 10:38:17 +00:00
Kimmo Ollila
88f30250eb Add USB HID device feature to INTEGRITY
This change adds USB mouse handling support for INTEGRITY

Change-Id: I8a2a51c8c3578898e90dd5bbb01f6aed6c64e2a4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tero Alamaki <tero.alamaki@qt.io>
2017-05-30 10:38:12 +00:00
Marc Mutz
e136565505 QGestureManager: use QScopedPointer to hold prototype gesture
When registering a QGestureRecognizer, we create a prototype QGesture
to ask for it's QGesture::type(). Instead of a manual delete, use a
QScopedPointer to hold it.

Change-Id: I5cf1ad95864265b7d465b6344751acfb19a16800
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
2017-05-30 07:36:53 +00:00
Marc Mutz
a6351be355 QGestureManager: use op[] instead of contains() + insert() to ensure an entry exists
... in an associative container.

This is more efficient (one lookup instead of two).

Change-Id: I07f1ffebb9b27714c0694658366f750752ea438c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
2017-05-30 07:35:31 +00:00
Allan Sandfeld Jensen
2a0d96daa8 Do not use FT_LOAD_TARGET_LCD when full hinting is requested
In FreeType 2.8.0 FT_LOAD_TARGET_LCD is now a variant of
FT_LOAD_TARGET_LIGHT instead of of FT_LOAD_TARGET_NORMAL. This means
requesting it will get us light hinting.

See https://sourceforge.net/projects/freetype/files/freetype2/2.8

We should just avoid using it all together since we request the LCD
mode separately anyway with FT_RENDER_MODE later.

Change-Id: I9ea2e39a6e9ba25ba11604a194e552fe4240a127
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-05-29 14:09:47 +00:00
Allan Sandfeld Jensen
4008400060 Claim alpha8 is premultiplied
The image format alpha8 is neither premultiplied nor non-premultiplied,
but premultiplied being the default, it is better to claim that to
avoid it trigging any special handling of unpremultiplied semi-
transparent formats.

Change-Id: I4af28bca472cd97ab6867bf12c4a202005577bb4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-29 13:58:45 +00:00
Friedemann Kleint
afab37a4de QThread: Refine check for presence of std::future
MinGW with win32 threads might not have _GLIBCXX_HAS_GTHREADS, so it
needs to be checked.

Amends change 597d4ff796.

Change-Id: I5c91d1dd3967c4922ced315b475d653b8b102ad6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-05-29 13:27:40 +00:00
Stephan Binner
ad8b4ba014 Convert features.splashscreen to QT_REQUIRE_CONFIG
Change-Id: Ie46b7c6fb52773dea25c552a77c96d800f471738
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 10:46:53 +00:00
Stephan Binner
61384e910d Convert features.lcdnumber to QT_[REQUIRE_]CONFIG
Change-Id: Ie99d2ce0a836c27fb882c04ff465e6cdd483d360
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 10:46:52 +00:00
Stephan Binner
3945cf1f9a Convert features.movie to QT_[REQUIRE_]CONFIG
Change-Id: I838c7305d4649f953c5bb972f1aa51dbb078afe2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 10:46:50 +00:00
Àlex Fiestas
9ec0280714 Make sure QWindow screen is set before calling QPlatformWindow::create
QWindow uses device independent geometry while QXcb and QPlatform
classes do not.

When QXcbWindow::create is called we have no guarantee that the correct
screen has been set in QWindow so the code
attempts to check if "currentScreen" matches "actualscreen". To perform
that operation though we need to convert
the units from "Device independent" to "native pixels" that we do by
calling QPlatformWindow::windowGeometry which
calls QHighDpiScaling::toNativePixels which requires the correct screen
to be already set.

So basically we have a cyclic dependency, to get the correct screen we
require the correct screen to be already set.

To fix this we can:
1-Remove the dependency (Look for the actual screen using device
independent pixels)
This will imply adding code in QXcb to use
QPlatformScreen::deviceIndependentGeometry to lookup the screen up

2-Make sure the Screen is set before calling QXcbWindow::create

This patch implements the first approach that allows us to keep the
changes within the QXcb backend which seems to be the only one affected.

Task-number: QTBUG-53813
Change-Id: I6dc955d63e17c3b3421f3a1a9e0d841e508b2e5c
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-05-29 10:40:53 +00:00
Friedemann Kleint
8b1377fde1 QWidgetEffectSourcePrivate::draw(): Call render() when no shared painter exists
Task-number: QTBUG-60231
Change-Id: If07274a01bb9a4b9323865a3e061b3674507fd5b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-05-29 10:23:01 +00:00
Tero Alamäki
b418c76396 Add INTEGRITY framebuffer test to configure
Change-Id: I606da783ef9959448a89a7a616ab197820194977
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 09:46:40 +00:00
Tero Alamäki
c49c559abe Get alpha buffer size bigger than zero for INTEGRITY ARMv8 Drive CX
Change-Id: I5bdfe9bb50aafe50542c665d91973e4c0c12e602
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-29 09:46:33 +00:00
Tero Alamäki
ccb3e25d82 Configure eglfs_kms_egldevice for INTEGRITY ARMv8 Drive CX
Change-Id: If41135cdf8287b90690321bef3ad839db6778782
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-29 09:46:27 +00:00
Tero Alamäki
5a01b58665 Add Integrity ARMv8 detection
Change-Id: I352c9b16077011aad1175e31ffaadfa44d2403ea
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-29 09:46:20 +00:00
Tero Alamäki
aea4e3823d Add INTEGRITY mkspec for ARMv8 Drive CX
Change-Id: I038de7a0cc9e6046aec3fc930876d43263702e90
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-29 09:46:12 +00:00
Liang Qi
6a772fd201 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	.qmake.conf
	mkspecs/common/msvc-desktop.conf
	mkspecs/win32-g++/qmake.conf
	mkspecs/win32-icc/qmake.conf
	src/platformsupport/fontdatabases/mac/coretext.pri
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: I74a6f7705c9547ed8bbac7260eb4645543e32655
2017-05-29 10:54:41 +02:00
Jesus Fernandez
40206a9f6d Modify QSqlQueryModel roleNames
QSqlQueryModel::roleNames was exposing the default QAbstractItemModel
roles. Only "display" role makes sense because it's a read-only model
and it is not providing any other data information.

[ChangeLog][Important Behavior Changes] The names of the roles
returned by QSqlQueryModel::roleNames now only include a name for the
Qt::DisplayRole. Previously all the roles names of QSqlQueryModel
were returned.

Task-number: QTBUG-60857
Change-Id: Ib18aa0e7083a828648767d700c5af05b6aa84f4f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-05-26 18:16:04 +00:00
David Faure
f6b36eaafe QHeaderView: fix visual/logical index corruption when restoring state
This is a followup to 77a8e90cdd which
didn't handle the case where no columns had been moved.
visualIndices and logicalIndices are empty until initializeIndexMapping()
is called, in which case appending is wrong.

As a result, visualIndex(i) would return -1 for the values over
those added by read(), and an assert would happen at painting time.

The fix is to leave visualIndices and logicalIndices empty if
they are empty already, leaving it to initializeIndexMapping()
to fill them later if necessary (e.g. when moving a column).

Task-number: QTBUG-60837
Change-Id: Ia7e4b9d3122647984acd434dfaa0400df319d065
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-05-26 12:43:31 +00:00
Tor Arne Vestbø
4c346b6e2b macOS: Don't keep WA_MacAlwaysShowToolWindow windows always on top
On macOS if an application is no longer active then it will cause any
tool windows to hide until the application is active again. For
applications that did not want this behavior and thus wanted the tool
window to stay visible, the WA_MacAlwaysShowToolWindow flag is
available.

In order to ensure that this flag is respected, the tool window needs
to have its level changed when the application active status changes.
Once it is no longer active the window needs to be seen as a normal
window, and when it is active then it needs to be set to be a window
that is always on top to get the right behavior.

Due to various bugs in AppKit we need to explicitly order windows
in front during this process, which requires us to then iterate the
windows in back-to-front order. For macOS versions < 10.12 there is
no way to get an ordered list of windows, so we fall back to using
the window creation order.

Task-number: QTBUG-57581
Change-Id: If20b4698616707685f83b1378f87593f8169c8c6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-05-24 07:45:23 +00:00
Andy Shaw
c1b81190e2 Use hasFocus() to check if the QTreeView is considered active or not
When drawing the branches in a QTreeView, it should use hasFocus() to
determine if it is the active widget or not. This is how it checks when
styling the other aspects of the treeview, so the branches should be
done in line with this.

Change-Id: Id721401424ad95e9fc7ffbdc991e53b5f7feac01
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-05-23 14:00:30 +00:00
Leena Miettinen
b2d8e1e5be Doc: Replace "Macintosh" with something suitable or omit it
Change-Id: I3067bd7e6ae2d6d68d5232a56eaf368a0415876c
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-23 13:02:33 +00:00
Andy Shaw
d67410c615 Ensure status tips for a headerview section are handled
When the mouse is moved over a header section then if there is a status
tip then this should be sent as an event like it would for a typical
QAbstractItemView.
Also adds a test for the StatusTipRole for the QTreeView itself as well as
the header.

Task-number: QTBUG-2066
Change-Id: Iaef8d91f1bd621c2463cde2dff4b2291fb037975
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-05-23 11:51:03 +00:00
Albert Astals Cid
2ca187caa3 moc: Allow NOTIFY signals defined in parent classes
Limitation is that the signal needs to be parameter-less

[ChangeLog][moc] moc now supports NOTIFY signals of parent classes in Q_PROPERTY

Change-Id: Iad64c96c3ec65d4be8ad9ff1a9f889938ab9bf45
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
2017-05-23 11:11:52 +00:00
André Klitzing
3d76b27118 Update bundled sqlite to 3.16.2 as it fix some small regressions
[ChangeLog][Third-Party Code] Sqlite was updated to version 3.16.2.

Change-Id: Ib3e9c3a7021760e3cfa6dbd44f67b9da4abbe367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-05-23 08:44:21 +00:00
Marc Mutz
f437fb2934 Qt containers: use std::move in take*() methods
Move the objects out of the data structure to avoid needless copies.

Change-Id: I1a69fccc431e040b229d6ea9ded0e041c208c861
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-23 08:03:31 +00:00
Andy Shaw
3dd089c08b Cocoa: Clean up memory leak when providing the accessibilityActions
Change-Id: Ib69155ceedb7bf35e3a7b5daa309fc2d54e3f254
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-05-23 06:17:25 +00:00
Oliver Wolff
7076438db4 winrt: Move handling of new socket connections into worker
Same as with receiving data, the "newConnection callback" might be
triggered late and cause a crash if it accesses data of a destroyed
object. By moving the handling of this callback to a worker without
much logic we can prevent these late callbacks from doing any harm.
The signals are no longer connected and thus do not trigger any
problems.

Change-Id: Ic61584f12a46506abe12d7b21403d0c0970c0aae
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-05-23 06:17:05 +00:00
Mitch Curtis
1fb85458fc Doc: fix grammar in QScopedPointer's detailed description
Change-Id: I3ce9650d62f3b53683c6b6f210c1413e94ae006c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-23 06:14:24 +00:00
Marc Mutz
2ff0814aa2 QSplashScreen: make all ctors use the same Qt::WindowFlags
One was setting FramelessWindowHint, the other didn't.

Settle on setting it.

[ChangeLog][QtWidgets][QSplashScreen] All constructors now implicitly
set Qt::FramelessWindowHint, not just the (pixmap, flags) one.

Change-Id: I5e3919acac80bf31c2c61fbade938ff319a6cea9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-22 21:09:55 +00:00
Marc Mutz
6d44fa53e1 QItemSelection: fix a quadratic loop
QList::erase(it) is a linear operation. Calling it in a loop
constitutes quadratic behavior.

Fix by using the erase-remove idiom.

Write a generic function object QtFunctionObjects::IsNotValid, instead
of a lambda, because I am building up a collection of such function
objects in my tree, to be submitted any time now™, so this will reduce
the churn once that gets merged. Wrap it in the unnamed namespace to
avoid ODR violations in case this pattern repeats.

Replace an existing erase-remove idiom's isNotValid lambda function
with the new function object.

Change-Id: I4f0af04e7b201eb168e79beeda332eee3c6f33c3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-22 18:16:38 +00:00
Edward Welbourne
fe8e0da33e QDateTimeParser: pass down an actual current value where expected
Method parse() was passing down its default value argument to various
methods that expected an argument reflecting what's been parsed thus
far.  Pass them what they expected !  Most are fairly insensitive to
the details at present, but the zone parsing I intend to add needs to
know the right date to compute its offset.

This makes it necessary to work out a sensible date and time to use,
from the fragments seen so far, using the default value to fill in
gaps but deviating from it wherever it conflicts with the actual
values seen.

Change-Id: I76750fcd92c1bdcad15c7dd4d8002cb90cec94ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-22 13:00:00 +00:00
Allan Sandfeld Jensen
7fbc7c9600 Optimize conversion from unpremultiplied to opaque formats
Save unnecessary premultiply and unpremultiplication when converting
from an unpremultiplied format like ARGB32 to any opaque format like
RGB32 or RGB16.

Change-Id: I73f58200ff5c62fb07910e6f2b1c29b7e254d327
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-22 11:04:16 +00:00
Tor Arne Vestbø
e794c1bb79 macOS: Remove workaround when adding view as subview
a6b34517e introduced this code as a workaround for stale QCocoaWindow
pointers during event delivery, but these days QCocoaWindow is a
QObject and guarded by QPointer. Disassembly of AppKit also shows that
the view is removed for us, so there's no need to do it explicitly,
especially as this causes two distinct event callbacks from AppKit
for what should be one atomic operation.

Task-number: QTBUG-42059
Change-Id: I212c894adf6aee51256ceff03c9821a995c2a63d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-05-22 10:57:53 +00:00
Tor Arne Vestbø
1051abc480 macOS: Remove workaround when setting view as content view
abde2a59c6 introduced this code on the basis that setContentView
does not remove the view from its superview, but disassembly of
AppKit shows that it does. Since commit 52767b8ee7 we also
ensure that the previous NSWindow has its contentView property
cleared, so this workaround is no longer needed.

Task-number: QTBUG-39628
Change-Id: I21e179263d006f3af1f8a55e9e2f7e8eeab2a632
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-05-22 10:57:49 +00:00
Marc Mutz
5336e061ec QVulkanWindow: return QMatrix4x4 by value
The function never returns nullptr, so return the matrix by value.

Change-Id: I7c1eeb43b9693866049763565b575348ddd35548
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-22 09:23:15 +00:00
Marc Mutz
85554be25f QWizard: move 'initialized' bit into QWizardPage
... as suggested by a code comment.

This avoids the external bookkeeping using a QSet, and will allow, in
Qt 6, when we can port QWizardPage to the NVI idiom, maintaining the
bit as part of the initialize and cleanup functions directly.

Change-Id: I25a4dbf4c42f2c0286aa1a72ab9c59463d44c5df
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-22 09:21:23 +00:00
Marc Mutz
d3f1076d0a QVulkanWindow: use QVector, not QSet, for small int set
Apart from being more efficient to construct and test, for the
expected very small number of entries, the example code itself shows
that a sorted vector is much more useful than an unordered set.

Change-Id: Ic5e38df0176ac4be08eac6a89c2e1cabab2a9020
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-22 08:50:05 +00:00
Eskil Abrahamsen Blomfeldt
33c59be551 doc: Add warning about QTextLayout::beginLayout() and clearLayout()
If you keep around QTextLines referring to the previous contents of
the layout, you can experience crashes when using these after the
layout has been cleared. Since QTextLine is a value type, this is
not very obvious in the API, so we should at least give a warning
in the docs.

Task-number: QTBUG-60804
Change-Id: I81b2b640eec5f62b0af1e878aadd9fa23654ec18
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-05-22 05:40:09 +00:00
Timur Pocheptsov
c21cee827f QSslSocket (OpenSSL) make supportsSsl return false, if v >= 1.1
Our OpenSSL backend allows missing symbols and in general protected
from possible related failures. Unfortunately, for OpenSSL 1.1 this
means not only missing symbols (removed functions), but new incompatible
opaque data-structures and our 1.0 code trying to use them and probably
accessing some data-members via macros - we end up in UB and crashes.
SSLeay, which returns a version number, was removed in 1.1. A failure
to resolve this symbol we consider as a version mismatch and we make
'supportsSsl' to return false.

Task-number: QTCREATORBUG-18137
Change-Id: I5cd270f9c61a729105149779ee7277816f9467d7
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-05-21 09:46:16 +00:00
Sérgio Martins
6ec3a97297 Remove a QT_STRICT_ITERATORS ifdef
Having special code paths defeats the purpose of QT_STRICT_ITERATORS
and is ugly.

Change-Id: Ie0bdbf1a9639a0903bcd020f526629ab2e69883b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-20 16:00:07 +00:00
Tor Arne Vestbø
da8ace713a QWidgetWindow: Forward incoming events with their original spontaneous state
The events may come from QPA, as spontaneous events, or from other parts
of Qt, as non-spontaneous events. We should keep the state of the original
event.

Introduces QCoreApplication::forwardEvent() as a wrapper around the
opaquely named notifyInternal2. Ideally this would be the behavior of
sendEvent, with an enum argument to override the flag, but that ship
has sailed.

Change-Id: Ib0209f2b99744bd10590c63239ee7a97b60be4fd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-20 12:26:28 +00:00
Martin Porcelli
f78ef9753c macOS: Ctrl LMB override can be set on a per window basis
QNSView instances check the _q_platform_MacDontOverrideCtrlLMB
window property along with the QT_MAC_DONT_OVERRIDE_CTRL_LMB
environment variable during creation.

Change-Id: Id6457fccdce2dff1fa83448dd2bc4d2757a87e9d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-05-19 21:51:43 +00:00
Liang Qi
d6248ed80e Merge "Merge remote-tracking branch 'origin/5.9.0' into 5.9" into refs/staging/5.9 2017-05-19 20:27:29 +00:00
Błażej Szczygieł
53335315ff HiDPI: Scale mouse position on enter event
Task-number: QTBUG-60892
Change-Id: If800ecaadc5b19c10a954658ece484f30b7f313f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-19 18:06:33 +00:00
Oliver Wolff
3137410594 Revert "Enable "combined-angle-lib" for ANGLE builds"
Combining libEGL and libGLESv2 into QtANGLE cannot be the default
any longer, as the change was binary incompatible. We just had to
return to previous behavior temporarily to be able to fix
qtlocation.

This reverts commit 97ab65076e30d8cd0cbe6bdbdb51d1dc2c0ff7e7.

Task-number: QTBUG-60795
Change-Id: I3095cb5f9da30e2d873d9a186cfbc5aee3fb10b2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-05-19 17:40:12 +00:00
Liang Qi
550e16b814 Merge remote-tracking branch 'origin/5.9.0' into 5.9
Change-Id: Ia8ac1960387c0f78c32f9d0385bb0aa9a8209af1
2017-05-19 08:57:59 +02:00
Friedemann Kleint
9301d48543 QGuiApplication: Initialize and clear static variables
Running:

tst_qapplication focusMouseClick touchEventPropagation

produced:

FAIL!  : tst_QApplication::touchEventPropagation() 'window.seenMouseEvent' returned FALSE. ()

since QGuiApplicationPrivate::mouse_buttons was not cleared
when destroying and re-instantiating QGuiApplication.

Add more initialization and clear screen list on exit.

Change-Id: I0d814852c362d4a86f1ff5d6a94ab00d32ed30b9
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-05-19 06:16:00 +00:00
Gabriel de Dietrich
9954187adb QCocoaMenuBar: Keep smart reference to platform window
Change-Id: Ib3a5b071f1cc66992969a85a092f8111e57dea44
Task-number: QTBUG-60786
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7da9fa2890)
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-05-18 21:18:47 +00:00
Thiago Macieira
9406bef6b3 Revert "Add qt_safe_ftok wrapper for ftok"
This reverts commit ac0184d608. That
commit added the use of qHash in qt_safe_ftok, which made ftok even more
unsafe than previously. Since the algorithm in qHash can change across
Qt versions, we need a stable algorithm instead.

[ChangeLog][Important Behavior Changes] Reverted a change that caused Qt
5.6 through 5.8 not to connect to QSystemSemaphore and QSharedMemory
created by running applications using Qt earlier than
5.6. Unfortunately, this means that Qt 5.9 will not connect to 5.6-5.8.

Task-number: QTBUG-60771
Change-Id: Ibc3472e1c11d46358357fffd14bf51aeb48ef2c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-18 21:17:52 +00:00
Timur Pocheptsov
6b17d995b7 QNSPanelContentsWrapper - call [super layout]
Docs say that we have to explicitly call [super layout] from the overriding
-layout. On macOS < 10.12 missing -layout call results in a noisy debug
message.

Task-number: QTBUG-58699
Change-Id: I58ce442f1e3640a6b1ec32774078e2385d73f085
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-05-18 09:11:38 +00:00
Allan Sandfeld Jensen
c25bce109e Add QPolygon::intersects() methods
Corresponds to the similar function QPainterPath::intersects() and is
faster than calculating the intersection and then checking if it is
empty.

Change-Id: I694bb2206ed330a456a41d4118a952a68177b7a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-18 08:55:16 +00:00
Oliver Wolff
acc134c8ea winrt: Skip host lookup for http connections
While QAbstractSocket is already changed in a way that winrt only
connects to host names and does not do IP lookups, http connections
still do a lookup to check, whether to use IPv4 or IPv6. As this
information is not needed on winrt anyways and hostnames are to be
preferred over IP addresses on winrt (automatic lookup & proxy handling
internally), we skip the lookup for http as well.

Task-number: QTBUG-59989
Change-Id: Ibc11f5ac07faf23e7af508fd20ee4880b24f79a8
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-05-18 05:18:47 +00:00
Thiago Macieira
087b4fc6cd Remove unnecessary FunctionPointer::ChangeClass
Those were added by accident.

Change-Id: I067fcfe299b34ab6a771fffd14bf28f2d3c096f0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-05-18 02:48:27 +00:00
Oliver Wolff
b53858e609 Enable "combined-angle-lib" for ANGLE builds
As qtlocation's mapboxgl plugin links to QtANGLE if dynamic opengl is
used, we have to keep the combined library being the default until
qtlocation is fixed.
As soon as the qtlocation fix has landed in 5.9.0 this change should be
reverted.

Task-number: QTBUG-60795
Change-Id: I0781695e085a28a8971a6245a352413c0f779025
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-17 13:42:53 +00:00
Lars Knoll
51f095e655 Revert "Merge the QDBusMetaType's custom information to QDBusConnectionManager"
This reverts commit daeb334039.

The commit was causing race conditions, and random failures in CI.

Task-number: QTBUG-60792
Change-Id: I6e49b733965632a1a268f0e88809794098465ec0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-17 13:42:47 +00:00
Allan Sandfeld Jensen
07fd674740 Fix painterpath rect intersections with points on the rect
QPainterPath could in certain cases where sub-path points were on the
border of a rect fail to calculate intersects() correctly.

The patch adds handling of such cases by looking if end points cross in
or out of the rect. Other cases are already caught.

Task-number: QTBUG-31551
Change-Id: I6284da8ff8646d4636702923a76362302dde5767
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-17 11:56:46 +00:00
Glen Mabey
1eea9e60d0 improve docs for qfloat16
added a proper \title, \ingroup, and \brief

Change-Id: I85ac845d8e5415793e6de02cd653c60e2712faa5
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Glen Mabey <Glen.Mabey@swri.org>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-05-17 11:52:58 +00:00
Friedemann Kleint
ff8ce00cae Add debug operators for QOpenGLVersionProfile QOpenGLContext(Group)
Change-Id: I2bf06761bc3a19aa1f0973d9b2f32cec4cbdca0c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-05-17 06:11:09 +00:00
Tor Arne Vestbø
b545a6359b macOS: Don't create NSWindow for embedded views
An embedded view does not have a QCocoaWindow parent, but that doesn't
mean it's a top level.

Improved debug logging to make issues related to this code easier to
spot in the future.

Change-Id: I15b5acdd8d7112600618465a3b65b64fddc306f7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-05-16 17:16:02 +00:00
Gabriel de Dietrich
6775cfa054 QMacStyle: Remove unused default button logic
The auto-default button part must remain, but the pulsating
animation logic can go. Same for the pressed button logic.

Change-Id: I0e9a755f86601780a219296fbc02a1eb2b703aea
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-16 17:03:46 +00:00
Filipe Azevedo
b30ce06992 iOS: Fix the shortcuts bar not correctly hidden
To avoid a compiler warning due to a wrong Apple api, a wrong
workaround was introduced. This caused the hide of the shortcuts as
expects but the visual space reserved for shortcuts was still visible
as at top with a height of ~55pixels.
While this is not important because the default virtual keyboard
is always shown, it become a problem when one want to introduce his own
virtual keyboard (UIResponder.inputView) with no shortcuts bar.
This fix really hide the shortcuts bar.

Task-number: QTBUG-60812
Change-Id: I0da44dfc3fda15af3351543c0a05aac973b899b9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-05-16 14:36:09 +00:00
Jesus Fernandez
904788e3c6 Add swap and move operator to QHostInfo
Also mark as shared-come-qt6,

[ChangeLog][QtNetwork][QHostInfo] Added swap() and move operator.

Change-Id: I8f422868f0487a37aeba3bc74685dc4912e9b3a4
Coverity-Id: 168204
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-05-16 09:55:46 +00:00
Marc Mutz
cafefd1d33 QStringView/QLatin1String: add trimmed()
... using the same qt_trimmed(), qTrimmed(), Q..::trimmed() split we've
been using for all other out-of-line string-view member functions to
avoid forcing string-view objects onto the stack for the passing of 'this'.

In the test, had to fix nullness not being propagated from a QByteArray
to the QLatin1String constructed from it. Probably worth fixing in
QLatin1String(QByteArray), too.

[ChangeLog][QtCore] Added qTrimmed() free functions.

[ChangeLog][QtCore][QLatin1String] Added trimmed() function.

Change-Id: I73c18ef87e203f30f7552c10dd5c84223bcfae0e
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-16 09:34:59 +00:00
Marc Mutz
51e1374bae QLatin1String: add constructor from pointer pair
This is often more natural than (ptr, len), and I need it in the
implementation of QLatin1String::trimmed().

[ChangeLog][QtCore][QLatin1String] Added a constructor taking two
pointers, complementing the constructor that takes a pointer and a
length.

Change-Id: I0606fa0e3f820af1c3c1e261a340e5a941443e4f
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-16 09:34:54 +00:00
Marc Mutz
3c592a17f1 QStringView: add constructor from pointer pair
This is often more natural than (ptr, len), and I need it in the
implementation of QStringView::trimmed().

Change-Id: I1d99b5ddaf76eee0582150b0233ef6ce9c37d25d
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-16 09:34:50 +00:00
Marc Mutz
221653cbea Move Q_REQUIRED_RESULT to first in line in qstringalgorithms.h
Necessary to support C++17's [[nodiscard]] attribute, which needs to
be placed at the beginning of a function declaration.

Change-Id: I31494d13c7be558e86378782ab8684ef2956730b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-16 09:34:37 +00:00
Gatis Paeglis
5963528820 xcb: rename QXcbConnection::{setButton,buttons,m_buttons}
... to {setButtonState,buttonState,m_buttonState}. This is more
consistent with the naming from XCB events:

  xcb_button_press_event_t->state
  xcb_button_release_event_t->state
  xcb_motion_notify_event_t->state

Change-Id: I51ebb858defbdfee4a2009922178f0e58658e6b6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-05-16 07:54:46 +00:00
Shawn Rutledge
d0a1135f00 QDirIterator docs: add a cool recursive file-finding snippet
This is one of the main use cases for QDirIterator, but it wasn't
obvious enough that it's possible.

Change-Id: Idae11cfe75dd0e16f1a960bba2470b1695d11241
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-05-16 06:00:47 +00:00
Gabriel de Dietrich
7da9fa2890 QCocoaMenuBar: Keep smart reference to platform window
Change-Id: Ib3a5b071f1cc66992969a85a092f8111e57dea44
Task-number: QTBUG-60786
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-05-16 01:06:18 +00:00
Eirik Aavitsland
5dc0e4b285 Simplify code by factoring out brush transformation for gradients
Emulation of non-logical coordinate mode gradients was implemented by
essentially 3 x 2 repetitions of the same manipulation of the QBrush
transform. Avoid the code duplication by extracting a common method.
Add lancelot test scripts that excersizes these code paths.

Change-Id: I7baa921923231ef9e83e443dba996b82b32ad1e7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-05-15 22:55:06 +00:00
Gabriel de Dietrich
92a07c6289 QMacStyle: Move disclosure triangle into cocoaCell() logic
Change-Id: Ica7766dabba57af3107ea275aa48514bc65158fb
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:40:28 +00:00
Gabriel de Dietrich
6f3b59bfe4 QMacStyle: Use NSStepperCell for QSpinBox buttons
Includes painting and subcontrol rectangles.

Change-Id: I9a4c704bdea4f20f8dca94de24063f3e14dbaf91
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:40:18 +00:00
Gabriel de Dietrich
ee1868df2b QMacStyle: Remove a couple void *, dead code
Change-Id: If05fbdf8cc5ced81adfd75232313969223bf1453
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:40:05 +00:00
Gabriel de Dietrich
cdc5f7ab5c QMacStyle: Move NSScrollers into cocoaControl() logic
This patch amends b113107419.

Change-Id: Ib305554763457ae4b5a441e41947304cff2853a2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:39:59 +00:00
Gabriel de Dietrich
d422ba6b4a QMacStyle: Refactor NSGraphicsContext setup logic
Change-Id: I00d473454bf970ef55f44d6094039b3f02221155
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:39:47 +00:00
Gabriel de Dietrich
0d3a11acee QMacStyle: Remove brushed metal related code
Change-Id: I000d70c7bcc839c04a89cb87052187eeec62243f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:39:36 +00:00
Gabriel de Dietrich
639d6c4d0d QMacStyle: Replace QAquaWidgetSize with WidgetSizePolicy
No need to have two enums for the exact same purpose.

qmacstyle auto-test updated as well.

Change-Id: Ia601648191e39c0cbbaa7477143441005ae063c2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:39:28 +00:00
Gabriel de Dietrich
33833d4225 QMacStyle: Replace HIRect, HIPoint with CGRect, CGPoint
We probably changed how rounding is done between CGRect
and QRect coordinates, but we expect more things to change
in the near future.

Change-Id: If961849c46edc5fcfee9aef2acda57f386b2928b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:39:23 +00:00
Gabriel de Dietrich
6faa349eb0 QMacStyle: Remove HITheme for CE_MenuItem, etc.
Includes the unlikely non-native menu bar.

Change-Id: Ibc36cbdbe5add3798fe65066d87c48e84804ec33
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-15 22:39:18 +00:00