Commit Graph

31905 Commits

Author SHA1 Message Date
Marc Mutz
2c265d2700 QString: clean up internal string comparison functions
String comparison drew on a large number of internal functions such as
qMemEquals, ucstr{n,}{i,}cmp, and QString::compare_helper, all with
wildly different calling conventions. E.g. ucstrncmp took its
arguments as QChar*, while ucstricmp required ushort*. A complete
cleanup of these functions is left for another patch. This patch, as a
first step, centralizes calls to these functions.

Introduce two helpers, qt_compare_strings(QStringView, QStringView, cs)
and qt_compare_strings(QStringView, QLatin1String, cs) and replace all
uses of said lower-level functions with calls to these two functions.

I'm using QStringView instead of the more traditional (QChar*,int)
pairs, since we get two major benefits:

1. The onus of checking for valid arguments is put on the callers
   (creating QStringViews with negative sizes is UB), allowing these
   functions to be noexcept, even though the implementation still
   calls functions taking (ptr, size) or (ptr, ptr) tuples. Duly add a
   few asserts where we construct QStringViews from (ptr, size) pairs
   passed in through exported API.

2. Since QStringView can be constructed from both ushort* and QChar*,
   we no longer have to cast at the call sites. Much of the
   simplification of the code is due to reduced casts.

The Windows 64-bit ABI stipulates that no values greater than the
register width can be passed in registers (no register pairing as with
all other ABIs), but a) that is their problem, b) it does not seem to
matter within a TU, c) MS is known to introduce new calling
conventions all the time (like __vectorcall in MSVC2013), so maybe
they will introduce a __faststructcall at some point and d) giving up
on the above-mentioned two benefits for an unknown runtime cost means
we're falling prey to premature optimization.

As a consequence of the cleanup, qMemEquals() and ucstrnicmp(ushort*,
ushort*, int) can already be removed.

Port the ucstr{i,}cmp() functions to QChar/char to avoid casting in
their only callers, qt_compare_strings().

Port ucstrcmp from int to size_t indices to avoid MSVC warnings when
passing QStringView::size() to them.

Change-Id: I4a8add0fc773dc0e1225a3b9a1c1248341a1720f
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-28 11:27:40 +00:00
Liang Qi
71a2d4fa3d Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-03-28 11:20:40 +00:00
Liang Qi
b48a13fd68 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	examples/examples.pro
	tests/auto/corelib/tools/qchar/tst_qchar.cpp
	tests/auto/other/qaccessibility/accessiblewidgets.h

Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
2017-03-28 09:28:31 +02:00
Tobias Koenig
6c32927f8c Improve PDF/A-1b support in QPdfWriter
Add new enum QPrinter::PdfVersion to switch QPdfWriter
into PDF/A-1b mode. In that mode
    - meta data are embedded in XMP format
    - a color profile for sRGB is embedded and an OutputIntent defined
    - the ID key is added to the document trailer dictionary
    - a CIDSet entry is added to the font descriptor
    - transparency is removed from pens, brushes and images

Change-Id: Ia8a24d83609b239e716aefc1ba05f07320dbd290
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-28 07:02:05 +00:00
Daniel Teske
3398d9d40c Fix clipping of graphics effects in high dpi mode
Consider this pseudo code:
setSystemClip(region);
setSystemTransform( scale 2x );
setSystemTransform( scale 2x );

The second call to setSystemTransform should be a noop. Yet, with
the current code in setSystemTransform, the region would be scaled
twice by 2x and thus the clipping would be incorrect.

Fix that by saving the original untransformed clip and in
setSystemTransform recalculate the effective transform.

This is also a better fix for QTBUG-44067 /
sha: 083a945c166b325298a43ba591b1338d1b0f99b6, since with this patch
the order in which system clip, viewport and transform are set does
no longer matter.

Task-number: QTBUG-57257
Task-number: QTBUG-55698
Change-Id: Ibc232822e97ab116f7173a0cc50bba5a367619d8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-03-28 05:23:53 +00:00
Andy Shaw
9292ea17a0 Use unique table name for the sqlite_enableRegexp test
This change amends 2a3297c726.

