> If I add the QT_NO_CURSOR flag, Qt5 won’t compile at all.  I’m more concerned 
> about QT_NO_CURSOR not compiling for Qt5.

Here is more detail on the compile errors I am getting:

From the build log:
                cd src\gui\ && "C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\BIN\nmake.exe" -f Makefile

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

                "C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\BIN\nmake.exe" -f Makefile.Debug all

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

                cl -c -FIqt_gui_pch.h -Yuqt_gui_pch.h 
-Fptmp\obj\debug_shared\QtGuid_pch.pch -nologo -Zm200 -Zc:wchar_t- -DDEBUG 
-D_DEBUG -Zi -MDd -W3 -w34100 -w34189 -EHs-c- -GR -DQT_SHARED -DUNDER_CE 
-DWINCE -D_WINDOWS -D_UNICODE -DUNICODE -D_WIN32 -DQT_NO_PRINTER 
-DQT_NO_PRINTDIALOG -DQT_NO_NATIVE_GESTURES -D_CRT_SECURE_NO_DEPRECATE 
-D_CRT_SECURE_NO_WARNINGS -DQT_NO_CLIPBOARD -D_WIN32_WCE=0x600 -Darmv4i 
-D_AMRV4I_ -Darmv4i -D_ARM_ -DHAVE_LOCALTIME_S=0 -DQT_NO_CURSOR=1 
-DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_MAKEDLL -DQT_NO_CAST_TO_ASCII 
-DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER 
-DQT_DEPRECATED_WARNINGS -D_USE_MATH_DEFINES -DQT_USE_BUNDLED_LIBPNG 
-DQT_NO_OPENTYPE -DQT_NO_DIRECTWRITE -DQT_DLL -DQT_CORE_LIB -DQT_NO_EXCEPTIONS 
-I"..\..\include\QtCore\5.0.0" -I"..\..\include\QtCore\5.0.0\QtCore" 
-I"..\..\include\QtCore" -I"..\..\include" -I"..\..\include\QtGui\5.0.0" 
-I"..\..\include\QtGui\5.0.0\QtGui" -I"..\..\include\QtGui" -I"..\..\include" 
-I"tmp\rcc\debug_shared" -I"c:\_Qt5\src\qtbase\src\gui\tmp" 
-I"c:\_Qt5\src\qtbase\src\gui\image" -I"c:\_Qt5\src\qtbase\src\3rdparty\libpng" 
-I"c:\_Qt5\src\qtbase\src\3rdparty\zlib" 
-I"c:\_Qt5\src\qtbase\src\3rdparty\harfbuzz\src" 
-I"c:\_Qt5\src\qtbase\src\3rdparty\zlib" -I"tmp\moc\debug_shared" 
-I"c:\_Qt5\src\qtbase\src\gui" -I"." 
-I"c:\_Qt5\src\qtbase\mkspecs\wincetest-armv4i-msvc2008" 
-Fotmp\obj\debug_shared\ @C:\Users\user\AppData\Local\Temp\nm3BCA.tmp
qguivariant.cpp
c:\_qt5\src\qtbase\src\corelib\kernel\qmetatype.h(374) : error C2248: 
'QCursor::QCursor' : cannot access private member declared in class 'QCursor'
        c:\_qt5\src\qtbase\src\gui\kernel\qcursor.h(70) : see declaration of 
'QCursor::QCursor'                                                              
  
        c:\_qt5\src\qtbase\src\gui\kernel\qcursor.h(62) : see declaration of 
'QCursor'
        c:\_Qt5\src\qtbase\src\gui\kernel\qguivariant.cpp(343) : see reference 
to function template instantiation 'void *qMetaTypeCreateHelper<QCursor>(const 
void *)' being compiled
c:\_qt5\src\qtbase\src\corelib\kernel\qmetatype.h(402) : error C2679: binary 
'<<' : no operator found which takes a right-hand operand of type 'const 
QCursor' (or there is no acceptable conversion)
        
c:\_qt5\jnk\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qchar.h(389):
 could be 'QDataStream &operator <<(QDataStream &,QChar)'
        
c:\_qt5\jnk\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qbytearray.h(612):
 or 'QDataStream &operator <<(QDataStream &,const QByteArray &)'

*** Lot's of other candidates ***

        
c:\_qt5\jnk\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/io/qdatastream.h(163):
 or 'QDataStream &QDataStream::operator <<(const char *)'
        while trying to match the argument list '(QDataStream, const QCursor)'
        c:\_Qt5\src\qtbase\src\gui\kernel\qguivariant.cpp(343) : see reference 
