Commit Graph

31800 Commits

Author SHA1 Message Date
Topi Reinio
8a1880029d Doc: Add macro for embedding YouTube videos
This macro adds a \youtube <ID> command that embeds a YouTube link
into the documentation.

The video container scales to a specified percentage of the available
horizontal area. It assumes a source aspect ratio of 16:9, but looks
acceptable with other ratios.

For backends that do not support <iframe> (e.g. QTextBrowser), shows
a clickable video thumbnail that open the YouTube link in an external
browser window. Unfortunately, QTextBrowser cannot load images from
a remote URL, so we need to store a thumbnail image in the .qch file.

Change-Id: I3a3a0c5a20dd90e5cec6357ba70a23ee47dbe825
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-03-06 13:43:58 +00:00
Ulf Hermann
d6330a19b2 Use QT_CONFIG(library) instead of QT_NO_LIBRARY
For the windows file system engine, we add an extra macro to use
library loading if configured to do so, but avoid it on WinRT, as
none of the symbols would be found.

We also QT_REQUIRE_CONFIG(library) in the library headers and
exclude the sources from the build if library loading is disabled.
This, in turn, makes it necessary to clean up some header inclusions.

Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-06 11:27:20 +00:00
Marc Mutz
f31dbeb4c7 tst_QVersionNumber: fix Clang warning about superfluous move
Parameters passed by value, like local function variables, are subject
to NRVO/return-by-move already, so adding std::move, even disguised as
qMove(), makes Clang warn about a pessimizing move.

Change-Id: I7d59bfee4cf7ecddee0874ee489367044c702643
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-06 11:13:17 +00:00
Marc Mutz
a7b9a1f966 QString: make ucstrncmp() work for more than 2Gi characters
Required for implementing upcoming QStringView's member functions such
as compare(), indexOf(), endsWith(), ...

Most implementations of the function body just add the length to the
begin pointer to obtain an end pointer and then either no longer use
the length, or decrease it in lock-step with increasing the begin
pointer.

The only exception is MIPS DSP's qt_ucstrncmp_mips_dsp_asm(), which
gets the length passed in as an uint, implicitly converted from the
int parameter, proving that calling the function with negative length
was always undefined behavior, and therefore using an unsigned type
does not introduce incompatibilites.

I don't stand a snowball's chance in hell to fix the assembler
routine, but since the code is only included for MIPS32, we don't need
to do anything except be paranoid, add a static_assert that uint is
the same size as size_t, and keep calling the old code.

Dropped Q_COMPILER_LAMBDA in some places. We require lambdas since 5.7.
Also hold lambdas by value, not by reference. This stuff is supposedly
completely inlined, anyway, so there's no reason to make the code more
complicated with magic lifetime extension of temporaries bound to
references.

Change-Id: I0c7bdc47648b873992b51b2e9d47d808390320ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-06 10:55:15 +00:00
Marc Mutz
80bfb8f1ad QString: make UnrollTailLoop work with non-int indices
The extension of ucstrncmp to size_t will introduce the first user
of this loop unrolling construct with size_t indices.

Instead of choosing between int and size_t, make the index type a
new template argument to facilitate a step-by-step transition from
int to size_t users.

Change-Id: I9d8fa7aaefa572130403bd19e11f52c58dff0a4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-06 10:55:04 +00:00
Olivier Goffart
80cbe30798 Remove unused src/tools/moc/mwerks_mac.* files
These files are unused.
They still contains Qt3 code (QCString for example)

Task-number: QTBUG-59302
Change-Id: I661f08db4092311df1d6c7d54b9780d86adab8aa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-06 10:11:25 +00:00
Thiago Macieira
37fd42459e forkfd: fix calling the old signal handler when there wasn't one
On some stupid systems, execve() may clear the handler but not clear
the SA_SIGINFO flag.

This change now requires that sa_handler and sa_sigaction be in a union
together. We can't operate otherwise.

