On Saturday 11 May 2013 14:09:38 Dominik Holland wrote: > On May 11, 2013, at 1:50 PM, Olivier Goffart <oliv...@woboq.com> wrote: > > On Saturday 11 May 2013 11:41:03 魏越闽 wrote: > >> Hi, > >> My test result: > >> https://bugreports.qt-project.org/browse/QTBUG-31064?focusedCommentId=202 > >> 419 > >> &page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#c > >> omme nt-202419 > > > > You need to have both > > https://codereview.qt-project.org/#change,55521 > > and > > https://codereview.qt-project.org/#change,55658 > > > > With those two patches, you should be able to have an application with > > both > > QtQuick1 and QtQuick2 > > > > Howerver, you still cannot include QtQuick1 and QtQuick2 headers in the > > same translation unit. > > In other words, code using QtQuick1's QtDeclarative, and code using > > QtQuick2's QtQml needs to be in different .cpp files. > > I haven't had a look at the patches but i hope you will get some nice > warning when trying this or it is documented in both modules. Otherwise it > will lead to a lot of confusion… > > Dominik
This is not (yet) documented. Currently, you get errors such as: (from the bug report) QtDeclarative/qdeclarative.h(57): warning C4005: 'QML_DECLARE_TYPE' : macro redefinition QtQml/qqml.h(59) : see previous definition of 'QML_DECLARE_TYPE' QtDeclarative/qdeclarative.h(70): error C2365: 'QML_HAS_ATTACHED_PROPERTIES' : redefinition; previous definition was 'enumerator' QtQml/qqml.h(72) : see declaration of 'QML_HAS_ATTACHED_PROPERTIES' Something like that could be done in the headers: #ifdef QQML_H #error "you cannot include both QtQml and QtDeclarative headers in the same translation unit" #endif -- Olivier Woboq - Qt services and support - http://woboq.com - http://code.woboq.org _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development