to function template instantiation 'void 
qMetaTypeSaveHelper<QCursor>(QDataStream &,const void *)' being compiled
c:\_qt5\src\qtbase\src\corelib\kernel\qmetatype.h(410) : error C2679: binary 
'>>' : no operator found which takes a right-hand operand of type 'QCursor' (or 
there is no acceptable conversion)
        
c:\_qt5\jnk\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qchar.h(390):
 could be 'QDataStream &operator >>(QDataStream &,QChar &)'
        
c:\_qt5\jnk\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/tools/qbytearray.h(613):
 or 'QDataStream &operator >>(QDataStream &,QByteArray &)'

*** Lot's of other candidates ***

        
c:\_qt5\jnk\qtbase\include\qtcore\../../../../src/qtbase/src/corelib/io/qdatastream.h(150):
 or 'QDataStream &QDataStream::operator >>(char *&)'
        while trying to match the argument list '(QDataStream, QCursor)'
        c:\_Qt5\src\qtbase\src\gui\kernel\qguivariant.cpp(343) : see reference 
to function template instantiation 'void 
qMetaTypeLoadHelper<QCursor>(QDataStream &,void *)' being compiled

****************************

The line producing the error is in qguivaraint.cpp:
static const QMetaTypeInterface qVariantGuiHelper[] = {
    QT_FOR_EACH_STATIC_GUI_CLASS(QT_IMPL_METATYPEINTERFACE_GUI_TYPES)
};

It is using #defines to instantiate templates for each of the types, including 
QCursor (see qmetatype.h for the defn of QT_FOR_EACH_STATIC_GUI_CLASS)

Now there is the following in qmetatype_p.h:
template<> struct TypeDefinition<QKeySequence> { static const bool IsAvailable 
= false; };
but there isn’t a template specialization for QCursor with 
QT_IMPL_METATYPEINTERFACE_GUI_TYPES, so we get all of the above errors.

Here is the define sequence:

#define QT_METATYPE_INTERFACE_INIT(Type) QT_METATYPE_INTERFACE_INIT_IMPL(Type, 
QT_METATYPE_INTERFACE_INIT_DATASTREAM_IMPL)

#define QT_METATYPE_INTERFACE_INIT_IMPL(Type, DATASTREAM_DELEGATE) \
{ \
    /*creator*/(qMetaTypeCreateHelper<Type>), \
    /*deleter*/(qMetaTypeDeleteHelper<Type>), \
    DATASTREAM_DELEGATE(Type) \
    /*constructor*/(qMetaTypeConstructHelper<Type>), \
    /*destructor*/(qMetaTypeDestructHelper<Type>), \
    /*size*/(QTypeInfo<Type>::sizeOf), \
    /*flags*/QtPrivate::QMetaTypeTypeFlags<Type>::Flags \
}

#ifndef QT_NO_DATASTREAM
#  define QT_METATYPE_INTERFACE_INIT_DATASTREAM_IMPL(Type) \
    /*saveOp*/(qMetaTypeSaveHelper<Type>), \
    /*loadOp*/(qMetaTypeLoadHelper<Type>),
#  define QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(Type) \
    /*saveOp*/ 0, \
    /*loadOp*/ 0,
#else
#  define QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(Type) \
    /*saveOp*/ 0, \
    /*loadOp*/ 0,
#  define QT_METATYPE_INTERFACE_INIT_DATASTREAM_IMPL(Type) \
    QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(Type)
#endif

Based on the above defines, I will get the << and >> errors unless I define 
QT_NO_DATASTREAM, but even with QT_NO_DATASTREAM defined I will get the “cannot 
access private member declared in class 'QCursor'” error.  To fix that, there 
either needs to be a public constructor for QCursor (seems like a bad idea), or 
the qMetaTypeCreateHelper<T> needs to go away.

I tried reaching Suzuki-san at a nokia email address I was able to find, but 
have not gotten any reply.  Because all of these functions are part of the core 
of Qt (and not a platform plugin) I assume (although I have not tried) 
QT_NO_CURSOR will fail on all platforms.

I tried creating a 2nd definition of QT_FOR_EACH_STATIC_GUI_CLASS that doesn’t 
include QCursor if QT_NO_CURSOR is defined, but this is causing a ripple effect 
of errors based on code assuming at least a minimal implementation.  Which 
leaves modifying the above defines to create a specialization for QCursor and I 
was hoping someone with more experience could provide some recommendations.

Thanks!

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to