Task-number: QTBUG-59317
Change-Id: Ia08b83785f67105a1c7e71c1f4081f1bc755d756
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-03-27 09:07:02 +00:00
Kimmo Ollila
15fe60cfda Workaround GHS compiler bug
This temporary workaround allows to compile with GHS toolchain and
should be removed when GHS provides patch to fix the compiler issue.

Change-Id: I0d0eac8054e6ba2f448fed3d3c80a518e0d2af97
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-27 09:00:15 +00:00
Friedemann Kleint
e8d03c5599 Bump copyright year
Task-number: QTBUG-59648
Change-Id: Ie2d08515f4ad177bab338210a0a3e52f5519dcc3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-27 07:38:36 +00:00
Liang Qi
d5df0e9949 Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-03-27 09:21:47 +00:00
Liang Qi
7702fe8602 Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
2017-03-27 10:42:08 +02:00
Shawn Rutledge
1e7795ef60 Add documentation for TabletTrackingChange enum value
Amends 6aaf853222

Change-Id: I2c264db235ea552ce6b4eb003d7daeeb2cecde6f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-03-27 08:32:56 +00:00
Andy Shaw
197b55c939 iOS: Hide the overlay when the keyboard is hidden
If the keyboard is hidden via the hide keyboard button then the edit
menu should also hide with it. This ensures it behaves in the same way
as native applications on iOS then.

Change-Id: I4c714dd5c5cb27d8eaf310e2911dc38feb1cb74e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-03-27 07:21:32 +00:00
Laszlo Agocs
dfef2e3f3e Clarify the front face winding order in the Vulkan examples
After applying the correction matrix the front face is CW, not CCW.

The examples work either way but fix them up to avoid reader confusion.

Change-Id: I491e6dc17c21897a59f36d32061e937f2b6c4c9d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-26 22:40:18 +00:00
Laszlo Agocs
92dce210a2 QVulkanWindow: Add missing device wait after user code
In a multi-threaded setup it is not unlikely that
releaseSwapChainResources() will wait for and submit any remaining
frame building. Hence a wait is necessary also after invoking the user's
implementation.

Change-Id: I3c963c05c1c3981980da5e4ff9c572df24a1e473
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-26 22:40:14 +00:00
Marc Mutz
9a9195c806 Make QLocalePrivate::codeTo*() take QStringViews
... and remove now-superfluous overloads.

Adapt the sole user of the (QChar*, int) overload to construct a
QStringView first, which removes the ugly cast at the call site.

Change-Id: Ie5249d4b1b82d471896548e8a7d83c130ae28130
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-26 06:44:36 +00:00
Marc Mutz
59928d23fc Port QLocalePrivate::*ToCode() to QLatin1String
The returned data is in US-ASCII (or else Latin-1), and resides in
consecutive memory. We can therefore return it in a QLatin1String,
which, however, will in general not be NUL-terminated.

Many users use the return value as part of a QStringBuilder
expression, and those which are not are not pessimized further by
this change.

The caller in qtimezoneprivate_icu looks as if it could simply zero
-terminate the return value and use it as-is, as opposed to
converting to UTF-8, but I left the code equivalent to the original
just the same.

Change-Id: I0e628af8c1320fcff8d0aacf160e859681d2b85a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-26 06:44:29 +00:00
Kimmo Ollila
1dd54b5647 Increase the maximum recursive template depth on INTEGRITY
Set the limit to 128 instead of the default 64 by adding
QMAKE_CXXFLAGS += --pending_instantiations=128. This is
needed by QMetaType::typeName array implementation.

Change-Id: I3fd13967f862f492210572cfe7ee9ffc5e7c9745
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-25 15:45:58 +00:00
Marius Kittler
38550c562d json encoder: Harmonize number serialization with ES6
Ensures that numbers representable as 64-bit integer
are not printed using exponent notation.

Some JSON implementations such as the one of the Go
standard library expect this in the default
conversion to int.

