Rather than have a fontChanged() signal which can be connected to for
tracking when the application font has changed, then it is better to
use the event that is sent to all windows and the application itself.
That way it is easy for a window/widget or item that cares about the
change to the application font to catch it in the event() function.
[ChangeLog][QtGui][QGuiApplication] Deprecated fontChanged() signal in
favor of QEvent::ApplicationFontChanged.
Change-Id: Iae8e832238fc85e385a52305bc04f16e597454b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The SAX API in in Qt XML got deprecated, and examples using it
removed in commit 82d02b7b95.
Pick-to: 5.15
Change-Id: I39b71378c0f797e82431c8a0e12255626ed145ed
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This patch allows all the sqldrivers to be built as a standalone project.
It is not possible to build each plugin separately due to the configuration
features definition being located in the sqldriver's folder CMakeLists.txt.
In other words, the project needs to be generated from the
src/plugins/sqldrivers/CMakeLists.txt file.
Fixes: QTBUG-82962
Change-Id: If41c7e3827589391830a894a9c998d2e56239562
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Without this behavior enabled by default it is currently not possible to
build QtVirtualKeyboard as a static build. We run into the error where
cmake is trying to promote the targets to be global due the XCB library
already being found by one of the modules in QtBase.
In case we wish to disable this fix, any module can simply specify
QT_FIND_PACKAGE_DISABLE_DEBUG_BEHAVIOR=ON during configuration time.
Change-Id: Id7f2ad12ddea941dda754361660c7606439cd5a4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Added asserts to insure the invariant declared in the documentation.
Canceled future object is not valid, hence we don't need to handle
this case separately.
Fixes: QTBUG-83389
Change-Id: Ib0653ef40cd3135574a91740e4ce2c6dc4da8a71
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This follows up on commits 3e7463411e and
947883141d.
The changing of the pointer of QApplicationPrivate does not transfer
focus properly. It updates the pointer, but it doesn't deliver events
or update the widget hierarchy's focus chain. The result is that
multiple line edits might show a blinking cursor.
Instead, use QWidget::setFocus when the focus proxy has changed while
it had focus, and pass OtherFocusReason rather than NoFocusReason.
Add a basic test for QWidget::focusProxy, which exercises this code
path and verifies that pointers are consistent when focus changes as
a side effect of modifying the focusProxy.
Change-Id: I15a4d868bab2b590cfe4a1daa6a3c8cebc9c9ca2
Fixes: QTBUG-83720
Fixes: QTBUG-79707
Pick-to: 5.15
Reviewed-by: David Faure <david.faure@kdab.com>
It previously applied to dates and date-times, but was documented as
applying to times (and date-times then included it by reference).
It's only meaningful for a date-time.
Change-Id: Id9e8e8cb987b03e5ddc77b05c581b9b6944065fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old code got a QMap serialized as a QString and parsed it to
re-create the same map.
Just copy the map.
Change-Id: Ic71b9fa9d822eab53fe37dfb4d76223cd69ac057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Simply rename the function in order to not clash with aligned_alloc()
that is marked as 10.15 only (and thus would need annotation etc.) in
the 10.15 SDK. (note that aligned_alloc is a C11 function which was
presumably not present in earlier SDKs, by renaming our own version
everyone will be happy, hopefully)
Change-Id: Iee400d81df6a0af4fa2129358ed27b049720685b
Pick-to: 5.15
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Also extend autotesting, both for rendering into a given mip level
and for rendering into a given cubemap face.
Change-Id: Ida94b71150477ceb50a3b5616d8b7be13174558b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This feature is Windows-only and must be turned on manually.
For MSVC it sets the MSVC_RUNTIME_LIBRARY target property.
For MinGW it adds the -static linker flag.
Change-Id: I9da3b88d545b34bc34a3a80301b2dd1b5986fa88
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The last release of glibc 1 was 1995 and can be considered outdated.
Also, the current check prevented building with e.g. musl libc.
Every file that includes common/posix/qplatformdefs.h already has
QT_SOCKLEN_T defined to socklen_t, so remove the definition from those
completely.
This is a continuation of 813f468a and a421e409.
Change-Id: Icf2692a8e814286487662e290a8f844872eefe53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a .vscode line in the .gitignore file to ignore the Visual Studio Code auto generated files.
Add a .vscode line in the .gitignore file to ignore the Visual Studio Code auto generated files.
Change-Id: Ifbcf82a9c23b4ecf35ae9fd84787f7e1e29df47b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Comparing the layer contents to the backingstore surface doesn't make
sense when we're single buffered since we're always using the same
surface.
And once Core Animation has picked up on the surface it's not enough to
just keep drawing to it, we also need to tell Core Animation that the
contents has changed.
Change-Id: I517a0b7a3ba7e9d96033465c9bd5a192985643ac
Fixes: QTBUG-81071
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Qt assumes that ascent+descent is the bounding height of the
text, but for historical reasons, the ascent for some fonts
will not contain the diacritics. On Windows, the preference
is to use data from the OS/2 table which were explicitly
invented to work around this, but on other platforms we
are not respecting this table. This causes a text layout
that looks fine on Windows to have overlapping characters
on e.g. macOS.
To make vertical metrics (ascent, descent, leading) consistent
across all platforms, we don't blindly trust the values we get
from the underlying font system, but apply in the following order:
1. If OS/2 table exists and USE_TYPO_METRICS flag is set, we
use the typo metrics from OS/2 table
2. If OS/2 table exists and USE_TYPO_METRICS flag is not set,
we use winAscent/winDescent from OS/2 and the line gap from
HHEA table.
3. If no OS/2 table exists, we try to get ascent, descent and
line gap from the HHEA table.
4. If the HHEA table does not exist (not an SFNT), we fall back
to the system-provided metrics. (on macOS, we know the
system-provided metrics will match the data in HHEA, so we
skip parsing that table and use the data from CoreText if
there is no OS/2 table).
Task-number: QTBUG-80554
Change-Id: I41e6561a99513698c8e42451b4ec98bd5eb6892f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When changing scaling from 100%, at which High DPI scaling is inactive,
to something larger, High DPI scaling does not become active.
Update the factors when screens are refreshed.
Pick-to: 5.15
Task-number: QTBUG-77302
Task-number: QTBUG-77136
Task-number: QTBUG-82267
Change-Id: Iebbc29ced2f23af9db4d67839458848245e2db1d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When a date-time was parsed from a string, the result was equal (as a
date-time) to the correct value, but had (at least in some cases) the
wrong spec, where it should have had a spec reflecting the zone
specifier parsed.
The time-spec imposed for the benefit of QDateTimeEdit is now moved
from QDateTimeParser to QDateTimeEditPrivate, which takes over
responsibility for imposing it. QDateTimeParser assumes Qt::LocalTime
in member functions (where applicable) and uses the time-spec parsed
from the string when constructing the date-time.
QDateTime::fromString() and QLocale::toDateTime() are updated to
use the full QDateTime returned by QDateTimeParser.
Fixes: QTBUG-83075
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I8b79add2c7fc13a200e1252d48dbfa70b36757bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Due to the bug related to the 'new syntax' signal/slot connections,
it's unfortunately possible to have a connection not deleted properly
by the moment children objects get deleted. Then, as a result,
in e.g. QSslSocket's destructor the socket will change its state,
triggering the (now deleted) UI elements' access.
Note - the original bug was reported, the patch (only possible?) was
not accepted.
Fixes: QTBUG-83659
Change-Id: I2965532485bcd46f93f8449e4d0a30da92b572c5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This reverts commit 3a6d8df521.
That change is only for 5.14.
Conflicts:
src/plugins/platforms/wasm/qwasmeventtranslator.cpp
src/plugins/platforms/wasm/qwasmintegration.cpp
src/plugins/platforms/wasm/qwasmopenglcontext.cpp
src/plugins/platforms/wasm/qwasmscreen.cpp
Change-Id: Ib9151e199291fe6eb4151027b515393c05303d65
This patch adds a publicly callable qt6_add_plugin() API to create
plugins. This API is meant to cover cases such as the plugandpaint
example.
This patch also renames qt_add_plugin to qt_internal_add_plugin in order
to avoid clashes with the public API. To avoid breaking the existing
projects, a compatibility wrapper function is enabled by default unless
QT_DISABLE_QT_ADD_PLUGIN_COMPATIBILITY is specified.
Fixes: QTBUG-82961
Change-Id: If5b564a8406c90434f1bdad0b8df76d3e6626b5f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Ensure they are handled as enumerations in QMetaType.
This is required for handling QFlag-type properties in Qt Designer
Fixes: QTBUG-83689
Change-Id: Ifbfb5c5b5cd34fce462e299505d063e22e725c2e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We remove the QT_NO_TOOLTIP check from qstandarditemmodel.h, because as
the 'tooltip' feature is in QtWidgets, we cannot use it properly in
QtGui. Also this affects just two non-virtual inline methods, i.e. it
has no effect on library size.
Task-number: QTBUG-82785
Change-Id: Ic166f14fb1cf3e9dd789573a6b9db6a87fb50e10
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
qsocketnotifier.h:113:69: error: cannot initialize return object of type
'Qt::HANDLE' (aka 'void *') with an lvalue of type 'const
QSocketDescriptor::DescriptorType' (aka 'const int')
qsortfilterproxymodel.cpp:2938: error: out-of-line definition of
'recursiveFilteringEnabledChanged' does not match any declaration in
'QSortFilterProxyModel'
qline.cpp:376: (qdoc) warning: Cannot find 'QLineF::IntersectionType'
specified with '\enum' in any header file
Fixes: QTBUG-83676
Change-Id: I57b51f4ad15fdc50db88100ad5b1cb85ed394b7a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
QClipboard used QTextCodec to convert the war clipboard data to
a QString. HTML is nowadays always encoded as utf8, and we were only
supporting utf based encodings for other text.
Add a qFromUtfEncoded() to our UTF helpers that auto detects utf16
and utf32 byte order marks, and assumes utf8 otherwise, to keep
this compatible with what we have been doing in Qt 5.
Change-Id: I5a9fccb67a88dff27cbbdecff9bd548d31aa1c6c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
When converting a text document to HTML, always convert it to utf-8,
as required by the HTML standard. This also means that we remove
the optional encoding parameter.
Change-Id: I0bd2fc9df2d06734e1c5b8053b964fbfbb6881e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Get rid of the options to set another encoding. In 2020,
we should always write documents as utf-8.
Change-Id: If39dd3a876f85a70735169113bce9c25f2d981b3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
There are convoluted cases, based on the backtrace attached
to the associated bug report, where we attempt to destroy a
QOpenGLVertexArrayObject during the destruction of Q(Gui)Application.
Just avoid accessing qGuiApp in destroy(). Rather, store it in create().
Fixes: QTBUG-75138
Pick-to: 5.15
Change-Id: If8e67301c0843cbf3a409dcf427f44c42079de2f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
The typical approach of setting QT_OPENGL_BUGLIST to a non-existing file is neither
documented nor is very friendly. Instead, add a QT_NO_* style of variable that
skips reading the JSON config file altogether.
This can then be used in more exotic, possibly virtualized, environments to disable
the driver and adapter discovery, and instead assume that OpenGL is available and
fully usable.
Task-number: QTBUG-82372
Pick-to: 5.15
Change-Id: I192baa83c5d9760ee27873385a246fef87421b16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Amends 402efef57b. The original patch
has a problem, namely that it directly calls QPlatformWindow::requestUpdate()
instead of going through QWindow::requestUpdate(). As there is a chance that
an update gets scheduled between the creation of the QPlatformWindow and this
extra, optional invocation of requestUpdate() at the end of QWindow::create(),
this becomes quite unsafe because QPlatformWindow, unlike QWindow, is not
graceful: it will just assert if there is a pending update still.
Solve the whole thing by storing the updateRequestPending flag of QWindowPrivate,
then resetting it, and then going through the safe, public
QWindow::requestUpdate() when our copy of the flag says so.
Task-number: QTBUG-81400
Task-number: QTBUG-70957
Pick-to: 5.15
Change-Id: I99aedfae3928b75301b46a4666c169e657ff8079
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This reverts commit 449390c3a5.
QLocale::system() should behave consistently.
If UI widgets are consulting the system locale where they should be
consulting their configured UI locale, that is a bug in the UI widget
and should not be "fixed" by breaking QLocale.
Change-Id: Ib31cf7882a28b26f9a018fba3adabba94a8c43bf
Pick-to: 5.15
Fixes: QTBUG-49031
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
If the widget whose line control we are has its own locale setting,
then we should use that rather than the default UI layout direction.
Instead, the client of the QWidgetLineControl needs to handle the case
where auto-detection of the text direction can't be done based on the
content of the line control.
Fortunately, QWidget's handling of text direction handles setting to
auto gracefully as unsetting, on which it consults the parent widget
to set a sensible default.
Change-Id: Id0d247f1e6e7219b6d0ece5856ca93ee87778c74
Pick-to: 5.15
Fixes: QTBUG-53110
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
After adding new tests, the source code of tst_concurrentmap
grows rapidly with copy/paste/replace pattern.
This intoduce the issue with maintaining the test.
Get rid of separate functions for testing blocking versions
of mapped/mappedReduced and test blocking versions in parallel
with non-blocking flavors. So again, get rid of duplicated code.
Task-number: QTBUG-83258
Change-Id: I4cac6f4e1bfd1b50363dc094610717674aebf2af
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Test the case where reduce function of the form:
V function(T &result, const U &intermediate)
has T and U types different. Make use of
numberSumReduce function and corresponding functor
that reduce Number class object to the result of int type.
Fixes: QTBUG-83258
Change-Id: I194d290988b48e7bca91228c0cd5d39efd1b4712
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Move tests with initial value next to their original version.
Join new lambda tests into a common functions
testing all possible 16 combinations of
functor / function / member / lambda, as they
test in fact the same function. There is no need
to distinguish lambda case over other cases.
This helps in test readability and maintenance.
Add missing tests for lambdas with a combination
of initial value.
Task-number: QTBUG-83258
Change-Id: I7a3d2bf87384d7feecffaaf39281cd626955b0a4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Both Negotiate and NTLM are conditioned on the 'challenge' being empty
when starting the authentication process. So let's reset it when we
start the authentication process.
Fixes: QTBUG-83370
Change-Id: I41af6d5bcfe3dd980ca2bedce10ceff4f61047ff
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>