Commit Graph

29488 Commits

Author SHA1 Message Date
Marc Mutz
c38ac3dab8 tst_QStringListModel: don't leak memory when tests fail
Simply allocate objects on the stack instead of the heap.

Change-Id: Ic047d78e49668878821cce1c8ab599a8551b6476
Reviewed-by: David Faure <david.faure@kdab.com>
2016-08-12 08:28:07 +00:00
Marc Mutz
b57f743c46 QStringListModel: fix dataChanged's roles parameter
In QStringListModel, the display and the edit roles are synonyms,
so when one is changed, the other changes with it. However, in
setData() we only emitted a vector with just the role that was
passed in by the user.

Fix by always passing both roles, regardless of which one was used
to set the data.

Change-Id: I498e7cb33796fae266901817b01ad85d861d4bb4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-12 08:27:53 +00:00
David Faure
4e24ff2e68 QCommandLineParser: call qCoreApp post routines before ::exit()
This gives a chance for some cleanups at least.

Change-Id: I3a628e32c6fc8c7fa00943769210c517005f2a0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-12 08:26:59 +00:00
Kai Koehne
7c5ccdd83b Add list of 3rd party code attributions to Qt Core, Qt GUI, Qt SQL
Also document the current license the modules are available from,
since this is not consistent anymore across Qt.

Task-number: QTBUG-55139
Change-Id: I117fdb0cda7bd7ff92aa825e29c28f22a8a2f96d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-08-12 06:55:08 +00:00
Kai Koehne
357a35eaf0 Add \externalpage for The Qt Company
Change-Id: If8f8e949c6c6799fbe2e382fee3b1fcccab6a350
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-12 06:55:04 +00:00
Kai Koehne
492ca3e503 Add qt_attribution.json files
The format is documented in

  http://wiki.qt.io/Qt_attribution.json

Also add a LICENSE file in case there is none yet
(usually copied from the source headers).

Task-number: QTBUG-55139
Change-Id: Ib54c73d0bb9946cfd8579e86c6858035184ca516
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-12 06:55:01 +00:00
Simon Hausmann
8e29d463dc Make imageAt and formatAt more robus against different font metrics
Don't try to locate the text by coordinates at the edge of the text but
simply aim at the center vertically _and_ horizontally.

Task-number: QTBUG-52991
Change-Id: Ia9e84fc5d12491840e739c4eea730fe13058f3c7
Reviewed-by: Simo Fält <simo.falt@theqtcompany.com>
2016-08-12 03:59:23 +00:00
Gabriel de Dietrich
7833f7bc06 QCoreTextFontEngine: Remove calls to deprecated API on macOS
CGContextShowGlyphsWithAdvances has been deprecated since 10.9.
We use instead CTFontDrawGlyphs as recommended by Apple.

Change-Id: I568bf588f403228e3b695e42dfe39de807537a9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-12 01:00:37 +00:00
Morten Johan Sørvig
b0abe20d4b Darwin: Add QImage::toCGImage() conversion function
(Move QT_FORWARD_DECLARE_CG to qglobal.h)

This function converts to CGImage for supported formats. This
is done by creating a CGImageRef that reuses the QImage data.

The CGImage and QImage ref counting systems are bridged, implemented
by using CGDataProvider that holds a copy of the QImage.

Unlike the previous internal implementation this public version
does not implicitly convert unsupported formats to ARGB32_Premultiplied.

See included documentation for the complete description.

Change-Id: Ie3984a7a8331e02a6f1c42943caaf76854e93538
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-08-11 21:21:05 +00:00
Laszlo Agocs
dfae6a7593 evdevtouch: Enable touch in multi-screen eglfs environments
Parse the touchDevice property from the KMS/DRM config file. When all
outputs have an explicitly specified index in the virtual desktop, we
can set up a mapping between the device node and the screen index. It
is somewhat fragile (device nodes may change, requires explicit
virtualIndex properties for all outputs, etc.) but better than
nothing.

For example, having the screen on DisplayPort as primary and the
touchscreen on HDMI as the secondary screen breaks by default because
touching the second screen generates touch (and synthesized mouse)
events for the first screen.  Assuming the touchscreen is
/dev/input/event5, the issue can now be fixed by setting
QT_QPA_EGLFS_KMS_CONFIG with a configuration like the following:

  {
    "device": "drm-nvdc",
    "outputs": [
      {
        "name": "HDMI1",
        "touchDevice": "/dev/input/event5",
        "virtualIndex": 1
      },
      {
        "name": "DP1",
        "virtualIndex": 0
      }
    ]
  }