Change-Id: Ic3ac718b7fd36462b4fcabbfb100a528a87798c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-25 14:26:30 +00:00
Olivier Goffart
94e6e8dfc6 tst_moc: fix include guards
Change-Id: I465c035cc741f94cb6737e86e33fbd1589ddaa8e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-25 12:53:09 +00:00
Marc Mutz
d8e2db0173 QDir: replace QLVA<QChar> with QVLA<ushort>
... as used in qstring.cpp, too. QChar is only marked as movable, not
primitive, as it should have been and ushort is, and there's some hope
that the template instantiations can be shared across TUs.

Saves a rather disappointing 148B in text size on optimized GCC 7
Linux AMD64 builds.

Change-Id: Ic9558a4d83611a6461cd5540c9090cbd4c4f2f4e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-25 08:03:10 +00:00
Marc Mutz
5ca7d56aca QVarLengthArray: fix compilation with GCC 7
This fixes a warning-turned-Werror in qdistancefield.cpp:

  In member function ‘void QVarLengthArray<T, Prealloc>::realloc(int, int) [with T = bool; int Prealloc = 256]’,
      inlined from ‘void makeDistanceField(QDistanceFieldData*, const QPainterPath&, int, int)’ at ../../include/QtCore/../../../../qt5/qtbase/src/corelib/tools/qvarlengtharray.h:275:10:
  ../../include/QtCore/../../../../qt5/qtbase/src/corelib/tools/qvarlengtharray.h:390:19: error: ‘void* memcpy(void*, const void*, size_t)’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
               memcpy(ptr, oldPtr, copySize * sizeof(T));
               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Apparently GCC cannot rule out that copySize may be negative in the
call to memcpy. Put GCC on the right track by adding a Q_ASSUME.

Change-Id: I63e3801e52ebe2a7f77e3a97ef03ec3869319c8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-25 08:02:31 +00:00
Eric Lemanissier
610a9e8f31 SQLite: Disable mutex on connections
By default SQLite opens DB in Serialized mode, allowing connections to be used
from several threads simultaneously: https://www.sqlite.org/threadsafe.html
According to Qt documentation, database can only be used from one thread.
This change opens sqlite dabases in "Multi-thread" mode, so that one does not
pay for useless mutex locking for each DB access

Change-Id: Ife61f1a648d74c91d3b27a2ce0059d052ccc62b2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-25 06:18:07 +00:00
Thiago Macieira
e19fda916a Fix some warnings found by QNX's compiler
-Werror is now disabled for that compiler, but it doesn't hurt to fix.

io/qstandardpaths_unix.cpp:149:32: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
qtestcase.cpp:2330:31: error: narrowing conversion of '(ms / 1000)' from 'int' to '_Timet {aka unsigned int}' inside { } [-Werror=narrowing]

Change-Id: Id92f4a61915b49ddaee6fffd14aea2c1e686e8f2
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2017-03-25 04:51:01 +00:00
Thiago Macieira
e26bcc4d5d Disable -Werror for QNX's compiler
The compiler is mostly GCC in disguise, but the libraries are not. Since
the toolchain is not open, it's difficult to fix issues in it.

Task-number: QTBUG-59671
Task-number: QTBUG-59672
Change-Id: Id92f4a61915b49ddaee6fffd14aea2639153f073
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-03-25 04:50:44 +00:00
Marc Mutz
8092a01f84 QDebug: add op<<(QStringView)
[ChangeLog][QtCore][QDebug] Added streaming of QStringViews.

Change-Id: Id81fae223b60188d541b255b67bc316f9f1b6bef
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-24 20:43:03 +00:00
Marc Mutz
00a8be85d1 Long live QStringView!
QStringView is a simple container for (const QChar*, int) and (const
char16_t*, size_t). It acts as a replacement interface type for const
QString and const QStringRef, and enables passing all kinds of
string-like types to functions otherwise expecting const QString& -
without the need to convert to QString first.

The use of this new class is guarded by a macro that enables three
levels of QStringView support:

 1. offer QStringView, overload some functions taking QString with
    QStringView

 2. like 1, but remove all overloads of functions taking QStringRef,
    leaving only the function taking QStringView.  Do this only where
    QStringRef overloads tradionally existed.

 3. like 2, but replace functions taking QString, too.

