[Solved] moc +boost::noncopyable namespace Probleme (QT4.1)
Verfasst: 8. Juni 2006 09:26
das moc und namespace einige Probleme hat *1), habe ich nun schon nachlesen können, aber nun stehe ich ganz platt da:
Offenbar bekommt er den namespace nicht gebacken, konkret schreibe ich:
importiere also boost in meinen namespace. Irgendeine Lösung/Hinweis?
moc macht daraus:
*1) leider nimmt moc dieses:
nicht an; moc erlaubt den switch -Dfoo=bar, aber es hat nicht funtioniert (Qt4.1.2); btw gibt es eine QMAKE Variable dafür?
Viele Grüße
Olaf
Code: Alles auswählen
moc_application.cpp(56) : error C2039: 'qt_metacast': Ist kein Element von 'boost::noncopyable_::noncopyable'
d:\boost-1_33_1\boost\noncopyable.hpp(22): Siehe Deklaration von 'boost::noncopyable_::noncopyable'
moc_application.cpp(61) : error C2039: 'qt_metacall': Ist kein Element von 'boost::noncopyable_::noncopyable'
d:\boost-1_33_1\boost\noncopyable.hpp(22): Siehe Deklaration von 'boost::noncopyable_::noncopyable'
Code: Alles auswählen
namespace eda {
using boost::noncopyable;
}
namespace eda {
class Application : public noncopyable, public QObject { Q_OBJECT ... };
}
moc macht daraus:
Code: Alles auswählen
void *Application::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_Application))
return static_cast<void*>(const_cast<Application*>(this));
if (!strcmp(_clname, "QApplication"))
return static_cast<QApplication*>(const_cast<Application*>(this));
return noncopyable::qt_metacast(_clname);
}
int Application::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = noncopyable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: initialized(); break;
}
_id -= 1;
}
return _id;
}
*1) leider nimmt moc dieses:
Code: Alles auswählen
#define NS_BGN namespace eda {Viele Grüße
Olaf