Commit Graph

30890 Commits

Author SHA1 Message Date
Jake Petroules
bd78f57463 Apple: always use the system time zone instead of the default time zone
This corrects an issue converting dates and times to strings which would
use the "default" time zone (CFTimeZoneCopyDefault) in contrast to the
rest of Qt which uses the system time zone in such contexts.

[ChangeLog][QtCore][QLocale] Qt functions now always use the system
time zone on Apple platforms, the same that low-level C APIs like
localtime() does. Previously, converting dates and times to strings
would use the "default" time zone (which is almost always the same as
the "system" time zone but could be changed with the Apple API).

Change-Id: I2942c3c1c8aa01a0130f1b7280371a72bdb01b1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-24 19:40:45 +00:00
Jake Petroules
c1cece8e54 Fix deprecated API usage
Change-Id: I62448507f80daf6be72994ee99f0fb1aa107eb78
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-01-24 19:40:40 +00:00
Jake Petroules
ffc9d27d7e Remove useless DARWIN_NO_CARBON define from uikit mkspecs
This was used solely for building freetype. It was made obsolete as of
2eaf0cf8fd which upgraded freetype to a
newer version which does not rely on that define, first included in 5.5.

Change-Id: Iaaea8d6783032d784f0a370f8404972967fa7a06
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-24 19:40:29 +00:00
Laszlo Agocs
4178ac2c8f Align blob start in program binary disk cache
Make INTEGRITY happy.

While we are at it, clean up the way the data is composed and accessed
and avoid unaligned uint32* accesses on our side as well.

Task-number: QTBUG-58183
Change-Id: I357be4b6844e5e8b8d27261a3676e135faea6250
Reviewed-by: Kimmo Ollila <kimmo.ollila@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-01-24 16:23:26 +00:00
Laszlo Agocs
962130c66c Add manual test for the QtGui triangulator
Have a widget-based application that uses qTriangulate for fills
and QTriangulatingStroker (and optionally the dash stroke processor)
for strokes.

The resulting triangle (strip) set is visualized on a simple QPainter
canvas, offering the ability to zoom in and examine how the triangulator
behaves on a number of example shapes. It is also possible to step through
and only have the first N set of triangles drawn.

Change-Id: I3a27d86d4ea13a63dd4be0fe81dd4b5ed6e4fa75
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-01-24 16:23:20 +00:00
Lars Schmertmann
139d2e5f10 Add debug stream operator for QNetworkProxyQuery
Change-Id: Iae215827350e47a8ce31e5828d3ad1ed54564e84
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-24 08:32:18 +00:00
Gerry Boland
c28fde3fda Mirclient: update based on upstream development in lp:qtubuntu
This is based on revision 360 of lp:qtubuntu.

Main features/bugs fixed:
- fix QQuickWidget-based app rendering
- wire up Qt window types to Mir to enable desktop-based applications
  to function with a window manager
- use QEGLPlatformContext and QEGLPBuffer instead of custom code
- correctly populate and update list of QScreens
- support for switching keyboard layouts
- improve window resizing to fix visual glitching

Change-Id: If816a858eb10b6356275d4b80c89a72562b3c29f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Matti Paaso <matti.paaso@qt.io>
2017-01-24 05:52:52 +00:00
Jake Petroules
4b507e8257 Add conversion functions for QTimeZone and CFTimeZone/NSTimeZone
Change-Id: I3a2e18d69577296bf612e13e40414bce1daa6a71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-23 21:55:22 +00:00
Jesus Fernandez
decab46c23 Fix qmake -project in an empty folder
Avoids iterating over the entire filesystem.

Task-number: QTBUG-57569
Change-Id: If089842553978843de73559d1b1a567aa322a047
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-23 13:20:42 +00:00
Julian Thijssen
7dc88b6890 Add support for OpenGL 3.2+ core profile contexts in QPainter
This change allows painting via QPainter onto a QOpenGLWindow, QOpenGLWidget
or QOpenGLFramebufferObject when an core profile context is in use. This is
important on macOS in particular, where compatibility profiles are not
available, and so the only way to use modern OpenGL is via a core profile
context.

Added core profile compatible shaders with moder GLSL keywords.

The paint engine binds a VAO and two VBOs from now on, whenever VAOs are
supported. Note that this changes behavior also for OpenGL 2.x context that
have VAO support via extensions.

