As QLocalSocket keeps incoming data in the inner socket object, we
can implement the outer's skip() by simply calling the inner's. This
avoids the slow read()-based code path provided by the base class.
Change-Id: I66547601ebad1b4acf168475bebd81fbeef969f8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Attempting to switch /dev/dri/cardX to /dev/dri/renderDY is futile
on its own now since many output-related drm operations fail and we
eventually crash.
Add a new headless mode that skips the real screen stuff and registers
a fairly dummy, headless screen, does not bother with the mouse cursor,
and disallows rendering to the screen via a QWindow (while keeping the
actual rendering still fully functional).
Such applications will not need any special privileges and will run even
if there is a DRM master (X11, Wayland compositor) active.
For example the configuration can look like this:
{
"device": "/dev/dri/renderD128",
"headless": "1024x768"
}
After this applications have two choices to perform offscreen
rendering:
1. Use an ordinary window (and its default framebuffer, meaning the
gbm_surface), e.g. a QOpenGLWindow subclass
MyOpenGLWindow w;
w.show(); // will not actually show on screen
w.grabFramebuffer().save("output.png");
Note that there is no vsync-based throttling. Also note that windows are
still sized to match the screen size, hence the need for specifying a size
in the headless property.
2. Or the typical offscreen approach with an extra FBO
QOffscreenSurface s;
s.setFormat(ctx.format());
s.create();
ctx.makeCurrent(&s0;
QOpenGLFramebufferObject fbo(1024, 768);
fbo.bind();
ctx.functions()->glClearColor(1, 0, 0, 1);
ctx.functions()->glClear(GL_COLOR_BUFFER_BIT);
fbo.toImage().save("output.png");
ctx.doneCurrent();
Task-number: QTBUG-62262
Change-Id: Ic1dbfa2b27b223bd5ef8ba36b665f0f61abf4f06
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
{
"device": "/dev/dri/card0",
"outputs": [
{ "name": "HDMI1", "mode": "1920x1080" },
{ "name": "DP1", "mode": "1920x1080", "clones": "HDMI1" }
]
}
Here, assuming the QScreen for DP1 is unused and the resolution is the same,
DP1 will simply mirror whatever is on HDMI1.
The plane-based mouse cursor is not currently supported. Same goes for any
form of scaling since this simply scans out the same framebuffer on all
target CRTCs.
Task-number: QTBUG-62262
Change-Id: I391be204264284a1bff752ebc2a1dbe5c8592013
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
In addition to "mode": "1280x720", one can now also specify the vrefresh
value: "mode": "1280x720@50".
This way if there is both a 60 and 50 Hz variant, then it is now possible
to choose the 50 Hz one.
Task-number: QTBUG-62262
Change-Id: I9ca21c5a513621c83f2f5348c411d8d7c5492b3d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Switch to drmModeAddFB2 and add mappings for RGB565 and ARGB8888,
and some BGR variants.
The default is XRGB8888, like before.
Others can be requested in the config file with
"format": "rgb565" or "argb8888" etc. on a per-output basis.
If the primary plane does not support the format, modesetting
and flipping will fail.
Task-number: QTBUG-62262
Change-Id: I8537cbeed7f046c46aa63fcea6d6946c0e0038a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...unless explicitly requested via QT_QPA_EGLFS_ALWAYS_SET_MODE.
This mirrors the behavior of the EGLDevice backend.
Synchronize the "swap" behavior in other aspects too: do not retry
a failing modeset until infinity, and make the (currently limited but
soon enhanced) plane setup independent of the modesetting.
Task-number: QTBUG-62262
Change-Id: If43c4edf09c526a3d0f566994a3d632c217d2c31
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...and make the struct initialization more readable while we are at it.
Task-number: QTBUG-62262
Change-Id: I1af82d1b2fd5a3c94dcdb720920618d4da80c21c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
There is still one fullscreen window per screen at a time, but
there is no reason we should fail in the backend when the screen
already has the gbm_surface created. If there is really another
active GL window for this screen, then the base eglfs window
implementation will panic anyway.
This should help certain cases, where windows belonging to screen B get
created for screen A and then moved (recreated) for screen B.
Task-number: QTBUG-62262
Change-Id: Ia029f028d32a35e8e023f3132097ba9a919b8fe8
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Unlike qdatastream.h, we can be ready for future versions. Current plans
say we should do Qt 5.12 and then begin working on 6.0.
Change-Id: I38341f8155354cc4a776fffd14e13c2f1362b483
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Teach our MiniHttpServer to better handle POST and PUT requests:
read the POST/PUT data too (not headers only), before replying
and flushing. The original comment says MiniHttpServer does
not support POST/PUT requests, it's not true anymore - we can
handle them (perhaps the simplest/shortest ones).
Task-number: QTBUG-62844
Change-Id: I80260f8ede1bb1b0b9d6042ecd59558bb7e9a998
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Classes inheriting QPlatformSurface need to return the QPlatformScreen
to allow the platform integration plugin to know information about the
used screen by the surface.
QPlatformSurface and QPlatformWindow had the same function defined, but
it was not possible to call it without casting the QPlatformSurface
pointer.
Change-Id: I1f93fe7c13ebbc51769677038edeca4de5db0024
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
'using' is recommended by C++ Core Guidelines for improving readability:
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rt-using
In the case of generated code it can be useful to leave
moc files unchanged when modernizing code with clang-tidy's
'modernize-use-using'.
Change-Id: Iabb4de2aa8d2f9396d8c8d4ee21f80fffff1dadc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Now that we have a proper ALPN/NPN + Protocol Upgrade, we can also
add H2Direct - this can be useful for our users that have to work
with either Secure Transport or a TLS implementation not supporting
ALPN/NPN and with 'h2direct' servers in case they have prior knowledge
of HTTP/2 support. The difference with RFC 7540 is the fact we also
allow this 'direct' in case of 'https' scheme (it appears existing
HTTP/2 server implementations support such mode too).
[ChangeLog][QtNetwork] Add Http2DirectAttribute to enable 'direct' HTTP/2
protocol without ALPN/NPN and without protocol upgrade negotiations.
Task-number: QTBUG-61397
Change-Id: I0499d33ec45dede765890059fd9542dab236bd5d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The item is not supposed to be modified, so it should be passed
as pointer-to-const. A similar change was already done for
QTreeWidget in b2aeeaf628.
Change-Id: I75d597867771f414821693a50f97c94b05a4ccb2
Reviewed-by: David Faure <david.faure@kdab.com>
Conflicts:
examples/examples.pro
qmake/library/qmakebuiltins.cpp
src/corelib/global/qglobal.cpp
Re-apply b525ec2 to qrandom.cpp(code movement in 030782e)
src/corelib/global/qnamespace.qdoc
src/corelib/global/qrandom.cpp
src/gui/kernel/qwindow.cpp
Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08)
src/network/ssl/qsslkey_openssl.cpp
src/plugins/platforms/android/androidjniinput.cpp
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/widgets/widgets/qmenu.cpp
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
... by using the new QIODevice::skip() function.
Change-Id: I943c4feb896d677f3150da542950595d7f485e75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reverts commit 8561281768.
This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.
Change-Id: Ice250ecedb14ac96fb3693b2d9884ef452a91cc2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Compile examples/opengl only in case opengl support is available.
Task-number: QTBUG-62372
Change-Id: I742a1eb7b7639a5a722c4d5e9b4ee070b629b02e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
It is (end - start) that represent the number of pixels being worked on
and needs to be smaller than the buffer size.
Change-Id: I75a22bc2656ac1c7d231278c3a1931758090f8ce
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QTBUG_10735_crashWithDialog started to show flakyness recently - it crashes,
but not every time (which fits the definition of UB perfectly).
While the test itself is doing weird things and puts our event dispatcher
into a weird state, our API allows to:
1. Using QDialog to enter event loop (with runModalSession under the hood), then ...
2. to call from a slot (e.g. timer-attached) QApplication::closeAllWindows() while ...
3. we are still inside that special loop and using the 'session' object, thus ...
4. on the next iteration with [NSApp runModalSession:session] we'll re-use already released
session (released by endModalSession which in turn was called indirectly by closeAllWindows).
And Cocoa gives us a warning/hint: "Use of freed session detected. Do not call
runModalSession: after calling endModalSesion:."
Task-number: QTBUG-62589
Change-Id: Ie651cee1fba43cfd2b0fc44af5eddc5fd52e2907
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This reverts commit 3d5bf00f18.
This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.
Change-Id: I9f1c88606c97afc5952af34e04310612b783a9c2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Delegating the border painting to qDrawPlainRect ensures that there are
no off-by-one pixel issues.
Task-number: QTBUG-61849
Change-Id: I56dc849da80fad00d02a0f9c60dbb621e6de7c48
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Use QImageReader::supportsOption() instead of ::supportsAnimation(),
since the former checks what the handler supports in general, not just
the particular device.
Task-number: QTBUG-61642
Change-Id: I57db24425b4fd8821446659936e6a8ca55008921
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
If the style changes after the browser already jumped to an anchor,
the resulting browser position will be messed up.
So, after we changed the style we need to make sure that we jump
to the anchor again.
Since browsers do not jump to anchors that they already jumped to,
that means first jumping to the top, then to the actual anchor.
Task-number: QTCREATORBUG-18448
Change-Id: I86c736adab6940903276f8a896b4054ddae11ebe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Dialogs and Sheets by default have the WindowsContextHelpButtonHint
set, which adds a question mark button to dialogs on Windows. This
button then triggers the 'What's this' mode by changing the cursor,
and letting the user explore the UI by showing whatsThis tooltips.
Anyhow, the paradigm is little used today and a lot of applications
do not set any whatsThis properties, leaving the mode pretty
non-functional. It's therefore common to explicitly remove the
WindowsContextHelpButtonHint from dialogs. However, this has to
be done for _every_ dialog.
Instead, this patch adds a global application flag to not set the
WindowsContextHelpButtonHint by default. This allows developers to
already buy into the Qt 6 behavior, where the flag will not be set
anymore by default.
[ChangeLog][QtWidgets] Added AA_DisableWindowContextHelpButton
attribute. Setting this attribute globally prevents the automatic
"What's this" button on dialogs on Windows
(WindowsContextHelpButtonHint).
Change-Id: I497a79575f222c78b2d5d051a6de346b231f72d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
nullptr can be used directly in the Qt code since Qt 5.7.
Use it in generated code for consistency.
Change-Id: I249aeaf0a39b46ce1106b29d3ea4569a399908b7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
CID 158429 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking ctx suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
Coverity-Id: 158429
Change-Id: I6d202599e962dae5ea4a45401f34237dd496d38b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This amends patch f27d1ccbb2.
Change-Id: I4c7a390a5f2cdd3307007c7b6708692c36f861b4
Task-number: QTBUG-62396
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Define the lib dependencies for corelib in corelib.pro, where they
belong.
Change-Id: I973d3b0c571782d869b27dea243e899db4dddc43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This was added in c6612de3 for WEC7 which we do not support anymore.
Change-Id: I329374bb8375d629a6f7619236371c0fc953792d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
It is currently impossible to get output from autotests in Visual Studio
or Qt Creator when running under the debugger. Qt Creator's cdb
integration cannot distinguish between the inferior's console output and
cdb's console output. If the inferior's output came from
OutputDebugString we'd be able to catch and display it.
Pave a way to force QTestLib's logging facility use OutputDebugString.
Task-number: QTCREATORBUG-16161
Change-Id: Iccd69c283626266ee4384a6163a8b72bb0e7df27
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It was already done correctly in the GCC generators, but lacked in MSVC.
Task-number: QTBUG-11117
Change-Id: I5e6c2e4802dbe33c0f15c46a227a08c3f0cc5707
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This prevents unnecessarily removing and reinstalling the completer
as event filter on the same widget.
This does not prevent what's going on in QComboBox::focusInEvent(),
where we'd set the line edit as widget just to immediately override
it with combo box itself.
Change-Id: I70c081a920f4daf4d7560e5cd7158e4070042d42
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
With MSG_TRUNC on Linux, recv/recvfrom/recvmsg will return the full size
of the datagram, even if it won't fit the buffer you passed. On Darwin,
we have a getsockopt() option to get that value.
Change-Id: I6e9274c1e7444ad48c81fffd14da7d5b93815f90
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
I'm getting crashes in Akonadi processes due to libproxy. I don't have
direct evidence that this was caused by a threading condition, but it's
clear from the source code of libproxy that the plugins it runs for
expanding PAC scripts are not thread-safe. To overcome this problem, we
only run libproxy functions in one thread only.
#0 0x00007f745f0ac1d8 in JSC::HeapTimer::timerDidFire() () at /usr/lib64/libjavascriptcoregtk-4.0.so.18
#1 0x00007f745f0ac287 in () at /usr/lib64/libjavascriptcoregtk-4.0.so.18
#2 0x00007f748e5ae9c5 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#3 0x00007f748e5aed88 in () at /usr/lib64/libglib-2.0.so.0
#4 0x00007f748e5aee1c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#5 0x00007f7494f4268f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#6 0x00007f7494eeb35a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#7 0x00007f7494d1b31a in QThread::exec() () at /usr/lib64/libQt5Core.so.5
#8 0x00007f7494d1fd2e in () at /usr/lib64/libQt5Core.so.5
#9 0x00007f74913174e7 in start_thread () at /lib64/libpthread.so.0
The pacrunner implementation of libproxy uses libdbus-1 which
(officially) is thread-safe, but experience tells that it has
problems. Since it is not running a JS engine, we don't need a thread,
but we do need to lock around it.
Change-Id: I84e45059a888497fb55ffffd14d2f638f21e807d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>