Go to file
Giuseppe D'Angelo 365904085e QFile: make constructors taking a path explicit
This is a level A SIC, as it breaks

  QFile f = "/some/path";

In general, it's not a good idea to have this implicit conversion. A
QFile is not a representation of a path, so the conversion should be
explicit.

I am going to keep the current semantics (implicit conversion) up to and
including Qt 6.8 (LTS). Starting from 6.9, the constructor will be
unconditionally explicit. This is deliberate, and done in order to make
users fix their code while staying in Qt 6, rather than encountering
this issue (and countless many more) if and when they upgrade from Qt 6
to Qt 7. In the meanwhile, users can opt-in to the new semantics by
defining a macro.

[ChangeLog][QtCore][QFile] The QFile constructors that take a path are
going to become unconditionally `explicit` in Qt 6.9. Code like `QFile f
= "/path";` will need to be ported to equivalent one (e.g. `QFile
f{"/path/"}`). This has been done in order to prevent a category of
mistakes when passing strings or paths to functions that actually take a
QFile. Users can opt-in to this change even before Qt 6.9 by defining
the QT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH macro before including any
Qt header.

Change-Id: I065a09b9ce5d24c352664df0d48776545f6a0d8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-29 23:22:25 +02:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin Minor fixes for qt-configure-module 2022-06-27 17:55:19 +02:00
cmake QFile: make constructors taking a path explicit 2022-10-29 23:22:25 +02:00
coin wasm: Add WebAssembly to platform of built tests on module-only build 2022-10-15 19:50:41 +02:00
config.tests Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Add a shortcut editor example 2022-10-25 14:38:46 +01:00
examples examples: fix configuring with -no-feature-widgets 2022-10-29 01:04:06 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
LICENSES Add license text file for Creative Commons Zero (CC0) 1.0 2022-10-19 12:06:09 +02:00
mkspecs Apple: Add CFBundleAllowMixedLocalizations=YES to Info.plist files 2022-10-25 10:06:59 +00:00
qmake Ensure proper format of Info.plist 2022-10-19 12:06:09 +02:00
src QFile: make constructors taking a path explicit 2022-10-29 23:22:25 +02:00
tests tests: fix configuring with -no-feature-gui 2022-10-29 01:04:09 +02:00
util Port from qAsConst() to std::as_const() 2022-10-11 23:17:18 +02:00
.cmake.conf Replace the syncqt.pl script with syncqt tool 2022-09-27 13:12:11 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
conanfile.py Conan: Do not force 'qt_host_path' usage in cross-build context 2022-06-22 18:18:42 +03:00
config_help.txt Add -disable-deprecated-up-to parameter to configure script 2022-08-19 23:52:05 +02:00
configure Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.bat Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.cmake Allow specifying different linkers for MinGW 2022-10-25 13:19:41 +00:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
qt_cmdline.cmake QCryptographicHash: implement OpenSSL 3.0 support 2022-09-26 17:26:37 +02:00
sync.profile Move qurltlds_p.h out of src/network, and make it a .cpp file 2022-10-01 06:24:51 +00:00