Can an Extension have a QDockWindow?

Hi,

I’m experimenting building a new extension for Avogadro.
Is it possible to have for an extension a dockWindow(), just like the
"Tool Settings…" and “Display Settings” dock windows?
There is a virtual interface function

QDockWidget* Extension::dockWidget()

which, according to the documentation is supposed to return a list (?)
of QDockWidgets , but I don’t understand how I should use this function.
Can somebody explain how this can be done?

Kind Regards,
Bertwim

While I haven’t replied or talked on this list in forever (or seen the
new updates to the code), when I originally created that virtual
function, it was used to allow extensions to add QDockWidgets to the
main application interface. Thus, users could select the dock widget
to be viewable.

I’m not sure if you’re supposed to return a List or just a single dock
widget. (Maybe just a single dock widget). Try it out. Make a new
Extension then create a dock widget with some items and return it from
that function.

This is how the original Python terminal was implemented.


Donald Ephraim Curtis
Department of Computer Science
University of Iowa

On Mon, Jan 11, 2010 at 15:17, B.W.H. van Beest bwvb@xs4all.nl wrote:

Hi,

I’m experimenting building a new extension for Avogadro.
Is it possible to have for an extension a dockWindow(), just like the
"Tool Settings…" and “Display Settings” dock windows?
There is a virtual interface function

QDockWidget* Extension::dockWidget()

which, according to the documentation is supposed to return a list (?)
of QDockWidgets , but I don’t understand how I should use this function.
Can somebody explain how this can be done?

Kind Regards,
Bertwim


This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev


Avogadro-Discuss mailing list
Avogadro-Discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-discuss

Hi,

On Mon, Jan 11, 2010 at 10:17 PM, B.W.H. van Beest bwvb@xs4all.nl wrote:

Hi,

I’m experimenting building a new extension for Avogadro.
Is it possible to have for an extension a dockWindow(), just like the
"Tool Settings…" and “Display Settings” dock windows?

Yes

There is a virtual interface function

QDockWidget* Extension::dockWidget()

which, according to the documentation is supposed to return a list (?)
of QDockWidgets , but I don’t understand how I should use this function.

This seems to be an error in the documentation. Instead of a list, a
single QDockWidget should be returned.

Can somebody explain how this can be done?

In your subclass, overload the function like this:

QDockWidget* MyExtension::dockWidget()
{
if (!m_dockWidget) { // defined as class data member in myextension.h
m_dockWidget = new QDockWidget(tr(“My dock widget”))
… set up dock widget …
}

return m_dockWidget;
}

Does this help?
Tim

Kind Regards,
Bertwim


This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev


Avogadro-Discuss mailing list
Avogadro-Discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-discuss

Yes, it works indeed exactly as you describe! Thanks.

Kind Regards,
Bertwim

Tim Vandermeersch wrote:

Hi,

On Mon, Jan 11, 2010 at 10:17 PM, B.W.H. van Beest bwvb@xs4all.nl wrote:

Hi,

I’m experimenting building a new extension for Avogadro.
Is it possible to have for an extension a dockWindow(), just like the
"Tool Settings…" and “Display Settings” dock windows?

Yes

There is a virtual interface function

QDockWidget* Extension::dockWidget()

which, according to the documentation is supposed to return a list (?)
of QDockWidgets , but I don’t understand how I should use this function.

This seems to be an error in the documentation. Instead of a list, a
single QDockWidget should be returned.

Can somebody explain how this can be done?

In your subclass, overload the function like this:

QDockWidget* MyExtension::dockWidget()
{
if (!m_dockWidget) { // defined as class data member in myextension.h
m_dockWidget = new QDockWidget(tr(“My dock widget”))
… set up dock widget …
}

return m_dockWidget;
}

Does this help?
Tim

Kind Regards,
Bertwim


This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev


Avogadro-Discuss mailing list
Avogadro-Discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-discuss

On Jan 11, 2010, at 5:14 PM, B.W.H. van Beest wrote:

Yes, it works indeed exactly as you describe! Thanks.

One “admin” point here… this mailing list is mostly for users of Avogadro, but several of these discussions have been more technical. There is a separate avogadro-devel mailing list, which might be a better forum.

Glad to hear Avogadro is working for you and can interface with your MD code. That’s obviously something we’d like to see working well, so please let us know any feedback about the process.

Thanks and best regards,
-Geoff