Page 1 of 1
Error to access mainwindow
Posted: Mon Feb 05, 2018 9:56 am
by dmmontes
Hi, I'm developping a plugin but when I try to access to MainWindow::TheInstance, for example, I get an error LNK2019: "two external whitout resolve...". What can I do to access to this functions or others? Thank you
Re: Error to access mainwindow
Posted: Mon Feb 05, 2018 11:05 am
by daniel
You have to use the 'm_app' member of the plugin to access the main application resources.
See how the other plugins are doing it.
Re: Error to access mainwindow
Posted: Mon Feb 05, 2018 12:51 pm
by dmmontes
I have searched but there aren't plugins that use functions like MainWindow::TheInstance or MainWindow::putObjectBackIntoDBTree. These functions are used only in qcc/ and aren't accesible from m_app, at least, I couldn't. Is there any method to do that?
Re: Error to access mainwindow
Posted: Mon Feb 05, 2018 7:43 pm
by daniel
The m_app interface is actually the MainWindow instance but limited to the methods that plugins are currently allowed to access (for various reasons).
If you can explain why you need to access the 'putObjectBackIntoDBTree' specifically we may add it to the interface. In this particular case, you shouldn't call 'putObjectBackIntoDBTree' if you haven't called 'removeObjectTemporarilyFromDBTree' before. Is this really what you want to do?
Re: Error to access mainwindow
Posted: Tue Feb 06, 2018 2:05 pm
by dmmontes
Yes I would like to use both methods. I'm working in a plugin to interactuate with the program with a device. So I must use these methods to move or rotate a single mesh and apply changes.
Re: Error to access mainwindow
Posted: Tue Feb 06, 2018 8:00 pm
by daniel
Actually these methods are just here to make sure that children of the entity (in the DB tree) which may be discarded by the process you are applying are correctly removed from the DB tree.
In effect, if your clouds or meshes don't have any octree, or if you manually remove the octree before transforming the entities, then you don't need to call them. But I'll make these methods accessible for the sake of "cleanliness".
Re: Error to access mainwindow
Posted: Tue Feb 06, 2018 8:24 pm
by dmmontes
Ok, thank you very much, notify me when this be posible
Re: Error to access mainwindow
Posted: Tue Feb 06, 2018 10:08 pm
by daniel