<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"/></head><body>I am learning PyQt in order to rewrite my wxPython application to
use it. Having been accustomed to using wxPython, I am used to being
required to pass a parent as an argument to the constructor of every
non-top-level widget. But in PyQt, the parent argument is often
optional, and I am having some difficulty to know when I should and
shouldn't use it.<br>
<br>
From what I have learned so far, I was guessing that perhaps the
parent argument should not be used in cases where the parent of the
widget will later be specified by calling a function (such as
QDockWidget.setWidget, QMainWindow.addDockWidget,
QMainWindow.addToolBar, QMainWindow.setCentralWidget,
QStatusBar..addPermanentWidget, QToolBar.addWidget, ,
QTabWidget.addTab, etc.), but should be used in all other cases. Is
this correct? Could someone please help clarify this?<br>
<br>
Also, which is the more acceptable practice:<br>
<blockquote>from PyQt5.QtWidgets import *<br>
</blockquote>
OR:<br>
<blockquote>from PyQt5.QtWidgets import QAction,
QLabel,...QTabWidget, QToolBar<br>
</blockquote>
(I know that generally the use of wild imports is discouraged in
Python, but it's much easier than having to add a widget to the
import list whenever I use another one.)<br>
<br>
Thank you.<br>
<br>
-- Timothy</body></html>