The Lancelot test suite gains support for core profile contexts. This can
be triggered via -coreglbuffer in place of -glbuffer when manually inspecting
via 'lance', while tst_lancelot will automatically run core context-based tests
whenever supported.

Task-number: QTBUG-33535
Change-Id: I6323a7ea2aaa9e111651ebbffd3e40259c8e7a9c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-01-23 11:34:05 +00:00
Jesus Fernandez
da4b6c4774 Fix uninitialized member
Non-static class member "domainIndex" was not initialized in the
constructor nor in any functions that it calls.

Change-Id: Ie72d997a1f0cf2f3499aac6f7714c7a9d3c7d525
Coverity-Id: 174997
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-23 09:15:28 +00:00
Kimmo Ollila
f346d0e2b0 Increase the default stack size on INTEGRITY
INTEGRITY doesn't support self-extending stack. The default stack
size for a pthread on INTEGRITY is too small so we have to increase
the default size.

Change-Id: I0787d14938cf5e7e96c35df204212c8e83aa8893
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-23 06:25:12 +00:00
Laszlo Agocs
8e445f8434 Rename ill-named RPi3 specs to match the rest
Renaming these specs should cause less trouble than usual since
most people are likely using the rasp-pi2 spec even for RPi3.

[ChangeLog][Platform Specific Changes][Linux] The Raspberry Pi 3
device specs have been renamed from linux-rpi3-* to linux-rasp-pi3-*
in order to follow the pattern of the RPi 1 and 2 specs.

Change-Id: I7d1ed6a4665078af9a4cbbe4c38b5fac760d03f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-20 11:38:14 +00:00
Timur Pocheptsov
83f4f9b401 Add HTTP strict tranport security support to QNAM
HTTP Strict Transport Security (HSTS) is a web security policy that
allows a web server to declare that user agents should only interact
with it using secure HTTPS connections. HSTS is described by RFC6797.

This patch introduces a new API in Network Access Manager to enable
this policy or disable it (default - STS is disabled).

We also implement QHstsCache which caches known HTTS hosts, does
host name lookup and domain name matching; QHstsHeaderParser to
parse HSTS headers with HSTS policies.

A new autotest added to test the caching, host name matching
and headers parsing.

[ChangeLog][QtNetwork] Added HTTP Strict Transport Security to QNAM

Task-number: QTPM-238
Change-Id: Iabb5920344bf204a0d3036284f0d60675c29315c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-20 08:41:50 +00:00
Sebastian Lösch
da0241a2e7 Make variant selection possible if base is missing
[ChangeLog][QtCore][QFileSelector] Removed the requirement for an unused
default base file in case you want to load only a variant.

When the base file (e.g. /image.jpg) was missing, no selectors were
considered and it was not possible to load variants of this file (e.g.
/+android/image.jpg, /+android/+tablet/image.jpg) without specifying the
directory as well.

As a work around, one previously had to place a default file in
the base location, which is undesirable in some cases because:
1. The extra file consumes unnecessary space.
2. It is impossible to encapsulate platform-specific implementation
   details by hiding files in a subdirectory.

Task-number: QTBUG-51230
Change-Id: I4c7f9ec952bff6e5b7738d8cabe3c762c208a38e
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-20 05:25:19 +00:00
Marc Mutz
04dc59d989 QStringListModel: default data()s 'role' argument
... the way it's done elsewhere, too.

Change-Id: Icbb6802c2244469cda7db7eb9e088cf3b7729c89
Task-number: QTBUG-58160
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-19 23:58:01 +00:00
Marc Mutz
3af5cab054 Long live QStaticByteArrayMatcher!
This is a version of QByteArrayMatcher that calculates the
Boyer-Moore skip table at compile-time instead of at run-time,
making this class more generally applicable than QByteArray-
Matcher itself, at least for statically-known strings.

The compile-time part requires C++14 constexpr support, but
the class should compile and work even in C++98 mode, just
with runtime initialization of the skip-table.

While touching tst_qbytearraymatcher, clean up the static
global QByteArrayMatchers there and add tests with needles
longer than 255 characters for QByteArrayMatcher, too.

[ChangeLog][QtCore] Added QStaticByteArrayMatcher.

