Commit Graph

36793 Commits

Author SHA1 Message Date
Edward Welbourne
dcd35d13e0 Rework the start-of-time fileTimes() test to add another test-case
Turned it into a data-driven test, with the old start-of-time as one
row, in order to add a regression test for an alleged MS API bug in
Windows XP.

Task-number: QTBUG-12006
Change-Id: I632ecc854f50f4183a990c8a27826ede9bd20e55
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-25 09:21:42 +00:00
Edward Welbourne
09f254fcc0 Fix two "unused variable" warnings
Change-Id: Iafced3ffcc24303a1034805b46eb49bd076d1e79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-25 09:09:29 +00:00
Andre de la Rocha
54e117d27d WinRT: Fix invisible element being included in the UI Automation tree
When an element is not visible then it should not be shown in the element
tree at all when using tools like Inspect. Also, the IsOffscreen property
was hardcoded to false instead of reflecting the actual object offscreen
state.

Task-number: QTBUG-69537
Change-Id: Ic8f55486685837cf5e21b3499085bb669c1dc6c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-07-25 08:50:13 +00:00
Kai Koehne
f493324066 qdoc: Fix CONFIG documentation table
Amends 591edbb11c

Change-Id: Ic31d733a1f2d386daa05afa865cb61a987f45578
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-25 07:37:19 +00:00
Jędrzej Nowacki
6970d4048f tst_QCommandLineParser: Add missing QVERIFY
QCommandLineParser::addOption returns false in case of an error.
Tests should check it.

Change-Id: I3507e1c236a15a7c0a77c0c80f8dba65b664a535
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-07-25 07:26:45 +00:00
Ulf Hermann
e883ef6197 rcc: Add a --list-mapping option to output both resource and real paths
The --list option outputs only the file system paths, but does not tell
us where those files end up in the resource file system. This is
unfortunate because the resource paths are possibly the most interesting
thing to be expected from a listing of resource files. Add an option
that outputs a full mapping.

This is also useful for tools that need to resolve files for resource
paths from outside the application using the resources.

[ChangeLog][Tools][rcc] Added a --list-mapping option which shows a
mapping of resource paths to file system paths.

Change-Id: I0cb57fe091ef78b4a9eca8be2fc53278ae50cc11
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-25 07:08:31 +00:00
Mikhail Svetkin
d1dcc4d8cd corelib/tools: add qMakeArray() API
This function can be used to create std::array without the need
to explicitly provide the size of array. It also has a specialization
that allow to generate sorted array at compile time. Sorted array can
be beneficial for example in binary search.

Change-Id: Ifc7e06e451812fce2ab94293959db5e9cc038793
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-07-25 06:57:44 +00:00
Oswald Buddenhagen
80dea66424 qmake: don't drop non-existing files from .depend_command output
this allows for dynamic generation of the dependencies.

Task-number: QTBUG-61267
Change-Id: If5b8aed6b9e4bde189cc3ba6a5f13dcf8def3a1e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-07-25 06:53:56 +00:00
Oliver Wolff
92c5f3fb7b Add qt_test_helper feature
To avoid (even more) duplicated code, "qt_test_helper" ensures the
policy of putting a test's helper application next to the test's
own executable.
The helper executable is suffixed with "_helper" to avoid name
clashes with its folder.

Change-Id: Ic50cb1daa257e7ffc75440c10a3b90fd39424683
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-25 05:17:47 +00:00
Oliver Wolff
64d63d036c Change tests' default installation folder from TARGET to folder name
Instead of having tests installed into a folder named like their
target, we now use their source folder name for the installation.

An upcoming patch will rely on this behavior and simplify creation
of tests that need helper applications.

Change-Id: I17d9ff15edf502d82ab698627189532b83e72546
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-25 05:17:41 +00:00
Friedemann Kleint
8d8a830f13 uic: Modernize the ui4.cpp/.h files
Apply a change from Qt Designer.
Silence clang-tidy warnings in the generated files

- use nullptr [modernize-use-nullptr]:

    Use nullptr where applicable and simplify the switch()
    statement in write() on this occasion to use member variables
    instead of accessors.

-  use '= default' to define a trivial destructor [modernize-use-equals-default]

    Check if any delete statements are required. If not, use "= default".

- use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]

   Use auto.

Change-Id: I7b48872fd42a6118e7cca8510aacb9ffa7e01839
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-07-24 20:22:17 +00:00
Eirik Aavitsland
731538fdd4 Add API for reading and decoding graphical texture files
Add a framework for reading and decoding stored graphical texture file
formats. Includes decoders for the PKM and KTX formats.

