summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Document which header to include for the various native interfacesTor Arne Vestbø2021-12-042-0/+4
| | | | | | | Fixes: QTBUG-98654 Pick-to: 6.2 Change-Id: Ic5ea3cc7d90ed336a5b6e827d1523bdd58fabc13 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStringBuilder: Add support for QByteArrayViewMårten Nordheim2021-12-042-0/+25
| | | | | | | [ChangeLog][QtCore][QStringBuilder] Added support for QByteArrayView. Change-Id: If2c23549d533dd31c320f3ee455fcd01ea5b460a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QNAM: Reintroduce h2c with an attributeMårten Nordheim2021-12-046-6/+107
| | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkRequest] Added QNetworkRequest::Http2CleartextAllowedAttribute which controls whether HTTP/2 cleartext (h2c) is allowed or not. The default is false. This replaces the QT_NETWORK_H2C_ALLOWED environment variable. Task-number: QTBUG-98642 Change-Id: I43ae1cc671788f6d2559cd316f6667b412c8e75e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* MSVC: Use dubbed FH4 to make C++ exception handling smallerYuhang Zhao2021-12-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Visual Studio 2019 introduced the dubbed FH4 feature which can make C++ exception handling smaller on x64. According to the article [1], it's enabled by default for UWP applications, and Microsoft also use it in their own widely-known commercial products such as Office to reduce the binary size. So make use of this feature for Qt when possible, to get smaller binary. As a drive-by, add "/EHs-c-" explicitly to the flags when we want to disable C++ exception handling. [1] Official article that introduces dubbed FH4: https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/ Change-Id: I2e3330de477f78372cf7903d0ef7a732b09552a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QFile: Add open() overload that accepts permissions argumentIevgenii Meshcheriakov2021-12-043-1/+101
| | | | | | | | | | | | | | | The new overload allows creation of files with non-default permissions. This is useful when files need to be created with more restrictive permissions than the default ones, and removes the time window when such files are available with less restrictive permissions. [ChangeLog][QtCore][QFile] Added QDir::open() overload that accepts permissions argument. Fixes: QTBUG-79750 Change-Id: Iddfced3c324e03f2c53f421c9b31c76dee82df58 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAbstractFileEngine: Add permission argument to open()Ievgenii Meshcheriakov2021-12-0417-27/+71
| | | | | | | | | The new argument allows atomic creation of files with non-default permissions. Task-number: QTBUG-79750 Change-Id: I4c49455b41f924ba87148302c8d0f77f5de0832b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Don't change resolve mask when setting brush doesn't change paletteVolker Hilsheimer2021-12-032-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 556511f9f39ddc887481e0cd5a877134ceb0da6b, which moved the resolve mask storage into the palette's d-pointer, modifying the resolve mask requires a detach. As of now, we only detached when setting a different brush, but always modified the resolve mask, which broke palettes that shared the d-pointer (likely the global default palette). However, detaching has negative side effects when styles set brushes on temporary palette objects and then use that palette object's cache key to build a cache of pixmaps. As each drawing would detach the palette (even if the palette doesn't change, which is likely), the cache key changes with each detach, and the cache would quickly increase in size. This was addressed in changes d7bcdc3a442b99c2caebd4cfd38de67e14090e05 and 1e75dcf2518e37a7b83d006a4e002f972615b43b. We can either detach and find other ways to address the issues from QTBUG-65475, or we can not change the resolve mask when the brush doesn't change and completely ignore the call. Since QFont ignores the setting of any attribute to a value that is identical to the current value, and since it's possible to force that the resolve-bit is set by calling setBrush twice with different brushes, ignoring the call seems like the better solution. [ChangeLog][QtGui][QPalette] Setting a brush on a palette that is identical to the current brush no longer sets the resolve mask bit for that particular role, so items using the palette will continue to inherit changes from parent items. Fixes: QTBUG-98762 Task-number: QTBUG-65475 Pick-to: 6.2 Change-Id: Ife0f934b6a066858408ef75b7bb7ab61193ceb47 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add QFontComboBox::setDisplayFontAlbert Astals Cid2021-12-032-0/+28
| | | | | | | | | Allows changing the font used to display a font family [ChangeLog][QtWidgets][QFontComboBox] Added the setDisplayFont() function, in order to be able to control the font used to render the font name and sample text (when previewing the fonts). Change-Id: I94bfef43142c5346237e3069449bd19dbacb7420 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add QFontComboBox::setSampleTextAlbert Astals Cid2021-12-032-21/+80
| | | | | | | | | Allows setting the sample text to be used [ChangeLog][QtWidgets][QFontComboBox] Added the setSampleText() function, in order to be able to control the sample text displayed by the combobox (when previewing the fonts). Change-Id: Iedcd3bb72bc6aec9a178f14f7fbbe324ba0223ef Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QSystemTrayIcon example: ignore non-spontaneous QCloseEventShawn Rutledge2021-12-032-8/+5
| | | | | | | | | | Apparently this code is needed on other platforms now, not only macOS. Pick-to: 6.2 Fixes: QTBUG-98504 Change-Id: Ie0a7e38609e8fc8c11915784dd3652a3517bb639 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* androiddeployqt: Fix signing of paths with spacesKai Köhne2021-12-031-21/+24
| | | | | | | | | | Only use shellQuote() if the path is actually passed to a native API. For QFile API, use the unquoted path. Fixes: QTBUG-97649 Pick-to: 5.15 6.2 Change-Id: I9d8131819010bbd2faa8a81eef367245d90a767f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QFontDatabase: unify relevant documentation piecesAndrei Golubev2021-12-031-9/+3
| | | | | | | | | | | | | | | | addApplicationFont and addApplicationFontFromData basically do the same thing (with one reading the data from a file and another reading it directly from QByteArray) The documentation is not quite identical, so fix that by using \include magic of qdoc As a drive-by, remove outdated \note within addApplicationFont() description Fixes: QTBUG-98752 Pick-to: 5.15 6.2 Change-Id: I29738e7411d241c26a4b2e1dd91d0af867fcc111 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QLayoutPolicy: fix annoying -Wdeprecated-enum-enum-conversionMarc Mutz2021-12-031-10/+10
| | | | | | | | | | | | | | | | | | | | Says GCC -std=c++20: src/gui/util/qlayoutpolicy_p.h:127:30: warning: bitwise operation between different enumeration types ‘QLayoutPolicy::Policy’ and ‘QLayoutPolicy::PolicyFlag’ is deprecated [-Wdeprecated-enum-enum-conversion] 127 | if (verticalPolicy() & ExpandFlag) | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ Fix by making Policy a QFlags<PolicyFlag>, which we can do because the class is private. In QSizePolicy, this would break BC. Since a QFlags cannot be opened for constants like an enum, we need to define the ex-Policy-enumerators as static inline constexpr objects instead. Pick-to: 6.2 Change-Id: I29bc938f86508deed3f99ad9d1c1892547206c05 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QSizePolicy: make qHash() a hidden friendMarc Mutz2021-12-032-5/+3
| | | | | | | | | | | | | | Less noisy compiler error messages. [ChangeLog][Potentially Source-Incompatible Changes][QSizePolicy] qHash() is now a hidden friend and can only be called by unqualified (qHash(sp)), not by qualified lookup (as in, say, ::qHash(sp) or QT_PREPEND_NAMESPACE(qHash)(sp)). Task-number: QTBUG-98863 Change-Id: I37d26c661c2d8bb74350eb9378bd19fa426678d2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Android: add methods to get the FileDescriptor for a UriAssam Boudjelthia2021-12-031-0/+32
| | | | | | | | | | | | | This can be useful for some cases when the Android APIs have calls that expects a FileDescriptor instead of a Uri or an int file descriptor (like a case in Qt Multimedia with MediaRecorder). Pick-to: 6.2 Task-number: QTBUG-96081 Task-number: QTBUG-96957 Change-Id: I0ab8d37a43b7cb94f6ebb5d48014e5a7903aadc7 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: simplifications to exception messages for content file handlingAssam Boudjelthia2021-12-031-76/+63
| | | | | | | | | | | | | | | | The method getUriWithValidPermission() now returns null only if the Uri couldn't be parsed, otherwise, returns the parsed Uri and fail later when used if it doesn't have permissions for example. Also, Don't use use hardcoded strings for method names, and print the exception message instead of the whole stack. Pick-to: 6.2 Task-number: QTBUG-96081 Task-number: QTBUG-96957 Change-Id: If7ba88265c9683e6660cb483cfee6c22016f2976 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* QPA: Set focus reason when window activation changes focusVolker Hilsheimer2021-12-037-10/+46
| | | | | | | | | | | | | | | QApplication hides the fact that the reason is never set by several QPA plugins, but Quick items don't receive the correct reason on Windows, Android, the offscreen plugin, and other platforms. Add relevant scenario to the QFocusEvent test case, and fix the plugins to always set the focus reason when handling window activation changes. Exclude the minimal plugin from the test, it seems largely unmaintained anyway. Task-number: QTBUG-75862 Change-Id: I5404a225b387fc9a3851b6968d0777c687127ed1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Repair parameter typeChunLin Wang2021-12-035-5/+5
| | | | | | | | | Fix the parameter types corresponding to the sample code and subclasses Fixes: QTBUG-98578 Pick-to: 6.2 Change-Id: I06e342ae1210ed53c5deec3e2711457cf2ac5b15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6Marc Mutz2021-12-032-9/+0
| | | | | | | There are no users left in the tree. Change-Id: I336f4e15c0ec1f5933c1fcfa661bad85bd38ed35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove XCB_EVENT_MASK_RESIZE_REDIRECT for Qt:WindowTransparentForInputInho Lee2021-12-031-1/+1
| | | | | | | | | | | | | In xcb plugin, XCB_EVENT_MASK_RESIZE_REDIRECT is set but it is not necessary. Mouse events are disabled by setTransparentForMouseEvents and there is no reason to have this event mask. Fixes: QTBUG-86372 Pick-to: 6.2 5.15 Change-Id: I2124b0684a0847d6705344bb5850bac178a292b6 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Text editing: smart block and char format after newlineShawn Rutledge2021-12-023-1/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you are editing in a QTextEdit and press enter to start a new line, calling insertBlock() with no arguments tries to preserve the current charFormat and blockFormat. That is often OK: - if you hit enter at the end of a list item, you probably want another item in the same list - if you are writing code inside a code block, you're probably just writing the next statement on the next line: stay in the same block - margins, indents, tab positions should stay the same (but hopefully your editor has UI to manually reset the block format to default in case you are not continuing in the same style) But there are some exceptions we can apply to be helpful: - nobody ever wants to follow an <hr/> with another one (but hopefully the application has an action to insert one manually) - a heading is more likely to be followed by a paragraph, or perhaps a smaller heading; another heading at the same level is unlikely. We need to reset the char format, not only the block format, because the large font and heavy font weight are stored there. - when adding to a todo list, hitting enter at the end of the last task, let's assume the next task is not yet done, so it will be unchecked by default (else, why are you writing a todo list at all) To achieve that, we need to customize the formats and call the insertBlock() overload that takes them. The no-argument insertBlock() will continue to preserve the formats, because it's an old API that is used for much more than interactive editing. Additionally, word processors tend to let you end a list (for example) by hitting enter twice. In that case, you stay in the same paragraph that you created the first time you hit enter, but now the formats are reset to default, so that you can go on typing an ordinary paragraph, rather than having to mouse up to the toolbar to select the paragraph style in a combobox, or something like that. So we now do that: reset both block and char formats after you hit enter on a blank line; but if you then hit enter again, after the block format has been reset, then you will get the actual blank line (empty block) inserted. [ChangeLog][QtWidgets][QTextEdit] Hitting enter at the end of a line with a special block format (horizontal rule, heading, checklist item) now makes some "smart" adjustments to avoid retaining properties that are unlikely to be continued on the next line. Hitting enter twice now resets block and char formats to default. Fixes: QTBUG-48815 Task-number: QTBUG-80473 Fixes: QTBUG-97459 Change-Id: I3dfdd5b4c0d9ffb4673acc861cb7b5c22291df25 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* android:qmake: Fix static libraries to include the QT_ARCH suffixAlexandru Croitor2021-12-021-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building a shared library (with qmake) in a user project targeting Android, the library gets a QT_ARCH suffix added to its name. This suffix is not added when building a static library (CONFIG += staticlib). In the context of a multi-abi android qmake build, all the arch specific static libraries would have the same name and would override each other. This happens with Qt 5.15 and it would also happen in Qt 6, but we don't support multi-abi qmake builds in Qt 6 so far. When the original fix to include the arch suffix for shared libraries was done in Qt 5, d463a63bb94d3f5c9530790541d9706490e44b3a it was likely an oversight that it was not applied to static libraries as well. The !static part of the condition was added in 72d4f0750baae1bb296341bde166f020d29c7faa . The change only handled installation responsibilities, not naming of libraries. Fix static libraries to include the arch suffix, but only in Qt 6. It's too late to fix it in Qt 5, there might be projects that rely on there not being a suffix in static library names. Adding the suffix would suddenly cause linking errors. Amends d463a63bb94d3f5c9530790541d9706490e44b3a [ChangeLog][Android][qmake] Static libraries targeting Android will now include an arch suffix when built using qmake. Fixes: QTBUG-83165 Change-Id: I6f68dcb74cec30b4c8f0bc5a819d89843e9d695e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* OpenSSL: handle renegotiate errors by comparing certsMårten Nordheim2021-12-022-2/+52
| | | | | | | | | | | | If the certificate didn't change then our trust in it didn't either. Sadly, cannot have an autotest because we don't have any way to facilitate a renegotiation at the moment and with TLS 1.3 not having them at all it's unlikely we ever will. Pick-to: 6.2 5.15 Task-number: QTBUG-92231 Change-Id: Ibaa9b2f627daca05021c574e69526710aacdadae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Exclude INTEGRITY artifacts from Archivation step on CITatiana Borisova2021-12-021-0/+5
| | | | | | | | - there is no possibilities for running autotests on CI Pick-to: 6.2 Change-Id: I15f0c600172ec4962edf3716a651483982c4f8c6 Reviewed-by: Toni Saario <toni.saario@qt.io>
* Use Android's View.generateViewId() for generating ids for views/surfacesMichał Cieślak2021-12-021-3/+7
| | | | | | | | | | | Qt Android was using consecutive numbers starting from 1 as ids for View.setId(int). The ids are used internally with an assumption that they are unique. It was potentially leading to collisions and unexpected behavior when adding custom views with id generated by View.generateViewId(). Task-number: QTBUG-98649 Pick-to: 5.15 6.2 Change-Id: I5bf2fe1d196c7adafeec544d8d945ebd82ba5cb6 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Close leak of QOCIDateTime objectEdward Welbourne2021-12-021-0/+1
| | | | | | | | | | | Noticed while reviewing usage of this type. The code has a whole TempStorage class to take care of keeping allocated memory live until we're done with it, explicitly including date-time objects as a special case, but neglected to use it in one place. Pick-to: 6.2 5.15 Change-Id: Ic94c56d67dda6dc3ee36a025a2e0149f6b2a1837 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Reduce scope of a hack using volatile in favor of viewAt()Edward Welbourne2021-12-021-11/+7
| | | | | | | | | | | We can now get qt_configure_strs to tell us the size of the string, as well as its start, bypassing the strlen()-calling branch of fromLocal8Bit() that caused the need for a hack using a volatile variable. However, QT_CONFIGURE_SETTINGS_PATH still needs the volatile hack. Change-Id: I0181abf512123e6355acdd506d6845c3fb75c0e3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restrict clang warning disabler to affected versionsEdward Welbourne2021-12-021-0/+2
| | | | | | | | | | | Apparently -Wdeprecated-copy got added between clang 9 and 11. Versions without it warn about the attempt to suppress this option's warnings. This follows-up on commit 8662fbdd7e0c8c5b089a3c9871ae0cd71790858e Change-Id: I7fe9258cfe8a79d24c1f8b331a56468415b25cdb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qnx: Fix typos in source code commentsJonas Kvinge2021-12-023-3/+3
| | | | | Change-Id: I6420e14e3de9c7efc7d5073f44ccfd7ee9b88ea6 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* android: Fix typo in source code commentJonas Kvinge2021-12-021-1/+1
| | | | | Change-Id: Ieeab35d51588cf247c3d9626d0291e2983720873 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QString et al: fix lastIndexOf() API asymmetryMarc Mutz2021-12-025-4/+41
| | | | | | | | | | | | | | | | | Commit 6cee204d56205e250b0675c9c6d4dd8a2367f3c4 introduced overloads of lastIndexOf() which drop the 'from' argument, inadvertently fixing QTBUG-80694, but failed to provide the new overloads for all existing lastIndexOf() overloads, making the fix for QTBUG-80694 incomplete. This patch completes the fix, by adding the missing overloads (for char-likes) and also adds the missing (non-regex) tests to tst_qstringapisymmetry. Also amends 1c164ec7f21a78025475c561a70b94d1e3dd6bb6. Fixes: QTBUG-80694 Change-Id: Ib4b3d597d658ce2edf01a2bce0d711ecea593d6e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Support to get timing from pagefilpElvis Lee2021-12-033-3/+14
| | | | | | | | | Handle the timing from drmEvent when page flip finished. The information can be used to optimize rendering timing. Change-Id: I14612ca48a8fea5208aa74949d7543787e860c5f Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix dependency chain that collects the metatype json filesAlexey Edelev2021-12-0215-37/+447
| | | | | | | | | | | | | | | | | | | | | cmake_automoc_parser has the logic preventing the run of moc with the --collect-json parameter if metatype json files are not changed. This logic only verify if the file list is changed but not their content. This change adds a timestamp file that contains the last metatype json file timestamp that was modified during the last cmake_automoc_parser run. The logic still prevents of running 'moc --collect-json' when the list of metatype json files is not changed, but also checks if their content is no changed. Another approach it to generate the depfile that can be utilized by CMake in add_custom_command as DEPFILE argument. But this concept only works from the second build attempt because of an issue related to dyndep. Pick-to: 6.2 Fixes: QTBUG-98532 Change-Id: I713f8bfa9ae769cefe0beac0b7fa19750b00a765 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace BUILD_OPTIONS_LIST variable by the getter functionAlexey Edelev2021-12-021-54/+70
| | | | | | | | | Encapsulate configuration options in a function and use it instead of a globally defined variable. Pick-to: 6.2 Change-Id: I5c69c207788fe069fdd046b68a6bc58aa16e71b4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QTableView: correctly toggle column selection when scrolledVolker Hilsheimer2021-12-022-1/+57
| | | | | | | | | | | | | | | | We need to check whether the horizontal header's selection includes the index for the row at the top, rather than for row 0, as the index we check is based on the scrolled position of the header, so would never be included in the top row when the view is scrolled. This is correctly done in selectRow already. Add a test case that simulates selection of rows and columns by clicking on the header. Fixes: QTBUG-98444 Pick-to: 6.2 Change-Id: I2fa1b32bf75dc96225b40145b713bf7e2ffc29dd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Don't let text table cells shrink below their minimum widthVolker Hilsheimer2021-12-022-1/+61
| | | | | | | | | | | | | | We calculate the minimum width, but then use it only to make sure that the maximum width is at least as large as it. Without setting the layout struct's minimumWidth as well, table cells can be smaller. Add a test case. Fixes: QTBUG-86671 Fixes: QTBUG-97463 Pick-to: 6.2 5.15 Change-Id: Idf4ad015938abb8d3e599e9a58e002f29c0067be Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Update latest qt license agreementJani Heikkinen2021-12-021-852/+836
| | | | | | | | Change-Id: Idc5346bbdd05646ad8eee754d1d708bc59d704fc Reviewed-by: Tino Pyssysalo <tino.pyssysalo@qt.io> Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io> (cherry picked from commit eae95814a46386f8930eeae5486513a78a7a4ddc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix size_t / int conversion warnings in qmakeKai Köhne2021-12-021-2/+2
| | | | | | | | | | | Fixes qtbase\qmake\generators\makefiledeps.cpp(985): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data qtbase\qmake\generators\makefiledeps.cpp(986): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Pick-to: 6.2 Change-Id: I7c6b4f36dc383db420c10d674666d58dbf29d2dd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use depfile to control ABI-specific builds of executable targetsAlexey Edelev2021-12-022-18/+57
| | | | | | | | | | | | | qt_internal_${target}_copy_apk_dependencies should use CMake DEPFILE approach when it's possible. Since we don't have any specific artifact that androiddeployqt can produce when collecting dependencies this change adds simple timestamp file that is touched each time when androiddeployqt is running. The timestamp is used then as a file-level dependency for the qt_internal_${target}_copy_apk_dependencies target. Task-number: QTBUG-88841 Change-Id: I985535c7b6e471cb4cfbf90128628087dadc72d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change the external projects approach for multi-abi buildsAlexey Edelev2021-12-023-35/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating external projects that build the project tree for each target, this creates a single project for each ABI that have the common for all targets configure steps. Each executable target then adds additional build step to each ABI-specific external project, that builds and copies dependencies to the "main" project build tree. To resolve dependencies from the build tree, when building multi-abi apk instead of scanning the build directories of external projects for dependencies, it makes sense to run androiddeployqt for each ABI-specific external project to copy all necessary libraries. This is done by adding --copy-dependencies-only flag to androiddeployqt that only copies the apk dependencies, but avoids creating apk and all the essential steps. The ABI-specific external project now handles the deploying of the build artifacts to the end-point apk deployment directory and the "main" project assembles the apk using collected artifacts. The ABI-specific external project uses the qt_internal_${target}_copy_apk_dependencies target to run androiddeployqt with the introduced --copy-dependencies-only flag. TODO: Build steps that build and copy the ABI-specific apk dependencies are non-skipable and will run each time top-level build is triggered. This behavior should be fixed by adding dependencies to the generated by androiddeployqt DEPFILES for each ABI in the top-level build. Task-number: QTBUG-88841 Tash-number: QTBUG-94714 Change-Id: Id442a9fbd589f58b70f4204c5215645056b379a2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Freetype: adjust underlinePosition to match our expectationsMårten Nordheim2021-12-021-1/+2
| | | | | | | | | | | | | | | | | We expect underlinePosition() to be the topleft corner of where we start drawing the underline but freetype reports the _center_ of the underline: "underline_position: [...]. It is the center of the underlining stem." - https://freetype.org/freetype2/docs/reference/ft2-base_interface.html Pick-to: 6.2 5.15 Fixes: QTBUG-62602 Change-Id: I96808816f50f3f37b18f579adf285502c88e6ea5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Document the example showing the benefits of using bindable propertiesSona Kurazyan2021-12-0213-0/+281
| | | | | | | | | | | And mention the example in the bindable properties docs. Pick-to: 6.2 Task-number: QTBUG-97655 Change-Id: I676e90dbda66c2e718c7f6c2240fac608a8653df Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add example showing the benefits of using bindable propertiesSona Kurazyan2021-12-0224-0/+1492
| | | | | | | | | | | | | Added two examples for modeling a subscription service: signal/slot connection-based and bindable property-based. The examples are based on the example from Fabian's Qt WS talk about the bindable properties. Pick-to: 6.2 Task-number: QTBUG-97655 Change-Id: I0345913b8b6e5c40b8477e128d36483598bdfcaa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Install MSVC debug information for resource object librariesJoerg Bornemann2021-12-022-1/+32
| | | | | | | | | | | | | | | | Building against a static debug MSVC Qt produced LNK4099 warnings (PDB was not found with object file). This was because we did not install the .pdb files for the object libraries that are created for Qt resources. Now, these .pdb files are named like the object library targets and are installed next to the object files. Pick-to: 6.2 Fixes: QTBUG-97699 Change-Id: I7e23f8392b7ac657be1d2fb3b33e051ae2e4d407 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix overlapping text for Osaka font on macOSEskil Abrahamsen Blomfeldt2021-12-022-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | The Osaka font on macOS has all zeroes in the OS/2 table, probably because it is not intended to be cross-platform. In Qt 6 (since f761ad3cd9ad1252f24b76ae413298dc7bed8af3) we are trying using the same vertical metrics on all platforms, but this only works if they are valid. To work around this issue, we detect the case when ascent/descent values are both 0, since this is very unlikely to be intentional, so we fall back to the system-provided ascent and descent in these cases. Adding the test also revealed that we had missed the check for a macOS-specific bitmap font format when skipping the check for bitmap fonts in 7a18b7e2c2394b2b2cc95833c755f91193d9ba2e. [ChangeLog][macOS][Text] Fixed a problem where using the Osaka font would lead to overlapping text. Pick-to: 6.2 Fixes: QTBUG-96880 Change-Id: Ifea7918641a68829e8f5ef20a4fb61c0a7e5b757 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix fail to activate first sub window with QMdiArea::TabbedViewZhang Yu2021-12-022-0/+61
| | | | | | | | | | | | | | | | | | | The first sub window added will activate itself automatically, and isActive is set to true. Therefore the call to setActiveSubWindow to activate the first sub window will be ignored. When showing the mdiarea, all sub windows will be activated in the order in which they were added, so the active window will always be the last sub window added. Fix this by setting isActive to false so that setActiveSubWindow activates the first sub window when the mdiarea becomes active. Fixes: QTBUG-92037 Pick-to: 6.2 Change-Id: Id4a793e2059803c1a4ada916fdae2d3cc02cdf06 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QVarLengthArray: make static if's constexprMarc Mutz2021-12-021-5/+5
| | | | | | | | | | | Cleaner. Probably also more efficient at compile time, who knows? Also more consistent, since _some_ static if's were already constexpr'ed. Change-Id: I9657f7cf2166975f562db52e9f90630aaf412986 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix missing characters or assert with certain font sizesEskil Abrahamsen Blomfeldt2021-12-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The alphaMapBoundingBox() only exists to prefetch the size of rendered alpha maps, to reserve space in the glyph cache. Since 104e6d0f5427f5ebaab106b1651eb76c4c56df98 we have not used the QPainterPath fallback code path when actually rendering the glyphs, but that patch neglected to update the code that retrieved the bounding box. This could in some cases cause a mismatch, and if the alpha map we ended up with in the end was larger than the reserved space, this could trigger an assert or an empty spot in the cache. [ChangeLog][Text][Freetype] Fixed an issue where characters would in some rare cases be missing from text, depending on font metrics, font size and system scale factor. Pick-to: 5.15 6.2 Fixes: QTBUG-86633 Change-Id: Ic8ade168115e4f51bac71539325936bbae993120 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Turn on autotest build for INTEGRITY on CITatiana Borisova2021-12-014-5/+5
| | | | | | | | - add INTEGRITY tests to CI for qtbase Pick-to: 6.2 Change-Id: I7c7b0cb2639a086c1d53bea2d2e682d4c0fb2581 Reviewed-by: Toni Saario <toni.saario@qt.io>
* Don't shrink a column when it spans multiple columnsVolker Hilsheimer2021-12-012-0/+30
| | | | | | | | | | | | | | | | | | If a cell spans multiple columns, then the merged cells' starting column's maximum width should never become smaller than what was calculated from previous rows. Otherwise, we'd distribute the space of the column that has a span across all merged columns, resulting in unnecessary line breaks esp if WrapAnywhere is enabled. Add a test case. Fixes: QTBUG-91691 Fixes: QTBUG-95240 Pick-to: 6.2 5.15 Change-Id: Ic27dbdb128071e50fba049de85c9f23ba2f059b3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>