Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.7.0
-
None
-
Gentoo Linux, Qt 5.6 and 5.7 compiled from sources.
Description
The behaviour of qdbuscpp2xml w.r.t. the include search has changed in Qt 5.7. In Qt 5.6 the tool was looking for includes in the directory of the output file. In Qt 5.7 the search is performed in the directory of the source header file. This breaks interfaces which have some methods wrapped around #ifdef-s and use config.h to define them.
Consider this example consisting of two headers:
src/testinterface.h
#ifndef _TESTINTERFACE_H #define _TESTINTERFACE_H #include <QtDBus/QDBusContext> #include "config.h" class TestInterface : public QDBusContext { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.test.TestInterface") public: TestInterface(); virtual ~TestInterface(); Q_SCRIPTABLE void sampleMethod(); #ifdef HAVE_TEST Q_SCRIPTABLE void sampleTestMethod(); #endif } #endif
build/config.h
#ifndef _CONFIG_H #define _CONFIG_H #define HAVE_TEST #endif
When running qdbuscpp2xml from the build directory using the command:
qdbuscpp2xml -a /home/kriss/workspace/qdbustest/src/testinterface.h -o /home/kriss/workspace/qdbustest/build/testinterface.xml
the results are different depending on Qt version:
testinterface.xml (Qt 5.6)
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node> <interface name="org.test.TestInterface"> <method name="sampleMethod"> </method> <method name="sampleTestMethod"> </method> </interface> </node>
testinterface.xml (Qt 5.7)
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node> <interface name="org.test.TestInterface"> <method name="sampleMethod"> </method> </interface> </node>