This is basically the same texture file reading that was added to
qtdeclarative for 5.11, but has been refactored to be independent of
the scenegraph and opengl.

Task-number: QTBUG-67026
Change-Id: I87d8117550d8a2112f4f58c03e9ac6b3249cbc5a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-24 16:46:05 +00:00
Eirik Aavitsland
1ed0b2170d Give the QGradient presets ObjectMode coordinate mode by default
ObjectBoundingMode has inconsistent behavior and is deprecated in
favor of ObjectMode.

Change-Id: I748f6283f3db5869bb9a67c08bf5f16abc6f95b0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-24 16:45:53 +00:00
Eirik Aavitsland
bafa5a14dd Add demo of the new QGradient presets to the gradients example
In the gradients example, allow the user to select and show
QGradient's named presets.

Change-Id: I40bc6cbe3a0316ce49d67d63511881b6f6112574
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-24 16:45:41 +00:00
Shawn Rutledge
5d0827cbe7 formatQEnum: deal with enum class types
The enum class doesn't get treated as an int automatically, the
way that a plain enum does; so there's a silly compile error which
this cast fixes.

Change-Id: I21b56337e4f724e4de1819e22bc93e9af23c51ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-24 16:25:13 +00:00
Joni Jantti
549abf9e6a Blacklist tst_Gestures::graphicsView on Ubuntu 18.04
This autotest fails on the new Ubuntu 18.04 platform.

Task-number: QTBUG-69599
Change-Id: I575e6f52a539e03ab37ca62e580889854ddb9781
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:20 +00:00
Joni Jantti
05ddbacf6c Blacklist tst_QWidget_window::setWindowState
This autotest fails on the new Ubuntu 18.04 platform.

Task-number: QTBUG-68864
Change-Id: I799defcec3a41d86a604bfcd4c2e1081ae4e0e53
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:13 +00:00
Joni Jantti
d2015b4d06 Blacklist tst_QWidget_window::tst_resize_count
This autotest fails on the new Ubuntu 18.04 platform.

Change-Id: I815e36f7a099ca4c83767c7a1adb0f87f5bff7b5
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:07 +00:00
Joni Jäntti
28cdd1b497 Revert "Blacklist tst_QWidget_window::setWindowState"
Wrong test was blacklisted for this commit.

This reverts commit 85607bd70d.

Change-Id: Ica5272799afec88c05e2cd137835bcdcb587836e
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-07-24 15:32:00 +00:00
hjk
37e91af083 QHash: Remove reference to Qt3's QDict implementation
While it is still formally correct, it does not add much
value anymore.

Change-Id: I32431e3e73f3ca662dc4beb754f53449692c56a9
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-07-24 09:23:55 +00:00
Richard Weickelt
f8c15fe63c Fix wrong relative path to qdbus_symbols.cpp
Commit d743df975d broke tst_qdbusinterface
when not using dbus-linked config option.

Change-Id: Iae5725ac781151e3a3d70032d6530bf4363daafa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-24 04:24:31 +00:00
Oswald Buddenhagen
9b48b3514f qmake: add line-based mode for .depend_commands
Task-number: QTBUG-48919
Change-Id: I6988fb2f26fd62ab40eb7392ccb0e033ad291fe6
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-07-23 17:39:21 +00:00
Oswald Buddenhagen
9c71693de4 prune dead code
msvc2013 is not supported any more.

Change-Id: Idca32f77e1b97a219d8bb4571cfd41e7334ac84e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-23 17:39:09 +00:00
Tor Arne Vestbø
f8774c69b2 QMacStyle: Normalize how we call drawNSViewInRect
Change-Id: I351635c7cc0bb8c852626dc3c0a3caf33b25a761
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-07-23 10:04:33 +00:00
Joerg Bornemann
781beb6eb9 Remove transitioning include from qdnd_p.h
Now all files that use QInternalMimeData include
qinternalmimedata_p.h, and we can remove the transitioning include
from qdnd_p.h

Change-Id: I6c86cb6a5bd73076e5dd3bafc01861b75ab83845
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-07-23 05:50:12 +00:00
Thiago Macieira
d6e9076891 moc: align and use newlines in the generated staticMetaObjects
Change-Id: Id59bdd8f1a804b809e22fffd154078f047078d70
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-07-23 03:44:44 +00:00
Christian Ehrlicher
16794e98bc QTabBar: fix mixed up left and right css pseudo classes
The pseudo classes left and right for QTabBar were mixed up. This
resulted in the fact that the east (=right) tab position was selected
with QTabBar::tab::right and the west with ::left