Change-Id: I0662f262ab19b79ae4096f3ab384d5b3ada72347
Reviewed-by: David Faure <david.faure@kdab.com>
2017-01-19 21:37:46 +00:00
Giuseppe D'Angelo
a6cdfacf8d QHostAddress: make it implictly shared
QHostAddress is one of the few classes in Qt which is pimpl'd but not
implictly shared, making it suprisingly expensive to copy around, return
by value and so on. Being pimpl'd it is also still lacking a move
constructor, like most of such types in Qt.

Remove a bit of the surprise factor and make it implictly shared. In
practice this means making it eagerly parse host addresses from strings.

Since it was entirely implemented out of line, replacing it with a
implictly shared implementation is binary compatible.

[ChangeLog][QtNetwork][QHostAddress] QHostAddress is now implicitly
shared.

Change-Id: Ia7ff94efcb74e7321b7607cd690c5c162f685605
Reviewed-by: Richard J. Moore <rich@kde.org>
2017-01-19 14:09:47 +00:00
Andy Shaw
f46496602e Windows: Support custom sizes entered via the print dialog
When going via the advanced settings for a printer in the print
dialog it is possible to specify a custom page size directly. This
needs to be picked up via the POSTSCRIPT_IDENTIFY ExtEscape
identifier to see if it is supported at all and then queried to see
if a custom size is set.

Change-Id: Id5e94c1b25be1c6e28d9e26d8001cd1c96d8f5d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-01-19 14:09:24 +00:00
Andy Shaw
d2a589e1f0 When changing the printer used, try to preserve the original page settings
Since not all elements of the original page settings can be kept, it needs
to be set bit by bit in order to apply what it can.

Change-Id: I82a2de91e3b8e344a61a290bb4486885fde62b4e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-01-19 14:09:15 +00:00
Leena Miettinen
11875b89f4 Doc: Fix issues in QStyleHints documentation
The \c command is not supported within the \brief command.
If used, QDoc omits the value and the command. Rewrite briefs
to avoid using the \c command in them.

Task-number: QTBUG-58212
Change-Id: Ia29eae8b17a5fd46bec39e113aabf22e010217a4
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-01-19 09:32:33 +00:00
Timur Pocheptsov
231259c3d5 Add a user-controlled auto-redirect policy
With this new policy, after emitting 'redirected', QNetworkReplyHttpImpl
waits for client code to decide if QNAM should follow this redirect or
not. The client can either allow this redirect by emitting 'redirectAllowed'
or abort the reply.

Task-number: QTPM-236
Change-Id: Ia04619f6bd1f0caa477833ae859b24033027b2e1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-01-19 04:34:03 +00:00
Friedemann Kleint
45f80a52c2 Windows platform headers: Add isTabletMode()
Add a bool function querying Windows 10 tablet mode.

Task-number: QTBUG-56831
Change-Id: Ief728a7d80a11ba79f7859033ff4be6ef79bbd4e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-01-18 15:24:18 +00:00
Laszlo Agocs
a0bc9d0027 DRM/KMS config: add support for specifying the primary screen
Not having a way to say that a given output should be registered as the
primary screen (meaning it comes first in the QGuiApplication::screens() list,
emits primaryScreenChanged() signal etc.) can be a problem for some systems.

The order of the outputs array in the JSON configuration file is not relevant
in this respect since screens are registered either in the original DRM connector
order, or, when the virtual desktop layout is specified via virtualIndex, in the
order specified by virtualIndex. The primary screen status is independent from this.

Therefore, add a new, optional boolean property: primary. For example, the following
forces the QScreen corresponding to the VGA output to be the primary screen on the
Renesas R-Car H2 board, even though by default it is the HDMI one that happens to
be reported first by the system.

{
    "device": "/dev/dri/card0",
    "outputs": [
        { "name": "HDMI1", "mode": "1280x720" },
        { "name": "VGA1", "mode": "1280x720", "primary": true },
        { "name": "LVDS1", "mode": "off" }
    ]
}

In addition, improve the quality of the logging output.

[ChangeLog][Platform Specific Changes] Added support for specifying the primary screen
in the JSON config file in QT_QPA_EGLFS_KMS_CONFIG when running on DRM/KMS with eglfs.

Task-number: QTBUG-57980
Change-Id: Iba490800dee3b7162c68c4d40b0822f3f6d81b69
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-01-18 14:48:35 +00:00
Laszlo Agocs
8c14429843 Remove OpenGL dependency from qTriangulate
The original implementation is only suitable as long as the only client
is the GL paint engine which will call the function with the GL context
current. In other cases this cannot be ensured. For instance, doing
triangulation on the gui thread in a Quick application using the threaded
render loop will have to deal with not having a current context on that
thread at all. Doing triangulation on worker threads has the same problem
as well.

