Now set the QImage devicePixelRatio so the content is correct on all
screens.
Task-number: QTBUG-53795
Change-Id: Ic92eee98f691ebb1e0212498c1ae13ede74bca93
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The QNetworkAccessCache was keeping the connection alive and it was
trying to reuse it for subsequent calls to download files from the
same server. After closing the connection, it is not usable anymore
and a new one should be created.
Task-number: QTBUG-40368
Change-Id: I1a0d08956a94eb36f39d14112cdcab6c1e2add82
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Certain display and scale factor configurations would
cause menus to pop up in incorrect locations or not
be shown at all.
This was due to QDesktopWidget::screenNumber() having
a toNativePixels(QRect, QWindow) call which requires
that QWindow::screen() returns the correct screen.
Break the circular dependency by converting coordinates
the other way for the intersection test: transform screen
geometry to device independent coordinates.
Task-number: QTBUG-58329
Change-Id: I5621de89a9a2b8df44bdae528baf011fc111eba3
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If we do not the fontDef of the multifont will be the default 0.
Task-number: QTBUG-59443
Change-Id: Ib223517975b2a57b2371e309d12cd8f918d30825
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Set stretch to always have no transform on raw fonts.
Task-number: QTBUG-59799
Change-Id: Ibfacc5c247e0b4a8410572e207f09f6e67b74f9d
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
On some ARM devices the font glyph generation is broken
Add an environment variable to enable workaround_brokenFBOReadBack
in QOpenGLContext, to fix font rendering on such devices as
Mali and Adreno
Change-Id: I9cc99ecb8b71a35bc369ec9dd11b877016b1179e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Changed the file position and offset types so they can properly handle
files larger than the 32bit limit
Task-number: QTBUG-59493
Change-Id: I00e1741c7682c4c79f35fef808fe1ea26e67c8b5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Hendrick Melo
When the last QSqlDatabase object is destroyed the destructor implicitly
calls close() to release the database connection.
Task-number: QTBUG-59919
Change-Id: I04c15c4999cdaaa8800a44a1a1006f977a90d8a6
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
More fallthrough-are-errors fixed.
Change-Id: I9a6cb6efe988400ed3f9cb95d1e426dac317e6c4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Fix QT_SCALE_FACTOR usage on macOS. Follow-up to
2d2d9078
QRasterBackingStore should account for native scaling
only. Any Qt scaling will have already been factored
into the size argument.
Change-Id: I26a67addfcbec3d45f4ed87f03b8dd79fd99cb62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When we call realloc, the alignment of the new block may be different
from the old one. When that happens, we need to memmove the data to the
new position, before we start overwriting things.
Task-number: QTBUG-59804
Change-Id: I27b55fdf514247549455fffd14b07ea78918a3d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
GCC 7 defines __has_cpp_attribute even when invoked as "gcc" (possibly,
Clang does the same, according to a comment in the code, did not test
myself).
Hence, define the fallthrough declaration (as C++11 attributes)
only when compiling as C++, otherwise we pick them up even in C mode,
and they cause build failures.
Change-Id: I3f13205e014bb1dea59ee3664b29111521a7eae3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Remove Xutil.h include from qxcbmime.cpp as it does
not use any Xlib APIs. Using API from Xutil.h requires
Xlib as noted in Xutil.h:
/* You must include <X11/Xlib.h> before including this file */
Everywhere else we do check for presence of Xlib, before
including Xutil.h
And remove some useless #undef(s)
Task-number: QTBUG-39665
Change-Id: Ibfd2341338fe7e902b47eae2df6b9dafe4ab962d
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
With the current implementation, the QXcbConnection::m_focusWindow
was holding a dangling pointer during the focus transition from a
dying modal window to other modal window.
1) QXcbConnection::m_focusWindow holds a pointer to A;
2) A is closed;
3) relayFocusToModalWindow B;
=> m_focusWindow now points to a dead window.
4) We get a reply back from WM in a respone to
relayFocusToModalWindow (_NET_ACTIVE_WINDOW)
=> m_focusWindow now points to a valid window.
The fix is to update m_focusWindow to nullptr, when the current
focus window was destroyed and the new focus window has not been
set yet by WM.
This patch actually solves a more general case - whenever we get a
focus-out event, we should set m_focusWindow to nullptr. It is ok
for none of the windows to be in-focus while focus transition is
happening. The focusInPeeker will make sure to "optimize out" (when possible)
this no-window-in-focus state, and GUI won't be bothered by this
extra event. This is how things were working before relayFocusToModalWindow
was introduced. Having a focus-relay mechanism in-between is ok,
but it should not have changed the original behavior.
Task-number: QTBUG-48391
Task-number: QTBUG-55197
Change-Id: I6fdda9de73f999dad84000059ce4b89c0d1a964c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The configure-time detection (cxx11default) isn't enough if the compiler
can be changed. This is especially necessary if Qt is compiled with a
compiler that defaults to >= C++11 (e.g., GCC 6) and then the user
selects a compiler another compiler (e.g., Clang) via -spec option. In
that case, we'd miss adding the -std=c++11 or -std=gnu++11 option to the
command-line, causing the compilation to fail.
As a nice side-effect, even moc without moc_predefs.h will now get the
__cplusplus setting.
Task-number: QTBUG-58321
Change-Id: I74966ed02f674a7295f8fffd14a8be35da9640e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Some compilers are known to complain about this with a warning. GCC
complains about const on return values on -Wignored-qualifiers (enabled
at -Wextra), so it's not too much of a jump to assume that others do
too. Besides, this is not Qt Library API policy. As maintainer for
QtCore, I'm exercising my prerrogative in specifying certain unspecified
parts of the coding style, like I've done for constructor initializer
lists.
Since all the classes involved are exported (including QVector, through
derived classes), we can't remove the qualifier until Qt 6, since there
are compilers known to encode the qualifier in the mangled name
(suncc). I'm not introducing #ifdef to silence unknown compilers unless
we get an actual complaint.
Change-Id: I33850dcdb2ce4a47878efffd14a876edef843c46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Implicit conversion from QByteArray to const char* works for most gtk
functions. But gtk_file_chooser_dialog_new() uses varargs and passing
the non-POD QByteArray through varargs does not work (it's UB).
Task-number: QTBUG-59763
Change-Id: I85f9323d99342896e6921cdeb85f5a1af7377b4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The SHA3 family is a modified version of Keccak. We were
incorrectly calculating Keccak (and even *testing* Keccak!),
but claiming it was SHA3.
To actually calculate SHA3, we need invoke Keccak on the original
message followed by the two bits sequence 0b01, cf. §6.1 [1].
[1] http://dx.doi.org/10.6028/NIST.FIPS.202
[ChangeLog][QtCore][QCryptographicHash] QCryptographicHash now
properly calculates SHA3 message digests. Before, when asked
to calculate a SHA3 digest, it calculated a Keccak digest instead.
Task-number: QTBUG-59770
Change-Id: Iae694d1a1668aa676922e3e00a292cddc30d3e0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unix mmap(2) system calls do allow for mapping beyond the end of the
file, though what happens after you try to dereference the pointers it
gives is unspecified. POSIX[1] says that implementations shouldn't allow
it:
The system shall always zero-fill any partial page at the end of an
object. Further, the system shall never write out any modified portions
of the last page of an object which are beyond its end. References
within the address range starting at pa and continuing for len bytes to
whole pages following the end of an object shall result in delivery of
a SIGBUS signal.
However, Linux allows this in read-write mode and extends the file
(depending on the filesystem).
Windows MapViewOfFile never allows mapping beyond the end.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html
Change-Id: Ie67d35dff21147e99ad9fffd14acc8d9a1a0c38d
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Apply white text only for macOS style.
Amends 2c0033983b
Task-number: QTBUG-59784
Change-Id: I9e66e929699efd715ed4565394f1aba763aeb32a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
GCC bug 68949 causes tst_QGraphicsGridLayout and tst_QGraphicsLinearLayout
to fail on 5.2.x/5.3.x: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68949.
This change adds aggregate initialization to QSizeF arrays to work around
the bug. The bug was discovered when compiling and running tests on ARM
with GCC 5.3.0.
Change-Id: I9ecf7b032b6ca1477c29dca3bd7d0ec8d69a0454
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add the missing endobj tag for the shader function object.
Change-Id: Ieb3cfa5a5d0e27d04164a80b028d41371507fb94
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>
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>
-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>
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>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>