[ChangeLog][QTabBar][QTabBar] fixed mixed up css pseudo class for
left and right

Task-number: QTBUG-18146
Change-Id: I9f485f21c0a1c54bfac757a6f530aeeeef9b08bc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-07-22 09:14:28 +00:00
Sérgio Martins
9229452e57 Introduce QScopeGuard
A RAII style class which calls a function at end of scope.

Example usage:
    auto cleanup = qScopeGuard([] { <my cleanup code> ; });

[ChangeLog][QtCore] Introduced QScopeGuard.

Task-number: QTBUG-62894
Change-Id: Ife67f5c76255a1fafbae03367263da0bac9a0070
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-21 17:47:35 +00:00
Giuseppe D'Angelo
89bca67499 Remove a deprecation warning coming from QRegularExpression
The flag is deprecated.

Change-Id: Ice6ffafac6a5fa79675fc7cd84a9fb746f17dfb5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-21 16:28:20 +00:00
Giuseppe D'Angelo
b42d305333 Remove a deprecation warning coming from QRegularExpression
The flag is deprecated.

Change-Id: Idfd7c31278032ee96b27f3f447a97ecfdd8051af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-21 16:28:12 +00:00
Friedemann Kleint
189e40e11e Add QTextStream operators for QStringView
Change-Id: I72d597fa21521a04b7f7c0e41bd45ee9dabb6222
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-20 20:51:08 +00:00
Nils Jeisecke
0aea57dfc8 Fix QGuiApplication::queryKeyboardModifiers() on macOS
To quote the documentation:

 Queries and returns the state of the modifier keys on the keyboard.
 Unlike keyboardModifiers, this method returns the actual keys held
 on the input device at the time of calling the method.

So GetCurrentKeyModifiers seems to be the correct Carbon
function to use.

[ChangeLog][QtGui][QGuiApplication] Fix queryKeyboardModifiers() on
macOS to actually return the current modifier key state

Change-Id: I11f2ef1897a39aea13df4afbfebb8172ca803a30
Task-number: QTBUG-26413
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-20 13:48:38 +00:00
Andy Shaw
9c99a13d9e Windows: Cache the printer capability information the first time
As remote based printers can be slow to query, meaning that it will take
time to check all the capabilities, especially if the QPrinter is
recreated on need. Then the information should be cached and reused if
the printer is deemed to be the same.

Change-Id: If8f9626c0d44113c698b4f61bbd197157932ccbe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-07-20 07:49:40 +00:00
Joni Jäntti
588fcde580 Revert "Blacklist tst_QThread::create"
The "boot2qt" platform needs to be blacklisted,
not "ubuntu-18.04".

This reverts commit 0d49ac0ffc.

Change-Id: I768a66c56f5fc7e0771473152579ed1c01bbbdb9
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-07-20 07:00:29 +00:00
Tor Arne Vestbø
87d5d14d10 qmake: Write correct Xcode project directory name to xcscheme file
The Xcode project name may be affected by e.g. the -o argument to qmake,
so we can't assume it's based on the target.

Change-Id: Ibb9f4265017ffcfe26bd8734758dcb30237c704f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-20 06:40:12 +00:00
Tor Arne Vestbø
65463857a9 Inline deprecated QTest::qWaitForWindowShown
Change-Id: Ie8c3975643b9d7e60caf9de4dd3eaa13066a1028
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-20 06:40:11 +00:00
Tor Arne Vestbø
8aa14a84a9 macOS: Correctly scale CALayer contentsRect for child NSViews
When flushing parts of a QBackingStore onto child QWindows, and we're
in layer-backed mode, we need to set the contentsRect of the layer
so that the layer will only show the part of the top-level-owned
backingstore image that's relevant for the child window.

Since the contentsRect is in unit coordinate system, we need to apply
a transform, but this must be based on the top level view's size, not
the image size, as the latter will be twice as big on a retina screen,
giving the wrong unit rect.

Change-Id: I7d6f378ed46a98272efb13406a2878ec1efe734e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-20 06:40:07 +00:00
Tor Arne Vestbø
8316131dab macOS: Don't try to install lldb debug script unless the module provides one
Change-Id: Ib22d2fdca6a4819c1b4056e3207940ceebfbe365
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-20 06:40:05 +00:00
Tor Arne Vestbø
cc27a50ef8 QGLWidget: Gracefully handle failed makeCurrent during resize and paint event
The underlying QOpenGLContext may fail to be made current, e.g. if the
surface is not exposed, or the graphics hardware is not available.

