<HTML>
<HEAD>
<TITLE>Re: [PyQt] QDockWidgetquestion</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>QDockWidgets behave a little different than normal widgets. You need to call “setWidget” to place a widget in a dock widget.<BR>
<BR>
<a href="http://doc.trolltech.com/4.4/qdockwidget.html">http://doc.trolltech.com/4.4/qdockwidget.html</a><BR>
<BR>
Try:<BR>
<BR>
CustomDockWidget(QDockWidget):<BR>
def __init__(self,parent):<BR>
QDockWidget.__init__(self, parent)<BR>
self.tree = QTreeWidget(self)<BR>
self.setWidget(self.tree) <BR>
<BR>
<BR>
On 12/22/08 9:54 AM, "Iliya Gogolev" <<a href="iliya@realdice.com">iliya@realdice.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi everyone!<BR>
<BR>
<BR>
I added QTreeWidget to QDockWidget and then added it to MainWindow by<BR>
addDockWidget function:<BR>
<BR>
"""""""""""""""""""""""""""""""""""""""""""<BR>
CustomDockWidget(QDockWidget):<BR>
def __init__(self,parent):<BR>
QDockWidget.__init__(self, p_parent)<BR>
self.tree = QTreeWidget(self)<BR>
<BR>
.<BR>
.<BR>
.<BR>
<BR>
<BR>
"""""""""""""""""""""""""""""""""""""""""""<BR>
<BR>
class MainWindow(QMainWindow):<BR>
def __init__(self, p_parent = None):<BR>
QMainWindow.__init__(self, p_parent)<BR>
<BR>
self.customWidget = CustomDockWidget(self)<BR>
self.addDockWidget (Qt.LeftDockWidgetArea, self.customWidget)<BR>
.<BR>
.<BR>
.<BR>
<BR>
I'm trying to catch mouse event in MainWindow when I click on the<BR>
QTreeWidget and no success.<BR>
<BR>
Any ideas?<BR>
<BR>
Thanks<BR>
<BR>
Internal Virus Database is out-of-date.<BR>
Checked by AVG.<BR>
Version: 7.5.549 / Virus Database: 270.9.10/1814 - Release Date: 11/26/2008<BR>
8:53 PM<BR>
<BR>
<BR>
_______________________________________________<BR>
PyQt mailing list <a href="PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><BR>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>