Task-number: QTBUG-59246
Change-Id: I33850dcdb2ce4a47878efffd14a84b48a8f6b1e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-06 09:56:35 +00:00
Edward Welbourne
a1c27748d2 Make QLocale consistent about special handling of the C locale
QLocale::matchingLocales() simply created each locale using the basic
data, without (unless the matching conditions stipulated Language C)
applying number-options hacks that it applies everywhere else, when
creating the C locale.  Thus the C locale in its returned list (if it
wasn't the only entry) ended up with the default number options,
without omiting separators in numbers.  Thus QLocale::c() didn't
actually appear as an entry in the list.  Discovered while
investigating QTBUG-58947.

Added a dumb autotest that checks various ways of getting the C locale
do actually give us equal locale objects.  Fixed matchingLocales() to
apply the same hack as is used elsewhere for the C locale.

Change-Id: I263f31da623052b63171f5b5a83c65802383df21
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-06 09:51:49 +00:00
Thiago Macieira
3a2f4bde14 QStaticByteArrayMatcher: enforce alignment
The data is 256 bytes, so might as well align it on a 16-byte boundary
to facilitate copying (if that happens). We should consider similar for
QByteArrayMatcher in 6.0.

Change-Id: I74966ed02f674a7295f8fffd14a8c64526d734bb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-06 09:42:45 +00:00
Thiago Macieira
03b3f7a3af Make new QtCore code conform to the coding style
Change-Id: I74966ed02f674a7295f8fffd14a8c6389da538c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-06 09:42:23 +00:00
Marc Mutz
51bec76d10 QLineEditPrivate: introduce SideWidgetLocation class
... as a replacement for QPair<enum, int>, and move some
repsonsibilities into it.

This avoids the repeated use of the magic number -1 to indicate
invalid locations and does away with the confusing .first and .second,
replacing them instead with proper names, .position and .index.

Change-Id: If904c5333cecf8ce3d5160ca4be9264a13a2b72a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-06 09:19:58 +00:00
Paul Olav Tvete
d5fe06a94e Make uic handle -no-feature-shortcut
Change-Id: I0f8c9fdc8b0fe573443cfc126f21e473544ddcba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-06 09:08:34 +00:00
Oleg Yadrov
f2e103296f QMenu: make wide submenu appear on the same screen with its parent menu
On a multi-display system wide submenu might either appear on wrong
screen or not appear at all (depending on the specific display
configuration).

Task-number: QTBUG-56917
Change-Id: I40013b0bee340a01ae1c08a5e074afa63da4dbfd
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
2017-03-04 05:37:30 +00:00
Oleg Yadrov
ad5565b643 Wide QMenu: fix size and position
This patch fixes 2 issues related to wide menus:
1) Menu took on full screen height when menu width was larger than
screen width;
2) On a multi-display system wide menu might appear on wrong monitor
(not the one where show event was triggered).

The idea is we limit parent menu and all its submenus within the screen
where it was opened.

Note that this patch fixes only geometry-related issues and there are
also some style flaws which need to be addressed (for example, currently
the text does not elide if it doesn’t fit to the menu’s width).

Task-number: QTBUG-56917
Change-Id: I7e9ff4a48bf03060d76e34d33a13ad6cc890c133
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-04 00:43:50 +00:00
Jake Petroules
a4bec7b388 Remove unused Carbon include
Change-Id: I62d7fa00da98e2925049fc381f0a592e27f2a245
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-03 21:55:45 +00:00
Jake Petroules
7b796116ff Move widget size policy methods to QStyleHelper
While they're relatively Mac-specific, conceivably multiple style
implementations could use them, and it breaks a tight coupling between
QStyleOption and QMacStyle.

Change-Id: I5915c519129538a9ac39a34d5cfc3aeb838145d6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-03 21:55:27 +00:00
Jake Petroules
f892318898 Remove QT_CONFIG checks for style_mac
These checks are now done entirely at runtime.

Change-Id: I63cfee6123fc8465cee2ee36049ece0e5262ce8f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-03 21:55:16 +00:00
Oleg Yadrov
d46afc24c1 QMacStyle::sizeFromContents(CT_Menu): take proxy style into account
This is missed in 10d0f4cba9

Change-Id: If3566eb4b1f00f6882c290c83e10e51e1bf1d6d9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-03 21:21:45 +00:00
Stephan Binner
dc2512f308 Add feature.label and feature.formlayout
Change-Id: Ic8dc0aee7f3fc0d8218ba709352b1378078c6070
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-03 20:34:58 +00:00
Jake Petroules
840aa67146 Fix Bitcode handling for both makefile and Xcode generators
This fixes an issue which caused certain iOS projects to fail to link
when building with Xcode, and also fixes an issue where projects were
only ever built with -fembed-bitcode instead of -fembed-bitcode-marker
for debug builds with the makefile generator.

Task-number: QTBUG-58754
Change-Id: Icf0c9f0d64dbc0b38d6c48bf635c5383a78bd6d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-03 20:25:52 +00:00
Shawn Rutledge
46bf3d71e5 xcb: stringify enums for tablet qt.qpa.input.events qCDebug
It's a bit easier to read, not having to look up TabletDevice and
PointerType enum values manually.

Change-Id: I53353be4dcea3e2cb875f04250502ffe802fc971
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-03-03 20:24:31 +00:00
Thiago Macieira
aa3391e474 Remove use of QMutexPool in Windows code resolving libraries
We can use Q_GLOBAL_STATIC for this, which is thread safe.

