Frage

I have a problem. I have this code:

balls = [Ball() for i in range(1, 10)]

So, when I say Ball() this will draw a ball on QDialog. And then when this is done, I am moving the balls around QDialog in an infinite loop. I want to say something like while QDialog.isVisible() move them around.

I don't have any parent dialog or form or any child dialog or form. It's all just about this QDialog. I know that it's stupid to do with QDialog, but I am not allowed to use anything else than just QDialog.

War es hilfreich?

Lösung

You can use isVisible from QWidget because QDialog basically inherits QWidget. So you should be able to check the visibility.

myDialog = QtGui.QDialog()
isVis = myDialog.isVisible()

For more details http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwidget.html#isVisible

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top