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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
xbm bitmaps are conventionally accepted as valid even if there is not
enough data to fill the declared bitmap size: both ImageMagick and
GIMP do this. Qt did too, but the uncovered areas would be
uninitialized, and thus contain random junk bits. This commit adds
clearing of the full QImage data.
Task-number: QTBUG-54169
Change-Id: I84150d54d07dbd546a4947e7ec332f83f2d7ca41
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
... as that would error out unhelpfully.
but hypothetically, there could be dynamic builds of system libpng and
sqlite3 against a static zlib, so allow it. however, it's a tad
unlikely, so default to -qt-libpng when using -qt-zlib (and -qt-sqlite3
is the default anyway).
amends dab013804.
Change-Id: I74c41e8d8a7ee1ba5add395842383d176e23f142
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
In QMacPasteboard we use converters from QMacInternalPasteboardMime, which
has essentially a global QList of available converters.
QMacInternalPasteboardMime and derived classes register/unregister their
instances in this list (in ctors/dtors) and then QMacPasteboard is using
converters from this list. Unfortunately, when we're un-registering converter
(and this means we delete those objects) we do not remove dangling pointers
from our pasteboard objects. Apparently, this problem can be seen only when
working with macextras (thus having an access to this private API in client's
code).
Task-number: QTBUG-54832
Change-Id: Ie3aef4aaca8ef6c80544dc58821cf43fc26f84a1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
As of Windows 10, MailToProtocolHandler is set as handler for
mailto URLs if there is no mail client installed. As it silently fails
or brings up a broken dialog after a long time, exclude it and
fall back to ShellExecute() which brings up the URL assocation dialog.
Task-number: QTBUG-57816
Change-Id: Ia8c09676bc44848e0549c06c3a82c9b5cce79279
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Remove HTML tags.
Fix notes that predate the introduction of deviceFunctions().
Add a note about the function wrappers being auto-generated.
Change-Id: If99022ce74313c6bb33c3bb7bd6840b6cf26b3be
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
mkdir(data2) depended on mkdir(data1) being run before, or it would
fail. In addition, the rmdir() test required the equivalent mkdir() test
being run before. So drop these annoying dependencies and make the tests
cleaner by having clear separation of the test data and merging the two
tests into one
The entryList() test still depends on the testdir being clean: it will
fail if mkdirRmdir() previously failed.
Change-Id: Iaddbecfbba5441c8b2e4fffd14a3e35972d2a3d8
Reviewed-by: David Faure <david.faure@kdab.com>
QString::toUtf8() returns QByteArray, which got implicitly converted to
C strings and promptly deleted. Instead, return the QByteArray to the
caller.
Found by ASAN:
==13935==ERROR: AddressSanitizer: heap-use-after-free on address 0x6060000dffb8 at pc 0x7f764f27320b bp 0x7ffd49b11bb0 sp 0x7ffd49b11358
READ of size 7 at 0x6060000dffb8 thread T0
#1 0x7f7649d174e2 in g_strdup (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x684e2)
#2 0x7f763f7abe5b (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x39e5b)
#3 0x7f763f78915a in g_object_new_valist (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x1715a)
#4 0x7f763f789520 in g_object_new (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x17520)
#5 0x7f7640f6bcb0 in gtk_dialog_add_button (/usr/lib/x86_64-linux-gnu/libgtk-3.so.0+0x186cb0)
#6 0x7f7640f8d2c9 in gtk_file_chooser_dialog_new (/usr/lib/x86_64-linux-gnu/libgtk-3.so.0+0x1a82c9)
#7 0x7f7641727281 (/opt/Qt5.8.0/5.8/gcc_64/plugins/platformthemes/libqgtk3.so+0x13281)
Task-number: QTBUG-59611
Change-Id: I37cc967e689f4523b504fffd14adbf944b53b754
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
The value is hard-coded, there's no need to parse a string to extract the value.
Change-Id: I987280d7a92b7a1eb75233b2a1f811b5177f0a63
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
[ChangeLog][QtCore][Logging] If you set QT_FATAL_WARNINGS to a number
greater than 1, Qt will stop the application at that nth warning,
instead of on the first one. For compatibility reasons with previous
versions, if the variable is set to any non-empty and non-numeric value
different from 0, Qt will understand as "stop on first warning".
Change-Id: I0031aa609e714ae983c3fffd14676f1826f34600
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Can be used by CI system to set QTEST_ENVIRONMENT="ci", allowing test to
be blacklisted only for the CI.
Task-number: QTBUG-59564
Change-Id: I7088abb888c179bafc621f11191efbc45c37b179
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Don't cast an expiring QObject down to QWidget. Cast the QWidgets stored
internally up to QObject to perform the comparison. The result is the
same, but no invalid casts are possible anymore.
Found by independent review.
Change-Id: Iffa8a66cf5cab0270961befe982637ac8e4f0f7b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fix warning:
qwindowswindow.cpp: In member function 'void QWindowsWindow::setWindowState_sys(Qt::WindowStates)':
qwindowswindow.cpp:1965:74: error: suggest parentheses around arithmetic in operand of '^' [-Werror=parentheses]
if ((newState & Qt::WindowMinimized) && (oldState ^ newState & Qt::WindowMaximized))
This is actually a real bug. What was meant was to check if the Maximized flag
was changed. This code path is for the case in which the windows becomes
minimized, and the maximized state changed.
Amends change a02959bb5b.
Task-number: QTBUG-57882
Change-Id: I1cd32a7080240e4462d3cd4f129c6c1a08409996
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
The change does not change legally observable behavior as the result
of using QT_RESTRICTED_CAST_FROM_ASCII is only defined for (a part of)
the 7-bit range where Latin1 and UTF-8 are the same.
This change does not intend to lift the 7-bit restriction on string
literals for which the use of QT_RESTRICTED_CAST_FROM_ASCII is
well-defined even though in practice it works now for any UTF-8,
which is the presumed encoding outside that range nowadays.
Change-Id: If9a4199235396a43f8f26d7591907b21120823ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
WidgetMapper is larger than a void*, so holding it in QLists is
needlessly inefficient. Worse, the code could come to depend on the
fragile property of (inefficient) QLists that references to elements
therein never are invalidated.
Fix by holding it in a std::vector instead (tried QVector, too, but
that produced almost exactly 1KiB more text size). Adapt to std API.
There are a few changes in there which are not strictly necessary when
using std::vector, but were done as part of the port to QVector:
- dropping of WidgetMapper ctors (because QVector requires a default
ctor, and I didn't want to provide one manually),
- marking the type as movable (no effect with std::vector, but doesn't
hurt and keeps the next guy from wondering), and
- marking Private::flipEventFilters() const (to avoid a detach when
using ranged for loops).
Changes required by the port to std::vector:
- at() -> op[] (not strictly necessary, but expands to less code even
when compiling, as QtWidgets is, without exception support),
- append() -> push_back()
Saves 40B in text size on optimized GCC 6.1 Linux AMD64 builds (for
comparison: QVector had 1240B more than QList).
Change-Id: Iaae81d1a8bebe8000bf69e7fb8b2bcd6c38afafd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
qmake really lacks version comparing functions:
users either use ugly constructions to compare versions
by components, such as
greaterThan(QT_CLANG_MAJOR_VERSION, 3)|greaterThan(QT_CLANG_MINOR_VERSION, 4):
or even incorrectly compare versions as strings:
!lessThan(apple_clang_ver, "5.1")|!lessThan(reg_clang_ver, "3.4"):
Add test functions versionAtLeast and versionAtMost which use
QVersionNumber to compare version numbers by components.
Change-Id: I65e6b3c296d0301d544b7e38bf3d44f8d555c7fc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Our headers ought to be clean in all compiler versions.
Change-Id: I4a7dc1fe14154695b968fffd14aba9ff9995c618
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
We don't load and save pointers usually because the pointer value cannot
be guaranteed to remain across program invocations. However, nullptr is
an exception: a null pointer is always a null pointer.
We don't actually have to read or write anything: there's only one value
possible for a std::nullptr_t and it is nullptr.
[ChangeLog][Important Behavior Changes] A QVariant containing a
std::nullptr_t is now streamable to/from QDataStream.
Task-number: QTBUG-59391
Change-Id: Iae839f6a131a4f0784bffffd14aa374f6475d283
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The only allowed way to access the variable is now via the public
qGlobalQHashSeed and qSetGlobalQHashSeed functions. The variable was
private API, so we're allowed to remove it.
Task-number: QTBUG-47566
Change-Id: I4a7dc1fe14154695b968fffd14abd331e5810482
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
The warning comes from the MS headers, not from the compiler.
Task-number: QTBUG-59576
Change-Id: Ie67d35dff21147e99ad9fffd14acd7fb628fa1d4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Task-number: QTBUG-59218
Change-Id: Ic839a36af1ecab39da0c3394c34181b6717e24e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Add the option to omit code generated by wayland-scanner, to
avoid the case where the Qt versions replace driver-specific
functionality.
Task-number: QTBUG-58299
Change-Id: I508b18b9392dbd9e2b8233399301c06410f9f5ba
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
QUrl::isRelative(str) would be false for such files, so first check for
file existence before doing any URL parsing.
Change-Id: I51b6229251ad94877ac408b2f8018456d3e10a36
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qwindowsnativeinterface.cpp: In member function 'virtual void* QWindowsNativeInterface::nativeResourceForWindow(const QByteArray&, QWindow*)':
qwindowsnativeinterface.cpp:104:12: error: enumeration value 'VulkanSurface' not handled in switch [-Werror=switch]
Amends f1a23a5467.
Task-number: QTBUG-55981
Change-Id: Ie9bf396ab8ea1be505abfaffd5d603bb3856c089
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
When a text block is empty, and we are adding preedit text to it,
we need to merge the format of the preedit text with the current
format of the cursor, otherwise we will use a default format and
then suddenly switch to the proper one when the text is committed.
The reason this becomes a bit complex is that there are no rules
preventing someone from using several ime attributes to specify
formats for isolated parts of the text, and no rules defining the
order of such attributes. So even if the common case is one
text format attribute for the entire string, we need to make sure
we also handle the other cases gracefully, e.g. when we are setting
different formats for different substrings and then providing these
out of order. To make sure we have these corner cases covered, we
also add a set of autotests.
[ChangeLog][Qt Widgets][TextEdit] Fixed initial char format of
input method text as it is in pre-edit mode.
Task-number: QTBUG-59196
Change-Id: I1e37928e3bd1395fec1b5591908d4c69b84eb618
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
... to reduce text size by replacing QStringLiteral with QL1S.
Change-Id: I8166282d915f081ba816989039451466ec29e208
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>