Commit Graph

33353 Commits

Author SHA1 Message Date
Friedemann Kleint
6e861d8412 pathstroke example: Add Q_FALLTHROUGH to unmarked fallthrough seen by GCC 7
Task-number: QTBUG-60635
Change-Id: I10695f96122f1b0859bbe7fadb349efb3c7277a6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-07-09 11:07:17 +00:00
Tor Arne Vestbø
920ba35397 macOS: Use same naming for QPA event forwarding functions
Expose events and others will follow.

Change-Id: I8e11a133381a678517b54ad1872fe302515d4104
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-07-09 10:02:55 +00:00
Morten Johan Sørvig
0e0034d93a macOS: Simplify QCocoaWindow::handleGeometryChange
There are really only two cases here, where the difference
is the coordinate system of the window position.

1) Child QWindow and embedded QWindow:
   The position is relative to parent view/window origin.
2) Top-level QWindow:
   The position is relative to screen origin.

Change-Id: I867133a5adbbf3a690f574aec06b70c2bc64ad95
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-09 10:02:53 +00:00
Allan Sandfeld Jensen
6be94e8f6d Move endian-specific integer types to public qtendian header
The classes have recently been cleaned up to be ready for being made
public, and this change adds the final documentation. The classes are
already used in qjson, qtdeclarative and some image format decoders.

Change-Id: Ib6df89f1119162c5bad7a08e9b6f843a2db4040f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-09 09:00:16 +00:00
Tor Arne Vestbø
16799ba394 Only try to resolve library paths via linker for Drawin clang
Task-number: QTBUG-61735
Change-Id: Ia8e777928aa0cff44f092968eac14d32501a5d73
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-08 16:59:07 +00:00
Tor Arne Vestbø
74fc88f638 macOS: Move geometry reporting from QNSView to QCocoaWindow
There's no longer any reason to call out from QCocoaWindow to QNView for
this, as the geometry events from AppKit are delivered directly to the
QCocoaWindow. Most of the data used in the implementation are coming
from QCocoaWindow anyways, and this enables geometry events for foreign
windows in the future.

Change-Id: Idd724d078e9981304dcbe6742b9ddc71640a2350
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-08 16:53:28 +00:00
Kevin Funk
9db09b4700 Fix modernize-use-bool-literals issues
Reported by clang-tidy. Skipped fixes in implementation files, only
changed headers.

Change-Id: I5cfd266b3d4046f90baebc0c538b1b6ab03a02d2
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-08 11:49:55 +00:00
Friedemann Kleint
2300629df5 QWindowsFileIconEngine::filePixmap(): Handle non-existent files
Pass SHGFI_USEFILEATTRIBUTES/FILE_ATTRIBUTE_NORMAL to ShGetFileInfo() in
case a file does not exist to obtain an icon.

SHGFI_USEFILEATTRIBUTES cannot be used unconditionally as it
breaks custom directory icons.

The functionality is then on par with XCB which obtains icons
via QMimeDatabase look-up.

Task-number: QTBUG-25319
Change-Id: Icd894d97fd8d1a2c4d5d39e86afe89843e6720c4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-07-08 11:02:39 +00:00
Kevin Ottens
0d196b4268 Add support for parameters in QShaderGenerator
Change-Id: Iff8fec51ddbf9b018cb5ec3aff357125134013eb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:23 +00:00
Kevin Ottens
13ecd686b9 Add support for node parameters in QShaderGraphLoader
Now the parameters from the prototypes are used as default values and
the graph file can overload them.

Change-Id: I9a8a73963c7e578bd0a34e96f76f147a12224f4f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:19 +00:00
Kevin Ottens
5667c870fb Add support for node parameters in QShaderNodesLoader
This will allow to make the prototypes more extensible when referred to
from a graph file while providing some sane defaults.

Change-Id: I1ae10182427d8a7d29c51a64e19e99139494ea92
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:16 +00:00
Kevin Ottens
f7fefed2ea Add parameters to QShaderNode
This will allow to create nodes having an entry point for tuning, still
need to be exploited by the loaders and the shader generator. Coming in
further commits.

Change-Id: I8384b0f528c9919e9f8d35102adde2b307f08b80
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:13 +00:00
Kevin Ottens
74e9a11386 Complete the QShaderGraphLoader tests to introspect nodes
We forgot to check that the node content was correct and complete when
loading the graph.

Change-Id: Id4ee6aaba6ca268b0785e7fa3fb51a19817e7c9c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:10 +00:00
Allan Sandfeld Jensen
4f88475a96 Allow QImage with more than 2GByte of image data
Changes internal data-size and pointer calculations
to qssize_t.

