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>
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>
Consider a negated feature config value like the following:
qt_feature_config("foo" QMAKE_PUBLIC_QT_CONFIG NEGATE)
If this feature was disabled, it would turn up in both,
enabled_features and disabled_features of module .pri files.
Also, QT_CONFIG would contain foo.
Expected however is that QT_CONFIG contains no-foo, and only
disabled_features contains foo.
Fix this by prepending a "no_" prefix to the value, similar to the
"no-" prefix in the qmake build. The qt_correct_config function was
adjusted to recognize "no_foo" and translate it to the qmakeish
"no-foo" config value.
Config values that start with "no_" but do not correspond to a feature
are left untouched. You can still have values like
"no_valley_too_deep" or "no_mountain_too_high".
Change-Id: I23d8b18c84e04ea6dfa25cc6ccd8f7e86211b144
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Extend the fix 53d5811b0c
to work for the file generation mode as well.
Pick-to: 5.15
Fixes: PYSIDE-1273
Change-Id: I5a91e2de87b44658f276cea87cbd730452b1bd78
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Move QT6_ADD_RESOURCE to Qt6CoreMacros in order to avoid the extra
config file step.
Change-Id: Ib445ca35c648cf344ee8795de8bdddc0f0758972
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Since there's no way to register callbacks or to store functions to be
called later in CMake, the only way to isolate the quick compiler
behavior for qt_add_resources() is to wrap it in a conditional check.
As soon as someone loads Qt6QmlMacros, the variable will set and the
functionality will be available.
Change-Id: I5fbdf2966e7dfdc734512a5b2b973e0ace9da5df
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is basically a duplicate of the commit which fixed building with
musl, but on linux-g++, 813f468a14.
Change-Id: I399005ac6947ba3f2b4ed5087472cd9d54a0850d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Otherwise we may perform a use-after-free.
Change-Id: I58080dfc8bb6ef9a86f2118407a05db8ae1ecfbd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use the move-only versions of result reporting and getting operations,
if the type of QFuture is not copyable.
Task-number: QTBUG-81941
Change-Id: Ic9fa978380e2c24e190e68d974051a650b0e5571
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
This maps to the CMake variable QT_USE_CCACHE.
Change-Id: I3258027301284d907f6ecde6c65d2c0dde8f0a11
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This maps to the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION.
Change-Id: Id0ce48f176b95c27e74ab80276e89503b1660f79
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Once we can require CMake 3.17 everywhere, we can remove the variable
set up from QtSeparateDebugInfo.cmake.
Change-Id: I91572583654054f5fa47ac1e41be23050a5a8c0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Cleaning up those that are trivial to remove because they have direct
replacements.
Change-Id: Ie9fecd8c4822ed1a8f378b210cc4c4d9a10f7e36
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Not used anywhere in qtbase or other modules, so trivial to remove.
Change-Id: I98575e77f181e617675e536ff0dd67ac93a2f0f5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Cleaning up those that are trivial to remove because they have direct
replacements.
The QLabel changes to the pixmap/picture getters provide the following
migration path:
QPixmap *ppix = l->pixmap(); // up to 5.15, warns in 5.15
QPixmap pval = l->pixmap(Qt::ReturnByValue); // new in 5.15, works in 6
QPixmap pixmap = l->pixmap(); // from Qt 6 on
The overload with argument can be deprecated after the first LTS or
so.
Change-Id: I8494ceeea55b2aeda0bd340640ad95cb7c91f7d6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
In a non-prefix build, the module .pri files must end up in the
mkspecs/modules subdirectory of qtbase's build directory.
Change-Id: I241f4e274d31de7c1e3c2fa8e5e26fb8747f11c5
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Implemented some necessary functionality to generate correct .pri
information, so that qmake can build modules.
Task-number: QTBUG-75666
Change-Id: I63281adfef3d01385928b1d8c4be0b32ac97c4d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit also adds a qt_finalize_module function that is called for
every Qt module after all link dependencies have been added.
Change-Id: I489d188d05e368208a8a62828bb12fb395df54bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This feature was removed in commit 60588e1a.
Change-Id: I061410dfab13a2210474014892d1bc828a5b21cf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In 73f3f501f3, the classes were
moved out of Qt Gui, and a mechanism to attach them to the
QOpenGLContext was implemented using a QMap and a connection
on destroyed to delete it.
This solution was not thread-safe, so the suggestion was to either
add a mutex or to make an opaque pointer for the storage in the
(thread-affine) QOpenGLContextPrivate.
I decided to go with the latter. A solution using hash lookups
and mutexes seems to complex when the only benefit is to avoid
forward declarations from Qt Gui to Qt OpenGL in private API.
Especially since this dependency already exists with
the "textureFunctions", which serve the same purpose,
although the destructor is being passed in as an explicit
function pointer there, probably because the ambition was
to use a forward declaration rather than a superclass.
Fixes: QTBUG-82742
Change-Id: I5c6b82c5b33d9cb73ad1ec05d3fc3e87a9eae4cf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
We don't want people accidentally installing tests into the
Qt prefix.
Change-Id: Ic99492559875f753897a83af162253cac846a8a5
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The install prefix in such a case is the qtbase build dir,
and not the qt6 top-level build dir. This caused issues with
certain incorrect paths being generated, including a broken
qt-cmake-standalone-test script, as well as upon reconfiguration
determining that a non-prefix build should be installed.
The fix for a non-prefix build is to check explicitly for
the qtbase build dir. This works both for super and non-super
builds.
Task-number: QTBUG-83496
Change-Id: Ida2393176c4c81da767023ff48159afdedfb0a19
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Instead of using CMAKE_INSTALL_RPATH to embed an absolute path
to prefix/libdir into all targets, use the more sophisticated aproach
that qmake does.
For certain targets (modules, plugins, tools) use relative rpaths.
Otherwise embed absolute paths (examples, regular binaries).
Installed tests currently have no rpaths.
On certain platforms rpaths are not used (Windows, Android,
iOS / uikit).
Frameworks, app bundles and shallow bundles should also be handled
correctly.
Additional rpaths can be provided via QT_EXTRA_RPATHS variable
(similar to the -R option that configure takes).
Automatic embedding can be disabled either via QT_FEATURE_rpath=OFF
or QT_DISABLE_RPATH=ON.
Note that installed examples are not relocatable at the moment (due
to always having an absolute path rpath), so this is a missing feature
compared to qmake. This is due to missing information on where
examples will be installed, so a relative rpath can not be computed.
By default a Qt installation is relocatable, so there is no need to
pass -DQT_EXTRA_RPATHS=. like Coin used to do with qmake e.g. -R .
Relative rpaths will have the appropriate 'relative base' prefixed
to them (e.g $ORIGIN on linux and @loader_path on darwin platforms).
There is currently no support for other platforms that might have a
different 'relative base' than the ones mentioned above.
Any extra rpaths are saved to BuildInternalsExtra which are re-used
when building other repositories.
configurejson2cmake modified to include correct conditions for the
rpath feature.
It's very likely that we will need a new qt_add_internal_app()
function for gui apps that are to be installed to prefix/bin.
For example for Assistant from qttools. Currently such apps
use qt_add_executable().
The distinction is necessary to make sure that relative rpaths are
embedded into apps, but not executables (which tests are part of).
Amends e835a6853b
Task-number: QTBUG-83497
Change-Id: I3510f63c0a59489741116cc8ec3ef6a0a7704f25
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Also fixed a few unrelated typos in docs.
Task-number: QTBUG-83236
Change-Id: I776cda8f0ef4de6c4a93e94092dc19e94d1884c8
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This is a follow-up to commit ed2b110b6a
to fix indexing errors. Added the test that should have accompanied
that commit, which found some bugs, and refined the Indian number
formatting test (on which it's based).
Make variable i in the loops that insert grouping characters in a
number be consistently a *character* offset - which, when each digit
is a surrogate pair, isn't the same as an index into the
QString. Apply the needed scaling when indexing with it, not when
setting it or decrementing it. Don't assume the separator has the same
width as a digit.
Differences in index no longer give the number of digits between two
points in a string, so actively track how many digits we've seen in a
group when converting a numeric string to the C locale. Partially
cleaned up the code for that in the process (more shall follow when I
sort out digit grouping properly, without special-casing India).
Change-Id: I13d0f24efa26e599dfefb5733e062088fa56d375
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QT_OPENGL_ES* macros are leftovers from an earlier,
ad hoc configuration system, which has since been
replaced by QT_CONFIG. To clean things up in Qt 6,
we use the new way instead.
Task-number: QTBUG-83467
Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The original was too close to QOPENGLVERSIONFUNCTIONS_H for comfort
so to avoid future confusion or errors, just use the convention
of matching the file name.
Change-Id: I57fcc4da239ddec329f75ac29b254b5909c39bf0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
And remove a test failure when compiling with asan enabled.
Change-Id: I2b8e676665572adcbbac6a910983d5b209bf6d23
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>