In addition, in modern Qt versions a -no-opengl build does not imply no
accelerated graphics API.

Therefore, drop the ElementIndexUint check from qtriangulator.cpp and leave
it up to the caller to tell if uint indices are supported or not.

Change-Id: I7491d84981ee22d05c5fde08994dbb3a4e2432e9
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-01-18 14:48:07 +00:00
Friedemann Kleint
eba886c32f tst_qaccessibility.cpp: Fix warnings about assignment used as truth value
tst_qaccessibility.cpp: In member function 'void tst_QAccessibility::treeTest()':
tst_qaccessibility.cpp:3005:75: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qaccessibility.cpp:3008:75: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qaccessibility.cpp: In member function 'void tst_QAccessibility::tableTest()':
tst_qaccessibility.cpp:3133:75: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Change-Id: I175af3215258c70da8284907f5ddfe95abf41029
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-01-18 14:21:00 +00:00
Allan Sandfeld Jensen
f4a098c635 Introduce QImage::reinterpretAsFormat
QImage::reinterpretAsFormat can be used to change the format of an image
without converting the data, to correct wrong formats or narrow the
format to an opaque one if found to be opaque.

[ChangeLog][QtGui][QImage] A new method reinterpretAsFormat is has been
added to change the format of a QImage without converting the data.

Change-Id: I5e15bc5a1c474a35d3921b06299008ab2effd945
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-01-18 13:10:52 +00:00
Kimmo Ollila
d2d9d26b1e Fix --exceptions flag usage on INTEGRITY
When an executable is being linked and uses a library that has been
built with exceptions enabled, the executable will need the exceptions
flag in order to link in the exceptions handling code.

Change-Id: I3acdb571afbbcaf860fb0ef0482f704f605a9bbe
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-18 13:07:57 +00:00
Kimmo Ollila
daf2aa0047 Add eglfs-viv support for INTEGRITY
Change-Id: I5ea23eeac930dcc628047e3322061d543bddb643
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
2017-01-18 13:04:38 +00:00
Maurice Kalinowski
d3eec16862 Remove support for WinRT 8.1 and Windows Phone 8.1
[ChangeLog][QtBase][General] Removed support for WinRT/Windows Phone 8.1.

Task-number: QTBUG-57288
Change-Id: Ifd6d6780cbbdb710d99556ba3d2fb2e514d4f789
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-01-18 12:38:56 +00:00
Jake Petroules
b9887f3d9a Remove dead code in Xcode generator
These code paths have not needed to be exercised since Xcode < 3.2 was
dropped from support, which is beyond ancient at this point.

Incidentally, this removes use of a deprecated function.

Change-Id: I3e5a45794c21b434b31a48da8a8b0ff22f2852fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-18 05:15:05 +00:00
Jake Petroules
ae072cd9c4 Polish up the QOperatingSystemVersion API and documentation
operator== and operator!= have been disabled, as they are likely to be
misused and are not particularly useful in practice. The same goes for
the QVersionNumber conversion convenience functions.

The constructor normalizes version component values so that invalid
versions like [5, -1, 3] cannot be constructed and made to wreak havoc
on assumed logic.

Change-Id: Iabb6876bd5dc11522032837f78cf825b921a49b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-18 05:15:01 +00:00
Tor Arne Vestbø
2fe9f30512 macOS: Keep reference to NSScreen via index instead of pointer
Manual revert of 73e68a9c0f, which was flawed. macOS can, and will,
dealloc and realloc NSScreen instances for a given screen index, for
example when deallocing an NSWindow, which has the screen as an
auxiliary resource. This is also documented for +[NSScreen screens],
which states that "The array should not be cached".

Task-number: QTBUG-58128
Change-Id: I926513a26cb7af52acd7fc5ee9380ef29ede65e6
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-17 22:18:22 +00:00
Gabriel de Dietrich
04a74c362f QMacStyle: fix focus ring thickness on retina displays
NSSetFocusRingStyle() doesn't take the device pixel ratio
into account for offscreen graphics contexts. As a result,
the focus ring would appear too thin on retina displays.
Therefore, we need to render the focus ring in a more manual
way. The only added dependency is the focus ring's opacity
value and thickness.

