Nested namespaces are quite common, therefore moc should support them.
Task-number: QTBUG-55415
Change-Id: I756cab36d498eb4342b402d255836d5d30f07b30
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Regression introduced in c32ef0a725
The expansion vector can be empty, in that case it is not allowed to
call constLast()
Task-number: QTBUG-55853
Change-Id: I47aa8eb7507ee91662215df42b4a66eebaa32bb5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Parsing the other files will (re)generate the same metaobject info in two places
Change-Id: I8984ed30751a7587de870f55dd427f067d1b2495
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Q_NAMESPACE is useful to add Q_ENUM_NS/Q_ENUMS, Q_FLAG_NS/Q_FLAGS and
Q_CLASSINFO to a namespace.
[ChangeLog] Added Q_NAMESPACE which can be used to add Q_ENUM_NS/
Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace
Task-number: QTBUG-54981
Change-Id: Ic61b972794063e77134681fb347d6c4acddcdb44
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Conflicts:
configure
5.7 now supports clang on android; but dev re-worked configure
src/gui/kernel/qevent.h
One side renamed a parameter of a constructor; the other added an
alternate constructor on the next line. Applied the rename to both
for consistency.
tests/auto/tools/moc/tst_moc.cpp
Each side added a new test at the end.
.qmake.conf
Ignored 5.7's change to MODULE_VERSION.
configure.json
No conflict noticed by git; but changes in 5.7 were needed for the
re-worked configure to accommodate 5.7's stricter handling of C++11.
Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
Conflicts:
src/corelib/io/qtemporarydir.cpp
One side encapsulated a repeated piece of #if-ery in a local define;
the other added to the #if-ery. Made its addition to the other's.
src/corelib/kernel/qeventdispatcher_unix_p.h
One side moved some members into a struct; this collided with a #undef
check that neither side now has. Discarded the #undef part.
src/gui/opengl/qopengltexturehelper_p.h
5.7 deleted a bunch of methods; not clear why merge got confused.
src/tools/moc/moc.cpp
One added a name to the copyright header; another changed its URL.
Change-Id: I9e9032b819f030d67f1915445acf2793e98713fa
We should not call prev() if we had already reched the end.
Task-number: QTBUG-54815
Change-Id: I56bc86880a0dbfdce57fc4a08e5950f2ff3a5958
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
C preprocessors augment their standard list of include paths from the
environment: Unix preprocessors use $C_INCLUDE_PATH (for C) and
$CPLUS_INCLUDE_PATH (for C++), plus CPATH for both, whereas MSVC uses
the an environment variable simply called "INCLUDE". Handling this for
MSVC is particularly important because the VCVARSALL.BAT script sets the
necessary #include paths in the environment for important things.
Without that being parsed, moc won't find some #defines, like
WINAPI_DESKTOP_FAMILY.
[ChangeLog][moc] qmake and moc now cooperate to use the Visual Studio
environment variables (set by the VCVARSALL.BAT script) to find system
include files. A possible consequence is that moc parses application
headers slightly differently, depending on #if conditions that depended
on macros that previous versions had not seen #define'd. Implementers of
other buildsystems are advised to pass the --compiler-flavor=msvc option
to moc.
Change-Id: I7e06274214d1939b0124e5b4bf169cceaef9ca46
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
In order for moc to properly parse #ifdefs and family, we've had
QMAKE_COMPILER_DEFINES as a list of pre-defined macros from the
compiler. That list is woefully incomplete.
Instead, let's simply ask the compiler for the list. With GCC and
family, we use the -dM flag while preprocessing. With ICC on Windows,
the flag gains an extra "Q" but is otherwise the same. For MSVC, it
requires using some undocumented switches and parsing environment
variables (I've tested MSVC 2012, 2013 and 2015).
The new moc option is called --include to be similar to GCC's -include
option. It does more than just parse a list of pre-defined macros and
can be used to insert any sort of code that moc needs to parse prior to
the main file.
Change-Id: I7de033f80b0e4431b7f1ffff13fca02dbb60a0a6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Conflicts:
qmake/library/qmakebuiltins.cpp
qmake/library/qmakeevaluator.cpp
qmake/library/qmakeevaluator.h
qmake/project.h
QMakeEvaluator:
* evaluateConditional(): one side changed return type, the other
changed a parameter type.
* split_value_list(): one side changed a parameter adjacent to where ...
* expandVariableReferences(): ... the other killed one overload and
changed the survivor
src/corelib/io/qlockfile_unix.cpp
One side changed a #if condition, the other moved NETBSD's part of
what it controlled.
src/corelib/tools/qdatetime.cpp
One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the
other moved it from the private class to the public one, in the midst
of the "short date-time" optimization, which confused diff entirely.
One side changed a QStringLiteral to QLatin1String, the other rewrote
adjoining code.
src/network/kernel/qauthenticator.cpp
Both rewrote a line, equivalently; kept the dev version.
src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
One side changed #if-ery that the other removed.
tools/configure/configureapp.cpp
One side added a check to -target parsing; the other killed -target.
tests/auto/testlib/selftests/expected_cmptest.lightxml
tests/auto/testlib/selftests/expected_cmptest.teamcity
tests/auto/testlib/selftests/expected_cmptest.txt
tests/auto/testlib/selftests/expected_cmptest.xml
tests/auto/testlib/selftests/expected_cmptest.xunitxml
Regenerated using generate_expected_output.py
I note that quite a few other expected_* come out changed, now.
There was no git-conflict in
src/widgets/kernel/qformlayout.cpp
but it didn't compile; one side removed some unused methods; the other
found uses for one of them. Put FixedColumnMatrix<>::removeRow(int)
back for its new user.
Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
Conflicts:
qmake/library/qmakeevaluator.cpp
One side changed the iterator to use ranged-for, the other changed its
body; they only conflicted because the latter had to add braces around
the body, intruding on the for-line. Trivial resolution.
Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
Do not increment 'data' past the buffer in case of invalid token.
Remove the left over qDebug so we can make a test.
Task-number: QTBUG-54609
Change-Id: I8f0dd3381fbdea3f07d3c05c9a44a16d92538117
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
"foo" ## "bar" doesn't make a lot of sense, but MSVC allows them
(although gcc errors out on them). Simply ignore the ## in this case
instead of aborting with an error.
Fixes parsing of the Windows winsock2.h header.
Task-number: QTBUG-54560
Change-Id: I84cd5fbb56a006cf379430708c955cf0da475cff
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The previous definition of signals does not need to be "public". It may
have been something else.
Change-Id: Id69569111e7d4e619e22ffff144b4855e6acdbef
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
make the 'cleaned' more robust by making sure we do not read past the
buffer in some cases. We must also use resize and not reserve on the
outpt buffer because reseve is meant as a hint and we are not supposed
to write past the size of the QByteArray even if it is reserved.
[ChangeLog][moc] Fixed crash on file ending with \\\r
Task-number: QTBUG-53441
Change-Id: I901e6c0ffc7f8877de3d07fd08cf26495461d294
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Doing what this code section was doing is not valid use of the
preprocessor. Therefore, we don't have to have this behavior and are
allowed to change how moc parses this.
Change-Id: Id69569111e7d4e619e22ffff144b45ea91ae22e3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
If moc is invoked with the @ argument and no options file is specified
or the options file cannot be read, do not try to parse the empty
arguments list. Otherwise QCommandLineParser will print an additional
error message that is of no value for the user.
Task-number: QTBUG-51847
Change-Id: I9aa1eb20a44097b553123be8bc6fded87473a03a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define
and undef in src/corelib/tools/qsimd_p.h.
This change is also squashed with "Fall back to c++11 standard
compiler flag for host builds" which is done by Peter Seiderer.
Conflicts:
mkspecs/features/default_post.prf
src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch
src/3rdparty/sqlite/sqlite3.c
src/corelib/tools/qsimd_p.h
src/gui/kernel/qevent.cpp
src/gui/kernel/qwindowsysteminterface.cpp
src/gui/kernel/qwindowsysteminterface_p.h
src/plugins/bearer/blackberry/blackberry.pro
src/plugins/platforms/cocoa/qcocoasystemsettings.mm
src/plugins/platformthemes/gtk2/gtk2.pro
src/plugins/styles/bb10style/bb10style.pro
src/sql/drivers/sqlite2/qsql_sqlite2.cpp
tools/configure/configureapp.cpp
Task-number: QTBUG-51644
Done-with: Peter Seiderer <ps.report@gmx.net>
Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
This warning is triggered when we try to apply the Q_DECL_HIDDEN
attribute to a class in an unnamed namespace. Such classes are
already not exported.
qobjectdefs.h:175:108: warning: ‘visibility’ attribute ignored [-Wattributes]
qobjectdefs.h:198:108: warning: ‘visibility’ attribute ignored [-Wattributes]
Added a test on gadgets (and QObjects) in unnamed namespaces,
because qtbase currently does not contain such Q_GADGETs.
Done-with: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Ic747cc2ab45e4dc6bb70ffff1438c747b05c5672
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Not that we require it, but since The Qt Company did it for all files
they have copyright, even if they haven't touched the file in years
(especially not in 2016), I'm doing the same.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b4c9d53039846
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
[ChangeLog][Important Behavior Changes] Starting with Qt 5.7, Qt
requires a C++11 compiler with support for C++11 atomics. This affects
user code too: Qt headers no longer compile with a C++98 compiler. The
minimum compiler versions for this release are:
* Clang 3.4 (found in XCode 5.1)
* GCC 4.7
* Microsoft Visual Studio 2012
Change-Id: Ib056b47dde3341ef9a52ffff13ef1f496ea9363f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
This was never a documented feature, but happended to work before Qt 5.5.
It broke because the peoperty access went into the static function and are
now prefixed with '_t->'
So restore the behavior as it was by not including the parentheses in the
member name.
Task-number: QTBUG-47695
Change-Id: Ic3509ddea7ac9abc871e71f5bfbe81d04d08e9bc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
If a macro is used with too few parameters, complaining about its
definition using '#' followed by something other than a macro
parameter name is apt to be confusing - reading the definition will
reveal that the name in fact is a macro parameter after all. The
reader needs attention directed to the invocation, not the definition.
Split the test in two: one to test the prior error message does in
fact get produced for an invalid macro definition, the other to test
the invalid invocation case.
Task-number: QTBUG-46210
Change-Id: Ie177a56d346e553bf9d67e2008a4352633afa1ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The keyword no longer has a meaning for the new CI.
Change-Id: Ibcea4c7a82fb7f982cf4569fdff19f82066543d1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0) by
Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and
add casts where necessary. The values will then be logged
should a test fail.
in tests/auto/other, tests/auto/printsupport and tests/auto/xml.
Change-Id: I28cbdc89d36791f179425f17f90b697c60660938
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
When invoking a macro with less argument than it expect, we would
crash trying to access the vector of arguments from the invocation
as we are trying to substitute an argument.
(Note that we do not show an error in case of argument mismatch
because ithat might happen parsing valid code as moc's c++ parser
is not 100% accurate (that was QTBUG-29331))
Task-number: QTBUG-46210
Change-Id: I3f08d7f5049e593a5bdc02a594ea63cadf66e7a4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Prior to this, moc would not generate the function unless the
gadget class had a property or a non-constructor invokable.
Change-Id: Ic020ea5f8f59702f5e9e194a46e26850e53e5cfe
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
An error similar to the one below would be emitted
by the compiler on the moc generated file:
error: assigning to 'QObject *' from incompatible type 'Gadget *'
if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break;
Change-Id: I75ae7bd6c46d20db2d47a80eaa08aae302d7d6c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
GCC 5 combined with a recent binutils have a new optimization that
allows them to generate copy relocations even in -fPIE code. Clang has
the same functionality when compiling an executable with -flto. We need
to let the compilers know that they cannot use copy relocations, so they
need to use really position-independent code.
Position independent code throughout is not really required. We just
need the compilers to use position-independent access to symbols coming
from the Qt libraries, but there's currently no other way of doing that.
Task-number: QTBUG-45755
Change-Id: I0d4913955e3745b69672ffff13db5df7377398c5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
In replacement for Q_ENUMS and Q_FLAGS.
Q_ENUM(Foo) has to be put after the declaration of Foo in an object.
It will tell moc to include the enum in the meta object (just like
Q_ENUMS) and will allow templated code to get the metaobject for
that enum.
Will be used by QDebug and QMetaType
Change-Id: Iefaf8ae07dc0359828102bf384809346629b3e23
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
The call was invalid from C99 perspective.
Change-Id: Ie07310735736eddf5eb0e142297e56164fde7fe4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Contrarily to Q_OBJECTs, Q_GADGETs are not guaranteed to
descend from a Q_GADGET. Here, we ensure that if the first
superclass is a Q_GADGET, then the derived class will be
treated as one. This allows gaps in the Q_GADGET hierarchy
while preventing from trying to link to the inexistent
staticMetaObject if there's no such ancestor.
Change-Id: If10fb952e23655102a425bb18fe8babaf447a47f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>