This is done in order to measure the impact of QStringView on code
size and execution speed, and to help guide the decision of which
level to choose for Qt 6.

This first patch adds QStringView with most of its planned
constructors, but not much more than iterators and isNull()/isEmpty().

Further patches will add support for QStringView to QStringBuilder,
add QStringView overloads of functions taking QString, and add the
complete API of const QString to QStringView.

[ChangeLog][QtCore][QStringView] New class, superseding const QString
and QStringRef as function parameters, accepting a wide variety of
UTF-16 string data sources, e.g. u"string", std::u16string{,_view},
and, on Windows, L"string", std::wstring{,_view} without converting to
QString first.

Change-Id: Iac273e46b2c61ec2c31b3dacebb29500599d6898
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-24 18:34:35 +00:00
Edward Welbourne
e5c0371d18 Fix propagation of locale from widget to its children
Fix the condition in QWidgetPrivate::resolveLocale() to decide whether
to propagate locale: make it match setLocale_helper()'s condition when
deciding whether to propagate to descendants.  This lead to a
QDateTimeEdit's calendar popup not getting told what locale to use
correctly, unless we setLocale() on it overtly, which then blocked
propagation of locale changes to it unless QDateTimeEdit manually
propagated the changes.

Fix the documentation of WA_WindowPropagation to mention locale as
also being propagated (which it was in several places, only neglecting
this one in resolveLocale).

[ChangeLog][QWidget][Qt::WA_WindowPropagation] Propagate locale
consistently, along with font and palette, within the widget
hierarchy.  Previously, locale was propagated on ancestral
setLocale(), but not on creation of the descendant.

Task-number: QTBUG-59106
Change-Id: I92270f7789c8eda66a458274a658c84c7b0df754
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-24 13:57:22 +00:00
Thiago Macieira
9021a748af QStorageInfo: Fix warning about unused variable
Happens on non-Linux, non-macOS Unix systems (got it on FreeBSD).

Change-Id: Ie67d35dff21147e99ad9fffd14acc7308b5ff17e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-23 22:15:27 +00:00
Olivier Goffart
d82d2f6716 QSslSocket: fix connection to a international domain name
RFC6125 section 6.4.2 specify we need to convert the IDN to ascii
before comparison. Note that we don't need to toLower anymore
because toAce takes care of it.

Section 7.2 recommands that we dod not attempt to check for wildcard
character embedded within the A-labels or U-labels of an
internationalized domain name. So we reject names that contiains a
'*' but starts with 'xn--'.

Change-Id: Ib0830520a1f82bbf9fd11818718277a479527ee3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-03-23 16:11:15 +00:00
David Faure
83038a7acf QSFPM optimization in dataChanged: don't re-sort if the order didn't change
We can quickly check if the change affects sorting by checking whether
lessThan(N-1, N) and lessThan(N, N+1) are still true. If this is the case
for all changed rows, then we can skip the whole remove+insert+layoutChanged().

Task-number: QTBUG-1548
Change-Id: Ia778b3e8880cc9909eef1f8a016c84235870353d
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2017-03-23 14:19:09 +00:00
BogDan Vatra
12a0e1b4f8 Add gradle wrapper to Qt & update default Andriod gradle plugin
We need to add gradle wrapper to Qt because it was removed from latest Android SDK.
Adding it to Qt, will give us more control and will save us from pain in the future.

Task-number: QTBUG-59237
Change-Id: I6419876f8be11c0feeac448b228a46f811065264
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-03-23 13:04:51 +00:00
Laszlo Agocs
95d4ac10e9 Add missing class doc for QVulkanWindowRenderer
The functions are documented but the class does not show up in the
docs without the \class.

Change-Id: I8a7e4c82ba11354855ca272e5c6be59cf1419f14
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-23 11:55:05 +00:00
BogDan Vatra
da4b91e2b2 Fix hang on sleep/wakeup
This patch fixes the followings:
- call "it.value()" only on valid iterators
- destroySurface() doesn't remove the surfaceId from m_surfaces
- the surfaceId is removed from m_surfaces when the QtSurface is really
destroyed

