[PyQt] Cannot get any SIGNAL from QTreeWidget

Bjorn Egil Ludvigsen bludvigsen at gmail.com
Wed Apr 14 15:54:14 BST 2010


Thank you very much Vincent, your second option using another signal
"itemSelectionChanged()" worked very well, so I can use that to perform
other actions.

However, I still cannot get the "itemClicked(QTreeWidgetItem*)" to work (or
"itemDoubleClicked..."), even with sending the column (int) in addition,
which should not be necessary in PyQt.

Appreciate more help on this, but not critical for now with Vincent's
suggestion.

Regards,
Bjorn

On Tue, Apr 13, 2010 at 10:35 PM, Vincent Vande Vyvre <
vincent.vandevyvre at swing.be> wrote:

> Try with "itemClicked(QTreeWidgetItem*, int)
>
> also:
>
>         self.connect(self.projectTree,
>                 SIGNAL("itemSelectionChanged()"),
>                 self.showEvents)
>
>         def showEvents(self):
>             item = self.projectTree.currentItem()
>
> Bjorn Egil Ludvigsen a écrit :
>
>   Hi,
>
> I cannot get any signal from QTreeWidget and wonder if anyone have any idea
> of where to look?
>
> I have a QMainWindow with a QTabWidget and some QDockWidgets. A QTreeWidget
> is added to the dockwidget. After successfully populating all tables and the
> tree with data, I want to click on certain items in the tree to select data
> and set focus on a particular table. When I click in the tree it looks like
> items are selected (background color is set), but I am not able to get any
> actions out of it.
>
> To debug I am checking to see if items are clicked:
>
>         self.connect(self.uncertaintyTable,
>                 SIGNAL("itemDoubleClicked(QTableWidgetItem*)"),
> self.debug1)
>         self.connect(self.projectTree,
>                 SIGNAL("itemClicked(QTreeWidgetItem*)"),
>                 self.showEvents)
> .
> .
> .
> .
>     def debug1(self):
>         self.logMessages.addItem("Uncertainty table item double
> clicked")
>     def showEvents(self):
>         self.logMessages.addItem("tree item clicked")
>
> For the table I successfully see the text that the item was clicked (or
> double clicked), but for the tree I cannot get anything to work.
>
> Regards,
> Bjorn
>
> ------------------------------
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.comhttp://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
> --
> Vincent V.V.
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100414/f657965c/attachment.html>


More information about the PyQt mailing list