Otherwise we'll end up creating a NSPanel for the QMacNativeWidget which is
never closed, even if the backing NSView is moved to a new superview.
Ideally this would be based on [NSView viewDidMoveToSuperview] and
[NSView viewDidMoveToWindow], with retain/releases of the corresponding
NSWindow, but that needs more research, especially as AppKit on macOS
10.13 will always keep a strong reference to the NSWindow.
Task-number: QTBUG-63443
Change-Id: I9eec5ea871373d00dedf154600bf7005898cf37a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The modern approach to offscreen rendering on macOS is via FBOs, which
means there's no reason to allocate an NSView and corresponding NSWindow
just for that. In the offscreen case the NSOpenGLContext has a nil-view.
Change-Id: I2d1d407069af4d5283e6f56fba83db8eaf694ac6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
We were using the default ones, provided by RFC7540. It appears they are way
too restrictive and conservative: when downloading something relatively big,
a stream keeps spending the whole session/its own 'recv' windows and thus
we have to constantly send WINDOW_UPDATE frames. This significantly slows
down our HTTP/2 implementation, making it orders of magnitude slower than
HTTP/1.1. To fix this:
- We send SETTINGS_INITIAL_WINDOW_SIZE in the first SETTINGS frame
to inform our peer that per-stream WINDOW is bigger than 64Kb
- We increase the session's receive window size.
Task-number: QTBUG-63722
Change-Id: I31312fcfd5f0fc0aee6aaa5d3562cc7d1b931adc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Error out if it's missing or broken (Mersenne Twister not present).
This ensures that we never have a low-quality random generator in Qt.
Change-Id: I0a103569c81b4711a649fffd14ec80649df7087e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
NSTimeInterval is a typedef for double, but the code stored its value in
an int, and only then multiplied by 1000.
Fix by only truncating NSTimeIntervals to int(64_t) *after* the
multiplication by 1e3 to get milliseconds.
While it's highly unlikely that a transition will have fractional seconds
length, don't assume if you can just calculate the more exact result.
Adapted-From: Marc Mutz <marc.mutz@kdab.com>
Change-Id: I0911b9c945a94ca24c3dfb23ed6a849141076326
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Overrides keyboardRect() and isInputPanelVisible() in QWindowsInputContext
in order to provide support for virtual keyboard geometry and visibility
information in the Windows platform.
Change-Id: I15382e604dc076929d253c0c1fbe64ea7da853ce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Upgrading to a recent Vulkan SDK (e.g. 1.0.61) leads to getting
a few previously unseen warnings from the validation layers.
Fix these:
vkDebug: ParameterValidation: 8: vkCreateSampler(): The
samplerAnisotropy feature was not enabled at device-creation
time, so the maxAnisotropy member of the VkSamplerCreateInfo
structure must be 1.0 but is 0.000000.
vkDebug: DS: 461375808: vkCmdPipelineBarrier():
pImageMemBarriers[0].srcAccessMask (0x4000) is not supported by
srcStageMask (0x1). The spec valid usage text states 'Any given
element of pMemoryBarriers, pBufferMemoryBarriers or
pImageMemoryBarriers must not have any access flag included in
its srcAccessMask member if that bit is not supported by any of
the pipeline stages in srcStageMask, as specified in the table of
supported access types.'
vkDebug: DS: 6: vkCmdDraw(): Cannot use image 0x7 with specific
layout VK_IMAGE_LAYOUT_GENERAL that doesn't match the actual
current layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL.
vkDebug: DS: 61: Descriptor set 0xc encountered the following
validation error at vkCmdDraw() time: Image layout specified at
vkUpdateDescriptorSets() time doesn't match actual image layout
at time descriptor is used. See previous error callback for
specific details.
Change-Id: I1a3200221ac725c2fa661eff3ac075262b9355c2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Auto-reset events are automatically reset to non-signaled when we get
notified about the signaled state. This implies that we cannot check the
event state again in activateEventNotifiers. Instead, store the signaled
state in a QAtomicInt and test and decrement that.
This amends commit 85403d0a.
Task-number: QTBUG-63555
Change-Id: I0adee3d2929783f98d91060f9106c8b5266d72fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The Qt documentation is using 'upper-left' everywhere except at
QRect(F) detailed description and Qt::CoordinateSystem enum description.
Therefore fix it in those four places to be consistent.
Task-number: QTBUG-59981
Change-Id: Ie652044d0207ea5a42888d9e1f1dc9a86b1e9410
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Use assignment. Fixes:
vulkan\qvulkaninstance.cpp(811) : error C2061: syntax error : identifier 'd_ptr'
vulkan\qvulkaninstance.cpp(812) : warning C4551: function call missing argument list
vulkan\qvulkaninstance.cpp(813) : error C2659: '=' : function as left operand
vulkan\qvulkaninstance.cpp(814) : error C2440: 'return' : cannot convert from 'QVulkanDeviceFunctions *&(__cdecl *)(void)' to 'QVulkanDeviceFunctions *'
There is no context in which this conversion is possible
vulkan\qvulkaninstance.cpp(832) : error C2061: syntax error : identifier 'd_ptr'
vulkan\qvulkaninstance.cpp(833) : error C2541: 'delete' : cannot delete objects that are not pointers
vulkan\qvulkaninstance.cpp(834) : error C2659: '=' : function as left operand
Change-Id: I859b141aa0cb24b1f85dc9f229262a4145651d7c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
qkmsdevice.cpp:737:40: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
Change-Id: I90f0281baeb7bd8216d62515e4b087070c98c235
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Commit 282065d443 renamed the generator
functions but we didn't update all the docs.
Change-Id: I0a103569c81b4711a649fffd14ec877ffbfe710d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
There are a couple of Q_ASSERT wrapped by the new noexcepts, but most of
those aren't validation of external parameters, only of internal
construction. The two exceptions are the checks for pointer alignment.
Change-Id: I0a103569c81b4711a649fffd14ec8523d741dfb6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Incidentally, we can fix a typo.
[ChangeLog][QtNetwork][QNetworkInterface] Changed allAddresses() to not
include addresses found in inactive interfaces, matching the user
expectations of this function. If those addresses are needed for some
purpose, the application will need to call allInterfaces() and obtain
the addresses in each interface.
Task-number: QTBUG-51922
Change-Id: Iaf4157b7efa2416d898cfffd14d969c963ec0a2a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
I don't know why this needs to be a template specialization instead of
overload, like all the other toString overloads. With GCC 7, it was
calling QTest::toString<QHostAddress>, which returns nullptr.
Change-Id: I638cf58bfa7b4e5fb386fffd14ea7add0eef8f87
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
382faed introduced placeholder text to QPlainTextEdit. But the code
relied on the text begin short enough to fit inside the width of
the text edit. If the text was longer, and therefore wrapped, drawing
artifacts would show.
This patch will listen for text changes and check if the
placeholder text should show or not, and if so, issue a full update
to ensure that the whole placeholder text is either fully drawn
or hidden. And then we allow to the placeholder text to be drawn
inside the full rect of the text edit.
Task-number: QTBUG-61875
Change-Id: I808472839ab397340080b56407c76e74f9ad1ae6
Reviewed-by: David Faure <david.faure@kdab.com>
Similar to cfe1a295fc which was in a different file.
Change-Id: I40e204f8603a2d4c10a6c737192957653f537d1a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
... so that it comments the actual code, not what this code was before.
Change-Id: Ib191b9d7bd3ae3cda39a15f0f711cb1dd3c5c2b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
On some systems (e.g. Debian/buster) a standard Qt package may install
a qtlogging.ini file, e.g. in /etc/xdg/QtProject/, which suppresses
QDEBUG output. A ~/.config/QtProject/qtlogging.ini could interfere
similarly. This can break the selftest, when run with expected_*
files generated without such interference. Likewise, if those
expected_* files are generated on a system such similar, they won't
work on CI. Given that this caused confusion and delay with
integrating the latest set of updates to the expected_* files, it
seemed best to save others from similar bafflement.
So set a standard value for QT_LOGGING_RULES in both the selftest and
the generator script, so we get consistency.
Change-Id: I649e2f1f6ead21edf8af051aaee286e369fed064
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
In selftests.qrc, imposed alphabetic order (on stem of name, then on
suffix, effectively treating . as sorting before any letter) while
removing old tests and adding new tests and data. Updated all non-csv
files and added many missing files. (Not clear on csv support status;
the script seems to have dropped it after 5.6, but the test still uses
it.)
Left expected_crashes* alone (no new files added, no update to old) as
I don't get results resembling those anticipated.
Omitted printdatatagswithglobaltags, printdatatags due to dangling
hspace on output lines, which upset sanity-bot. A change to the test
cpp is needed to make it viable to skip that dangling hspace.
Change-Id: Iab3fb626c44a91c249b2fb626c12c75ea0317098
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
kernel/qopenglcontext_p.h included opengl/qopengl.h as "qopengl.h",
triggering:
In file included from ..\..\include\QtGui\5.11.0\QtGui\private/qopenglcontext_p.h:1:
..\..\include\QtGui\5.11.0\QtGui/private/../../../../../src/gui/kernel/qopenglcontext_p.h(58,10): warning: #include resolved using non-portable Microsoft search rules as: ..\..\include\QtGui/../../src/gui/opengl/qopengl.h [-Wmicrosoft-include]
Task-number: QTBUG-63512
Change-Id: I867a8f2ceeb8a9369dfe0163c179572feadc033e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The documentation of QKeyValueIterator was in the wrong place. This
patch moves it with the other iterators documentation.
Change-Id: I42ad529f72f9b19fdecfca7ddfeb6e6f4dcfebac
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
That overload documentation was missing the "exact" qualifier regarding
the search result.
Change-Id: I27a08b60f9b88ae497f8bd9d9ba6a99f4a9ab4d6
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
The file path included in the return value was
incorrect when giving the following value to the argument of
"QStandardPaths::standardLocations()".
- QStandardPaths::AppDataLocation
- QStandardPaths::AppLocalDataLocation
- QStandardPaths::DataLocation
The function to obtain the path to <AppName>.app changed from
CFURLCopyPath() to CFURLCopyFileSystemPath() by commit id
c0da37a806.
CFURLCopyPath() returns a value with a path delimiter appended at the
end, but CFURLCopyFileSystemPath() is not.
This is a commit to append '/' to the end of the return value of
CFURLCopyFileSystemPath().
Task-number: QTBUG-61159
Change-Id: Icaebdf09d9cdf992d59c16a398dfe666e6225f99
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
All the required data is just there, few lines above. Instead of
throwing it away and then deducing again in mouse event handler,
use the enhanced mouse constructor.
Tablet event handler was the last remaining user of the obsolete
mouse event constructor. This patch removes the now unused construtor.
Change-Id: I0df7f1b82f0e768f651aa7fbe2d4efce93e992fa
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
The documentation for AA_SynthesizeMouseForUnhandledTouchEvents states:
"All touch events that are not accepted by the application will be
translated to left button mouse events instead."
This is exactly what this patch does. With the enhanced mouse event,
we can simply pass event details as necessary. This should not conflict
with the code doing its own mouse synthesis (as long as custom event
handler accepts QEvent::Touch{Begin,Update,End}).
What was wrong with the previous implementation:
It was sharing the same state variable (mouse_buttons) to deduce button
state/type on physical mouse and emulated mouse. This was wrong, you
can't track state of two input devices by sharing one variable. Moreover,
this variable is intended for tracking state of a hardware mouse only.
Button state on physical mouse (as a separate pointer device) is
irrelevant for touch input (which is another "pointer device"). The
current API does not support multiple pointer devices, thus button state
on one pointer device should not affect state on other pointer device.
Task-number: QTBUG-57465
Task-number: QTBUG-52102
Change-Id: Id45d815508918b4e52319baddb2c9564d52ad783
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
... and deprecate QWSI APIs that accepts mouse event without mouse button/
type data.
In the early days of Qt5 it was decided to centralize mouse button/type
handling in QGuiApplication (because of limitation of some now unknown
platform). This has proven to be problematic as mouse handling details
differ across platforms (e.g on X11 we do not receive mouse release event
when closing popup windows or ordinary windows that are closed from the
mouse press event). Instead of hacking around platform specific behaviors
in Qt Gui, we should move this task back to platform plugins (similar to
how this was done in Qt4 with native APIs sending mouse details directly
to QApplication). There are even cases where it simply is not possible
to deduce (from QGuiApplication) which button caused the event (e.g. when
more than one button is involved and some event goes missing). Besisdes,
throwing away information which is already available at QPA level (for free)
and trying to deduce it again at Qt Gui level seems impractical, fagile
(as probably noticed by people fixing all the unexpected issues) and adds
unnecessary complexity.
Note:
Removing the deprecated QWSI APIs from offscreen plugin depends on fixing
autotests that rely on QOffscreenCursor::setPos() logic.
For the convenience of testing use QT_QPA_DISABLE_ENHANCED_MOUSE to restore
to the old code path where QGuiApplication does the mouse state deducing.
Other platforms have similar issues. I do not have all supported platform
available on my desk, so other platform maintainers will need to take care
of porting those platforms to the new APIs. And mainly, I don't want to deal
with all the hacks that other platforms have added to workaround this broken
mouse logic.
In Qt6 we need to remove deprecated code path from QGuiApplication.
This patch:
- Extends QWindowSystemInterfacePrivate::MouseEvent ctor with QEvent::Type
and Qt::MouseButton. We use this extra data when processing mouse events in
QGuiApplication. This actually is similar to KeyEvent, where we do pass the
type (press or release) to QtGui.
- Refactors QGuiApplicationPrivate::processMouseEvent and qtestlib to use
the new APIs.
Task-number: QTBUG-59277
Task-number: QTBUG-62329
Task-number: QTBUG-63467
Change-Id: If94fd46a7cccfea8264dcb1368804c73334558b8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
The TIMESTAMP type has been available in Oracle since Oracle 9i
which was released in June 2001 and contains more data than the
DATE type so it can be reliably used for the related data types.
This adds support for preserving milliseconds and the time zone
information if this is passed or in the database.
[ChangeLog][QtSql][OCI] Added support for the TIMESTAMP data type.
Task-number: QTBUG-23
Change-Id: Icf7a012dda75fb342ce6c6aa34eaa2a52755ff2d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- Store "event->data.data32[0]" in a variable with a meaningful name.
This improves code readility.
- Use categorized logging.
- Wrap lines where it makes sense (Qt Coding Style discorages more than
100 chars per line).
Change-Id: I163abab8380b459fd349227f22dc417a444aefa7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
I need to include linxx/if.h from elsewhere and these two files conflict
by defining the same types (struct ifreq, struct ifmap, struct ifconf,
etc.)
Change-Id: I0a103569c81b4711a649fffd14eb2f6dbbef83b6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
We're not going to crash to avoid core dumps getting recorded by
systemd, filling up filesystems or showing dialog boxes. We just need to
exit without running destructors. Now, exit() isn't supposed to run
function-scope destructors, so just in case we use _exit().
Change-Id: I0b48fc8e90304e0dacc3fffd14e909ff248ce1a1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
As QAbstractSocket does not handle most cases for this socket type, we
should override skip() in QSslSocketPrivate implementation.
In unencrypted mode, QSslSocket should forward skipping to the plain
socket. If a connection is secure, we just need to check the connection
state.
Change-Id: I56602c6427b8617e8a9f453809a30fb2914ad798
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Use the FreeType LCD rendering path with 2.8.1 even when it has lcd-
filtering disabled. This gives us proper subpixel rendering even with
a freetype build with the patented lcd-filtering code disabled.
The code is also simplified by removing the long pointless
ifdefs for 10+ year old versions of freetype.
Change-Id: I487e465317cb984b6e33c7bcc497f27cf29f9bcd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Make a common function to replace the two existing ones that convert
from XCB visuals to QImage format.
Change-Id: I2ae08ef4df96df950910a45e71c9d9cd98375b2e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This fixes a regression introduced in 8e70241dcc.
Task-number: QTBUG-63631
Change-Id: I5a2c23e06b790a482e1542ac2db3dcf25927caf2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This makes qtestlib behave more like real Qt applications with an
event loop, where exiting the application does indeed flush deleteLaters.
And since every test method is supposed to be independent from other
test methods, we should even cleanup between tests.
For "app less" tests, no flushing happens.
Real life use cases:
* A unittest for some code (e.g. KIO job) which uses a socket, runs an
event loop until the socket communication is done, and ends. However
slotDisconnected() does, as recommended, socket->deleteLater(). So the
test finishes before the socket has a chance to actually get deleted,
and memory leak tools flag a memory leak, which doesn't actually happen
outside the unittest.
* Deleting a QWebEngineView with deleteLater is even worse than a memleak,
it leads to an assert (from a global object destructor) in QtWebEngine
if the view deletion hasn't actually been processed.
Change-Id: I18fc822fd26988a0fa4e75313c1947fcaa7d9e56
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
<future> is needed by QThread::create. Instead of a fragile series
of preprocessor tests, move its detection to a configure test.
This dramatically simplifies the code, but on the other hand ties
the availability of QThread::create() to the system used to compile
Qt (rather the one used to compile an application).
Change-Id: If1b06363379bf29126cfa68f2a0651cbb78a67f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
That was stupid for two reasons. First, applicationName() can be changed
by the user by calling QCoreApplication::setApplicationName(), so if
that happens, we won't be able to properly identify a lock belonging to a
given application because the name changed.
Second, because applicationName() is not what we compare to. Instead,
let's use processNameByPid() on both content creation and verification.
[ChangeLog][QtCore][QLockFile] Fixed a bug that would cause QLockFile
mis-identify valid lock files as stale if the application name was set
with QCoreApplication::setApplicationName().
Change-Id: I0b48fc8e90304e0dacc3fffd14e912a5c98c87e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We duplicated both the creation of the contents and the check if the
file was stale. Centralize everything in qlockfile.cpp.
Change-Id: I0b48fc8e90304e0dacc3fffd14e91174af79841f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
F_SETLK is bad. Explanation in the comment. And flock(2) does work with
NFS on Linux, so let's just stick to that, which is simpler.
We only use the file locks when we attempt to delete an apparently stale
lock: that is, for a lock file that is at least staleLockTime old.
Change-Id: I0b48fc8e90304e0dacc3fffd14e908c8c4c9d59b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
It's confusing to keep it along with an unrelated class. Let's keep it
in its own file like for most other platform plugins.
Change-Id: I449ee061ff9fd5dc7ef06cadd633414d6b16358f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>