Adds new sizeInBytes() accessor to read byte size, and
marks the old one deprecated.

Task-number: QTBUG-50912
Change-Id: Idf0c2010542b0ec1c9abef8afd02d6db07f43e6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-08 08:17:13 +00:00
Thiago Macieira
80c152d689 Move the readlink(2) wrapper to qcore_unix.cpp
This deduplicates the code between QFileSystemEngine and QLockFile.

Change-Id: I1eba2b016de74620bfc8fffd14cd005d5fd9beaa
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-07-08 02:18:16 +00:00
Thiago Macieira
3c689c4b3f QLockFile: Move the check for Linux /proc to a central place
I'll need it soon in QTemporaryFile. This also reduces the overhead,
since QFile::exists -> QFileInfo::exists needs to check if there's a
file engine that handles "/proc/version" (there isn't), convert the
UTF-16 filename to UTF-8 and QFileSystemEngine::fillMetaData will issue
a more expensive stat(2) syscall.

access(2) is cheaper.

This commit also introduces QT_LINUX_ALWAYS_HAVE_PROCFS that isn't
defined anywhere, but could be passed during configure with -D if a
build wants it.

Change-Id: I1eba2b016de74620bfc8fffd14ccfd1593d59ade
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-07-08 02:18:14 +00:00
Gatis Paeglis
fb78adf8df xcb: cleanup gl_integrations_plugin_base.pri
The original version (8758f532ae) of
this file was full of things that are irrelevant for XCB GL plugins.
Most of this has been cleaned out as side effect of porting to the
new configure system. This patch cleans up the remaining pieces.

It does not matter for XCB GL plugins if Qt was configured with
-qt-xcb or -system-xcb as those are dependencies of xcb_qpa_lib-private
and are not used directly by these plugins.

The only XCB dependencies that are directly used by these plugins
are libxcb-glx and libxcb, which are managed directly in xcb_glx.pro:

qtConfig(xcb-glx): QMAKE_USE += xcb_glx

Change-Id: I2175185902bb028de142c8ff6e0b0a3b76a09703
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-07 23:05:17 +00:00
Friedemann Kleint
05fd45ac8d QIntegrityHIDManager: Fix syncqt warnings
QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QObject when it should include QtCore/QObject
QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QList when it should include QtCore/QList
QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QList when it should include QtGui/QList
QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QThread when it should include QtCore/QThread

Amends 88f30250eb.

Change-Id: Ia56fdd87871fdeae8fe34752c61a66195100ceb7
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-07 21:39:17 +00:00
Thiago Macieira
8d542154a8 Avoid sharing violation in QFileSystemEngine::id on Windows
We can't open a file for reading if the file is open by another process
(or by ourselves) without sharing permitted. So ask for no access just
so we can get a handle to it.

Change-Id: I998653739e1cec2a58a07a6593b6ff87c1d59dd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-07 21:39:16 +00:00
Thiago Macieira
fd95ef765a QFile::rename: avoid two stat(2)/CreateFile in a row
QFileSystemEngine::id() will stat(2)/CreateFile in order to get the ID
of the file anyway, so we don't need to use QFile::exists() to check if
the destination exists. Instead, rely on id() returning a null value to
indicate error. On Windows, it's possible that the calls to either
GetFileInformationByHandle or GetFileInformationByHandleEx might fail,
but we ignore those.

Change-Id: I1eba2b016de74620bfc8fffd14ccaebcbed64419
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-07-07 21:39:12 +00:00
Thiago Macieira
49ab284d34 Stop using QVector in QFileInfoPrivate
This was added in 32629676b9 for Qt 5.1
because QDateTime always allocated memory, so QVector was much faster
for default-created objects. Since Qt 5.7, QDateTime no longer allocates
memory in the default constructor, and in Qt 5.8 on 64-bit systems, it
won't allocate memory at all for most reasonable dates, so construction
times are acceptable now.

Change-Id: If0ad4d988da143b3b1b2fffd1480e83121cddc8c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-07-07 18:40:31 +00:00
Thiago Macieira
0b7d9d2811 QAbstractFileEngine: make setFileTime not a pure virtual
Most engines just had to override the virtual to return false. So do it
in the base class.

Change-Id: I8d96dea9955d4c749b99fffd14cd738a48aa818c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-07-07 18:40:30 +00:00
Tor Arne Vestbø
1b73c202ce macOS: Add LLDB debug script when building with separate debug info (dSYM)
The script will look for the most recent Qt Creator version on the system,
and pick up the LLDB summary providers from there, allowing pretty-printing
of Qt types inside LLDB/Xcode.

LLDB will detect the file when loading the dSYM, and inform the user that
the file can be loaded to enable the formatters. The script can be loaded
automatically by adding the following setting in ~/.lldbinit:

    settings set target.load-script-from-symbol-file true

Which comes as a slight security risk, as other libraries might have
scripts of their own. The alternative is to load the script directly
from ~/.lldbinit:

    command script import "<path to debug script in dSYM>"

With an optional target.load-script-from-symbol-file set to false, to
silence the warning when loading the dSYM bundle.

Change-Id: I01ba51dab725a8d0a58f1ad1749742443b639cc5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-07-07 18:09:45 +00:00
Edward Welbourne
ddcbe23f20 Mark an unlikely test as such and condition in positive order
Also wrap two blocks in braces, since the formerly-else block spreads
across many lines; and split those lines differently to limit length.

Change-Id: Ib89329b11aad6599926f0338d6546f4141d2c002
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-07 18:09:44 +00:00
Tor Arne Vestbø
3a31c70879 Ensure all platforms send geometry events if request was not fulfilled
The logic of deciding whether or not to send resize and move events
has been centralized in QGuiApplication. This ensures that if a
window with geometry 100,100+200x200 is moved and resized to e.g.
0,0+100x100, but the window manager denies the request (because the
window would e.g. overlap with system UI), and issues a geometry
update with the original geometry, 100,100+200x200, we will still
treat that as warrant of a move/resize event to the application,
so the application knows that its position and size is as before.

[ChangeLog][Qt Gui][QPA] QWindowSystemInterfacePrivate::handleGeometryChange
no longer takes the old geometry as an argument.

Task-number: QTBUG-57608
Change-Id: I1d471cc7a257fef958bdb1e56184fa95489403a3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-07 18:09:43 +00:00
Edward Welbourne
9381ca77b2 tst_QDateTime::toTimeSpec(): verify round-tripping works cleanly
Change-Id: I811fa4249dae923e5e4e434910d8bf96c15bff25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-07 18:09:33 +00:00
Edward Welbourne
cf9187f8c9 tst_QFileInfo: generalize old-file test
Now that QFileDevice::setFileTime() provides a portable way to prepare
our test file, we can verify QFileInfo does handle the distant past,
notably including negative time_t values.  The old MS-specific code
used a time back in 1601, which we can't hope to support
cross-platform, so use one in 1901 that's a little inside the range of
32-bit time_t.

Task-number: QTBUG-47985
Change-Id: I2de3e79d8c7864221f92395813b63f373e4d8a3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-07 18:09:24 +00:00
Edward Welbourne
3a9e135d55 Exploit QVector3D::length() instead of duplicating its work
Calling the class-method dotProduct(x, x) in order to then take its
square root is a clumsy way to obfuscate x.length() - and lacks its
efforts (clumsy though they are) to limit rounding issues.

Change-Id: I1dc1f38764651bc70c0620e286cb5625f505ddbf
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-07-07 18:09:08 +00:00
Edward Welbourne
fcb423d1f2 Q(Date|Time)+: in QDebug's <<, handle invalid explicitly
The output didn't previously make clear that the datum was invalid.
It's now explicitly invalid.  At the same time, use QDebug's space()
and nospace() methods to make spacing choices explicit.
Revised a QDate test to match.

Change-Id: I4699f5897530b4caa31c22fdb07de149832b30f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-07 18:08:59 +00:00
Edward Welbourne
cc3b9cf3b3 Clarify tst_QDateTime::fromStringToStringLocale() using a macro
Separate the part varying between tests from the common form of all
the tests, so the reader can see the common pattern and know for sure
that there's not a typo or copy-and-paste glitch.

Change-Id: I3145a26ab42c104eb27756d906ac87f937024bad
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-07 18:08:51 +00:00
Edward Welbourne
6d77ed23ef Call sinh() rather than implementing it using exp()
Change-Id: I8dda2f94524b19bcdec640e7541b04d46a6c3941
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-07-07 18:08:41 +00:00
Edward Welbourne
85a793075c Fix an egregious misnaming, s/deg([XY])/rad$1/g
The angles in question were in radians, not degrees;
we get them from std::atan().

Change-Id: Ifd60efbd975997ffca02e45ae884fb75e59806b4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-07-07 18:08:32 +00:00
Gabriel de Dietrich
ac8955794f tst_qstyle: Don't fail on empty scroller subcontrols on macOS
macOS hasn't had SC_ScrollBarAddLine and SC_ScrollBarAddLine
since 10.7, when transient scrollbars first appeared.

We also make the warning message a bit more informative.

Change-Id: Idef4684162456d9bc274eea77908a6afe24fa0f5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-07 17:54:53 +00:00
Gabriel de Dietrich
2673d05dc9 QMacStyle: De-Carbonize QScrollBar
Addresses drawing, hit testing, subcontrol rects and one metric.

Also fixes the knob width on hovered transient scrollbars. Since Cocoa
won't help for this (and never will), we do it manually.

For non-transient scrollbars, no more HITheme. That's why we're doing
this after all. It also comes with its own small hack; see how we darken
the knob when hovered.

We had to de-intertwine the logic with QSlider in drawComplexControl(),
which now gets its own full case CC_Slider statements. QSlider will be
addressed next.

Task-number: QTBUG-49585
Change-Id: Iced58d52fff0c11866bdf6eb562dbab36c8f3ef2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-07-07 17:54:39 +00:00
Giuseppe D'Angelo
353fb118c3 Fix detection of QMAKE_DEFAULT_LIBDIRS with Clang under Linux
With 4183475080, Qt fails to build if
qmake is unable to detect the compiler's default include and
library search paths. Clang on non-Darwin systems was missing working
code for the detection.

Unlike GCC, Clang on its own does not print the library search paths
when called with the -v option.

On Darwin, the -Wl,-v option will reach ld64, which will print those paths.
However, neither GNU ld nor gold will print anything useful with just
-v. GNU ld has a --verbose option that does print some search paths, but
those are not the ones used when ld is invoked (via collect2) by GCC or
Clang, so it can't be used.

To make Clang print its library search paths one can use
-print-search-dirs, which however doesn't print include search paths. So
amend the existing code in order to make a second call to clang on
non-Darwin systems. This second call is used for library path detection,
and fixes the build on non-Darwin (tested on Linux).

Change-Id: Ic858f908ee1a2e0eb307abb074daee0ded38abd5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-07 16:23:46 +00:00
Alessandro Portale
f2db946fa4 QWidgets/FusionStyle: Fix menu drawing under HighDPI
Delegating the border painting to qDrawPlainRect ensures that there are
no off-by-one pixel issues.

Task-number: QTBUG-61845
Change-Id: I732795e048cbc2e5b279782e9a19700884f8bc40
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-07 16:23:45 +00:00
Friedemann Kleint
b6d5026b1f QWidgets/drawutils: Handle device pixel ratio != 1
The panel drawing helpers have code drawing shadows that relies
on working with integer coordinates and one pixel lines, which causes
artifacts when Qt High DPI scaling is in effect.

Add code that checks for device pixel ratio != 1 and in that
case reverts out the Qt High DPI scaling transformation and scales
the parameters so that the drawing code used device
pixels.

Task-number: QTBUG-58611
Task-number: QTBUG-59116
Change-Id: I8402044f3fd4dfcd349b31c573dcad12ae1f609f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-07-07 14:25:20 +00:00
Tor Arne Vestbø
9d3cd2268c macOS: Account for fullscreen geometry bug in AppKit on OS X 10.10
Task-number: QTBUG-61776
Change-Id: Ifac502cf422088eafe9211d759f2f5cd9769d0d3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-07-07 10:36:54 +00:00
Simon Hausmann
3fb0852091 Skip the dbus abstract adaptor test on OpenSuSE 42.1
It has been crashing for months...

Change-Id: I1d6077f949d642465771c4d618babc64ebc340f6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-07-07 09:40:14 +00:00
Friedemann Kleint
d7bfbf3a13 Windows QPA: Further restrict windows for WM_DPICHANGED
Exclude popups among other non-applicable windows types
from resizing in WM_DPICHANGED.

When resizing was enabled for non-fixed size windows
by c854fc5a6b
it turned out that context menus were truncated
when moving an application from a high resolution
to a low resolution monitor.

Factor out a function to check for the applicable window types.

Amends 886ce572d6,
c854fc5a6b.

Task-number: QTBUG-55510
Change-Id: I16fee07f3e11828848ec71cdceadff958cedb13a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2017-07-07 09:29:11 +00:00
Berthold Krevert
e53a57d254 Add Q_FALLTHROUGH
Change-Id: I14efe4dbffb5808f3f9b763f7dae38301a1f6e5c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-07-07 08:45:49 +00:00
Orgad Shaneh
5772cac426 qmake: Do not default to -pipe on Windows
It is considered slightly faster than the default mode[1],
but on Windows it causes trouble when aborting the build,
it leaves behind zero-sized object files which cause link
error. See discussion in the bug-make mailing list[2].

[1] https://stackoverflow.com/a/1512947/764870
[2] http://lists.gnu.org/archive/html/bug-make/2017-06/msg00066.html

Change-Id: I7aa0b328a8c743fdfe9b0aece02b329066515076
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-07 08:11:42 +00:00
Orgad Shaneh
e10be52e21 qmake: Separate object_script by Makefile name
If several Makefiles are used in the same directory (for example, for
multiple projects in the same directory or different build configurations),
they all reference the same object_script, which is obviously wrong.

Change-Id: I9b499ceb6b6bd6058f54b452fa44bfb2313eec26
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-07 08:11:44 +00:00
Friedemann Kleint
db404fea64 QListView: Fix viewport size when checking scroll bar visibility
Subtract the viewport margins from the contentsRect in
QCommonListViewBase::updateHorizontal/VerticalScrollBar(). This
affects list views in icon mode and list mode / ScrollPerPixel.

Task-number: QTBUG-61383
Change-Id: I6f2f7951ac9344ac21cef1eba061780d130e2467
Reviewed-by: David Faure <david.faure@kdab.com>
2017-07-07 08:10:01 +00:00
Thiago Macieira
9bec818ccc Use the namespace-mangled symbol for the qt_version_tag group name
Doesn't affect our current builds since it's just a marker for the
linker on what sections should be merged. Unless you're mixing
namespaced and non-namespaced static builds into one executable.

Change-Id: Ia53158e207a94bf49489fffd14c7bc294fccf8f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-07 07:22:03 +00:00
Thiago Macieira
c7ea60d1ab QWizard: Fix null pointer dereference if no pixmap was set
The pixmap may be set in QWizardPrivate::updateLayout() if there's a
side widget or a watermark. If neither exists, then no pixmap is set and
this would cause a crash.

Task-number: QTBUG-61423
Change-Id: Ia53158e207a94bf49489fffd14c80dd93415dd0f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-07-07 07:22:01 +00:00
Thiago Macieira
3509626128 QDeadlineTimer: round milliseconds up instead of down
Code like:
    QElapsedTimer timer;
    timer.start();
    QTest::qWait(30);
    QVERIFY(timer.elapsed() >= 30);

is failing, because qWait sleeps in increments of 10 ms and the last
chunk may be off by less than one millisecond, so we end up sleeping too
little and thus returning before 30 ms have elapsed.

This matches the QElapsedTimer::elapsed() code that rounds down:
    return nsecsElapsed() / Q_INT64_C(1000000);

Task-number: QTBUG-61741
Change-Id: Ic3a088f9f08a4fd7ae91fffd14cea4a91d3f51a8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-07-07 07:21:58 +00:00
Thiago Macieira
bcd19b723a QLocale: fix handling of milliseconds in string format and document
[ChangeLog][QtCore][QLocale] Fixed the conversion of QTime to string
form and parsing from string form to always treat the value as the
decimal fraction of the seconds component. That is, the string format
".z" produces/parses ".2" for 200 milliseconds and ".002" for 2
milliseconds. Use of "z" or "zzz" is discouraged outside decimal
fractions to avoid surprises.

Task-number: QTBUG-53565
Change-Id: Ia19de85ad35e4eb7bb95fffd14792caf9b4a5156
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-07-07 07:21:53 +00:00
Friedemann Kleint
e1d7f7dfbc QFileSystemWatcher/Windows: Recreate handle for files
QWindowsFileSystemWatcherEngine uses one change notification
per directory to watch directories or files within that
directory. Adding files and their directories in a sequence
caused the value in QWindowsFileSystemWatcherEngineThread::HandleForDirHash
to be overwritten.
Relax the check for the flags (watcher attributes) to use >= and recreate
the change notification of a directory should its flags be insufficient.
This triggers when a file is added after its directory since files
require more attributes.

Task-number: QTBUG-61792
Change-Id: I371a72f1934fa82c53aaf84beb907825031f1c81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-07 07:02:45 +00:00
Tor Arne Vestbø
a4c8129d09 Relieve platform plugins of having to persist geometry on WM callbacks
We can offload this to QGuiApplication, just like the geometry of the
QWindow is set. This ensures that all platforms behave the same, and
that the documentation of QPlatformWindow::setGeometry is adhered.

Change-Id: I19dbc32cb4fb146d716ec289c28030a547d3afaa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-07 02:01:22 +00:00