summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QtWidgets: Propagate event device when translating mouse eventsFriedemann Kleint2020-11-275-6/+12
| | | | | | | | | | | There are a few places left over, for example the QTextEdit creating mouse events in a timer and notably QGraphicsView. Task-number: QTBUG-88678 Task-number: QTBUG-46412 Pick-to: 6.0 Change-Id: I7ed23911be3b86b4b39fb478b947ec3b7a60761f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Change android target SDK version to 29Fabio Falsini2020-11-261-1/+1
| | | | | | | | | Play Store now accept only app with target SDK version set to 29 or above Pick-to: 6.0 Change-Id: If38f20c88fd6b0e6f29939cdf3d2eb793c0e1489 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QPushButton: fix support of style sheet rule for text alignmentXiang Xiaojun2020-11-261-2/+4
| | | | | | | Fixes: QTBUG-86857 Pick-to: 5.15 6.0 Change-Id: I7e3e2b5323b1e46f572cacfddae20cb6e7882a47 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Reduce the scope of variables in exec() and fetchNext()Zou Ya2020-11-262-7/+3
| | | | | | | | | | | | The scope of the variable 'currBind' can be reduced if the variable 'r' is not 0. So declare the variable when the variable 'r' is 0. The local variable 'i' shadows outer variable in fetchNext(), so move it to the front of switch. Don't declare 'res' until we need and initialize it. Change-Id: Idfb220b96cfbcd4088fd7858ed9392d0a3e10aea Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename Application ExampleVolker Hilsheimer2020-11-261-1/+1
| | | | | | | | | | Prefix it with "Qt Widgets -" to make it a bit clearer in the list of highlighted examples which module this one is about. Pick-to: 6.0 6.0.0 Change-Id: I0bf65b02db72173f1adfe0bcf8657be7905dbd6c Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QString/QByteArray: add erase() for iteratorsGiuseppe D'Angelo2020-11-264-0/+32
| | | | | | | | | | | | | Otherwise they're not usable with iterator-based algorithms that e.g. remove, partition and the like. [ChangeLog][QtCore][QString] Added erase(). [ChangeLog][QtCore][QByteArray] Added erase(). Change-Id: I78829b1a5365dd53b6b6423ceedbc52edeafbc63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QVLA: modernize some codeGiuseppe D'Angelo2020-11-261-25/+16
| | | | | | | | | | Use if constexpr instead of plain if; use C++17 algorithms instead of hand-rolled loops. Change-Id: Ifa092f892199b9b21bad04b2d72d5e3117a1b377 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QVLA: always use new to create new objectsGiuseppe D'Angelo2020-11-261-14/+3
| | | | | | | | | | | Even for non-complex types, it makes no sense to use the assignment operator instead of placement new when constructing new objects. Pick-to: 6.0 5.15 Change-Id: I5f15fe4b3397cf52d1d35e6c4dcc513b94b3cf14 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QEventDispatcherWin32Private: Get rid of TimerInfo struct listMaks Naumov2020-11-262-30/+20
| | | | | | | | | It was redundant with the timer info dictionary, and was even used where using the dictionary would have been more efficient. Change-Id: Ia656bf9b56c61e23df9f8743d8f8efbf65d37574 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
* QTextDocument: allow css border-style of table collapsed cell bordersChristian Ehrlicher2020-11-261-1/+1
| | | | | | | | | | | | 8664ee610d3d8bb8a2a578a6aa6bfd38afe4fcda added support for collapsed borders but set the style to solid no matter what border-style defined. Fix it by properly setting the desired border style. Task-number: QTBUG-36152 Change-Id: Ie527511f831e7f62ab7064d4958b35ddbf1a9403 Pick-to: 5.12 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* RHI: Reset attribute instancing properly for OpenGL ESPaul Olav Tvete2020-11-261-3/+24
| | | | | | | | | | | | Enabling instanced drawing will set glVertexAttribDivisor to 1 for the PerInstance attributes. This is of course a persistent state, because GL, so it will apply to all subsequent draw calls that uses attributes with the same location number, introducing weird and wonderful randomness. Therefore, make sure we set the divisor back to 0 for non-instanced attributes. Change-Id: I2d9115369fa24e8d57396d2a5f88d1435fe98971 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove deprecated algorithms from documentationMarcel Krems2020-11-262-319/+7
| | | | | Change-Id: Ie1eff48696c62ed23fedda1a9e711aeb8264432f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QSet: add missing insert-with-hintMarc Mutz2020-11-252-0/+19
| | | | | | | | | | | | | Since QHash is missing the overload, too, just ignore the hint for now, but provide the STL-compatible signature so generic code can use QSet as a normal sequential container. [ChangeLog][QtCore][QSet] Added insert() overload taking an insertion hint, for STL compatibility. Change-Id: I9fe41877343ebff721b650fb7b9cd4e06b6608d8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove some examples from highlighted listVolker Hilsheimer2020-11-251-3/+0
| | | | | | | | | | The Local Fortune examples and the JSON Save Game don't need to be highlighted in Qt Creator. Pick-to: 6.0 6.0.0 Change-Id: I7c7c9997e9a1cfb61f94309f16be65c810b42e14 Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Output source in debug operator of QMouseEventFriedemann Kleint2020-11-251-0/+4
| | | | | | | | Task-number: QTBUG-88678 Task-number: QTBUG-46412 Pick-to: 6.0 Change-Id: If9282f5b845ef16ff7e7ce523f78e3b8adfbef90 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Document removal of QEvent copyingVolker Hilsheimer2020-11-251-0/+39
| | | | | | Pick-to: 6.0 6.0.0 Change-Id: Ia4681fe5c5ae0953ba75f4ab24da4eec7461c719 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix link to Qt OpenGL C++ classesVolker Hilsheimer2020-11-251-1/+1
| | | | | | Pick-to: 6.0 6.0.0 Change-Id: Ia8d71cf48b2d0c3d0f6d3de81335c263eb5466c4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Change generated resources namingAlexey Edelev2020-11-241-1/+1
| | | | | | | | | | Align generated resources .qrc file naming to qmake naming. Update tests. Fixes: QTBUG-88581 Pick-to: 6.0 Change-Id: Id8a2f91f23c257e5b8bd371748c2151ec54a6418 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Use lower cased property name for entrypoint library opt-outAlexandru Croitor2020-11-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need this to enable headersclean functionality to work with CMake <=3.18 which is our minimum required CMake version to build Qt (it's not a problem for 3.19). Otherwise we hit a configuration error while trying to evaluate generator expressions for INTERFACE only libraries for which we need to do the headersclean check (e.g. UiPlugin in qttools). Sample error message: INTERFACE_LIBRARY targets may only have whitelisted properties. The property "QT_NO_ENTRYPOINT" is not allowed. More info: https://gitlab.kitware.com/cmake/cmake/-/issues/21484 Naming it lower case avoids the issue, but is inconsistent with all our other public property names. Furthermore if we do this change, it should probably go to 6.0.0 due to it being a property that a user is meant to set in their project. Task-number: QTBUG-82615 Change-Id: I1f1439f1e5cbc816010eba7301605a8f60b88fd1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 6ca66de9120537134b63d42de6c53c6e5834e8f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Return a QString() if the families list is emptyAndy Shaw2020-11-241-2/+2
| | | | | | Fixes: QTBUG-88781 Change-Id: Iafed2be29e2e0c3029e832986ba58d19446214eb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add font function to OffscreenTheme to run unit tests with offscreenAndreas Buhr2020-11-241-0/+14
| | | | | | | | | | | Two unit tests fail at the moment with the offscreen theme because the font function of the offscreen theme does not return a monospace font when asked for a monospace font. This patch fixes it. Change-Id: Id682c75e2a94b246cffe97b342b1b562bac82a68 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Update container overview documentation - section on growth strategiesAndreas Buhr2020-11-241-30/+14
| | | | | | | | | | | | The Qt container overview documentation contained outdated information on container growth strategies. This patch updates the documentation to reflect the current implementation. Task-number: QTBUG-86584 Pick-to: 6.0 Change-Id: I8fd014138f9a2e73925dafaa270d4c98ab672d96 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Re-fix the definition of primitive typesGiuseppe D'Angelo2020-11-241-1/+1
| | | | | | | | | | | The conditions are AND, not OR. Technically we don't rely on not having constructors any more, but we may reserve the right in the future to have uninitialized resizes. Change-Id: Icfae61079a544f7ac8e90a32ad605c12cfa8b4aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit bcd38a96149f5397375b57e948c05c7a8f172194) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Reduce the scope of variables in bindInValues()Huang Jie2020-11-241-4/+3
| | | | | | | | | The scope of the variables 'bind', 'field', 'i' can be reduced if the variable 'meta' is a null pointer. So declare the variables when the variable 'meta' is valid. Change-Id: I599406c034168dd73799c69dfb9c5e676861cdf2 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QStackedLayout: fix a memory leakGiuseppe D'Angelo2020-11-231-1/+3
| | | | | | | | A layout takes ownership of the QLayoutItem passed to addItem. Change-Id: Iea3c64453f3cbf4f1b5660e505c1a35dca537833 Pick-to: 6.0 5.15 5.12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Drop a [[maybe_unused]] on a variableGiuseppe D'Angelo2020-11-231-1/+1
| | | | | | | Turn it into an inline variable. Change-Id: Iab7fa2d53259ced0b1a78bf7368e0e862ba2c799 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid integer overflow and division by zeroAllan Sandfeld Jensen2020-11-231-3/+3
| | | | | | | | | | | | Restrain patterns to sensible lengths and values. [ChangeLog][QCosmeticStroker] Pen patterns are restrained to a maximum length and values of 1024, fixing oss-fuzz issue 25310. Pick-to: 5.12 5.15 6.0 6.0.0 Change-Id: If062f8336ff5ad113258391b0d70b8ac6f42c4b3 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* CMake: Fix entrypoint output directory when multi-config buildLi Xinwei2020-11-231-0/+1
| | | | | | | | | | | When multi-config build, the output directory of Qt6EntryPoint.lib is <build_dir>/lib/Release, the output directory of Qt6EntryPointd.lib is <build_dir>/lib/Debug. This behavior is different from other lib files. Both release and debug lib files should be outputted to <build_dir>/lib. Pick-to: 6.0 Change-Id: I81d284e4630afebb40ba90fe822dd5bda2b2036a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Return subclass type from overrides of QEvent::cloneVolker Hilsheimer2020-11-232-38/+38
| | | | | | | | | | C++ allows overrides to return a covariant type, so if calling code has already cast the callee down to the right type, don't require it to cast the returned clone down as well. Pick-to: 6.0 6.0.0 Change-Id: I802f00a3c78e03047046986d0ed0a479b47573b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up docs of QCalendar-related QLocale::toString() variantsEdward Welbourne2020-11-232-45/+63
| | | | | | | | | | | | | Some of the new functions were added without documentation, or without updating the docs to mention the optional calendars. Shuffle the methods so that the one with calendar is what the primary documentation comment describes and the one without is documented as an overload. Pick-to: 5.15 Change-Id: Iee4cdb1d3b0ed21a50e205a5275a0695a2667550 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Update CMake functions in Qt Widgets for Qt 6Kai Koehne2020-11-233-80/+12
| | | | | | Pick-to: 6.0 6.0.0 Change-Id: I4110e8695c75c40cec6f94bb94879b07282b29d3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Do not advise using AUTORCC anymoreKai Koehne2020-11-231-3/+0
| | | | | | | Task-number: QTBUG-87643 Pick-to: 6.0 6.0.0 Change-Id: Ib07586cc4206312044c0f0c154fa2ab2aada2c19 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Update CMake functions in Qt Core for Qt 6Kai Koehne2020-11-237-494/+115
| | | | | | Pick-to: 6.0 6.0.0 Change-Id: Ica6141f183c75f60e5b1031c0972f79de7821841 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QMetaType: Track whether type is QML list typeFabian Kosmale2020-11-232-0/+6
| | | | | | | | | This information is required in the QML engine to handle list properties (instances of QQmlListproperty<T> and list<T> types from QML). Pick-to: 6.0.0 6.0 Change-Id: I1e30572f1c91f58b290cb9b4b07433af99a1db6f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add convenience functions for QFuture creationIvan Solovev2020-11-232-1/+170
| | | | | | | | | | [ChangeLog][QtCore][QFuture] Add convenience functions to create a ready QFuture and a QFuture with an exception Task-number: QTBUG-86713 Change-Id: Ic7f9ca590a8ea8a9696b84f35bad074780794461 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-2315-120/+28
| | | | | | | We can depend on C++14 now. Change-Id: Iee9796cd22dbfbb70d4bdb25f0eee1662a026d6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Drop a [[maybe_unused]] on a variableGiuseppe D'Angelo2020-11-231-1/+1
| | | | | | | Turn it into an inline variable. Change-Id: I491bd8fee3d25f814587db5a1047f15990081d66 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* wasm: fix resizing of qwidget windowsLorn Potter2020-11-232-1/+36
| | | | | | | | | This also fixes the cursor changing during resize mode Fixes: QTBUG-85361 Pick-to: 5.15 Change-Id: Ic85a5c31a8a2dc4265a84f16fd5fcdc231062c6d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix mouse double clickLorn Potter2020-11-232-6/+21
| | | | | | | | | | Two issues here, timestamp value was getting smashed, and MouseButtonDblClick was not getting sent. Fixes: QTBUG-85712 Pick-to: 5.15 Change-Id: I912e968f1eb0fb9c6f4cf8548b114e23d182396e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMargins(F): add support for structured bindingGiuseppe D'Angelo2020-11-221-0/+60
| | | | | | | | | | | [ChangeLog][QtCore][QMargins] QMargins is usable in a structured binding. [ChangeLog][QtCore][QMarginsF] QMarginsF is usable in a structured binding. Change-Id: I0c501847b9377c47bd0e63da3735792075bd0079 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCache: fix accidental pessimizationMårten Nordheim2020-11-211-2/+1
| | | | | | | | | | | By unconditionally removing the existing entry we never hit the if (result.initialized) branch. Change it to only remove the existing entry if we don't plan on inserting. Task-number: QTBUG-88183 Pick-to: 6.0 6.0.0 Change-Id: If4e7ebac23aa63d4b9d4b0a22882dd7d90a58e8b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QGuiAppPriv: don't clear target and window for TouchCancelShawn Rutledge2020-11-211-2/+0
| | | | | | | | | | | | | It's nice not to leave garbage in QPointingDevicePrivate::activePoints between events; on the other hand, this garbage doesn't matter, because every press event sets the target and window independently, without caring what was stored there from before. But it was wrong to clear it before we've even delivered the TouchCancel event. Pick-to: 6.0 Pick-to: 6.0.0 Change-Id: I924039a7c7a8ed75f420d1837c63dc19d3cc98b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Delete move constructor and move-assignment for QEventVolker Hilsheimer2020-11-201-1/+3
| | | | | | | | | | As of 19f9b0d5f54379151eb71e98555b203ad6756276 we define a protected copy constructor and assignment operator. Static analyzers warn about missing move variants, so delete those in addition. Pick-to: 6.0 6.0.0 Change-Id: I28c1a2afd4560ce35a258bde507dafd93245b75b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWin32PrintEngine: fix compilationAlex Trotsenko2020-11-201-2/+0
| | | | | | | | | | | On MinGW32 it fails with error: .../src/corelib/global/global.h: 1186:34: error: unused variable 'q' ...qprintengine_win.cpp: 753:5: note: in expansion of macro 'Q_Q' Pick-to: 6.0 6.0.0 Change-Id: I8eb0e3c5b72f8542cd3bd11514b12d308481f250 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix weight when reading old serialized QFontsEskil Abrahamsen Blomfeldt2020-11-201-1/+4
| | | | | | | | | | | | | | | | | | The QFont::fromString() needs to differ between strings produced before and after Qt 6.0 when interpreting the weight value, since in older strings this will be the legacy scale. Luckily the number of tokens in the string can be used for this purpose, since many tokens were added in Qt 6.0. This broke KDE, where font settings are stored in QSettings and serialized using QFont::toString() from Qt 5. Fixes: QTBUG-88589 Pick-to: 6.0.0 6.0 Change-Id: I199737fed61917f8b9d8f86176ead29a89eb8e0c Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QLayout: add a way to unset user-defined contents marginsGiuseppe D'Angelo2020-11-202-0/+14
| | | | | | | | | | | | Once user-defined margins are set on a layout, there's no way to unset them, except by abusing setContentsMargins and passing -1, which is a total API abuse (does a negative margin mean that contents *overflow* the layout?). Add a proper function. [ChangeLog][QtWidgets][QLayout] Added unsetContentsMargins(). Change-Id: I089788a7470f9649a8f00e42914dafb7242f12cd Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Fix safe conversionAllan Sandfeld Jensen2020-11-201-4/+11
| | | | | | | | | | | Ensure the resulting QScFixed values are no larger than can be safely returned to int after shifting the fixed factor away. Pick-to: 6.0 6.0.0 Fixes: QTBUG-88683 Change-Id: Id0754b021e5fa9a3cf0d15e37ac643cfc1509993 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QCoreApplication: add doc to discourage use of processEventsThiago Macieira2020-11-201-4/+8
| | | | | | Change-Id: If51855da004b4f3fbf43fffd1648fc580c00224a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QCoreApplication: add more information to processEvents() docsThiago Macieira2020-11-201-0/+3
| | | | | | | | | Just shows how bad an idea to call this function it is. Pick-to: 5.15 Fixes: QTBUG-88653 Change-Id: If51855da004b4f3fbf43fffd1648fc294065160d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Fix build of plugins/styles/mac using PCHCristian Adam2020-11-201-0/+7
| | | | | | | | | | | | | | If a target inherits precompile headers from a different target that has more languages enabled (CXX, OBJCXX), the target will depend on PCH artifacts for a language that is not actually present. Ammends d9d137c8f39b8aa77b28b12fcb6f1642ca650291 Fixes: QTBUG-88609 Pick-to: 6.0.0 6.0 Change-Id: I9735317e634b62732df0fce84fe7cf229cfdea1b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>