Instead of trying to initialize and resize the GL viewport with a
non-current context, we return early and defer the init and resize
until later.

Change-Id: I278ca8f1ad4d3da2d5be18b44d775f8d6c8af726
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-20 06:40:04 +00:00
Tor Arne Vestbø
8c91070606 macOS: Invalidate window shadow after flushing backingstore to CALayer
The macOS bug preventing us from doing this has now been fixed:

  http://openradar.appspot.com/radar?id=4976602949615616

Change-Id: I3bfa75d6bf982a051a9b274f530529f4ec4351a0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-07-19 19:04:10 +00:00
Oswald Buddenhagen
99c3ef0789 prune cargo-culted and obsolete winsock deps from autotests
Change-Id: I9666598d34e965d7058aeb2b2e7fb3f59600675c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-19 13:31:08 +00:00
Samuel Gaist
82b4c79fb9 MySQL: handle my_bool for newer versions of MySQL
Since MySQL 8.0.1 the my_bool type has been removed because all the C
compilers supported by the project supports C99 which has bool through
<stdbool.h>. This patch makes the driver both forward and backward
compatible.

[ChangeLog][QtSQL][MySQL] Now supports MySQL versions >= 8.0.1.

Change-Id: Ib373992763643bd470d33e85ce5cec7e4ae5e895
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-19 13:00:16 +00:00
Jarek Kobus
ff18b02f21 uic: Revert the microoptimization patch introducing QStringLiteral
This reverts the following commits:
d12d2949d1
26c3bec09b
49b08f96e8

We can't easily predict all code paths for QDesigner
with such a microoptimization. We also don't want
to generate three different string constructions
depending on some sophisticated heuristics.

[ChangeLog][uic] The -no-stringliteral option is now deprecated and
UIC will not generate QStringLiteral anymore.

Task-number: QTBUG-65251
Task-number: QTBUG-51602
Change-Id: I34a5a1934a8df19c5c84ac2ba8e5168ce5665037
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-19 12:38:45 +00:00
Tor Arne Vestbø
519fcb38a2 macOS: Add categorized logging to QCocoaGLContext
Change-Id: I0fa37457f91d905ed6fb8a2aba20add311705ec7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-07-18 19:20:36 +00:00
Thiago Macieira
32591b660e Update the Qt version tagging to adapt to expected Qt 5.16
Change-Id: I61ecce6b1324410bbab4fffd153d5d362d4429bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-18 15:57:05 +00:00
Thiago Macieira
354842fbc1 Update TinyCBOR to 1b233087a6e6b6be297e69bfcce5ed36f338c91d
From the fork at https://github.com/thiagomacieira/tinycbor

Change-Id: I117816bf0f5e469b8d34fffd153dc88683051208
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-18 11:37:03 +00:00
Thorbjørn Lund Martsum
678b0cf6c3 Remove strange icon highlight for active menu item
Windows and macOS do not highlight the icon for an active menu item.
It requires quite a few kludges in styles and/or stylesheets
to make it behave and we simply should not highlight this icon.

[ChangeLog][QtWidgets][QMenu] Removed icon highlight when a
stylesheet was applied the application.

Task-number: QTBUG-69199
Change-Id: I35c5b255766254d11312d7f86c625b811d1dfd64
Reviewed-by: Morten Kristensen <msk@nullpointer.dk>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-07-18 10:16:48 +00:00
Oswald Buddenhagen
4f066d1071 include QTcpSocket to make the header self-contained again
amends 9e24b43cb.

Change-Id: I000261dcbfb50999c68b590afd91177362645562
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-07-18 09:49:48 +00:00
Edward Welbourne
a040369622 Restore qlistview testing on Linux
It might have been fixed in the three years since it was marked
insignificant, and we can't investigate the crash while it's not
tested.

Task-number: QTBUG-50747
Change-Id: I99cdeb55e207d10fe524cd5f4868f042c64eb7d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-07-18 09:25:30 +00:00
Mikhail Svetkin
0826aeddd2 qlibrary_unix: work around compile bug in gcc5.4
GCC5.4 generates incorrect code.

The QString object which is passed by value to f-lambda,
has been corrupted by the time this lambda returns.
Accessing this object causes memory corruption.
The same can be reproduced with std::list and std::string

Task-number: QTBUG-69394
Change-Id: I22522d2ddd1d5226de0aff378133d18391e370de
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-07-18 08:26:32 +00:00