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>
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>
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>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>
These checks are now done entirely at runtime.
Change-Id: I63cfee6123fc8465cee2ee36049ece0e5262ce8f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The drag event handler classes should have virtual destructors.
Change-Id: Ia011856eec37ed303649a1eda036c52f5fa9f8e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>