summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated QPrinter and QPagedPaintDevice APIsVolker Hilsheimer2020-09-044-638/+290
| | | | | | | | | | | Adjusting the QPrinter test case - some use cases no longer exist, or are already tested in QPageSize and QPageLayout tests. Adjust examples and manual tests. Change-Id: I01cbc65f3d8031aea2dac86dd942126ba708b111 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix flaky QFutureWatcher::startFinish() testJarek Kobus2020-09-031-11/+22
| | | | | | | | | | | | | | | | | | Since waiting for a spy employs polling, it may happen that while waiting for a startedSpy we had received already a signal for finishedSpy. This explains current flakiness. The fix is to connect to lambdas instead and update the hit count accordingly. Inside lambdas we also ensure the correct order for started / finised signals. After waitForFinished() unblocks we ensure that possible pending asynchronous signals (started / finished) are processed and check the final state. Task-number: QTBUG-83076 Change-Id: I16963ef9c011cb613d7b409d3e3032303a942336 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove timeStep parameter from QAnimationDrive::advanceAnimationVolker Hilsheimer2020-09-031-2/+2
| | | | | | | | | | | | | | Addresses ### Qt 6 comment, and documentation pointing out that the parameter value is ignored. It wasn't ignored in the code, but that's the kind of change we can make now. With this change, QUnifiedTimer::updateAnimationTimers is only called with -1 as the currentTick input parameter, also from Qt Declarative. Make it default, so that leaf modules can be fixed. Once that it done, the parameter can be removed completely. Change-Id: I80c57ff92f3b615b932dd73d711cf6397347efd8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Extend test blacklisting from Ubuntu 18.04 to 20.04Tor Arne Vestbø2020-09-034-0/+4
| | | | | | Task-number: QTBUG-86187 Change-Id: I3ac3233f7355d1c16bc9bf6e052fdf4bd9ea90de Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Reimplement QSequentialIterable using QMetaSequenceUlf Hermann2020-09-032-33/+50
| | | | | Change-Id: Ie721a5f0caa697c4bf15a81f3762cf79d3c54f5a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Ignore weight in .ui files instead of converting itEskil Abrahamsen Blomfeldt2020-09-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | In 3558704ed5c3d2c6dc6d024dfa454997469ca75f, we added code to support old .ui files which used the old integer scale for font weights by checking for a special attribute which would help separate new and old files. Since then, it has become apparent that the weight element in .ui is not actually used for anything, since it is only emitted when the bold flag is set and always has to match QFont::Bold in these cases. So instead of converting, we simply ignore it now, and respect the bold flag instead. This also reverts the changes to ui4.* in uic, since the scale attribute is no longer needed. Task-number: QTBUG-42248 Change-Id: I1898868b58004099590f4eaf01f24c57bd34d779 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Long live QKeyCombination!Giuseppe D'Angelo2020-09-037-2/+338
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++20 via P1120 is deprecating arithmetic operations between unrelated enumeration types, and GCC 10 is already complaining. Hence, these operations might become illegal in C++23 or C++26 at the latest. A case of this that affects Qt is in key combinations: a QKeySequence can be constructed by summing / ORing modifiers and a key, for instance: Qt::CTRL + Qt::Key_A Qt::SHIFT | Qt::CTRL | Qt::Key_G (recommended, see below) The problem is that the modifiers and the key belong to different enumerations (and there's 2 enumerations for the modifier, and one for the key). To solve this: add a dedicated class to represent a combination of keys, and operators between those enumerations to build instances of this class. I would've simply defined operator|, but again docs and pre-existing code use operator+ as well, so added both to at least tackle simple cases (modifier + key). Multiple modifiers create a problem: operator+ between them yields int, not the corresponding flags type (because operator+ is not overloaded for this use case): Qt::CTRL + Qt::SHIFT + Qt::Key_A \__________________/ / int / \______________/ int Not only this loses track of the datatypes involved, but it would also then "add" the key (with NO warnings, now its int + enum, so it's not mixing enums!) and yielding int again. I don't want to special-case this; the point of the class is that int is the wrong datatype. Everything works just fine when using operator| instead: Qt::CTRL | Qt::SHIFT | Qt::Key_A \__________________/ / Qt::Modifiers / \______________/ QKeyCombination So I'm defining operator+ so that the simple cases still work, but also deprecating it. Port some code around Qt to the new class. In certain cases, it's a huge win for clarity. In some others, I've just added the necessary casts to make it still compile without warnings, without attempting refactorings. [ChangeLog][QtCore][QKeyCombination] New class to represent a combination of a key and zero or more modifiers, to be used when defining shortcuts or similar. [ChangeLog][Potentially Source-Incompatible Changes] A keyboard modifier (such as Qt::CTRL, Qt::AltModifier, etc.) should be combined with a key (such as Qt::Key_A, Qt::Key_F1, etc.) by using operator|, not operator+. The result is now an object of type QKeyCombination, that stores the key and the modifiers. Change-Id: I657a3a328232f059023fff69c5031ee31cc91dd6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* pro2cmake: Fix qmake parser's line continuation handlingJoerg Bornemann2020-09-022-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | The qmake parser of pro2cmake handles completely commented lines to make assignments like this work: SUBDIRS = \ foo \ # bar \ bar However, assignments like SUBDIRS = \ foo \ #bar \ bar were cut off at the commented line. Fix this by allowing leading whitespace for "fully commented lines". Change-Id: Ib5de850a02fd9b9ebb7c056c2f64f9d684334b08 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QByteArray: Disregard space at front during ::reserve(...)Mårten Nordheim2020-09-021-0/+8
| | | | | | | | | | | | Traditionally when calling reserve it's because you expect to append up to X amount of bytes. We should keep that behavior the same. With another patch still in the works current behavior caused an issue with QStringBuilder in QNAM, as mirrored in the testcase attached. Change-Id: I9792a8f158fc9235e3de48ac8b06ac2c10e7f3dc Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Long live QAIM::multiData!Giuseppe D'Angelo2020-09-021-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Views / delegates absolutely *adore* hammering data(). A simple QListView showing a couple of dozens entries can call data() a hundred of times on the first show. Back of the hand calculation, * 2 times per visible item (sizeHint() + paint()), * times 9 roles used by the default delegate, * times 20 visible items = 360 as a bare minimum, assuming the view doesn't redraw twice accidentally. Move the mouse over the view, and that'll cause a full update with certain styles: 360 calls to data() per update. This has an overhead visible in profilers. The model's data() has to re-fetch the index from its data structure and extract the requested field every time. Also, QVariant is used for the data interexchange, meaning anything that won't fit in one is also a memory allocation. This problem will likely be gone in Qt6Variant as that will store sizeof(void*) * 3, meaning QImage/QPixmap and similar polymorphic classes will fit in a QVariant now... So I'm trying to to remove part of that overhead by allowing views to request all the data they need in one go. For now, one index a a time. A view might also store the data returned. The idea is that the same role on different indexes will _very likely_ return variants of the same type. So a model could move-assign the data into the variant, avoiding the memory allocation /deallocation for the variant's private. This patch: 1) Introduces QModelRoleData as a holder for role+data. 2) Introduces QModelRoleDataSpan as a span over QModelRoleData. The idea of a span type is twofold. First and foremost, we are in no position to choose which kind of container a view should use to store the QModelRoleData objects for a multiData() call; a span abstracts any contiguous sequence, leaving the view free to do whatever it wants (statically allocate, use a vector, etc.). It also solves the problem of efficient passing the roles and gathering the returned variants from multiData(). 3) Add multiData(), which populates a span of roles for a given model index. The main advantage here is that a model can fetch all the needed information for a given index just once, then iterate on the span and provide data for each requested role. Cf. this with data(), where every call has to re-fetch the information for the index. A couple of models have been ported to multiData(), as well as QStyledItemDelegate. [ChangeLog][QtCore][QModelRoleData] New class. [ChangeLog][QtCore][QModelRoleDataSpan] New class. [ChangeLog][QtCore][QAbstractItemModel] Added the multiData() function. Change-Id: Icce0d108ad4e156c9fb05c83ce6df5f58f99f118 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QVariant: Fix conversion codeFabian Kosmale2020-09-021-0/+38
| | | | | | Fixes: QTBUG-86330 Change-Id: Ib89dcf1195e0081b4c4e2845f90c52c612e5911a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QTable/TreeView: fix sortByColumn() when view is already sortedChristian Ehrlicher2020-09-022-0/+69
| | | | | | | | | | | | | When the view was already sorted by the column and order given to sortByColumn(), a resort was not triggered which is a regression since d0f909f8dbdd8594b0d950822f0e7ab8728da513. Therefore don't rely on sortIndicatorChanged() in this case and trigger an explicit sort as it's done when no user-triggered sorting is enabled Fixes: QTBUG-86268 Change-Id: I3ec30ab81f304d5a19cef6d67b8a81c21b4a112d Pick-to: 5.15 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix QPropertyAlias to work with all kinds of propertiesLars Knoll2020-09-021-0/+37
| | | | | | | | | | So far QPropertyAlias was limited to working with QProperty<T>. Change the implementation, so it can be constructed from any property or even a QBindable<T>. Change-Id: I175cffe94a9ef332367d39faa976eb065b0e6ffe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make bindings introspectable through mocLars Knoll2020-09-023-143/+151
| | | | | | | | | | | | | | | Add a new BINDABLE declaration to the Q_PROPERTY() macro that tells moc where to find the QBindable for the property. Add a QUntypedBindable base class to QBindable<T> that gives access to generic functionality and checks argument compatibility at runtime. QBindable<T> will still do static checking at compile time. Add QMetaProperty::isBindable() and QMetaProperty::bindable() to be able to dynamically access the binding functionality. Change-Id: Ic7b08ae2cde83fd43e627d813a886e1de01fa3dc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add QObjectCompatPropertyLars Knoll2020-09-021-0/+76
| | | | | | | | | | | | Add a compatibility property class that makes porting to the new property system as simple as possible. Binding evaluation for those compat properties is eager, as we do not control possible side effects of the code in the existing setters. Change-Id: Ic56347abb49e40631ec73e88c6d40d4bdb05ca29 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add support for computed propertiesLars Knoll2020-09-021-0/+14
| | | | | | | | | | Add a QObjectComputedProperty. This class doesn't store the data itself, instead relies on a getter method to compute it's value. As the property is read-only, one can not bind to it, but it can be used in other property bindings. Change-Id: I0f6bffdd9f80f1d0829826f93a47257f2b3127af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add support for bindable properties to QObjectLars Knoll2020-09-021-12/+99
| | | | | | | | | | | | | | | | Add Q_OBJECT_BINDABLE_PROPERTY() macro that can be used to define a bindable property inside QObject. The macro and the class behind it creates storage for a property that is bindable inside a QObject or QObjectPrivate. The property only uses as much space as the data contained, ie. it has no storage overhead, as long as no bindings are being used. Bindings are being stored and looked up in the QBindingStorage associated with the owning object. Change-Id: I1dadd7bddbad6fbf10cfa791d6461574b9db82dd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add a QBindingStorage classLars Knoll2020-09-021-2/+2
| | | | | | | | | | | | | | | | | | | QBindingStorage is a class that can store a set of binding objects for the properties of a QObject. This will get used to reduce the memory overhead of the property system when adding bindable properties to QObject based classes. The binding storage has a pointer to the TLS entry containing the currently evaluating binding. Like that we avoid repeated TLS lookups and reduce the overhead of the property system to one pointer lookup and one compare for the case that properties aren't being used. Each QObject now owns one binding storage object, that can be used to store binding data for properties that members of the QObject. Change-Id: I27427c03c2ba281f072e074be96147bdbcaac246 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Ground work for bindable properties in QObjectLars Knoll2020-09-021-0/+112
| | | | | | | | | | | | | | Add a private QBindableInterface and a public QBindable<T> class, that will be the API interface for accessing bindings for properties in QObject. The QBindable class gives access to all aspects of the property related to bindings. This includes setting and retrieving bindings, installing observers and creating a direct binding on this property. Change-Id: Iaead54d2bd6947bd2cda5052142b2a47dd8bf7c4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove operators allowing assignment of a binding to a propertyLars Knoll2020-09-021-40/+36
| | | | | | | | | These look rather weird, an explicit property.setBinding() call is simply better in this case, and also more aligned with the API we can offer in QObject. Change-Id: Ifb00fd47a75e6b3bc94e34bf49e4f13249565bfe Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove QNotifiedProperty and Q_PRIVATE_QPROPERTYLars Knoll2020-09-022-370/+129
| | | | | | | | | | | | | And all related functionality. This is being replaced by Q_BINDABLE_PROPERTY and Q_OBJECT_BINDABLE_PROPERTY in the next few commits. The new infrastructure coming will play nicer along with the existing property system. Commented out some autotests, that will get reimplemented with the updated infrastructure. Change-Id: I50c30bd4d5c6c6b6471f8eb93870e27d86f5a009 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cleanups: Rename some classesLars Knoll2020-09-021-20/+20
| | | | | | | | | | Rename QPropertyBase to QPropertyBindingData, as it contains the data related to bindings. The new name fits better, as the data can now also live somewhere else than the data strored in the property. Change-Id: I489efb86ad2e0bad2740c9d1aa74506fe103d343 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove the special handling of QProperty<bool>Lars Knoll2020-09-021-2/+0
| | | | | | | | | Since we will be storing property data differently in most cases, having this special case would create too many additional complications. Change-Id: I27042b0730559bb375d8e3c07324398403a9885d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add operator-> and operator*() to QPropertyFabian Kosmale2020-09-021-0/+29
| | | | | | | | | | | | | | Enable the arrow operator for all types that could have members, so that one can e.g. write myStringProperty->size() instead of having to use the less convenient myStringProperty.value().size(). Also cleaned up the rvalue ref overloads to be disabled for basic types. For those we now also return by value, for more complex types we return a const reference. Change-Id: If6a75898dc0a097f57052488f0af0cd7166b3393 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QObject: add a single shot connection flagGiuseppe D'Angelo2020-09-011-0/+591
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one needed to listen to a signal just once, one had to store the QMetaObject::Connection object returned by connect() and use it to disconnect the slot after the first signal activation. This has led to a proliferation of using wrappers (and enough TMP); they usually look like this: 1) create a shared_ptr<QMO::Connection>, allocating its payload; 2) create a lambda, capturing the shared_ptr by value; 3) in the lambda, disconnect the connection (through the shared_ptr), and call the actual slot; 4) connect the signal to the lambda, storing the returned QMO::Connection into the shared_ptr. This is expensive, error prone for newcomers, and tricky to support as a general facility inside one's projects. We can do better, just support single shot connections right in QObject. [ChangeLog][QtCore][QObject] Added the Qt::SingleShotConnection flag. When a connection is established with this flag set, the slot is going to be activated at most once; when the signal is emitted, the connection gets automatically broken by Qt. Change-Id: I5f5feeae7f76c9c3d6323d841efba81c8f98ce7e Fixes: QTBUG-44219 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Doc fix: disconnect with receiver also works for context objectsAndreas Hartmetz2020-09-011-4/+31
| | | | | | | | | | | | | | | | One could guess it by assuming that disconnecting for a destroyed receiver and disconnect() with given receiver use the same implementation, but without closely knowing the implementation a reader of the documentation can't know for sure. Also add a test to prove that what the new documentation says is really true. Also remove an unnecessary negation in the preceding sentence. Change-Id: I9d24442bb1a4646b89f969bad1a4d0e1eafa7534 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add a QMetaSequence interfaceUlf Hermann2020-09-016-0/+516
| | | | | | | | | | | | | | | This is in line with QMetaType and will be used to implement a mutable QSequentialIterable. Later on, a QMetaAssociation will be added as well, to implement a mutable QAssociativeIterable. The code here represents the minimal set of functionality needed to have a practical sequential container. The functionality is not completely orthogonal. In particular, the index based operations could be implemented in terms of iterator-based operations. Task-number: QTBUG-81716 Change-Id: Ibd41eb7db248a774673c701549d9a03cbf2e48b6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Take the right lock before using a connection's receiverGiuseppe D'Angelo2020-09-011-0/+87
| | | | | | | | | | | | When a signal/slot connection is activated, a lock on the receiver object is taken (to be sure it doesn't get destroyed). The path for blocking queued connections however took the lock on the sender by accident, fix that. Pick-to: 5.15 5.12 Change-Id: I8cd938a50eca2bf71e7bfb86768ee0c8431afdfa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live Q{Any,Utf8}StringView!Marc Mutz2020-08-311-39/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to add these two classes at the same time, because QAnyStringView makes all QUtf8StringView relational operators moot. We might want to add some later, esp. for UTF-8/UTf-8 comparisons, to avoid the pessimization that we can't early-out on size() mismatch in QAnyStringView equality operators, but that's an optimization, not a correctness issue, and can be fixed in a source-compatible way even after Qt 6 is released. To deal with the char8_t problem in C++20, make QUtf8StringView a class template out of which two UTF-8 views can be instantiated: the Qt 7 version, which depends on C++20 char8_t as value_type, and the Qt 6 version where value_type is a char. Use inline namespaces to map the QUtf8StringView identifier to one or the other, depending on the C++ version used to compile the user code. The inline namespace names must needs be a bit ugly, as their inline'ness depends on __cpp_char8_t. If we simply used q_v1/q_v2 we'd be blocking these names for Qt inline namespaces forever, because it's likely that inline'ness of other users of inline namespaces in Qt depends on things other than __cpp_char8_t. While inline'ness of namespaces is, theoretically speaking, a compile-time-only property, at least Clang warns about mixed use of inline on a given namespace, so we need to bite the bullet here. This is also the reason for the QT_BEGIN_..._NAMESPACE macros: GCC is ok with the first declaration making a namespace inline, while Clang warns upon re-opening an inline namespace as a non-inline one. [ChangeLog][QtCore][QUtf8StringView] New class. [ChangeLog][QtCore][QAnyStringView] New class. Change-Id: Ia7179760fca0e0b67d52f5accb0a62e389b17913 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Qpagedpaintdevice: Use marginsF instead of internal struct marginsPeng Wenhao2020-09-012-61/+57
| | | | | | | resolve remaining Qt6 TODOs Change-Id: Iad659a09ddfe136bdc545bc0635b4c695540c58b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Deprecate and remove uses of AA_DisableHighDpiScalingTor Arne Vestbø2020-08-316-34/+5
| | | | | | Change-Id: Ibadce68775858c524b998aacad310905ba2c2e8e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Deprecate and remove all uses of AA_UseHighDpiPixmapsTor Arne Vestbø2020-08-313-39/+0
| | | | | | | High-DPI pixmaps are always enabled, and cannot be disabled. Change-Id: I01a006b404e5431582b64ef812974c1c022b39ae Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWeakPointer: purge deprecated APIEdward Welbourne2020-08-313-215/+0
| | | | | | | | Since 5.0: assignment/construction from QObject pointer Since 5.14: data() to recover the packaged pointer Change-Id: I5d6ab561ce39bc0d9d3e5035eb2ca38139cd76b6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Work around qsizetype fallout in manual testsLaszlo Agocs2020-08-302-2/+2
| | | | | Change-Id: I9f0e210caacc6eefe5ed1ee6fa97574ad5e9edcc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use checked string iteration in case conversionsEdward Welbourne2020-08-291-0/+28
| | | | | | | | | | | | | | | | | | The Unicode table code can only be safely called on valid code-points. So code that calls it must only pass it valid Unicode data. The string iterator's Unchecked Unchecked methods only provide this guarantee when the string being iterated is guaranteed to be valid UTF-16; while client code should only use QString, QStringView and friends on valid UTF-16 data, we have no way to be sure they have respected that. So take the few extra cycles to actually check validity in the course of iterating strings, when the resulting code-points are to be passed to the Unicode table look-ups. Add tests that case mapping doesn't access Unicode tables out of range (it'll trigger the new assertion). Added some comments to qchar.h that helped me understand surrogates. Change-Id: Iec2c3106bf1a875bdaa1d622f6cf94d7007e281e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove remaining traces of deprecated QtMsgHandlerMarcel Krems2020-08-291-9/+0
| | | | | Change-Id: I28aecb444eb9bc9e26e6ff8998904dbf28419f25 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Prepend optimize QStringAndrei Golubev2020-08-291-0/+103
| | | | | | | | Added prepend optimization to QString Task-number: QTBUG-84320 Change-Id: Iaa8df790a10c56ecceb06f7143718fb94874ce76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port tst_qiconhighdpi to the new QIcon::pixmap() APIMorten Johan Sørvig2020-08-291-31/+20
| | | | | | | | | | | | Port the high-dpi icon test to use the new pixmap() API which takes the target devicePixelRatio as an argument. This means we can run the fromTheme test at dpr = {1,2,3}, instead of at the current global devicePixelRatio only. Task-number: QTBUG-85885 Change-Id: Iec7b21e04ed760e48964307d2048eaec1976ffe2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use build-system to declare tests that are low-DPITor Arne Vestbø2020-08-2811-22/+6
| | | | | Change-Id: I6da7204683b3c46232cfc542ed5e28131a82e87d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QTranslator::load() insist that its return value be checkedEdward Welbourne2020-08-281-2/+2
| | | | | | | | | | Add Q_REQUIRED_RESULT to force callers to check the return; the QTranslator object is unusable if load() fails. Check the result in QTranslator's own test. Task-number: QTBUG-85700 Change-Id: I07509c76470cc87626190670665cd3162bfb17e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Purge qalgorithm.h of deprecated APIEdward Welbourne2020-08-287-956/+2
| | | | | | | | | | | | | A large slice of it has been deprecated since 5.2. Reflowed a doc paragraph pointed out, in the deprecation commit, as having been left ragged by its edits. Note: qSwap() is documented as \deprecated but not marked, where it's defined, as deprecated. Change-Id: Iaff10ac0c4c38e5b85f10eca4eedeab861f09959 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* High-DPI: Remove usage of Qt::AA_EnableHighDpiScalingTor Arne Vestbø2020-08-289-22/+1
| | | | | | | | This attribute is now on by default. Change-Id: I7c9d2e3445d204d3450758673048d514bc9c850c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove QMacNativeWidget and QMacCocoaViewContainerTor Arne Vestbø2020-08-285-269/+0
| | | | | | | | | | | | The functionality should be available via QWidget::winId(), and QWidget::createWindowContainer() + QWindow::fromWinId(). Any bugs in this area should be fixed by improving the general wrapping APIs. Fixes: QTBUG-83254 Change-Id: I86584a4a8138d17d65a50da39efd58039f10da91 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix tst_QHighDpiScaling::scaleTor Arne Vestbø2020-08-281-0/+2
| | | | | | | | | | Without an override for logicalDpi() the base class implementation would use the geometry of the screen to figure out the DPI, and end up with ~100, which combined with a 96DPI base logical DPI would give a wrong scale factor. Change-Id: I68aecce44d2ee672c7b707dfe5444af8f551e961 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Avoid inifinite recursion call in tst_Compiler::cxx11_noexceptTor Arne Vestbø2020-08-281-1/+2
| | | | | | | warning: all paths through this function will call itself [-Winfinite-recursion] Change-Id: I70008710a7448ffd532bb6c3acb488fe439cb807 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove tst_QGLTor Arne Vestbø2020-08-281-2525/+0
| | | | | | | | | It was left out of the build in f08038fca79b0828da11fbf35f4165d6efa4de2f but not removed. It doesn't make sense to keep it, as the classes it tests have been removed. Change-Id: Ic36a066eb092d8b9b40c645de649af9dcaab4ff2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Use OpenType font weightsJonas Karlsson2020-08-289-45/+44
| | | | | | | Task-number: QTBUG-42248 Change-Id: Icdb301b27d6699c2b842c4563fbef9df73c23cbc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use qsizetype in QRegularExpressionMarcel Krems2020-08-281-76/+76
| | | | | | | PCRE2 already uses size_t which we can now make full use of. Change-Id: Icb5efd5c6ef27f2e31a9780bf62f5671ddc603cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve connect: Use existing metatypes if possibleFabian Kosmale2020-08-281-0/+27
| | | | | | | | | | | As there is now a chance that a QMetaMethod already contains the metatypes for its arguments, we can just query it directly (and use the fallback to name lookup logic that already exists there). This also allows us to avoid creating a QList of names, and only requires us to do a name lookup in case the connection actually fails. Change-Id: Idda30bc4b538a94476ae6c533776c22340f0030d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QFtp sources etc. in favor of alternate distributionMårten Nordheim2020-08-2710-3371/+102
| | | | | | | | | | | | While we initially wanted to just disable the functionality the way it is currently built forces people to do a full build of Qt just to enable it. Instead of doing this half-measure let's just remove the code completely from QtBase and rather prepare QtNetwork to handle being a plugin that can be compiled at any time. Task-number: QTBUG-80340 Change-Id: I19155c8c167cf932088f01b2a9706d0e7ab792d1 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>