Examples that use QDialog as main window should be maximized on Android
to avoid a black view on most of the screen.
Task-number: QTBUG-80717
Change-Id: I933c1a01d95d53da009c190c37fa32f27be5af5e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This reverts commit ccb2cb84f5 and
commit 0f568d0a67.
The patches fix ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.
Revert the commits to keep the getter as is and change the signal name instead.
Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred()
Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
http example uses QStandardPaths, on Android permissions might need to
be explicitly requested to write the downloaded file.
Task-number: QTBUG-80717
Change-Id: Icd377254ad77cac661c5ae37e9081e0463493d8b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This reverts commit 94b3dd77f2.
The patch fixes ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.
Revert the commit to keep the getter as is and change the signal name instead.
Change-Id: I0dd60cf1ae9d1bd95beeb8ad58661ca4b1fb63b9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Because bearer management is going away
Change-Id: I60439c1714e0350b0f2bbef6afc8d2015886135f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Because bearer management is going away
Change-Id: I64311895c347b3e63df75d10db1673bcfe54f52d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
I made a clazy automated check that replaced the use of QVariant::Type
by the equivalent in QMetaType.
This has been deprecated since Qt 5.0, but many uses were not yet removed.
In addition, there was some manual changes to fix the compilation errors.
Adapted the Private API of QDateTimeParser and QMimeDataPrivate
and adjust QDateTimeEdit and QSpinBox.
QVariant(QVariant::Invalid) in qstylesheet made no sense.
But note that in QVariant::save, we actually wanted to use the non-user type.
In the SQL module, many changes were actually reverted because the API
still expects QVarient::Type.
Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The one that is a getter for the last error found. This is to disambiguate
the expression '&QAbstractSocket::error'. Introduce a new member-function
socketError as a replacement.
[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the getter) is deprecated; superseded by socketError().
Task-number: QTBUG-80369
Change-Id: Ia2e3d108657aaa7929ab0810babe2ede309740ba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Cleanup network examples:
- use nullptr
- use member-init
- adjust includes
- use new-style connects
Change-Id: I80aa230168e5aec88a1bc93bbf49a471bfc30e7b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QDesktopWidget is marked as obsolete in docs, but it is not yet
completely deprecated, some of its methods are still in use.
Replace uses of the following methods marked as obsolete:
- QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen()
- QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry()
- QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry()
Task-number: QTBUG-76491
Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This changes many different CMake places to mention Qt6 instead of
Qt5.
Note that some old qt5 cmake config files in corelib are probably not
needed anymore, but I still renamed and kept them for now.
Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
* Simplify add_qt_gui_executable() to not require WIN32/MACOSX_BUNDLE
but provide it implicitly. It's redundant :)
* When on Android, build a module (shared library), just like qmake.
This requires an additional library destination in the install() call,
but that's ignored on other platforms.
* Fix typos in the android deployment generation settings function
* Use the correct cache variable to determine whether we're inside a Qt
build or not. Right now this only works inside Qt builds anyway as
QtPlatformAndroid.cmake is not publically accessible.
Change-Id: If1c763c31a7a83d0e0d854362ba7901657f63eb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Provide add_qt_gui_executable() as function in our public API that takes
care of automaticWinMain linkage. We can use this in the future to
encapsulate similarplatform-specific behavior and adjustments, such as
module generation onAndroid.
In order for the examples to see the function in Qt5CoreMacros, three more
additional fixes were required:
* Do the build_repo_end() call _before_ attempting to build the
examples, as we need the build_repo_end() to include QtPostProcess
and complete the creation of all the target config files.
Otherwise the find_package() calls in the examples see something
incomplete.
* Add more QT_NO_CREATE_TARGET guards
* Always call find_dependency on the dependencies, regardless of the
target creation mode. This way a find_package(Qt5 COMPONENTS
Widgets) will still load Qt5CoreMacros.
Change-Id: I03ce856e2f4312a050fe8043b8331cbe8a6c93e6
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Create CMake config files which can be used from the very same CMake
project. These CMake config files simply do not create any targets,
controlled via the QT_NO_CREATE_TARGETS.
This patch also allows to build qtbase.git:examples as a standalone
project, against an already-built Qt.
Ran this:
ag -s "QT " examples -l -0 | xargs -0 -n 1 .../util/cmake/pro2cmake.py --is-example
Task-number: QTBUG-74713
Change-Id: I44cce5a4048618b30f890c5b789592c227a8b47d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This came about trying to remove the Java-style iterator. It was used to
iterate in reverse order, something QMap can't do, easily, due to lack
of rbegin()/rend(). Instead of writing ugly loops, use a vector of pairs,
fill it, sort it, then iterate over that one in reverse.
Change-Id: I09c8a2732a0699fff4c497778745523e20d348a1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This allows the QFile factory there to actually return the payload in
a unique_ptr instead of falling back to a raw pointer.
The use of a unique_ptr member requires that the destructor be
out-of-line, since QFile is only forward-declared in the header
file. This is good hygiene, so do it for ProgressDialog, too.
Change-Id: Idb6ed327f9592526bb7d0d5b2cfbffe9f08f3eea
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Scope a previous iterator variable better so we can re-use 'it' as the
iterator name.
Change-Id: I46d239ad2d3646168408d1ef29ed74fd07bc663f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The function is const, but the d-pointer doesn't propagate it (raw pointer),
so we need the qAsConst() even here.
Change-Id: I9d2e1f7715abb3dc67a87cdadaa7ded971b15848
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The old code iterated over the peer list, inserting active peers into
a QSet, curiously not stopping to search for clients if it had already
determined the peer to be active.
It then iterated over the peers again, storing the indexes of the
peers it had determined to be active in the first loop, in a QList.
It _then_ iterated over the index list, in reverse, calling removeAt()
on the peers list.
<sean parent>That's a remove_if!</sean parent>
The twist is, that only some maximum number of inactive peers should
be removed, just enough to bring the number of peers below a
predefined number.
To solve, use a lambda that keeps track of the number of times it has
returned true, returning false once the count drops to zero. We can't
use a mutable lambda here, since the STL algorithms are allowed to
copy the predicate as many times as they wish, and, indeed, remove_if
is commonly implemented by calling find_if. But the standard
guarantees exactly one application of the predicate per element, so we
can assume that we're not called again on the same element, and
therefore keep a reference to an external count.
With this, what was a horrible mess becomes a single call to remove_if.
Also change a while(--n) c.removeFirst() loop to a single call of
range-erase.
Change-Id: I6c6a54a1805e5b376800e1116e7aec643e95e4e1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Java-iterators are going to be deprecated.
Change-Id: I2e6353f3fd9e2ddaf0767e7f6cea713249d9591e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The only reason the code used QSharedPointer is that it used QVector
to hold a collection of them, and QVector infamously cannot hold
move-only types such as std::unique_ptr.
Fix by using std::vector<std::unique_ptr> instead. Also, pass the
objeccts into non-sink functions by raw pointer instead of shared_ptr.
As a drive-by, replace clear-following-iterate by the for-exchanged
pattern.
Change-Id: I605fbb98af840c1b93eab9e65c07defd6e7b39e1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".
Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Replace deprecated functions to be able to compile examples with
QT_DISABLE_DEPRECATED_BEFORE=0x050d00
Change-Id: If6b8de31f526320d6a0e2a20bb5f8e26c77f2353
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Replace deprecated foreach macro with range-based for loop
Change-Id: I0d1f2cfd557d02ccc48b41b3fea137baa2962fc1
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Replace all occurrences of QApplication::set/resetOverrideCursor with
the QGuiApplication::set/resetOverrideCursor since it's a static
function of QGuiApplication.
Change-Id: Ic898ab50a7ad4ed2bc9c6acb26cf4a979c2f82af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>