Task-number: QTBUG-54151
Change-Id: If97fa18a65599ccfe64ce408ea43086ec3863682
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-08-11 21:11:43 +00:00
Laszlo Agocs
2afead0211 eglfs: Configurable screen order in the virtual desktop
Say one wants a virtual desktop with the display on HDMI above
the display on DisplayPort:

{
  "device": "drm-nvdc",
  "virtualDesktopOrientation": "vertical",
  "outputs": [
    {
      "name": "HDMI1",
      "virtualIndex": 0
    },
    {
      "name": "DP1"
    }
  ]
}

Undefined virtualIndex values map to INT_MAX and will go after the
explicitly specified ones. However, the sorting is stable so the original
order from the DRM connector list is preserved between such outputs.

Task-number: QTBUG-55188
Change-Id: I204fb08205ea7dbfbcdefd1d22ed22f5387f3e8c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-08-11 21:11:32 +00:00
Anton Kudryavtsev
5d1c35e21d QTranslator: use const to avoid detach()'ing
Change-Id: Idbab696affed9486e9077d72ba14ce409b98174c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-11 18:20:25 +00:00
Timur Pocheptsov
ce2419af89 Document HTTP2Allowed attribute
Change-Id: Ia318bf4b73f4716106f60370ed9ddff94f677eba
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-08-11 17:47:08 +00:00
Gabriel de Dietrich
4c002a8343 Cocoa: Update deprecated dragging session APIs
Change-Id: I06e2dd3861c4bc5d85421ac71daf188732279e77
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-08-11 17:24:16 +00:00
Gabriel de Dietrich
23ea54d861 Drag and Drop: Don't let Cocoa override proposed actions
When pressing the Command key, or any other modifier key,
Cocoa will filter whatever the application has set in the
QDrag object. However, Qt is already taking all this into
account, so we should not let yet another voice chime in.

Task-number: QTBUG-55177
Change-Id: I7c56e72d846d10cdfc132776bdfdd6b79799bcff
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-11 17:24:04 +00:00
Timur Pocheptsov
69ff49e8f1 Enable cleartext HTTP/2 and bring the auto-test back to life
HTTP/2 does not require TLS connection, it can work in a cleartext mode.
Plus at the moment only OpenSSL backend  allows HTTP/2 negotiation
via ALPN/NPN (and none of our CI configurations with OpenSSL supports
these extensions, rendering HTTP/2 auto-test useless). This patch
implements cleartext HTTP/2 ('h2c') in 'direct' mode - this is
allowed if a client has a prior knowledge that HTTP/2 is supported by
a server.

Change-Id: I4978775e9732c40bc77f549b83bb4a5d1761887e
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-11 15:38:20 +00:00
Timur Pocheptsov
193abdfc07 http2frame - do not rely on a socket's buffer
- Whenever we have a read notification, read this data, even if it's not
  enough for a frame's header - otherwise, QNAM can use a socket
  in an Ubuffered mode and FrameReader can potentially fail to read
  anything correctly.

- Do not call/rely on bytesAvailable and do not try to invoke
  _q_receiveReply in Qt::QueuedConnection mode, instead try to read
  until we end up in an incomplete frame or some error.