Change-Id: Ifea6e497f11a461db432ffff1449afe930f72d5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-03 19:38:57 +00:00
Joerg Bornemann
80145d556e Increase timeout of tst_QProcess::softExitInSlots even more
Commit eab7efd1 increased the timeout for this test, but apparently 10
seconds are still not enough. Set the timeout to a minute.

Task-number: QTBUG-59075
Change-Id: Iebab8e5c73c4858ca90063a82aedfbb2546a62cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-03 16:26:41 +00:00
Thiago Macieira
b736d2d7ce Remove the last remaining non-SSL use of QMutexPool in Qt
Task-number: QTBUG-59164
Change-Id: Idd5ceba1eba34cb78c46fffd14a734735991f4fb
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-03 15:29:57 +00:00
Marc Mutz
7982dfe6e6 QMimeBinaryProvider: avoid QString creation just to check for isEmpty()
Return a QLatin1String instead and only if that is not empty,
convert it into a QString.

Also saves 320B in text size on optimized GCC 6.1 AMD64 Linux
builds.

Change-Id: I5432d213a6200e45414626bedb9f216bafaf1108
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-03 14:13:45 +00:00
Gunnar Sletta
74bb6569b9 Fix another race in the filtered touch implementation
The lastPoints is used outside of the mutex-locked area, so of course
it cannot be a reference.

Change-Id: Ic69f9acd643366f8086e96b026a47d5de40cd77b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-03-03 11:55:46 +00:00
Kimmo Ollila
51e8bc9be5 Remove library feature condition from the imageformatplugin
Change-Id: I951ec5fa6d5788accdc82327326d39aac540bd7b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-03-03 11:20:22 +00:00
Stephan Binner
fd08361ad3 Add feature.radiobutton
Change-Id: Ie11f178ce22e2fafdfdf1760288e90563569e0cb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-03 09:21:33 +00:00
Marc Mutz
863debd720 Revert "Add expandingListItems property to QListView"
This reverts commit a4c25c0205.

The API is too limited in scope, and a good name is hard to find, as
evidenced in the API review discussion preceding Qt 5.9 beta.

This API will hopefully return as something like setItemAlignment().

[ChangeLog][QtWidgets][QListView] EDIT: REMOVE: Added expandingListItems property.

Conflicts:
	tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp

Change-Id: I397acd8a7a6c716e2d3c96eee45a276eb6d4f9dd
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
2017-03-03 08:34:19 +00:00
Albert Astals Cid
0cd15fd94d Make "finger touch" not be a tablet
Otherwise QTouchDevices::devices() doesn't return the touchscreen on my Thinkpad Yoga 460

Change-Id: Ibb829df95f92152a77c512e4325522825901074e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-03-03 08:14:44 +00:00
Paul Olav Tvete
259adc5e77 Fix build with -no-opengl
Change-Id: I6fb61944ef88e328a94ea6b7ab42db271828a602
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-03-03 08:05:03 +00:00
Paul Olav Tvete
6cff40c195 Build fix for -no-feature-shortcut
Change-Id: I99144b114b3c2eacb56b522b3059aa53a6bbd969
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-03 08:04:53 +00:00
Kai Koehne
585bb526c4 config.tests: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: Ia1f814ce822d247f3af14c1ea46e07cfad0fda09
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:50 +00:00
Kai Koehne
032d402485 mkspecs: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I04c403f81bb8a8d6d6222573030d1e6d09ec4c3d
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:43 +00:00
Kai Koehne
63fa8aa1ce Gui: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: Ic0bf112998707844eb0c2853d7516b76f4d5afa8
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:37 +00:00
Kai Koehne
fb2732c43d Testlib: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I7ffe7a8afa28fe8b66e00bc5e51595edeac042a9
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:31 +00:00
Kai Koehne
00696c32bc BSD plugins: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I27cee9135228dabcf1ece5dcf15db18a2aa536f9
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:25 +00:00
Kai Koehne
3ffb0b50a4 GTK3 plugin: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I6e925378ef4e82bdc739d23186d2dd6f23370d7a
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:17 +00:00
Kai Koehne
4460b9c843 Replace outdated BSD license text
For examples and documentation, use new BSD license text that
includes the commercial licenses.

Change-Id: I1cd74bd8e9c8f2746d8702df00780ee100cbebac
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-03 07:26:11 +00:00
Maurice Kalinowski
66e1d20537 winrt: Fix potential warning
fix warning about non-portable-includepath due to case insensitivity on
windows file system.

