> I think this option could be very useful. The extension I'm working on
> should allow to use Avogadro with an external controller in order to
> improve the usability. By accessing the main windows, my goal was to
> make any option of the menu bar, the tool bar and maybe the dock
> widgets available to the extension.
Well, this is off the top of my head -- I haven't checked code yet. I'd be
curious if QtScript or the Qt accessibility framework make this easier.
1) Tool bar is easy -- you can already switch tools with code.
foreach(Tool *tool, GLWidget::current->toolGroup()->tools())
{
qDebug() << tool->identifier();
}
// or something like this
GLWidget::current()->toolGroup()->setActiveTool("Manipulate");
2) Accessing the MainWindow and Dock widgets can occur through qApp():
foreach( QWidget *widget, qApp->topLevelWidgets() ) {
if ( qobject_cast<MainWindow *>( widget ) )
mainWindowCount++;
}
All widgets can be accessed through the Qt meta-object system:
http://doc.qt.nokia.com/4.7/qmetaobject.html#methodCount
http://doc.qt.nokia.com/4.7/qmetaobject.html#invokeMethod
If you can tell us a little more about what you're planning in the extension,
it might be easier for us to give specifics.
Hope that helps,
-Geoff
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Avogadro-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avogadro-devel