This patch fixes CE_FocusFrame and the focus ring around
regular QPushButtons. More work needs to be done for other
widgets that currently rely on HITheme or NSControl–NSCell
to draw their focus ring.

Task-number: QTBUG-57843
Change-Id: I2c6f273698fdfd5ad7344a9688e96aef6da906f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-01-17 20:12:37 +00:00
Timur Pocheptsov
80fd1f8188 HTTP/2 - fix SETTINGS frame validation
When testing peer's SETTINGS frames, namely MAX_CONCURRENT_STREAM identifier,
we should test against upper limit _new_ values from these frames, not our
own pre-set maxConcurrentStreams (it apparently was a typo).

Change-Id: I2036e45b0f931914f75ca99142192e2f9385623e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-01-17 18:52:53 +00:00
Timur Pocheptsov
cebf1fea4a Add redirects policy to QNetworkAccessManager
This patch makes it possible to enable/disable redirects on QNAM
level (before it was per-request only). This policy would be applied
to all subsequent requests* created by QNAM.

The policies we support at the moment:
a. Manual - that's what we always had - it's up to a user to handle
   redirects.
b. NoLessSafeRedirectsPolicy - we allow http->http, http->https and
   https->https redirects, but no protocol 'downgrade' (no
   https->http redirects).
c. SameOriginPolicy - we check that protocol/host/port are
   the same.

Updated tst_qnetworkreply.

*We previously were enabling redirect for each request, by
 setting FollowRedirectsAttribute on QNetworkRequest object.
 For backward compatibility this attribute has a higher priority
 (if set) than QNAM's policy (and it will work as NoLessSafeRedirectsPolicy).

[ChangeLog][QtNetwork] Added redirects policy to QNAM

Task-number: QTPM-239
Task-number: QTPM-237
Change-Id: I493d1728254b71b61b5504937e8e01dca5953527
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-17 18:51:32 +00:00
Alexander Volkov
27e27966bf QListView: Remove unneeded check inside the if block
info.wrap is already checked in the outer if condition.

Change-Id: I3a40dbaae22f00c66acb6f483b7b4786c5580d94
Reviewed-by: David Faure <david.faure@kdab.com>
2017-01-17 18:45:04 +00:00
Edward Welbourne
556b2ee773 Network (HTTPS): prevent recursion among ->close() methods
We observed a stack-trace in which, while handling an error,
QHttpNetworkConnectionChannel::close()'s call to its socket->close()
triggered (when the socket was a QSslSocket) a flush() which asked its
backend to transmit() which tripped over the original error, which
duly triggered endless recursion.  Transiently clear the socket
member, during its ->close(), to prevent this; do the same in abort(),
to preserve its structural correspondence to close().  Restructure
both so that any recursive call's setting of state is overwritten by
the top-level call's, while this still uses the prior socket state
(not the state after close() or abort() and any recursion) to
determine final state.

Task-number: QTBUG-56476
Change-Id: If69e97f7a77a729bf2338ed14214c65aa95f8b05
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-17 05:12:57 +00:00
Jake Petroules
7634225ad2 Fix whitespace, formatting, and line length in QOperatingSystemVersion
Change-Id: Ie26571a8098e8215a6bc1e0e363763e5fc546bcd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-17 01:40:54 +00:00
Sebastian Lösch
14bff46df4 Introduce QNetworkAccessManager::clearConnectionCache()
Sometimes it is desirable to use a new connection but keep already
entered user credentials for usability reasons. This is now possible by
clearing the connection cache (but keeping the authentication cache).

Change-Id: I2f5f64836ce19f81c8525701783a3da823dd468e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-16 11:04:46 +00:00
Pier Luigi Fiorini
abb47fc680 Add screen product information
Add new methods to QPlatformScreen that platform plugins can reimplement
in order to provide more information such as vendor, model and serial
number.

Expose that information as QScreen properties.

A use-case for this feature is a Wayland compositor that maps screens
to Wayland outputs hence it needs to replicate the information.

This information can also be added to the diagnostic output of qtdiag.

[ChangeLog][QtGui][QScreen] Add manufacturer, model and serialNumber
properties.