Task-number: QTBUG-59185
Change-Id: Iee37dde16fee16f19906812c55c1f0b0279b033c
Reviewed-by: Mathias Hasselmann <mathias.hasselmann@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-03-23 08:06:30 +00:00
Marc Mutz
e3ea95f81f Remove unused QPodList class
It's private API, the last in-tree user was removed in acbd7999, but
failed to remove the class. Do it now.

Change-Id: I26294b535d80b419a2f545a4783014b493a5dc93
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-22 22:05:09 +00:00
Friedemann Kleint
7a902e86ce Windows: Register windows for touch when a device is plugged in
Call QWindowsWindow::registerTouchWindow() for all windows when a device
is plugged in while the application is running. Guard
registerTouchWindow() against repetitive invocation and wrong window
types. This amends the crash fix 7daae2c2c7
and touch should then work.

Task-number: QTBUG-48849
Change-Id: I8b257dda144f28d60bcc5c4e369a413a90263998
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-03-22 20:05:05 +00:00
Friedemann Kleint
e0becd6a8a tst_QMdiArea::tabBetweenSubWindows(): Improve warning message
The test has been observed to be flaky, printing warnings
"Rubber band has different geometry". Output the geometries.

Task-number: QTBUG-59641
Change-Id: I6c209f2a98a07655e8523c012c5562d602d217ad
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-22 20:04:13 +00:00
Alex Henrie
33492375fb QGroupBox tests: Correct spelling of "release"
Change-Id: I2341cbac0588d1b0fa1fa0dfbc2ee49211ade934
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-22 18:30:14 +00:00
Edward Welbourne
058642eae9 tst_QTimeZone: fix #if-ery to use Q_OS_DARWIN
Avoid using deprecated define in test.

Change-Id: I33550ae6cfb1ebe03550826371c763afa35f1972
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-03-22 17:12:21 +00:00
Joerg Bornemann
02d9225db5 Fix uninitialized VCLinkerTool::DebugInfoOption
Due to that uninitialized variable /DEBUG:FASTLINK ended up in vcxproj
files for VS < 2015. However, that option is supported by VS >= 2015
only.

Task-number: QTBUG-59630
Change-Id: I34d9eef1a3bf2262bac48962938afe84eb7de934
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-22 16:15:15 +00:00
Olivier Goffart
bebd368d72 QDockAreaLayout: Simplify QDockAreaLayout::gapRect
Merge with QDockAreaLayoutInfo::itemRect, so it can be re-used
fromp the QDockWidgetGroupWindow layout.

Change-Id: Ic072eceb786be394f96e378a3ade4462cd1043fd
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-03-22 16:00:00 +00:00
Ulf Hermann
329385a5d5 Build examples and tests only if their requirements are met
If the respective modules aren't available we cannot build the tests
and examples. We drop the qtConfig(opengl) requirement for the opengl
examples as
a, we would need to make the QtGui configuration available for that to
   work, and
b, we should not add too much detail to the tests and examples build
   configurations. Checking each test and example for every feature it
   uses would be too much.

Task-number: QTBUG-57255
Change-Id: Ifb043c81ec9e5c487765297bd65704812cd281fc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-22 15:55:55 +00:00
Oswald Buddenhagen
28e9867a3c don't try to timestamp injected qvulkanfunctions.h
the target of the injected forwarding header doesn't exist at qmake
time, as it is generated by an extra compiler, so the touch() calls in
qt_module_headers.prf would fail.

the error scenario described in ce942a226 is not applicable to
gui/vulkan, as no bootstrapped modules are involved. therefore, we can
just suppress the timestamping.

Change-Id: I1c9b6fcdf3717069fdbb654e3cb5d73b199192f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-03-22 15:49:19 +00:00
Laszlo Agocs
1d647a22f3 xcb: Fix embedded Vulkan windows
Widget windows choose a visual via the GLX or EGL path. Vulkan windows
use the default, simple visual chooser. When having a parent, the
different visuals can cause a BadMatch. Avoid this by taking the parent's
visual.

This way the hellovulkanwidget example is now functional on xcb as well
(tested on Jetson TX1 with L4T 24.2).

