Also remove the example code for deprecated methods and use CBOR instead
where it makes sense.
Task-number: QTBUG-81068
Change-Id: Iffb7a4b3d7b16a1e485fc05b3ab2e2468e9e0718
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Since 072ca960f5 changed the default
of the styles example back to Norwegian Wood, it is no longer
suited as gallery example.
Extract the dialog from it and re-add it as a gallery example Add a
tooltip displaying the class name and a help shortcut opening the
documentation.
Restructure the group boxes to add more widgets.
Remove the gallery meta-tag from the styles example.
Task-number: PYSIDE-1112
Change-Id: Ie6f13084012771bd8f5bf9cad23b58d0720fdd92
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Deprecated the SAX classes and disabled or replaced their uses in
tests if applicable.
Removed the saxbookmarks example, no point in keeping examples for
the deprecated code.
[ChangeLog][QtXml] SAX classes are now deprecated. Use QXmlStreamReader,
QXmlStreamWriter in QtCore instead.
Task-number: QTBUG-76177
Change-Id: Ic171d62fa0527b0f36f94cf09a69586092269957
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
src/corelib/serialization/qjsonvalue.cpp:174: (qdoc) warning: No such parameter 'n' in QJsonValue::QJsonValue()
...
examples/widgets/doc/src/icons.qdoc:584: (qdoc) warning: Command '\snippet (//! [24])' failed at end of file 'widgets/icons/mainwindow.cpp'
src/corelib/text/qbytearray.cpp:5177: (qdoc) warning: clang found diagnostics parsing \fn QByteArray::FromBase64Result::operator QByteArray() const
error: out-of-line definition of 'operator QByteArray' does not match any declaration in 'QByteArray::FromBase64Result'
src/corelib/serialization/qjsonarray.cpp:178: (qdoc) warning: Overrides a previous doc
src/corelib/serialization/qjsonarray.cpp:140: (qdoc) warning: (The previous doc is here)
src/corelib/serialization/qjsonobject.cpp:1016: (qdoc) warning: clang found diagnostics parsing \fn QJsonValueRef QJsonObject::iterator::operator[](int j) const
error: out-of-line definition of 'operator[]' does not match any declaration in 'QJsonObject::iterator'
src/corelib/serialization/qjsonobject.cpp:1267: (qdoc) warning: clang found diagnostics parsing \fn QJsonValue QJsonObject::const_iterator::operator[](int j) const
error: out-of-line definition of 'operator[]' does not match any declaration in 'QJsonObject::const_iterator'
src/corelib/tools/qhash.cpp:2641: (qdoc) warning: Overrides a previous doc
src/corelib/tools/qhash.cpp:1492: (qdoc) warning: (The previous doc is here)
src/corelib/tools/qhash.cpp:2659: (qdoc) warning: Can't link to 'unit()'
src/corelib/text/qchar.cpp:274: (qdoc) warning: Undocumented enum item 'Script_Sundanese' in QChar::Script
src/corelib/text/qchar.cpp:274: (qdoc) warning: No such enum item 'Script_Sundaneseo' in QChar::Script
src/network/ssl/qsslsocket.cpp:1514: (qdoc) warning: Can't link to 'QSslConfiguration::addDefaultCaCertificate()'
src/widgets/widgets/qtabwidget.cpp:581: (qdoc) warning: Undocumented parameter 'visible' in QTabWidget::setTabVisible()
Change-Id: I05c2a4884873850b684fa94036cd90db1a6e7726
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Instead of polishing the (possible) system palette. Makes the checkbox
for "Use style's standard palette" actually work for the custom style,
and is how styles are supposed to provide their own preferred palette.
Change-Id: I3228ef45c023d0d058e48ff0fc14f094367b2008
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Allows running the example with -style foo or QT_STYLE_OVERRIDE.
No changes to documentation needed.
Change-Id: Id7cef450f13faabd118badde51afb7273439c9fc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Relying on the hard clipping of QRegion widget masks to create
non-rectangular windows is a solution from a bygone era. The result
looks horrible with today's eyes, particularly on a high-dpi
screen. Update the example to create smooth anti-aliased edges using
translucent window bacground.
Task-number: QTBUG-64229
Change-Id: I8859d61177d2a2dc446632c23f27f42050e0d7c7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The example is useful as a gallery for widgets in
which case the custom Norwegian Wood style is not primarily interesting.
Change-Id: I96e304f97edeb43da6e8f572e01a768b1317722c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This was used to support QFlags f = 0 initialization, but with 0 used
as a pointer literal now considered bad form, it had been changed many
places to QFlags f = nullptr, which is meaningless and confusing.
Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add missing include removed by 13426aff24.
Fixes: QTBUG-80163
Change-Id: I6b81f399a3abf637a2023700baac09b631d652d5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
QMenuBar is only forward declared in QMainWindow. I don't think this is
a recent change or breakage, just noticed then when running a complete
build of the 5.15 branch.
Change-Id: Ia1a072044bd26c5f3f51ec5f5b0f72f065a0576f
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@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>
The documentation was forgotten in
5d4b5dab7f
Change-Id: I4e0f8f507199601910a174a080936b9a619048a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::sendMessage()’:
examples/corelib/tools/customtypesending/window.cpp:79:71: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy]
79 | thisMessage = Message(editor->toPlainText(), thisMessage.headers());
| ^
In file included from examples/corelib/tools/customtypesending/window.h:55,
from examples/corelib/tools/customtypesending/window.cpp:52:
examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’
62 | Message(const Message &other);
| ^~~~~~~
examples/corelib/tools/customtypesending/window.cpp: In member function ‘void Window::setMessage(const Message&)’:
examples/corelib/tools/customtypesending/window.cpp:87:19: warning: implicitly-declared ‘Message& Message::operator=(const Message&)’ is deprecated [-Wdeprecated-copy]
87 | thisMessage = message;
| ^~~~~~~
In file included from examples/corelib/tools/customtypesending/window.h:55,
from examples/corelib/tools/customtypesending/window.cpp:52:
examples/corelib/tools/customtypesending/message.h:62:5: note: because ‘Message’ has user-provided ‘Message::Message(const Message&)’
62 | Message(const Message &other);
| ^~~~~~~
Change-Id: I563d53f7dd1e0e0dc5fd4db06299b2d0a70c62ff
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Due to work group size configured for desktop GL.
Change-Id: Id62cf297e280e04aecba748cf41b62c64ed9a0b2
Done-with: Andrey Yaromenok <ayaromenok@gmail.com>
Fixes: QTBUG-79374
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Replace QItemDelegate with QStyledItemDelegate in the examples since
QItemDelegate is deprecated.
Also fix up some unused documentation snippet references.
Change-Id: I42b8780ad0c317b9a253cc722d0b471695ed253f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
std::abs(int) is defined in cstdlib which is not included on QNX.
Fixes: QTBUG-78763
Change-Id: I14d087069369db7ab4e5db9d4f816a3fbffe95f6
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
Cleanup QtWidgets examples:
- use nullptr (clang-tidy)
- use member-initialization
- adjust the style
- fix includes
Change-Id: Ic5448606aacc525ea60b615a69227017aa2b821a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The flowlayout example crashes on startup because the last change
removed a c-style cast which converted -1 to ~0U ...
Fixes: QTBUG-78861
Change-Id: I0dbed4472b4f68a92b3f92763d00d28baa186f9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Don't use the hardcoded indices 0 and 1 but the ones returned from
QOpenGLShaderProgram::attributeLocation(). Also change them from GLuint
to GLint.
Fixes: QTBUG-43566
Change-Id: I582bcf899f20d90f4ec1cd61326a177aabb69992
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Cleanup the OpenGL examples
- use nullptr (clang-tidy)
- use member-initialization
- avoid redundant checks for != nullptr when deleting a pointer
Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
...instead of the qt_ meta catalogs. The qt_ catalogs
are needed for backwards compatibility and depend on
translations for now deprecated modules, such as qtscript,
that might not be installed in the system. This causes
loading the translation to fail.
Instead of the qt_ catalogs, the examples should use the
translation files for the Qt modules used, here qtbase_.
Task-number: QTBUG-69203
Change-Id: I13f5a3d6653cef8379a712fbc02ec320eea4e51a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Cleanup QtWidgets tools examples:
- use member-init (clang-tidy)
- fix includes/don't include QtWidgets globally
- include own header first
- use nullptr (clang-tidy)
- avoid c-style casts
- use QVector instead QList
- use QItemDelegate instead QStyledItemDelegate
Change-Id: Ibe9440cdf711e5cc2138c054864edebe1fc95731
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Cleanup GraphicsView examples with the help of clang-tidy
- modernize-use-nullptr
- modernize-use-default-member-init
- modernize-use-override.IgnoreDestructors
- Some QList -> QVector changes
- use nullptr
- use normalized includes, remove unused includes
- fix style
Change-Id: I79347e55bfde52f6ae7749cc7093fbd442044020
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fix an API review finding in 5.14, amending
6b9d319b26.
Change-Id: I6c67ebde91021b87a43a86ff831b724f098019aa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
- Replaced the usages of deprecated QWheelEvent::delta() and
QWheelEvent::orientation() with QWheelEvent::angleDelta().
In most of the examples it is acceptable to use only the vertical
component of angle delta.
- Made the docs APIs to build conditionally, based on the
deprecation version.
Task-number: QTBUG-76491
Task-number: QTBUG-76540
Change-Id: Id4230d483f724af49e4b6349b44881c3944de2a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The benefit of keeping this code around was to inspire or inform
changes in the areas to take into account possibly missing features
in Qt 5, but at this point that benefit is questionable. We can
always use the history to learn about missing pieces if needed.
Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Cleanup the QtWidgets animation examples:
- use nullptr
- use normalized includes, remove unused includes
- fix style
- fix crash of sub-attaq when the game ended (error during range-based
for loop porting)
- don't use keyword 'final' for a variable name
Change-Id: Id23be8ff8b1b310da005d13c052fe547f6a0d63a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Add Options flags similar to QFileDialog:
- DontWatch: Do not use file system watchers for simple
use cases like line edit completion. This brings it
closer to QDirModel, which then can be deprecated.
- DontResolveSymlinks: Similar to
QFileDialog::DontResolveSymlinks.
- DontUseCustomDirectoryIcons: matching
QFileIconProvider::DontUseCustomDirectoryIcons for
convenience.
Task-number: QTBUG-76493
Change-Id: I09d3cb73ef902a700e6ebfba427e2d990fce4b4c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As a macro, we can't directly deprecate it, but need to make it call
something deprecated. That is a new ctor with a new enum type
added. The type might be useful for other such ventures, so put it
into qglobal.h
Remove the QT_NO_UNICODE_LITERAL protection, as it's always false
these days, and QT_UNICODE_LITERAL is unconditionally #defined a 20
lines above.
[ChangeLog][QtCore][QStringView] Deprecated the (undocumented)
QStringViewLiteral macro. Just use u"" or QStringView(u"") instead.
Change-Id: I9141320225037e1bc6b7f920bf01a9d0144fdac2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
- Replace the usages of deprecated APIs by corresponding
alternatives in the library code and documentation.
- Build docs for deprecated APIs conditionally, based on deprecation
version. Remove the docs of methods deprecated since 5.0.0, these
methods are not compiled anymore.
- Modify the tests to make them build when deprecated APIs disabled:
* Make the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods
are enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, add tests for the replacement
Task-number: QTBUG-76491
Task-number: QTBUG-76540
Task-number: QTBUG-76541
Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This change removes the leftovers form other cleanup commits.
Task-number: QTBUG-76491
Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
QScopedPointer is scheduled for deprecation, and can't decide whether
it wants to be a scoped, or a unique pointer.
The use of a unique_ptr members requires that the destructor be
out-of-line, since the payload classes are only forward-declared in
the header file.
Change-Id: Id0dcdde52cb3adc30d3051d2eed1d24c76154921
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- Replaced the usages of deprecated APIs by corresponding
alternatives in the library code and documentation.
- Modified the tests to make them build when deprecated APIs disabled:
* Made the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods are
enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, added tests for the replacement.
Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Conflicts:
configure.pri
Also required s/solid\.color/solidColor/ in a couple of places in:
src/gui/painting/qpaintengine_raster.cpp
Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
The "None" and "Custom icon" cases where using the same value for icon
type, which resulted in both options showing the application icon.
Use -1 to indicate the custom option, and treat all other options
the same.
Task-number: QTBUG-76916
Change-Id: Ib715f5d328175bd6e221b3f507087954fa542838
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
- Replaced the usages of deprecated APIs of corelib by corresponding
alternatives in the library code and documentation.
- Modified the tests to make them build when deprecated APIs disabled:
* Made the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods are
enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, added tests for the replacement.
Task-number: QTBUG-76491
Task-number: QTBUG-76539
Task-number: QTBUG-76541
Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Used const variables for the SQL statements,
so that the code looks similar to its
couterpart in Qt for Python.
Change-Id: If2a505a404deff77d3d37c5ffad913c8c538d0b3
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Using QImage allows creating the style before the application has
been created, and is the more modern API.
No changes to the documentation needed.
Change-Id: Ifa0e5fa1113802fca18fbd45bb3c0a5ba1dbfeab
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
...instead of compatibility, in order to play nice with systems
that have no compatibility profile support (macOS). Instancing
needs OpenGL 3.x so sticking with 2.x contexts is not an option.
The example looks fully compatible with core profile so its
functionality should not change.
Change-Id: If0d554a6208973aa8a4fb86757e246d170cd0e71
Fixes: QTBUG-75680
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: I46363e5b8944459e8c48fffd158c03bca4b7394e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
QSaveFile should preferably be used by editor applications to catch
write errors.
Task-number: QTBUG-60635
Change-Id: Ia609435871b56b45714c3dd3d32bbc85b5cb4dd5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@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>
Set AA_UseHighDpiPixmaps.
Task-number: QTBUG-52622
Change-Id: Ic4373a9c94952f50bc1ad36bcc0dec850efc124a
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@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>
QPixmapCache::find(QString) and QPixmapCache::find(QString, QPixmap&)
are deprecated since Qt4 times.
Explicit mark them as deprecated so they can be removed with Qt6.
Change-Id: Iaf185f69afe02203559a1c812fbb4a95c9049a1d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Replace deprecated foreach macro with range-based for loop
Change-Id: If919ba1d1d4acddfc1c5460ce7aebf8c49e3ac38
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Cleanup the Widgets examples - adjust includes to Qt coding style and
remove unused includes and formward declarations
Change-Id: I9f2e513284ad631337ff52ec9c0b98645055dcca
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Cleanup the Widget examples - replace foreach with a standard for loop
Change-Id: I59cb2bf4494201f9f0228b07a8bb936ce40da46f
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Replace 0 with \nullptr in the documentation.
As a drive-by also replace some 0 with nullptr in the corresponding
code.
Change-Id: I8d7e9c838da1399988a830669d58fc7f2f010696
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Cleanup the widgets examples - use new signal/slot syntax where possible
Change-Id: I6bc8953534d8b1efca0de4ee6a9fe4a6aa79fda9
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>