
awithers at anduin
Jul 3, 2008, 10:34 AM
Post #2 of 3
(246 views)
Permalink
|
|
Re: libMyth fails to build in managedlist.cpp/h
[In reply to]
|
|
> In file included from managedlist.cpp:7: > /usr/local/Trolltech/Qt-4.4.0/include/QtCore/qpointer.h: In member > function ` > QPointer<T>::operator T*() const [with T = ManagedList]': > managedlist.h:42: instantiated from here > /usr/local/Trolltech/Qt-4.4.0/include/QtCore/qpointer.h:80: error: invalid > static_cast from type `QObject*' to type `ManagedList*' It should not be related to your Qt version (in this instance), probably some mix of compiler version/options. ManagedList is forward declared at the top of managedlist.h, when one instantiates QPointer<ManagedList>::operator T*() in ManagedListItem::getParentList(), well the QPointer template would be unaware of ManagedList's inheritance from QObject. Essentially the difference between: struct base {}; template <typename T> struct qp { operator T*() { base *ret = 0; return static_cast<T *>(ret);}}; struct d; int main() { qp<d> dinst; d *p = dinst; } struct d : public base {}; and struct base {}; template <typename T> struct qp { operator T*() { base *ret = 0; return static_cast<T *>(ret);}}; struct d : public base {}; int main() { qp<d> dinst; d *p = dinst; } So, which compiler version are you using? And yes, things should probably be moved around. -- Anduin Withers _______________________________________________ mythtv-dev mailing list mythtv-dev[at]mythtv.org http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
|