attributes of Mainwindow from childWindow

How can I make a childWindow access and/or modify an attribute from his MainWindow?

I have a MainWindow that opens different childWindows, dependeing on the pressed button on the MainWindow.

I would like any of the childWindows to be able to modify some attributes of the MainWindow, but I cannot get the good way to access them.

Answers


When defining your widget or window (your window is possibly just a QWidget), specify it's parent in the init-Method (just pass the parent-widget).

After that, you could use the parentWdiget-Method or simply set a "link" to the parent-widget in an attribute of the child-window.

See http://srinikom.github.io/pyside-docs/PySide/QtGui/QWidget.html


You could pass a reference (self) to your childwindow.


Need Your Help

Gibberish output with pchart

php drupal drupal-7 pchart

I have been trying to create graphs with pchart library in my drupal 7 site. I have installed and configured pchart properly and when I try to test it with an example provided by pcahrt itself am