Change-Id: I7f44ba9e34bc64f3e26bd29080f0050da635b3ae
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-11 12:45:59 +00:00
Fredrik Orderud
b6f5b38f8c Define _WINDLL when building a DLL
Visual Studio automatically defines _WINDLL when building a DLL,
regardless of project settings
(https://msdn.microsoft.com/en-us/library/8x480de8.aspx). This define
is therefore widely used to detect DLL vs. static library or executable
build target on Windows.

For makefiles, _WINDLL need to be manually defined, which QMake failed
to do so far.

Task-number: QTBUG-55183
Change-Id: Ic62201666c44e730e6881706d568ce9eaf22b7a4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-11 09:57:00 +00:00
Sérgio Martins
0681e60380 Cache the current QOpenGLFramebufferObject
This doesn't cover FBOs bound directly with glBindFramebuffer(),
but it's perfect to create a fast path for code we know uses QOGLFBO,
thus avoiding expensive glGetIntegerv() driver calls.

The use case is to use this in QSG24BitTextMaskShader::activate(), where
we need to check if the current FBO is sRGB capable.

Change-Id: I434eeeb7e6a3d16be9327315536ad7280245085d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-08-11 08:28:36 +00:00
Topi Reinio
fbc9edb5e7 Doc: Fix typo in the Semaphores Example
Change-Id: I140915014836a3bbc449c953aa54452483b0b886
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-08-11 08:27:36 +00:00
Edward Welbourne
6c473b7e08 QDateTimeParser::getAmPmText() use QLocale instead of tr()
I am not convinced toUpper/toLower is a generally sound solution here;
however, QLocale doesn't make the upper/lower case distinction this
parser does and a bug report shows tr() isn't doing an adequate job.

Task-number: QTBUG-47815
Change-Id: Iaf654d1d76d4c38d74fc647e168d50debb924a8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-11 08:12:04 +00:00
Oswald Buddenhagen
615616b069 add some unix-specific options understood by configure.exe
it's really a bit weird that the windows configure has more options to
configure unix features than the unix one, even if some are just
workarounds for missing auto-detection.

unlike in configure.exe itself, -posix-iconv is now also understood for
symmetry with -gnu-iconv and -sun-iconv.

Change-Id: Ic15376e5822e43b998bd17f02c11e5dd0567dc2b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:05:55 +00:00
Oswald Buddenhagen
0a434cc00f add missing 'disable' fields to {sun,gnu}-libiconv features
Change-Id: Ieed30c1cf388157c47c8a58979b8c214223d351a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:05:45 +00:00
Oswald Buddenhagen
30cac3ed2d refactor the configure help output
- remove the redundantly listed -no-* options and indicate the defaults
  differently
- completely regroup the options into somewhat logical sections

Change-Id: Iaa87c2f3749944cd3fc2ec18975767c04892f746
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:05:41 +00:00
Lars Knoll
c41dd40bff Fix ssl handling in configure to be compatible with configure.exe
Change-Id: I0fdd3aebaa9d2a4c68ee6ebc0b7a24868f3c2aa5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-11 08:05:37 +00:00
Oswald Buddenhagen
e23471abc0 fix quoting in the basic qmake command construction
... and refactor it to make it less scary.

note that "qmake_args" now basically means "qmake + args".

Change-Id: Ifa5b756642de95e2aadf01606d936ea1d7a18210
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:05:27 +00:00
Oswald Buddenhagen
b093aec1d1 don't use error() for user errors, take 2
missed configure.pri previously.

Change-Id: Ie642526a830ca6471d3f92507c7b22c812db0d86
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:05:05 +00:00
Oswald Buddenhagen
622ab0aca5 use qtLog() to also print command output
Change-Id: I950bc86b0b2dafcb8f2369478f391dc05280194f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:04:59 +00:00
Oswald Buddenhagen
f18cc7e3cc fix configure qtLog()
its actual function was qtLogCommand(), but all callers outside
configure_base.prf apparently didn't know that. adjust implementation.

Change-Id: I910d4ba33c6f31debc81c37e3bfff1a288190355
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:04:55 +00:00
Oswald Buddenhagen
615b9c1f06 make sure that we capture the entire test command's output
the command can be a compound statement (usually 'foo && bar' style),
so enclose it in parens before redirecting stderr.

Change-Id: Ib72a2c8ddfd17bf9457e9cfe2652121258ce9a64
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-11 08:04:44 +00:00
Alex Trotsenko
04e676c03c QAbstractSocket: prevent waitForReadyRead() from early exit
According to documentation, waitForReadyRead() returns 'true' if
the readyRead() signal is emitted and there is new data available
for reading. Thus, waitForReadyRead() is being blocked in cycle
until canReadNotification() will return 'true'. This patch
adjusts canReadNotification() to return 'true' only when new data
arrives on buffered socket that ensures waitForReadyRead() to
succeed correctly.

Change-Id: Ic38c4a4dd8ef9128f04b6c1d5f3d03068f6c9894
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-11 06:53:27 +00:00
Marc Mutz
3b0ea78603 tst_QSslSocket::setLocalCertificateChain(): fix resource leak when test fail
The deleteLater() call wasn't reliably reached when tests fail,
so use a QScopedPointer with QScopedPointerDeleteLater deleter.

Change-Id: Ica73bc73c2a0ac1e9b77e4804f2aedcad9b662a0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-08-11 04:34:19 +00:00
Marc Mutz
08a3a52958 Remove ~tst_QImageWriter
The test no longer writes to SRCDIR, so don't try to remove
generated files from there, either.

Amends bb5570082e.

Change-Id: I1d5df88b1865f3dbd914ec71147de61e173f2f4e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-08-11 04:34:14 +00:00
Marc Mutz
e7183f26f1 AtSpiAdaptor: fix 'defined' field in GetAttributeValue
Value was inverted.

Found by own code review.

Change-Id: I2027d97e1f9d52f6d79fb72ecad9ee2034f9af25
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-08-11 04:34:09 +00:00
Oswald Buddenhagen
46cb5a4dce make it impossible to lie about the feature an output belongs to
overriding an output's 'feature' field would just lead to confusing
error messages. the right way is setting the 'name' field.

adjust the 'dbus' library output to this policy.

Change-Id: I912133f3a0a50fc55f2e16a1ed6bfa464aae8d88
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:43:29 +00:00
Oswald Buddenhagen
4f8b40d74e make the egl-viv and egl-brcm config tests less convoluted
don't mix in gles2 stuff, and rely on the library definitions from the
mkspec.

Change-Id: Id81b27a8c4f24729866d3ceb5cf97b443def542c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:43:25 +00:00
Oswald Buddenhagen
1e6b403ecc restore lost egl-mali-2 test
Change-Id: I6e9e8244768d7e702a8a20ed18f5f0293dfefead
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:43:20 +00:00
Oswald Buddenhagen
337ce2fa68 rename the eglfs-* tests
the test names should be about the dependency, not the purpose.

Change-Id: I6e45f4caa36e6c6a9e62092416bcab89893db3d2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:43:16 +00:00
Liang Qi
8ba384a564 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I1a63523de158757964b6fb5ea026cf69a6c5ddcf
2016-08-10 17:43:13 +02:00
Oswald Buddenhagen
9945763cab remove redundant x11 handling
one of the effects of CONFIG+=x11 is LIBS+=$$QMAKE_LIBS_X11, so it's
positively pointless for project files to do the same.

Change-Id: I4085acd6254401897b34e131c2cb57f1f76a3638
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:43:11 +00:00
Oswald Buddenhagen
d520c825f1 delete orphaned config tests
mitshm, xcursor, xfixes, xrandr, xshape, and xsync were dead for a long
time (see also 4cb795cbdb).
glxfbconfig was also dead (see also d54b77d55).
x11/notype and x11/xkb became dead in 4535913c4f.
javascriptcore-jit became dead in 24f1025663.
stdint was another webkit vestige (see also 1b716724f7).

Change-Id: I04f408cb917c767951645c6445f15f24378fa43a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:43:06 +00:00
Oswald Buddenhagen
08f6545dcb fix over-quoting of OPENSSL_LIBS and QT_HOST_CFLAGS_DBUS
we pass the pre-quoted value directly to the output function, which
adds another layer of quoting. to avoid over-quoting, introduce the
'eval' attribute which sends the value through eval() first, thus
removing the extra quoting.

Change-Id: Ic63a50cb7eccc61b0f730476e124339aeb95586c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:43:02 +00:00
Oswald Buddenhagen
bcd0653e10 fix exit paths when pkg-config is not found
while the previous code actually worked, it's probably more or less
coincidence that running "false" produces the correct result.

Change-Id: Ib332bd6789ac7188570ba1af4676494b4e2c9d8c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:57 +00:00
Oswald Buddenhagen
472332559a fix use_gold_linker not being used by compile tests
Change-Id: Ib43ddb5174fd2d9b45f3c1a3e6d90f2b8f0dddd1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:50 +00:00
Oswald Buddenhagen
9987b1dc69 platform-scope the test executables the arch test is looking for
this is clearer, and avoids potential false hits if the target OS
is changed without cleaning the build dir first.

Change-Id: If88f3c555740dc9ff559c172b4b005ed8bfb60ae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:45 +00:00
Oswald Buddenhagen
52b3a81865 don't distclean before every compile test run in non-clean build dir
due to gmake's Makefile auto-rebuild feature, the distclean would
typically invoke qmake. overall, the step would almost double the run
time of each compile test.

instead, just clean between the regular qmake and make steps. this
deletes the object file the test executable depends on, so this is
sufficient to trigger a full rebuild.

Change-Id: If8e254e172dd169e31fd606d9ef31d9a14f670d8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:40 +00:00
Oswald Buddenhagen
a4e1bc5b13 fix 'test' field checking in qtConfOutput_library()
Change-Id: I7cfcc33e188713f32d31e023999f5059c0bd05b1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:33 +00:00
Oswald Buddenhagen
0eff800e81 add support for returning the command's exit status to $$system()
... and make use of it in qtRunLoggedCommand().

Change-Id: I242dfde344f555800cef1f55d3cb85418a93277f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:29 +00:00
Oswald Buddenhagen
62838f07d4 fix handling of multi-token fields in config test definitions
standardize on the fields in the json structure being single strings in
which separate elements are quoted and space-joined (because quoting
is unlikely to be necessary in the json file itself, and this format
avoids the visual noise of array handling).

the quoting itself is expected to be qmake-compatible, which is assumed
to be the case for the output of pkg-config (it's actually shell-quoted,
but that's the same except in some not-so-relevant corner cases).

Change-Id: Icc1d7abc02c449fa759d9714bc5e56e2b8809585
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:23 +00:00
Oswald Buddenhagen
53e06e68b6 fix passing arguments with spaces to configure -D/-I/-L/-F
Change-Id: Ic03e487e5988fa38246975b52d1494af58ccb22f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-10 15:42:17 +00:00