<HTML>
<HEAD>
<TITLE>Re: [PyQt] QDockWidgetquestion</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Apologies, I didn’t see your real question.<BR>
<BR>
> I'm trying to catch mouse event in MainWindow when I click on the<BR>
> QTreeWidget and no success.<BR>
<BR>
You should be able to connect any signal from the tree or toolbox and attach it to the mainwindow. What “mouse event” are you trying to capture?<BR>
<BR>
On 12/22/08 10:08 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'><FONT COLOR="#1F497D">I tried it too. It did not help.<BR>
<BR>
Sorry, I use QToolBox instead QTreeWidget, but there’s no sense<BR>
<BR>
<BR>
</FONT><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:10pt'><B>From:</B> Brian Kelley [<a href="mailto:kelley@eyesopen.com">mailto:kelley@eyesopen.com</a>] <BR>
<B>Sent:</B> Monday, December 22, 2008 5:00 PM<BR>
<B>To:</B> Iliya Gogolev; <a href="pyqt@riverbankcomputing.com">pyqt@riverbankcomputing.com</a><BR>
<B>Subject:</B> Re: [PyQt] QDockWidgetquestion<BR>
</SPAN></FONT></FONT><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT><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>
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>
</SPAN></FONT><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN><FONT SIZE="2"><SPAN STYLE='font-size:10pt'>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 8:53 PM<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
</SPAN></FONT><SPAN STYLE='font-size:11pt'><FONT FACE="Times New Roman">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 8:53 PM<BR>
</FONT></SPAN><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>