Compile problem with KUrl::operator QVariant()

Harri Porten porten at kde.org
Mon Mar 26 20:09:54 BST 2007


Hi!

I can't compile kdelibs anymore (see attached error) since change

   http://websvn.kde.org/?view=rev&revision=644457

was applied that added a QVariant conversion operator to KUrl. Maybe my 
compiler is too old (gcc 3.3.5) but isn't there anyway to rewrite the 
code? After all, I find it to be a questionable design to add such 
operators. The conversion should be done outside of the class IMO.

Harri.
-------------- next part --------------
[  0%] Building CXX object khtml/CMakeFiles/khtml.dir/khtmlview.o
In file included from /home/porten/svn4/kdelibs/kparts/part.h:25,
                 from /home/porten/svn4/kdelibs/khtml/khtml_part.h:32,
                 from /home/porten/svn4/kdelibs/khtml/khtmlview.cpp:32:
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h: In static member 
   function `static int QMetaTypeId2<T>::qt_metatype_id() [with T = KUrl::List]
   ':
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h:178:   instantiated from `int qMetaTypeId(T*) [with T = KUrl::List]'
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qvariant.h:405:   instantiated from `QVariant qVariantFromValue(const T&) [with T = KUrl::List]'
/home/porten/svn4/kdelibs/kdecore/io/kurl.h:150:   instantiated from here
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h:168: error: 'struct 
   QMetaTypeId<KUrl::List>' has no member named 'qt_metatype_id'
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h: In static member 
   function `static int QMetaTypeId2<T>::qt_metatype_id() [with T = KUrl]':
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h:178:   instantiated from `int qMetaTypeId(T*) [with T = KUrl]'
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qvariant.h:405:   instantiated from `QVariant qVariantFromValue(const T&) [with T = KUrl]'
/home/porten/svn4/kdelibs/kdecore/io/kurl.h:766:   instantiated from here
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h:168: error: 'struct 
   QMetaTypeId<KUrl>' has no member named 'qt_metatype_id'
/home/porten/svn4/kdelibs/kdecore/io/kurl.h: At global scope:
/home/porten/svn4/kdelibs/kdecore/io/kurl.h:999: error: redefinition of `struct 
   QMetaTypeId<KUrl>'
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h:160: error: previous 
   definition of `struct QMetaTypeId<KUrl>'
/home/porten/svn4/kdelibs/kdecore/io/kurl.h:1000: error: redefinition of `
   struct QMetaTypeId<KUrl::List>'
/mnt/extra/kde4svn/qt-copy/src/corelib/kernel/qmetatype.h:160: error: previous 
   definition of `struct QMetaTypeId<KUrl::List>'
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp: In member function `virtual void 
   KHTMLView::mouseMoveEvent(QMouseEvent*)':
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp:1292: warning: `erase' is 
   deprecated (declared at /mnt/extra/kde4svn/qt-copy/src/gui/kernel/qwidget.h:
   947)
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp:2487:2: warning: #warning "port QFocusEvent::setReason( QFocusEvent::Shortcut ); to qt4"
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp:2492:2: warning: #warning "port QFocusEvent::resetReason(); to qt4"
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp:2979:2: warning: #warning "This could not be tested when merge was done, suspect"
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp:3002:2: warning: #warning "This could not be tested when merge was done, suspect"
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp: In member function `void 
   KHTMLView::clearCompletionHistory(const QString&)':
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp:3140: warning: `writeEntry' is 
   deprecated (declared at 
   /home/porten/svn4/kdelibs/kdecore/config/kconfigbase.h:700)
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp: In member function `void 
   KHTMLView::addFormCompletionItem(const QString&, const QString&)':
/home/porten/svn4/kdelibs/khtml/khtmlview.cpp:3168: warning: `writeEntry' is 
   deprecated (declared at 
   /home/porten/svn4/kdelibs/kdecore/config/kconfigbase.h:760)
make[1]: *** [khtml/CMakeFiles/khtml.dir/khtmlview.o] Error 1
make: *** [khtmlview.o] Error 2


More information about the kde-core-devel mailing list