summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Replace QAbstractItemView::viewOptions with initViewItemOptionVolker Hilsheimer2020-08-261-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | viewOptions returned a QStyleOptionViewItem object. Such a method can never support newer versions of the option structure. Most styleable QWidget classes provide a virtual method initStyleOption that initializes the option object passed in as a pointer, e.g QFrame, QAbstractSpinBox, or QComboBox. Follow that API convention, but name it initViewItemOption, as the QStyleOptionViewItem struct contains information about the item as well as the widget itelf. This is a source incompatible change that will go unnoticed unless existing subclasses mark their overrides as 'override', or call the removed QAbstractItemView::viewOption virtual function. [ChangeLog][QtWidgets][QAbstractItemView] The virtual viewOptions method that previously returned a QStyleOptionViewItem object has been renamed to initViewItemOption, and initializes a QStyleOptionViewItem object that's passed in through a pointer. Change-Id: Ie058702aed42d77274fa3c4abb43ba302e57e348 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* macOS: rename 'macintosh' style to 'macos'Richard Moe Gustavsen2020-08-261-2/+2
| | | | | | | | | | | | | | Change the name/key of the style to 'macos'. Besides the name 'macintosh' being archaic, we also need this change to avoid creating 'macintosh' style folders in QtQuickControls, now that we plan to use QPlatformTheme also there to resolve the style. [ChangeLog][Widgets][QStyle] The 'macintosh' style has been renamed to 'macos'. Change-Id: I14b8a8b4dbd369e7a7d16b94e4ad27e501e7e8d0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move QStateMachine from QtCore to QtScxmlKarsten Heimrich2020-08-24187-14242/+1
| | | | | | Task-number: QTBUG-80316 Change-Id: I2ee74110fd55e94d86321d3b3dc5bb8297424ed4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* QAbstractSocket: Resolve remaining Qt6 TODOsMårten Nordheim2020-08-242-6/+6
| | | | | Change-Id: Id257f0721c1cd5fcbafa9297bae0251a2d68e366 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Deprecate the static int based API in QMetaTypeLars Knoll2020-08-243-6/+6
| | | | | | | | | | | | | And remove one of the type id to name mapping that still existed in QMetaType. QMetaTypeInterface can provide that, so there's no need to have a second copy of the data. qMetaTypeTypeInternal() can still map all the names of all builtin types to ids. That functionality is for now still required by moc and can't be removed yet. Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Automatically register data/debug stream operations in QMetaTypeLars Knoll2020-08-242-3/+0
| | | | | | | | | | | | | | | | | | | | | | And remove the old manual registration code for those operators. Add some special handling for long/ulong, as these types could be streamed as a QVariant so far, but are not directly streamable through QDataStream. [ChangeLog][QtCore][QMetaType] The QMetaType::registerStreamOperators() and QMetaType::registerDebugStreamOperator() methods have been removed. The streaming operators for a type are now automatically registered together with the type registration. This implies that the operators should be visible wherever the type is visible and being used. [ChangeLog][Behavior Incompatible Changes] Because the QDataStream and QDebug serialization operators are automatically registered with QMetaType, the declarations of those functions must be present at any point where the type is used with QMetaType and QVariant. Change-Id: I4a0732651b20319af4a8397ff90b848ca4580d99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Workaround building DBus 'car' example with qmakeAlexandru Croitor2020-08-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to implement instructions for building examples with qmake in the CI, an issue has surfaced. When building examples with CMake with -DBUILD_EXAMPLES=ON in the CI, the examples are built in-source, aka source dir == build dir. This means that the header files generated by qdbusxml2cpp will be placed in the qtbase source dir. The instructions that try to build examples with qmake build the examples in a separate build dir after building the examples with CMake. Unfortunately the qtbase/examples/dbus/remotecontrolledcar/car example includes the generated DBus adaptor header via a statement like #include "car_adaptor.h" and the compiler prefers to pick up the header file from the example source dir (the one generated by CMake), rather than the one generated by qmake in the example build dir. Because CMake's DBus integration uses different flags than qmake's DBus integration, the generated header file code is not compatible with the qmake generated cpp file, and the example fails to link when building with qmake, because it can't find an appropriate constructor symbol. In an ideal world, we wouldn't do in-source builds with the CMake build, but that leads to other issues which I currently don't recall. To circumvent the issue, adapt the CMake DBus qt6_add_dbus_adaptor function to allow not passing the problematic '-l' flag by making it optional. This shouldn't break existing code, but allows us to generate a compatible header that will be used by qmake and succeed in linking the example. Task-number: QTBUG-85986 Change-Id: I06759f79aeb66bb32da7f158f55dd4734c4a9887 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Move QStringRef and remains to Qt5CompatKarsten Heimrich2020-08-208-16/+15
| | | | | | | | | Export some private functions from QUtf8 to resolve undefined symbols in Qt5Compat after moving QStringRef. Task-number: QTBUG-84437 Change-Id: I9046dcb14ed520d8868a511d79da6e721e26f72b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port the QXmlStream API from QStringRef to QStringViewKarsten Heimrich2020-08-195-25/+25
| | | | | | | | | | | | | | This gives some source incompatibilities, most of them can be handled by using auto instead of QStringRef explicitly. [ChangeLog][Important API changes] QXmlStream now uses QStringView insteead of QStringRef in it's API. Using auto forvariables returning a QStringRef in Qt 5 should lead to code that can be used against both Qt versions. Fixes: QTBUG-84317 Change-Id: I6df3a9507276f5d16d044a6bdbe0e4810cf99440 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Disentangle QIODevice dependenciesLars Knoll2020-08-151-2/+2
| | | | | | | | | | | | | | | | | Move the QIODevice::OpenMode enum into a base class, so that we can remove the full QIODevice (and thus QObject) dependency from qdatastream.h and qtextstream.h. This is required so that we can include QDataStream in qmetatype.h without getting circular dependencies. As a nice side effect, QDataStream and QTextStream can now inherit QIODeviceBase and provide the OpenMode enum directly in their class scope. Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Deprecate QVariant::Type uses in QSqlFieldLars Knoll2020-08-151-7/+7
| | | | | | | | Add metaType()/setMetaType() methods to be used instead of the type() methods taking a QVariant::Type. Change-Id: Ieaba35b73f8061cd83288dd6b50d58322db3c7ed Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Don't depend on tools for the qtestlib examplesAndy Shaw2020-08-122-2/+2
| | | | | | | | | Only widgets is required here, so drop the dependency on QT_BUILD_PARTS and just depend on widgets. Pick-to: 5.15 Change-Id: Idaae547b69ffd91681900b33c73e4a341011c30c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Long Live QMap as a refcounted std::map!Giuseppe D'Angelo2020-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and QMultiMap as std::multimap. Just use the implementation from the STL; we can't really claim that our code is much better than STL's, or does things any differently (de facto they're both red-black trees). Decouple QMultiMap from QMap, by making it NOT inherit from QMap any longer. This completes the deprecation started in 5.15: QMap now does not store duplicated keys any more. Something to establish is where to put the QExplictlySharedDataPointer replcement that is in there as an ad-hoc solution. There's a number of patches in-flight by Marc that try to introduce the same (or very similar) functionality. Miscellanea changes to the Q(Multi)Map code itself: * consistently use size_type instead of int; * pass iterators by value; * drop QT_STRICT_ITERATORS; * iterators implictly convert to const_iterators, and APIs take const_iterators; * iterators are just bidirectional and not random access; * added noexcept where it makes sense; * "inline" dropped (churn); * qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE); * operator== on Q(Multi)Map requires operator== on the key type (we're checking for equality, not equivalence!). Very few breakages occur in qtbase. [ChangeLog][Potentially Source-Incompatible Changes] QMap does not support multiple equivalent keys any more. Any related functionality has been removed from QMap, following the deprecation that happened in Qt 5.15. Use QMultiMap for this use case. [ChangeLog][Potentially Source-Incompatible Changes] QMap and QMultiMap iterators random-access API have been removed. Note that the iterators have always been just bidirectional; moving an iterator by N positions can still be achieved using std::next or std::advance, at the same cost as before (O(N)). [ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does not inherit from QMap any more. Amongst other things, this means that iterators on a QMultiMap now belong to the QMultiMap class (and not to the QMap class); new Java iterators have been added. Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compiler warning about qsizetype/int mismatchLars Knoll2020-08-041-1/+1
| | | | | Change-Id: I58624d8c5de0734bd0851e6744ed34c1408dfda6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Deprecate QTimeLine's curveShape in favor of its easingCurveEdward Welbourne2020-07-161-1/+1
| | | | | | | | | | | | | | QEasingCurve has a richer variety of curves and curveShape was already implemented by changing the easingCurve property. [ChangeLog][QtCore][QTimeLine] Deprecated QTimeLine's curveShape property in favor of the easingCurve property. Pick-to: 5.15 Change-Id: I7261c0f24d7e02bc94624f0b74d699df62de1a52 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Polish the settingseditor exampleFriedemann Kleint2020-07-104-107/+227
| | | | | | | | | | | | | | | | | | | | | | | The example is meant to show an item delegate with a line edit with QRegularExpression-based validation depending on type. Unfortunately, this does not work since QSettings mostly return QString types. Fix it to a partially working state by - Making the expressions match from beginning to end which was overlooked in the QRegExp->QRegularExpression change. - Use QCheckBox, QSpinBox for bool/int since it is silly to have a user edit a bool value by typing 'true'/'false'. - Move the expressions out to a separate struct to be able to do some guessing of the type when reading the QSettings, implement for bool and int. - Use a fancy Unicode checkmark for displaying bools. - Fix the garbled display of QByteArray with binary data by displaying them with hex characters and setting them read-only. Change-Id: Iba22dfafc3b813b3fd3d2915ef5210d661049382 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate examplesAlexandru Croitor2020-07-09296-354/+1588
| | | | | | Change-Id: I1c51b10af4e2b26f54740f257164c56a0e2a03ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-073-3/+3
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use qsizetype in QListLars Knoll2020-07-065-12/+12
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in statemachineJarek Kobus2020-07-061-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: I2b1399c34ebcc2237ca2662d97b54e81f11cb7af Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Introduce platform API abstraction for QOpenGLContextTor Arne Vestbø2020-07-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is available by including qopenglcontext.h as usual, but scoped in the QPlatformInterface namespace. The namespace exposes platform specific type-safe interfaces that provide: a) Factory functions for adopting native contexts, e.g. QCocoaGLContext::fromNative(nsContext, shareContext); b) Access to underlying native handles, e.g. openGLContext->platformInterface<QCocoaGLContext>->nativeContext() c) Platform specific functionality, e.g. static QWGLContext::openGLModuleHandle() openGLContext->platformInterface<QEGLContext>->doSomething(); The platform interfaces live close to the classes they extend, removing the need for complex indirection and plumbing, and avoids kitchen-sink modules and APIs such as the extras modules, QPlatformFunctions, or QPlatformNativeInterface. In the case of QOpenGLContext these platform APIs are backed by the platform plugin, so dynamic_cast is used to ensure the platform plugin supports the requested interface, but this is and implementation detail. The interface APIs are agnostic to where the implementation lives, while still being available to the user as part of the APIs they extend/augment. The documentation will be restored when the dust settles. Task-number: QTBUG-80233 Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix warnings in QtConcurrent image scaling exampleTor Arne Vestbø2020-07-011-2/+2
| | | | | Change-Id: Ib82b2abf608536ef4df6d7cfa5fb106f29f9253f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Remove examples for deprecated QMac(NativeWidget|CocoaViewContainer)Tor Arne Vestbø2020-06-2610-337/+0
| | | | | Change-Id: I60d694f868623ed9761baf0cf532a87ab3412208 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Fix typoPaul Wicking2020-06-251-1/+1
| | | | | | | | Add missing quote in text. Pick-to: 5.15 Change-Id: If3a3d28f50057040c5aff90c70803b85c8a475a9 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Example: Connect to correct slotPaul Wicking2020-06-231-1/+1
| | | | | | | Pick-to: 5.15 Fixes: QTBUG-85009 Change-Id: Id4db9a20e6c92ae86c764abb723fbe4ad426f2f8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use QList instead of QVector in examplesJarek Kobus2020-06-2382-158/+156
| | | | | | Task-number: QTBUG-84469 Change-Id: Id14119168bb1bf11f99bda7ef6ee9cf51bcfab2e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Move QTextCodec support out of QtCoreKarsten Heimrich2020-06-2022-1258/+0
| | | | | | | | | | * Assume UTF-8 on all Unix like systems * Export some functions to be able to compile QTextCodec once moved to Qt5Compat. Task-number: QTBUG-75665 Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use | to OR some related flagsGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | And not +. Guess what, this was "accidentally" working around a number of bugs, most importantly QTBUG-75172 (which is caused by QTBUG-74639 and probably others). Change-Id: If13810d9408f2be7b87f0d259737bff8cacc6f7b Pick-to: 5.15 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: David Faure <david.faure@kdab.com>
* Fix examples build after a061a646429c6e9d695458fc0ecb0021a30e12eeKarsten Heimrich2020-06-171-1/+1
| | | | | Change-Id: I4d10b4439e5a858437751b00efde2bf8c467e857 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Introduce QInputDevice hierarchy; replace QTouchDeviceShawn Rutledge2020-06-162-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have seen during the Qt 5 series that QMouseEvent::source() does not provide enough information: if it is synthesized, it could have come from any device for which mouse events are synthesized, not only from a touchscreen. By providing in every QInputEvent as complete information about the actual source device as possible, we will enable very fine-tuned behavior in the object that handles each event. Further, we would like to support multiple keyboards, pointing devices, and named groups of devices that are known as "seats" in Wayland. In Qt 5, QPA plugins registered each touchscreen as it was discovered. Now we extend this pattern to all input devices. This new requirement can be implemented gradually; for now, if a QTWSI input event is received wtihout a device pointer, a default "core" device will be created on-the-fly, and a warning emitted. In Qt 5, QTouchEvent::TouchPoint::id() was forced to be unique even when multiple devices were in use simultaneously. Now that each event identifies the device it came from, this hack is no longer needed. A stub of the new QPointerEvent is added; it will be developed further in subsequent patches. [ChangeLog][QtGui][QInputEvent] Every QInputEvent now carries a pointer to an instance of QInputDevice, or the subclass QPointingDevice in case of mouse, touch and tablet events. Each platform plugin is expected to create the device instances, register them, and provide valid pointers with all input events. If this is not done, warnings are emitted and default devices are created as necessary. When the device has accurate information, it provides the opportunity to fine-tune behavior depending on device type and capabilities: for example if a QMouseEvent is synthesized from a touchscreen, the recipient can see which touchscreen it came from. Each device also has a seatName to distinguish users on multi-user windowing systems. Touchpoint IDs are no longer unique on their own, but the combination of ID and device is. Fixes: QTBUG-46412 Fixes: QTBUG-72167 Task-number: QTBUG-69433 Task-number: QTBUG-52430 Change-Id: I933fb2b86182efa722037b7a33e404c5daf5292a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* CMake: Fix lightmaps example to build in a namespaced QtAlexandru Croitor2020-06-122-1/+12
| | | | | | | | | | | | | Add misisng namespace bits. The example is built by a CMake configuration. It is not built in a qmake configuration due to a missing x11 / embedded requirement. Task-number: QTBUG-84881 Change-Id: I6c53299a53e7c4e19d994ec2ae2d542667d41899 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix OpenGL mode in examples like compositionLaszlo Agocs2020-06-091-3/+5
| | | | | | | | | | | | | | To avoid an incorrect offset for the native window, call create() after createWindowContainer(). The mysterious -1 for the width and height are removed as well because otherwise the GL window's size is clearly off by one. Fixes: QTBUG-82195 Pick-to: 5.15 Change-Id: I1a9cec62746fc110bfc4cd2e4fa111f621124638 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Phase 2 of removing QDesktopWidgetVolker Hilsheimer2020-06-084-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove QDestopWidget public header, simplify the implementation that maintains a Qt::Desktop type QWidget for each QScreen, and turn QWidget's initial target screen into a QScreen pointer. QApplication::desktop() now takes an optional QScreen pointer, and returns a QWidget pointer, so that applications and widgets can get access to the root widget for a specific screen without having to resort to private APIs. QDesktopWidgetPrivate implementations to look up a screen for an index, widget, or point are now all inline functions that thinly wrap QGuiApplication::screens/screenAt calls. We should consider adding those as convenience APIs to QScreen instead. Note that QWidget::screen is assumed to return a valid pointer; there is code that handles the case that it returns nullptr (but also code that trusts that it never is nullptr), so this needs to be defined, verified with tests, and asserted. We can then simplify the code further. Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-0836-134/+134
| | | | | | | Many of these were generated by clazy using the new qevent-accessors check. Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Example compile fix with namespaced Qthjk2020-06-081-3/+1
| | | | | | | | This uses the "unneeded #include" approach, as this looks less ugly than the QT_{BEGIN,END}_NAMESPACE decoration. Change-Id: I03b6cf3ebf464134fe78ab49cbbad70c0b5fd42a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove the deprecated QDirModelVolker Hilsheimer2020-06-043-7/+0
| | | | | | | | | QFileSystemModel is the documented replacement. It uses threads to populate the model, which QDirModel doesn't. Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Port QRegularExpression to QStringView, drop QStringRefGiuseppe D'Angelo2020-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | The idea is pretty simple -- add QRegularExpression matching over QStringView. When matching over a QString, keep the string alive (by taking a copy), and set the view onto that string. Otherwise, just use the view provided by the user (who is then responsible for ensuring the data stays valid while matching). Do just minor refactorings to support this use case in a cleaner fashion. In QRegularExpressionMatch drop the QStringRef-returning methods, as they cannot work any more -- in the general case there won't be a QString to build a QStringRef from. [ChangeLog][QtCore][QRegularExpression] All the APIs dealing with QStringRef have been ported to QStringView, following QStringRef deprecation in Qt 6.0. Change-Id: Ic367991d9583cc108c045e4387c9b7288c8f1ffd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix hellowindow exampleMichal Klocek2020-05-252-59/+30
| | | | | | | | | | | | | | | | | | | | It seems this example never worked as expected. It has a 'multiple' option which should show extra windows with rendering taking place in different thread, however although render is moved to other thread render() function was never called in that thread. Fix following things: * make rendering in other thread * stop requestUpdate if nothing is exposed * add timer so animation works at the same speed despite of number of windows (renderer B renders two windows) * wait for render to finish before triggering requestUdpate * remove mutex where not needed Pick-to: 5.15 Change-Id: I420436bd28d0357534332dd55b088d634d906c14 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Examples/RegularExpressionDialog: remove deprecated optionsChristian Ehrlicher2020-05-232-13/+0
| | | | | | | | | Remove the two deprecated (and non-functional) options OptimizeOnFirstUsageOption and DontAutomaticallyOptimizeOption. Change-Id: Id5191cee84bf7b1ae65f828a981f93d98db23f53 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Get rid of some QTextCodec leftoversLars Knoll2020-05-141-3/+2
| | | | | | | There's no real dependency to QTextCodec in those files anymore. Change-Id: Ifaf19ab554fd108fa26095db4e2bd4a3e9ea427f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of QTextCodec in the textedit exampleLars Knoll2020-05-141-10/+8
| | | | | | | | | And refactor the code a bit to not convert to unicode twice and use the mime database instead of Qt::mightBeRichText(). Change-Id: I56f9a732c8ad593e7f050eaad401be536bdf6f98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Doc: Use nullptr instead of 0 in examplePaul Wicking2020-05-111-1/+1
| | | | | | | Pick-to: 5.15 Fixes: QTBUG-84101 Change-Id: Ia0b5a87bf9776ee14eff0483b955dd99389cb6ae Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Torrent example: fix crashGiuseppe D'Angelo2020-05-111-2/+2
| | | | | | | | | | | | | | | | | | | | | Yet Another Side Effect of not keeping iterator stability. Although not idiomatic, the pattern while (i != e) { auto cur = i++; if (cond) erase(cur); } was actually correct. Move to the idiomatic erase pattern instead (it = cont.erase(it)). The example still has memory problems all over the place on shutdown. At least now it doesn't crash when running. Change-Id: I30bd2c4e2b3fa7fe4e28d4426ff3d894b9bae103 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* torrent example: fix premature pessimisationMarc Mutz2020-05-051-1/+1
| | | | | | | | | | | Use case-insensitive endsWith() instead of lowering a QString and then comparing case-sensitively. As a drive-by, replace ascii string literal with char16_t one. Change-Id: Id4d8e5b197baba7aa3ae4c2ae57414c1242b3827 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-041-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/text/qlocale.cpp src/network/access/qnetworkaccessmanager.cpp Regenerated tests/auto/testlib/selftests/float/CMakeLists.txt Change-Id: I5a8ae42511380ca49a38b13c6fa8a3c5df8bed01
| * torrent example: fix stripping of file extensionMarc Mutz2020-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | Due to QChar being convertible from almost any integral type, the old code actually called QString::remove(QChar). Fix by using QString::chop() instead. Change-Id: I345b018aa137ecff608a130e69ade5d37ef0805c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Remove a couple of QTextStream usagesLars Knoll2020-05-011-3/+3
| | | | | | | | | | | | | | | | | | | | Don't use QTextStream to write a QString to a file in UTF-8. This can be done more easily, by directly converting the QString to utf-8 and calling write on the io device. Change-Id: I4b617b342ab339affb396ed49c5a920985d1ddfd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | CMake: Regenerate examples/widgets/ projectsSona Kurazyan2020-04-2916-29/+163
| | | | | | | | | | | | | | | | Also add the missing examples/widgets/gallery project. Change-Id: Iec3d61881065cf93d90f9fd3da928ffcd4f0c0aa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Mark widget gallery example as "gallery"Friedemann Kleint2020-04-291-0/+1
| | | | | | | | | | | | | | | | | | Add a metatag. Amends 4e93e3b574390829c4c3c87716e0a9bb5ed579e4. Pick-to: 5.15 Task-number: PYSIDE-1112 Change-Id: I5003f958559438cc83eb98e5eedfcefb21a243b7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>