Hi all,

I'm currently working on an Avogadro extension. It should be able to control
most of the Avogadro functionnalities (camera, open file, copy/paste, select
a tool, add hydrogen, ...) with an external controller.
I found the Navigate class to use the camera, and it is ok. But for some
other points, I need help:
I think I can call every other functionnalities by using the MainWindow
instance, am I correct?
I tried to get the MainWindow instance by QObject_casting the parent() of
the extension in a loop in the constructor. The QObject_cast<QMainWindow>
works, but the casting in MainWindow fails.

if (!m_mainwindow) {
QObject *mainwindow = this;
while (mainwindow && !qobject_cast<MainWindow*>(mainwindow)) {
mainwindow = qobject_cast<QWidget*>(mainwindow->parent());
}
m_mainwindow = qobject_cast<MainWindow*>(mainwindow);
}

The error is :
In function `Avogadro::MainWindow*
qobject_cast<Avogadro::MainWindow*>(QObject*)':
/usr/include/qt4/QtCore/qobject.h:366: undefined reference to
`Avogadro::MainWindow::staticMetaObject'

MainWindow is a QObject, I don't understand why the QObject_cast doesn't
work.
Do you know why? (or maybe you know a better idea to resolve my problem)

Regards,

RM
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Avogadro-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

Reply via email to