[PyQt] QWidget.windowHandle()

Philipp A. flying-sheep at web.de
Wed Nov 20 13:34:22 GMT 2013


QWindows aren’t parents of anything:

from PyQt5.QtWidgets import QWidget
from PyQt5.QtCore import QApplication
app = QApplication([])
w = QWidget()
w.parent()
w.show()
assert(w.parent() == None)

and why not include a preliminary API? it’s available in Qt, so people are
able to choose if they want to risk having to change if it changes. we PyQt
users should be able to do the same.


2013/11/20 Filippo Cucchetto <filippocucchetto at gmail.com>

> Maybe you can just iterate up on the parent/child relationship till you
> get to the QWindow...
>
>
> 2013/11/20 Phil Thompson <phil at riverbankcomputing.com>
>
>> On Wed, 20 Nov 2013 00:35:29 +0100, "Philipp A." <flying-sheep at web.de>
>> wrote:
>> > so how am i supposed to get the QWindow of some .show()n widget?
>>
>> I don't know. Try and find out why the function is experimental and
>> when/if it will be finalised.
>>
>> Phil
>>
>> > 2013/11/19 Phil Thompson <phil at riverbankcomputing.com>
>> >
>> >> On Tue, 19 Nov 2013 22:06:09 +0100, "Philipp A." <flying-sheep at web.de>
>> >> wrote:
>> >> > hi, i need that method in order to get a reference to a widget’s
>> >> platform
>> >> > window.
>> >> >
>> >> > http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#windowHandle
>> >> >
>> >> > unfortunately, it’s not available.
>> >> >
>> >> > is there another way, or can the method be added?
>> >>
>> >> The method is marked as preliminary which is why it is not implemented.
>> >>
>> >> Phil
>> >>
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>
>
> --
> Filippo Cucchetto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20131120/13a06d68/attachment.html>


More information about the PyQt mailing list