Add QCalendarBackend as a base class for calendar implementations and
QCalendar as a facade via which to access it.
QDate's implicit implementation of the Gregorian calendar becomes
QGregorianCalendar and QDate methods now support choice of calendar.
Convert QLocale's CLDR data for month names to a locale-data component
of each supported calendar and relevant QLocale methods now support
choice of calendar. Adapt Python scripts for locale data generation to
extract month name data from CLDR (keeping on version v35.1) into the
new calendar-locale files. The locale data for the Gregorian calendar
is held in a Roman calendar base, for sharing with other calendars.
Add tests for basic uses of the new API.
[ChangeLog][QtCore][QCalendar] Added QCalendar to support diverse
calendars, supported by implementing QCalendarBackend.
[ChangeLog][QtCore][QDate] Allow choice of calendar in various
operations, with Gregorian remaining the default.
Done-with: Lars Knoll <lars.knoll@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-17110
Fixes: QTBUG-950
Change-Id: I9d6278f394269a183aee8156e990cec4d5198ab8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This was introduced by accident in 4da47d0f.
Fixes: QTBUG-77429
Change-Id: Ic3d9052e1fc83dab5ed3b8725629588208b0d7bb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Windows resource files support a subset of C preprocessor directives.
Among others they can have #include directives.
Use QMake's own scanner to retrieve the files that are included by a
Windows resource file and add them to its dependencies.
For the test case the TestCompiler class had to be extended:
runCommand is now public, and commandOutput is less peculiar.
Fixes: QTBUG-3859
Change-Id: I138703352c37c98297c0574a9a440510c1c494b8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Having those characters in QMAKE_EXTRA_COMPILERS broke the generated
VS project file. They must be replaced by XML entities.
Fixes: QTBUG-1935
Change-Id: Iff1edbeabec4cedef777071682412970b7769f19
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
QMakeLocalFileName is not suitable for QList. Use QVector instead.
Change-Id: I5a3c4c8da14c0a920b5a57cba148ad68ac0f85a2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
RC_FILE is not an internal variable that "rarely needs to be
modified". Mention that it's about Windows resources and link to the
corresponding section.
RES_FILE: Add link to RC_FILE and the more general section. Also
rephrase "compiled Windows resource file" to "Windows resource
compiler's output file" which is more precise.
Fixes: QTBUG-8709
Change-Id: I19c61e6a9505d45fc13fefbcd0ba9441191aa42e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com>
If a project has DESTDIR and TARGET set to fixed values, then the
target paths conflict when doing debug_and_release builds.
With this change we're detecting this situation and yield a warning.
Fixes: QTBUG-2736
Change-Id: Ib163db3463322792ab9fa5b997285ac9fc9819ab
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Libtool cannot cope with absolute paths in the dependency_libs entry.
We split absolute paths into -L and -l here.
Change-Id: I30bf11e490d1993d2a4d88c114e07bbae12def6d
Fixes: QTBUG-76625
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
In MakefileGenerator::initOutPaths() we ensure that directory
variables end with a directory separator, except for DLLDESTDIR.
There doesn't seem to be a valid reason for this exception.
Remove it for the sake of simplifying the code base.
Change-Id: I60eb01b410161e6e1d147d76f044f5140a7573bd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This undocumented option was introduced in
69c22301806b56d56cbe5f5076b889ba98e41a2b (old internal history, 2006) to
prepare some unspecified change to configure that was never done.
Change-Id: I60de731ac9bc6f6424c57574e59e9f6b4f6c5eb3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Re-generation of the Makefile depends on a correctly set up
QMAKE_INTERNAL_INCLUDED_FILES variable. In debug_and_release builds
this variable is set up for Makefile.Debug and Makefile.Release, but
not for the meta Makefile. However, that's where the Makefile
re-generation target is located.
We now collect the contents of QMAKE_INTERNAL_INCLUDED_FILES for
Makefile.Debug/Release and use that for the meta Makefile.
Fixes: QTBUG-13334
Change-Id: I6124a91447d5c54d51680e23570c4e97f44e6a73
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
...because
- it calls the properly camel-cased member function buildArgs(bool),
which is slightly confusing
- it returns buildArgs(true) plus input and output
We also let it return only the arguments, excluding the qmake
executable. This is consistent with the function's name and saves us a
string replacement stunt at one call site.
Change-Id: I8bea65900bd51962962e4cfd425ffbc26e3a52fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Remove usage of the 'if (0 && ...)' pattern that was presumably used
to temporarily disable code paths. The disabling of the two code paths
was introduced in 356a677b386648710efc4db9a8a1b4a975f95c48 (old
internal history, 2004) and
0326e3511928d90329152b9b0493da76e9caa442 (old internal history, 2006).
It can be deduced that it's pretty safe to remove both.
Change-Id: I88aee65b1286701241b5b80fbac0c65cd99ecd5e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Without treating -force_load as an option with an argument, we end up
leaving stray -force_loads in the linker line, resulting in build
failures when the following option is a random library then treated
as a file path.
Task-number: QTBUG-66091
Change-Id: I352c50ab67e32ef6b2b5c6a4f90455b20034e207
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The linker doesn't support -framworkFoo, so neither should we. The correct
syntax is -framework Foo.
Change-Id: I3f39ffc067871ce058542bf0068274b35f7b51f6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This change allows using custom flags for ar. For instance, it is
now possible to create a thin archive by setting QMAKE_LIB += -T.
This uses and extends commit d92c25b1b4
which served a similar purpose for the linker.
Change-Id: Ie1d6a0b957dc4809957726de00911c8d91647fab
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
It conflicts with 'requires' keyword.
Fixes: QTBUG-77093
Change-Id: I85e8f530dd1e2bf9a31906dd6c5123b947235b01
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
ProFunctionDef is move-enabled, meaning its `m_pro` field can
become nullptr. Its usage in the assignment operator and the dtor
must therefore be protected with a check.
Amends 9c63ad562b.
Change-Id: I0c77b07dc83969565480bbb9d9fc80751d4246b1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Not visible in QMake, because of too old C++ standard used to compile it,
but in the qttools copy. Fix here, as the authorative source, first.
Change-Id: I2552eccfaab2cef0863686dcd888f2a5f25ca29f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QChar currently is convertible from nearly every integral type. This
is bad code hygiene and should be fixed come Qt 6.
The present patch is the result of compile fixes from marking these
constructors explicit.
Amends 60ca2f5f7c.
Change-Id: I06887104d42f8327eb6196afcde5f942a74a6a78
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@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 absolute paths of certain static dependencies can have spaces in
them. The _qt5_$${CMAKE_MODULE_NAME}_process_prl_file fails to handle
this, and simply replaces all spaces with semicolons, which obviously
breaks the list of dependencies, and a consuming application fails to
link with a message like:
LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'
This change partially restores the functionality that was added in
102e1822ff specifically the part
that changes qmake to export an additional variable
QMAKE_PRL_LIBS_FOR_CMAKE. This variable has the same content as
QMAKE_PRL_LIBS except it uses a semicolon as a separator, so that
CMake can correctly parse the separate lib entries.
This is much cleaner than trying to parse the original QMAKE_PRL_LIBS
variable with a complicated regular expression.
Amends eda28621f6.
Task-number: QTBUG-38913
Change-Id: I1d18fb779606505bc92320d8ce13232c7022e212
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This reverts commit 224a60989e.
Turns out that we cannot just untangle the determination of
source root and build root, because this breaks the assumption
that every .qmake.conf results in a separate .qmake.cache in the
build tree. QTBUG-76140 must be fixed differently.
Fixes: QTBUG-76907
Change-Id: I5c0a3719d5e00a0f1cacad51651b47c1f284d22d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Since commit 20e9422e we don't ignore exit codes when installing files
anymore. This patch does the same for meta file installation. We
really should be notified properly if something goes wrong here.
Task-number: QTBUG-18870
Change-Id: Ib6a20293380f400379b10ec767bf38dc74d5beeb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
A recurring problem with the Q_NAMESPACE macro is that it declares
an object (staticMetaObject) in the surrounding namespace. That
object lacks any export/import qualification to make it usable
with shared libraries.
Introduce therefore another macro to work around this issue, allowing
the user to prefix the object with an exporting macro, f.i. like this:
Q_NAMESPACE_EXPORT(Q_CORE_EXPORT)
The old macro can simply then be rewritten in terms of this new one,
supplying an empty export macro.
Note that NOT passing an argument to a macro expecting one is well
defined behavior in C99 -- the macro will expand an empty token.
Of course, MSVC doesn't like this and emits warnings. As a
workaround, use a variadic macro.
[ChangeLog][QtCore] Added the new Q_NAMESPACE_EXPORT macro. It
can be used just like Q_NAMESPACE to add meta-object information
to a namespace; however it also supports exporting of such
information from shared libraries.
[ChangeLog][Potentially Source-Incompatible Changes] Prefixing
Q_NAMESPACE with an export macro may no longer work. Use the new
Q_NAMESPACE_EXPORT macro for that use case.
Fixes: QTBUG-68014
Change-Id: Ib044a555ace1f77ae8e0244d824ec473550f3d8e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This saves us lots of .toQString() and .toQStringList() typing when
qDebug()'ing qmake code.
Change-Id: I037e5e1816f2dcb6a20dec4c275f3d886f155ad5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
'make clean' removed the import libs for DLLs which makes them quite
unusable. Move the import lib removal to the 'distclean' target.
Fixes: QTBUG-51977
Change-Id: I727d520435f88a83a7fb14cb0ad81f8fe7c6d61b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Otherwise, it can happen that parsing goes on forever in cumulative
mode.
Task-number: QTCREATORBUG-17656
Change-Id: If69f2265ac7eee0d230bd77a9aa9500e97ebeff6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The qmake code to read output from dependency-generation was adding
QByteArray values to a QString, thereby tacitly converting from UTF-8;
this is misguided. Hopefully, the command emits its output in the same
local 8-bit encoding that QString knows to convert from.
Simplified needlessly verbose loops (that violated Qt coding style) in
the process.
Fixes: QTBUG-75904
Change-Id: I27cf81ffcb63ebc999b8e4fc57abdb9a68c4d2b3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Fix clang warnings that are disabled in the default build.
Change-Id: I4e773a24884db94acdc6c295d3f66da07cd8a5bd
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
QMake searches a .qmake.conf file to determine the source root of the
project, and a .qmake.cache to determine the build root.
If a .qmake.conf exists but no .qmake.cache in the build directory is
found, a build root would be set that is only valid if the build
directory is at the same depth as the source directory.
The invalid build root resulted in the creation of .qmake.cache files
at "interesting" locations (e.g. high up in the directory tree), a
potential cause for even more interesting build failures in the
future.
Fix this by splitting up the loop that determined build and source
root. Both are now determined independently of each other.
Fixes: QTBUG-76140
Change-Id: Ib5c922b87879fcf2f076298a69abcdbc4e8587b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Those modules are TEMPLATE=aux, so they weren't triggering the file creation
here.
To make this work properly we have to:
- check for TEMPLATE aux in the right places
- add a dummy target to INSTALLS to actually trigger the creation
- initialize PRL_TARGET for aux templates
Fixes: QTBUG-75901
Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Idce141629dd34287808bfffd159f92ac28c6c8b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Especially for header modules we don't want a 'Libs:' entry in their
.pc file.
Task-number: QTBUG-75901
Change-Id: I39037d3132e39dd360532e1425f794ebec28e0bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMake code like
rplc.match =
QMAKE_PRL_INSTALL_REPLACE += rplc
led to the generation of invalid sed calls in the Makefile.
It is already actively checked for empty matches, but if *all* matches
are empty, the sed call looks like
sed foo > bar
which is invalid.
Task-number: QTBUG-75901
Change-Id: I173ed99826414dcf06253a15a247f7d067ee3977
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use the whole value of 'name', not just the first element, and also
replace variables like ${QMAKE_FILE_IN}.
This fixes the file_copies feature (COPIES) for Visual Studio
projects, because for every entry in COPIES an extra compiler is
created with a name 'COPY ${QMAKE_FILE_IN}'. Before this patch the
name and the generated file filter would be just 'COPY'. However,
duplicate filters are being skipped by the VS project generator. All
but the first COPIES entry was ignored.
Fixes: QTBUG-76010
Change-Id: Icaa5d2cb8d88ae3ef8ce86220198bca1b9e673f5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Invalid SUBDIRS values like
SUBDIRS += foo \
bar \ \
baz
would produce a Makefile with a sub-- target that will call the make
on the same Makefile again recursively, letting make run forever.
Ignore values like this and print a warning message.
Fixes: QTBUG-76068
Change-Id: I6ca0f8c8238249f1be02d8c311b4c148fd80e707
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
[ChangeLog][qmake] The CONFIG value c++latest was added to select the
latest C++ standard the currently used toolchain supports.
Task-number: QTBUG-75653
Change-Id: I22ddc9d293109d99e652b7ccb19d7226fca4716d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qmake automatically appends a dir_sep to a few directory paths (see
MakefileGenerator::initOutPaths), and various .pri and .prf files rely on
that. Anyhow, for non-MSys MinGW on Windows this creates a problem,
because mingw32-make will interpret the backslash in
OBJECTS_DIR = some_path\
to escape the following newline. We have been working around this
problem in various ways:
- winmakefile.cpp just removes the trailing \ for OBJECTS_DIR, at the
cost of not being compatible with logic in .prf/.pri files that rely on
the separator.
- winmakefile.cpp adds a '#avoid trailing-slash linebreak' comment for
DESTDIR. Anyhow, this does not seem to work for mingw32-make: If you
reference $(DESTDIR), the variable will contain trailing spaces.
- unixmakefile2.cpp duplicates a trailing \ for DESTDIR.
The last approach is now taken also for OBJECTS_DIR.
Task-number: QTBUG-75257
Change-Id: Ie8171a990a9ce1cfbf1b94037252ef2392313338
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Conflicts:
src/corelib/tools/qlocale_data_p.h
(Regenerated by running the scripts in util/local_database/)
src/gui/opengl/qopengltextureuploader.cpp
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
Information about header files is cached by qmake. The key is the
filename of the #include directive. For system includes (<stdio.h>) this
is unique, according to the search order in INCLUDE_PATH.
For local includes, given as "foo.h", there may be name collisions. Usually a
compiler first searches in the directory of the current file (stored in the
sourceDir variable), and only in case of a miss the INCLUDE_PATH is
considered.
The dependency generation now distinguishes local header files by their full
relative path. This is implemented by forcing the use of the full relative
path as key into the SourceFiles data structure if the flag try_local is set.
Change-Id: Ifd75325b53496824054595f7fc98d71bbd9d8aa6
Fixes: QTBUG-72383
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Added a sentence to explain how a .qmake.cache file influences the project root.
Task-number: QTBUG-21411
Change-Id: I97766edd96851f1c988ab07f842fb81a339e4ecd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This fixes the "could not parse compiler option" warning when
generating VS project files.
Fixes: QTBUG-75275
Change-Id: Idd98ae5fdb8ebf5a4e311cbb6cd3ed1daba74ca4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Clang-cl couldn't find the header given to it by -FI when it isn't in
any of the included directories.
Additionally clang-cl 8 has a bug with exported templated classes with
inline methods that causes it to have missing symbols at link time. We
work around this.
Fixes: QTBUG-74563
Change-Id: I7becf05fa8edb07bd4cefe12bee3737e5e1dfa14
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
When installing directories, QINSTALL must not ignore contained hidden
files to be consistent with the old INSTALL_DIR.
Fixes: QTBUG-66835
Change-Id: I3a7c952dcac9732d5b17c5a258f87ca277b388d2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
The comment hints that it's fixing an issue in Visual Studio 2013, which
we don't support anymore.
In all supported Visual Studio Versions -Gm is actually deprecated
anyhow, and not set anymore by default. So I guess it's safe
to remove the special handling here.
Change-Id: I2e8ff85350ba651d9a763aabba7b6494ba88d82e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
...like the install commands before Qt 5.9 did.
This ensures consistent permissions. Also, we can throw away the code
that took care of removing and re-adding the read-only flag on Windows.
This reverts commit a0b5d6e60f with the
addition of preserving permissions when copying directories to properly
install app bundles (QTBUG-74912).
Fixes: QTBUG-74733
Task-number: QTBUG-74912
Change-Id: Iee6d7c5e86787dd3ada5e5e9441209d418100b1f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This reverts commit 3cdf46059a.
It seems change is causing regression & is reverted now to be able to
proceed with releases
Task-number: QTBUG-74912
Change-Id: Ib2365b96ee98fbbcc8853cc7f8726c157c1913a7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
...starting with Qt 5.0.0.
The text is manually inserted there, because \since does not work
within sections.
Task-number: QTBUG-74737
Change-Id: I0fe2d0a113d48be0266030c8466b062c6f743aab
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
For applications that set VERSION the installation targets of pdb
files were wrong in qmake's nmake Makefile generator.
Replace code that tries to reconstruct that target's versioned
extension with TARGET_EXT which already contains the fully resolved
target extension.
Fixes: QTBUG-74265
Change-Id: I9553a5f70170e077a59c866079ae51647ae80bef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
...like the install commands before Qt 5.9 did.
This ensures consistent permissions. Also, we can throw away the code
that took care of removing and re-adding the read-only flag on Windows.
Change-Id: I06bc3af8817f18c016119fbcb7360800d6c129bd
Fixes: QTBUG-74733
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Commit 2327944d added the QMAKE_DEFAULT_LIBDIRS to the library search
paths without taking care that explicit library search paths should be
inserted before system search paths.
Copy the behavior of the UnixMakefileGenerator, esp. of commits
5bc9541e and e185f343.
Fixes: QTBUG-73959
Change-Id: I7e951f432bb5f71ce4bcdb18b7102b4380441181
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
QMake's strategy is generally "pretend everything is Latin 1", which
basically equals "do 8-bit pass-through". Change the handling of
QMAKE_SUBSTITUTES input accordingly to avoid conversion losses when
converting from and to UTF-8.
Fixes: QTBUG-72130
Change-Id: Id903bbd2afa99708c92fd09fab3db944aa819a94
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Visual Studio doesn't support files being in multiple filters and
refuses to load such projects. Source files that appear in variables
that are mapped to file filters (SOURCES, TRANSLATIONS, ...) must not
be added to a second filter if they are input for an extra compiler.
Fixes: QTBUG-74004
Change-Id: Id2d752059c98d04e8154a7848c91f29a94bd092a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>