Change-Id: Ia6945f41023340602ef9d618e0d833a0c1825ab3
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-01-16 07:46:39 +00:00
Marc Mutz
3b0cd13222 QGradient: add a setStops fast-path for conformant QGradientStops
The setStops() docs state that the stops need to be sorted and the positions
must be valid. But the implementation sorts the stops and filters out invalid
ones, so we probably need to keep that behavior, which, however, causes memory
allocations and, potentially, O(N²) behavior, because setColorAt() uses a
form of Insertion Sort with linear scanning...

Add a fast-path for the common case that users adhere to the docs and pass
valid stops.

Change-Id: I93099a57bc4f37d1240a9e9f763618fd5095bc64
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-14 06:27:52 +00:00
Kimmo Ollila
01cade5050 Fix build for INTEGRITY
Change-Id: I2c41295688e962eb263f2180bebfd1dd37613804
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-01-13 07:52:16 +00:00
Jake Petroules
2f08a1d614 qglobal.cpp/QSysInfo::macVersion(): Silence deprecation warning
clang/g++ still warn when encountering the implementation of a
deprecated function.

Follows up 21a247adb4

Change-Id: I6ab1695acb520ef7ce7cb1896545d02607c3ce29
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-01-13 01:53:48 +00:00
Giuseppe D'Angelo
6255cb893d Remove qtypetraits.h's contents altogether
So that QFlags can use an (un)signed int matching the
underlying type as identified by the compiler and not by us.

Requires fixing a few warnings about sign conversion due to
QFlags misusages in qtbase that were either plain wrong, or
were relying on the enum being backed by an (un)signed int
when it wasn't.

Keep qtypetraits.h in the source tree in order to prevent
source breaks if some downstream #includes it (note however
that it did not contain any public API).

Change-Id: Ib3a92b98db7031e793a088fb2a3b306eff4d7a3c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-12 22:16:06 +00:00
Alexander Volkov
a4c25c0205 Add expandingListItems property to QListView
This property allows to change the default behavior in
which list items occupy the entire width of the column.
Setting it to false will reduce their widths to the
minimum values, thus allowing to have intermediate free
space. Then the user will be able to begin selections
by mouse from this space.

[ChangeLog][QtWidgets][QListView] Added expandingListItems property.

Change-Id: I6bd1b147fd0335324310a165104c36f6b0d6ac9f
Task-number: QTBUG-56606
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-01-12 17:54:52 +00:00
Alexander Volkov
dcec1420ea Use QString::asprintf(), QStringBuilder, and the multi-arg overload of QString::arg()
... instead of sequential .arg(const QString &) callings.
It saves memory allocations and prevents unexpected results
if replacing strings contain place markers.
Found with clazy's qstring-arg check.

Change-Id: I3912275a6e11c6fb7559ff5623f2e8cde9b7f07a
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-12 17:54:28 +00:00
Edward Welbourne
8f469e4a19 Remove two unused static methods of QDateTimePrivate
... along with the two matching unused methods of QDateTime's test.

Change-Id: Id11a4b1b0132587f0df451d49c0043e9425d87ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-12 16:42:21 +00:00
Gabriel de Dietrich
a50ed8685f QCocoaWindow: Fix 10.10 sheet API deprecation warning
'beginSheet:modalForWindow:modalDelegate:didEndSelector:
contextInfo:' is deprecated: first deprecated in macOS
10.10 - Use -[NSWindow beginSheet:completionHandler:]
instead [-Wdeprecated-declarations]

Similarly, although it won't emit any warning, we replace
the usage of -[NSApplication endSheet:] wit -[NSWindow
endSheet:].

Change-Id: Iae71247f818b7183d09c6831fa4cb1b71a54a87a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-01-12 02:14:25 +00:00
Jake Petroules
2b928ef6f9 Provide sensible defaults for QCoreApplication::applicationVersion
[ChangeLog][QtCore] QCoreApplication::applicationVersion now defaults to
an appropriate platform-specific value. On Windows, it defaults to the
PRODUCTVERSION parameter of the VERSIONINFO resource for classic desktop
apps, and the version attribute of the application package manifest for
Univeral Windows Platform apps. On Apple Platforms (macOS, iOS, tvOS,
watchOS), it defaults to the CFBundleVersion property of the information
property list (Info.plist) file. On Android, it defaults to the
android:versionName attribute of the AndroidManifest.xml manifest
element. On other platforms, the default remains an empty string.

Task-number: QTBUG-57715
Change-Id: I26f83dd00737e06f4321cf962aa5fab8398104ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-01-12 02:13:21 +00:00