While we are at it, stop forcing RGB888 in the format, unless nothing
was set.

Change-Id: I39ab87e3219c04d4f547325d13d4873d70564411
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-22 15:41:10 +00:00
Laszlo Agocs
a653669b20 Add license attribution for vk.xml
Same license as the existing OpenGL stuff.

Change-Id: I6d0a77a7213f496971b5c3a8676dedb8e4377ceb
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-22 15:41:03 +00:00
Laszlo Agocs
8d72aba9e3 Introduce QVulkanWindow
A convenience subclass of QWindow that provides a Vulkan-capable
window with a double-buffered FIFO swapchain.

While advanced use cases are better served by a custom QWindow
subclass, many applications can benefit from having a convenient
helper that makes getting started easier.

Add also three examples of increasing complexity, and a variant that
shows embeddeding into widgets via QWindowContainer.

[ChangeLog][QtGui] Added QVulkanWindow, a convenience subclass of
QWindow.

Task-number: QTBUG-55981
Change-Id: I6cdc9ff1390ac6258e278377233fd369a0bfeddc
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-22 15:40:57 +00:00
Robin Burchell
66e162e8f1 QImageReader: Pass up information about resource errors on open
If a system runs out of FDs, there is no sense in trying to autodetect
the format - as the real problem is the lack of FDs, not the
non-existent file.

Change-Id: I3302340859c3cc62995ac1b7b3c7b6e6326cb43e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-03-22 15:40:55 +00:00
Stephan Binner
b1a7a7b250 Add feature.dialog
Change-Id: I160d0f270d7f41671459358b9c180d71dd7786d6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-22 14:35:46 +00:00
Edward Welbourne
c587036dc6 Mark some methods in test code as overrides
CustomTextWidgetIface marked its text() method as an override;
DropOnOddRows marked its canDropMimeData() as an override; each
neglected some other methods that are overrides.  Convert
Q_DECL_OVERRIDE to the keyword in affected classes, to match.

Change-Id: I78b38e20a81e3e6aab282a1cb3d70cdf8a5f4135
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-03-22 14:29:58 +00:00
Olivier Goffart
ee84af00d1 Fix floating dock widget having the wrong parent
When dragging out a tabbed group which contains placeholder
for floating QDockWidget, the floating QDockWidget would not
be reparented to the new QDockWidgetGroupWindow. That's because
QDockAreaLayoutInfo::reparentWidgets does not reparent floating
widget (because of the item.skip test)

However, we need to be careful when reparenting to pass the
flags so it does not get docked.
Also do not reparent QDockWidgetGroupWindow which may end up
temporarily in the layout during animation when dragging a
QDockWidgetGroupWindow onto another.

Step to reproduce a crash that if fixed by this patch (with
the mainwindow example):

1. Enable QMainWindow::GroupedDragging from the "Main window" menu
2. Add a new dock widget, "Foo", from the "Dock Widgets"
3. Tab "Foo" together with the black dock widget
4. Drag "Foo" out.  (Now, Foo is still a child of the QMainWindow,
and is still in the layout as tabbed, but is skipped)
5. Drag the black dockwidget out. (This, in fact, crates a
QDockWidgetGroupWindow which contains the black dockwidget and the
floating "Foo", but since "Foo" is floating, it is not reparented)
6. Destroy "Foo" using the "Dock Widgets" menu. (Since Foo's parent
is the QMainWindow, it is not removed from the QDockWidgetGroupWindow's
layout, which will cause crash on the next relayout)"

This commits amends commits d57bb19902
and 0feeb6f6d2

Change-Id: I600a56cdd889435b83d2b740598a24d81059bf44
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-03-22 14:28:51 +00:00
Oswald Buddenhagen
97be8253fb fix bootstrapped modules in framework builds, take 2
the borrowing of headers always happens from "proper" modules which are
actually built as frameworks if so requested. that means that even
though the borrowing module itself never is a framework, it needs a
framework path and include paths that point into frameworks.

amends 20c7ab44.

Change-Id: Ic582060dd179cc592e9be7792ff02cebdfabd772
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-03-22 14:27:45 +00:00