Adds an enumName to QMetaEnum to carry the name of the enum since for
flags that doesn't match the name of the Qt type, but is needed if the
flag is scoped.
Change-Id: I1c0f77eb9e40e6fd1eb6a59bea77caf0f33fcf43
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Test that we don't silently replace an invalid TLS configuration with
the default one (for now, the only thing that is considered to be
non-valid - is having non-DTLS protocol set).
Change-Id: I6f714b009cf1345a085a3f26d638fc31330f1a94
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This autotest fails on Ubuntu 18.04.
Task-number: QTBUG-69892
Change-Id: I3673d06f06fcd8db307fc53c27724b227978f20d
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
IBus clients cannot access the IBus socket path in Flatpak and
need to watch the D-Bus disconnection.
Change-Id: Ida1a5ce4fe112c1c4f8855ec886e74f2cbdcc8a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
A weird behavior of the DTLS server example, when linked with 1.0.2,
exposed that client code, requesting an invalid protocol (for example, SSLv3)
can end-up with connection encrypted with DTLS 1.2 (which is not that bad,
but totally surprising). When we check the protocol version early in
setDtlsConfiguration() and find a wrong version, we leave our previous
configuration intact and we will use it later during the handshake.
This is wrong. So now we let our user set whatever wrong configuration they
have and later fail in TLS initialization, saying -
'Unsupported protocol, DTLS was expected'.
Auto-test was reduced - the follow-up patch will introduce a new
'invalidConfiguration' auto-test.
Change-Id: I9be054c6112eea11b7801a1595aaf1d34329e1d2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The one we had before was invalid and we ended up with
defaultDtlsConfiguration which has peerVerifyMode == AutoVerify.
Change-Id: I5b9ceb027e90189325c1d8fd0db37d1b212ebbc8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The QTRY_VERIFY was needed because the window doesn't initially have a handle,
and QTest::qWaitForWindowActive(QWidget *) only checks the active state of the
widget if it does, returning false if not.
This broken logic should be fixed, but for now let's make it clear what's
actually going on by using an explicit wait for the window handle.
Change-Id: I6dd89e0894efed14f4b9a2562dfe8ca76b5ef89c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
the global flags are deprecated in favor of per-library paths, but they
obviously should still work. but apparently no-one cares, because there
isn't even a bug report about it ...
amends 90eee08b3.
Change-Id: I85aee41ca11de1715d1c750ae8e663093e012fb7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When showing line and paragraph separators at an offset from the start
of the string, the end of string pointer would be incorrectly set, and
we would read past the end of the string. If any part of this memory
happened to match the line or paragraph separator, then we would
overwrite it and have a crash.
I couldn't find any reliable way to test this, since the crash depends on
the contents of the memory after the string allocated by the algorithm.
But with an overflow of 100 000 characters, I found that it crashed every
time I ran the test.
[ChangeLog][QtGui][Text] Fixed potential crash when using
QTextOption::ShowLineAndParagraphSeparators.
Task-number: QTBUG-69661
Change-Id: I17d1996b883560bacdc7ce114c8aeb2b0108faea
Reviewed-by: JiDe Zhang <zccrs@live.com>
Reviewed-by: Michal Lazo <xlazom00@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This updates the UI after the accent color or NSApp's effective
appearance have changed. For the accent color, we listen to
NSSystemColorsDidChangeNotification. For the effective appearance
changes, we do KVO on NSApp.effectiveAppearance.
Both changes will trigger rebuilding the system palettes followed
by a ThemeChangeEvent in the window system interface layer.
Task-number: QTBUG-68891
Change-Id: Iab1ec874e05f1f6d54cd60217c273e0f8ffbf49e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Until we can properly fix QPalette and QMacStyle,
we should disable dark appearance in Qt applications.
Disable by setting NSApp.appearance to Aqua, unless
dark mode support has been requested via Info.plist
or environment variable.
Read the NSRequiresAquaSystemAppearance Info.plist
key, don’t set NSApp.appearance if its value is false.
Also check the QT_MAC_REQUIRES_AQUA_SYSTEM_APPEARANCE
environment variable and apply similar logic. You then
enable dark mode support by setting:
QT_MAC_REQUIRES_AQUA_SYSTEM_APPEARANCE=0
which is slightly awkward, but matches Info.plist
behavior.
Task-number: QTBUG-68891
Change-Id: I86dc6cf3dee951d46c953396c57d2c31f2e4afcc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We were using CFRunLoopGetMain() everywhere. Get the
correct run loop using CFRunLoopGetCurrent() during
initialization, and store it.
Event dispatcher initialization must now be delayed
until after the constructor has run, since event dispatchers
may be created on the main thread and then moved to
the target thread. Initialize on first call to processEvents()
where the current thread will be the correct thread.
Use the stored m_runLoop instead of CFRunLoopGetMain().
This is required for wakeUp() and interrupt() which
may be called from another thread.
Change-Id: I6fffcfd4394899c4a12f241c42781979aaf99d5e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This change keeps the compatibility with old gradle.
It is needed for projects that must use the old gradle version.
src/tools/androiddeployqt/main.cpp was moved from qttools into
qtbase in 5.11. So re-apply c03f5673 in qttools here.
Task-number: QTBUG-69755
Change-Id: I2399d445f8208766e4185d717bb51f1317fdcc00
Reviewed-by: Volker Krause <volker.krause@kdab.com>
(cherry picked from commit e2f4193112)
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
For single config mode (no debug_and_release) extra compilers wouldn't
get added to the vcxproj file.
Single config mode creates a temporary project, and that was incomplete.
Multi config mode, on the other hand, directly operates on the "real
data" and wasn't affected by this problem.
Task-number: QTBUG-69769
Change-Id: I9cd942e43d80adbeac9a3c8fbe1a5766bc9645a0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
And reflow the text where it exceeds the 100 column limit.
Change-Id: I0d270c6a74a4c6ecba30e4e4d38a5d8f2cf81040
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
As discussed/proposed previously: remove the duplicated code when converting the
native certificate representation into QSslCertificate (configuration.peerCertificate).
Also, use the correct integer type when iterating - CFIndex is actually long, not int.
Change-Id: Ia6f43172e21b5153a93f1ef2589980d68ec2b39f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Turns out that there are two files and while a lot of distros symlink
one to the other, some distros lack the one in /etc.
[ChangeLog][QtCore][QSysInfo] Fixed QSysInfo::productType() to properly
detect some Linux distributions that ship with a minimal /etc.
Change-Id: Ia741b559c24d46c78fb2fffd1548cab414037220
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
A switch statement using enumeration type midlErrorCheckOption as
condition had an enumeration value from type midlStructMemberAlignOption
as a case label. This had only coincidentally the intended effect, since
the intended value (midlErrorCheckOption::midlEnableCustom) and the
actually used one
(midlStructMemberAlignOption::midlStructMemberAlignOption) have both
the value 0.
Change-Id: I73b337f23e733a1a6fb80517e29365e01838238a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QWindowsWindow::updateTransientParent retrieves the handle of the
topmost owner window, not that of the immediate owner window (which
corresponds to the handle of transient parent window).
Task-number: QTBUG-69620
Change-Id: I1433098e8e93832d97508ee1782f88ccc000ee3a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This test was un-blacklisted in 4050ee6ac7
but apparently it is still not stable.
Task-number: QTBUG-69666
Change-Id: Iaf933ee27d54ebbfa52d0a8d7b1def0ca91808e7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
We haven't yet run the configure checks to see if statx and renameat2
are present in glibc, so this fails when we redefine the structures and
functions.
linux/stat.h:56:8: error: redefinition of 'struct statx_timestamp'
bits/statx.h:25:8: note: previous definition of 'struct statx_timestamp'
qfilesystemengine_unix.cpp:110:12: error: 'int renameat2(int, const char*, int, const char*, unsigned int)' was declared 'extern' and later 'static' [-fpermissive]
Change-Id: Ia741b559c24d46c78fb2fffd1548a792d22e3368
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
dstZone.offset was being used without initialization.
Coverity-Id: 178898
Change-Id: I8eabef3b4386c3ebfea5d1caffff9add6264bfce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Following commit 35ce6247 in IBus, IBus input plugin now connects to
session bus and use IBus portal to create input context when running
in Flatpak environment or IBUS_USE_PORTAL is set.
[ChangeLog][plugins][ibus] Support IBus portal. Qt programs in Flatpak
environment can now trigger IBus input method.
Change-Id: I561f5f873d709b8abeae554d804daa058f9f6e16
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Takao Fujiwara <takao.fujiwara1@gmail.com>
Generated C++ source files with extensions other than .cpp would not get
compiled, because the code ignored all other C++ source extensions like
.cc and .cxx.
Fix this by respecting the value of QMAKE_EXT_CPP and QMAKE_EXT_C.
Task-number: QTBUG-69770
Change-Id: I097dfef6920e353a351c97891cdbfdc9a859815f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This isn't necessary anymore, since MSVC 2015 does have Unicode string
support and MinGW (GCC) has had it for a long time. More importantly, we
must remove this macro:
# define QT_UNICODE_LITERAL_II(str) L##str
As the updated MSVC preprocessor will no longer support it. See
"Behavior 2" in [1]
[1] https://blogs.msdn.microsoft.com/vcblog/2018/07/06/msvc-preprocessor-progress-towards-conformance/
Change-Id: Id59bdd8f1a804b809e22fffd15401099a67175d3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Calling update has a cost, and should only be done when the drawable
object changes size or location. Instead of calling update each time
makeCurrent is called, we listen for the appropriate notifications,
limiting the number of update calls significantly.
The code has also been refactored to get rid of the m_activeWindow
member, as the active window can be tracked through the context's
drawable object property.
There is also no need to clear the drawable when a window is hidden,
so the hook into QCocoaWindow can be removed.
The QPlatformNativeInterface hook is internal and can safely be removed.
Task-number: QTBUG-63572
Change-Id: I70e3267f47882e151144bd36a50abe906164429a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
If there's no background, we should copy the backingstore, so that the
backingstore is not blended with the result of the previous flush.
The unified toolbar case is covered by the window having a textured
background.
Task-number: QTBUG-69773
Change-Id: I2f4eed9f44a60ebe7495ce68cf5a54d3d2424b0c
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Specify that we're calling QLocalSocket::close in dtor.
While it's virtual it will not call any overloads at this time.
From cppcheck.
Change-Id: I7b8030ab96e1568cbb2a378ceaf07b2ecabf054f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QNetworkAccessBackend has a QSharedPointer called uploadByteDevice.
QNetworkAccessDebugPipeBackend and QNetworkAccessFileBackend both
duplicated the member, by taking a copy of the raw pointer, while also
shadowing the QNetworkAccessBackend's member by reusing the name.
Change-Id: I91f4e8d43d95c5f30c5bc2571393804209b7a843
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QUnixEventDispatcherQPA has no private class, there is no need to
declare a fake one.
Change-Id: I615304709fbbea83f6747bb6202dbfd2cc03256d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QGL2PaintEngineEx::end() calls endPaint() on the device, which may end up
calling QGLContext::swapBuffers() on the context, a call which we have
documented to require makeCurrent() for any further GL commands:
Call this to finish a frame of OpenGL rendering, and make sure to
call makeCurrent() again before issuing any further OpenGL commands,
for example as part of a new frame.
QOpenGLContext also documents that:
To be able to support certain platforms, QOpenGLContext requires that
you call makeCurrent() again before starting rendering a new frame,
after calling swapBuffers().
As a consequence, we need to guard the GL usage in QGLPaintDevice::endPaint(),
as well as the GL reset in QGL2PaintEngineEx::end().
Change-Id: Ib66e91cce12fbaea32ed3c30141150fa15907187
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We allocate the variant's PrivateShared for custom types with space for
the actual custom type right after that, using operator new to allocate
the memory and a new calls for the constructors. However to free the
memory we merely call delete on the private shared, which upsets ASAN
because the size passed to operator delete is the size of the private
shared, which is not the same as the size that was provided for the
returned address.
This is easily fixable by calling the destructor explicitly and calling
operator delete with just the pointer.
Change-Id: I50afbe0e8afc875c0876e85e02689dcbdc152633
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
When starting further into the string than index 0, do correct the
length too. This shows up in tst_qurl and tst_qurlinternal.
Kindly pointed out by ASAN:
==5513==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60600002bf27 at pc 0x000100654de3 bp 0x7ffeefbfad10 sp 0x7ffeefbfad08
READ of size 16 at 0x60600002bf27 thread T0
#0 0x100654de2 in QtNS::simdTestMask(char const*&, char const*, unsigned int) qstring.cpp:395
#1 0x1005f9777 in QtNS::isAscii(QtNS::QChar const*&, QtNS::QChar const*) qstring.cpp:491
#2 0x100638642 in QtNS::qt_string_normalize(QtNS::QString*, QtNS::QString::NormalizationForm, QtNS::QChar::UnicodeVersion, int) qstring.cpp:7999
Change-Id: I44ad65b47eb98c6085c77b56dc2da50ef5659d25
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I0f5009c8ba8f2f1853a968d9853dc45e8cbc2b5f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's useful to know how many times the signal was emitted, because it
gives us insight into why the test may have failed, especially when
it's difficult to reproduce.
Task-number: QTBUG-69492
Change-Id: I94796ed880512b060e0a724c87edde8c3b91bb7c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Tests could change this property, and since the majority of the tests
share testWidget instead of creating local instances, we should be
thorough when cleaning up.
Change-Id: I6039fb6857f4f788f809b1d1fd491b4ef34923ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The majority of the test reuses testWidget. While this may be faster
than creating a QDateTimeEdit instance on the stack for each test,
it introduces issues when certain properties aren't unset when cleaning
up. This happens easily when new tests are introduced which rely on
certain properties, for example.
Rather than making the newly introduced step-modifier-related tests
use testWidget, this patch goes with the simpler option of hiding
testWidget, just like other tests currently do.
Eventually we should probably switch to using local instances
everywhere.
Task-number: QTBUG-69492
Change-Id: I4d5625be0b7c72db793346f43fe3a7e7c1241f13
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>