Change-Id: Ib92db836910c2b9d06a18c841e7c6f0c2e9abab4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-03 06:59:11 +00:00
Maurice Kalinowski
374e0223c2 winrt: Fix compiler warning
The drag event handler classes should have virtual destructors.

Change-Id: Ia011856eec37ed303649a1eda036c52f5fa9f8e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-03 06:59:05 +00:00
Stig Bjørlykke
62e6aa6195 QVector: Avoid implicit conversion warnings
This fixes compiling an application using QVector and -Wshorten-64-to-32
on a 64-bit system without getting this warning:

 ... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:695:18:
 warning: implicit conversion loses integer precision: 'typename
 iterator_traits<QString *>::difference_type' (aka 'long') to 'int'
 [-Wshorten-64-to-32]
    int offset = std::distance(d->begin(), before);
        ~~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 ... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:731:35:
 warning: implicit conversion loses integer precision: 'long' to
 'const int' [-Wshorten-64-to-32]
    const int itemsToErase = aend - abegin;
              ~~~~~~~~~~~~   ~~~~~^~~~~~~~

 ... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:740:39:
 warning: implicit conversion loses integer precision: 'long' to
 'const int' [-Wshorten-64-to-32]
    const int itemsUntouched = abegin - d->begin();
              ~~~~~~~~~~~~~~   ~~~~~~~^~~~~~~~~~~~

Change-Id: I52d85908f4aac20c7e9ac8063ac760ce52f85541
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-02 20:03:03 +00:00
Gabriel de Dietrich
f874b6e995 QBoxLayout: Remove unconventional try/catch blocks
These appear in insertSpacing() and insertWidget() only
and without any justification of why they may be needed.
Several other instances of the pattern these try/catch
blocks were guarding, i.e. allocate new QBoxLayoutItem
and insert to the list of items, were left unguarded,
leading us to believe this may not be useful at all and
can be safely removed.

Change-Id: I887fbde9d10e10f4f5daaa37f6f2892bd4038d58
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-02 18:19:20 +00:00
Olivier Goffart
1d9270ee42 Fix DPI of QWidget with parent on a different screen
If a floating QWidget has a parent on a different screen, its DPI was
still inherited from the parent instead of taken from the screen.

The only reason we did was in case there is a customDpi set.
(customDpi is a private thing that is only used in designer to change
the appearance of the previewed widget)

So instead of recursing into QWidget::metric for each ancestor, just
use a for loop to find if one parent has a customDpi. If no customDpi
is found, then return the DPI of the right screen.

Task-number: QTBUG-58959
Task-number: QTBUG-48242
Change-Id: Ie6e9e48cdd10234994c0919ba3aea9b0cdb52494
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-02 16:43:38 +00:00
Giuseppe D'Angelo
8cd99d24a8 QRegularExpression: build fix
Latest PCRE2 versions require a macro to be defined before
including pcre2.h, so do it.

Task-number: QTBUG-59226
Change-Id: I472ff557e29d1212fdcd99454778551323be4d4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-02 16:25:17 +00:00
Lorenz Haas
7bfe093ae5 Fix possible use after free error in SQLite REGEXP
If the cache insertion fails, regexp is deleted and
"subject.contains(*regexp);" is UB.

Coverity-Id: 176868
Change-Id: Ibf9340e019f09fdb8b2a82de8877cdfb2ffe1372
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-03-02 16:08:24 +00:00
Olivier Goffart
2b13ba0ca0 Fix UB in QWidgetItemV2::~QWidgetItemV2
We might get there because 'wid' is already partially deleted (called
from ~QObject). In that case, it is an undefined behavior to call a
QWidget member function on it. Use QObjectPrivate::get instead.

Change-Id: I6da314bf8385684d1332aa031a2d92012941303b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-02 15:31:28 +00:00
Alexander Volkov
4428763001 xcb: Optimize QXcb{Screen,VirtualDesktop} for multi-monitor setup
Move non-monitor-specific members of QXcbScreen to QXcbVirtualDesktop:
they relate to an X screen rather than to a monitor.
It allows to save some memory and X server callings that were
previously made for each monitor.

Change-Id: I079cdec5f27ca93a2aade00c3040936a0e50b494
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-03-02 14:22:27 +00:00
Olivier Goffart
8387d87bdc QDialogButtonGroup: Fix removal of deleted buttons
As the destroyed() signal is emitted from ~QObject, it is not allowed
to use static_cast to a QAbstractButton on that pointer anymore.
And the qobject_cast will also fail which will keep a dangling pointer
in the hash.

Change-Id: If0d22fcc30cde87e771e70914c3afb04ea207289
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-02 10:42:55 +00:00
Liang Qi
71264bae08 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
2017-03-02 09:04:38 +01:00