[PyQt] How to Generate a "Header Clicked" event for a QTableWidget in PyQt5

Eric A eaa603 at hotmail.com
Tue Aug 22 21:56:20 BST 2017


Kyle,


Thanks for the response which solved my problem.


Its not easy finding one's way through the Qt documentation - more PyQt tutorials on using some of the lesser-used classes/properties/methods/signals would help.


Eric.


________________________________
From: Kyle Altendorf <sda at fstab.net>
Sent: Friday, 18 August 2017 12:56 a.m.
To: Eric A
Cc: pyqt at riverbankcomputing.com
Subject: Re: [PyQt] How to Generate a "Header Clicked" event for a QTableWidget in PyQt5

On 2017-08-16 23:45, Eric A wrote:

> I am using PyQt5 and Python 3.5
>
> I see that in PyQt4 there's a "sectionClicked" event for the header in
> a
> QTableWidget in PyQt4, but I don't seem to be able to find that method
> to generate the event signal in PyQt5.

I'm thinking it will be:
your_table_widget.horizontalHeader().sectionClicked.connect(your_callable)

http://doc.qt.io/qt-5/qtableview.html#horizontalHeader
QTableView Class | Qt Widgets 5.9<http://doc.qt.io/qt-5/qtableview.html#horizontalHeader>
doc.qt.io
Detailed Description. The QTableView class provides a default model/view implementation of a table view. A QTableView implements a table view that displays items from ...



http://doc.qt.io/qt-5/qheaderview.html#sectionClicked
QHeaderView Class | Qt Widgets 5.9<http://doc.qt.io/qt-5/qheaderview.html#sectionClicked>
doc.qt.io
Detailed Description. The QHeaderView class provides a header row or header column for item views. A QHeaderView displays the headers used in item views such as the ...




Cheers,
-kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170822/6d8c3b67/attachment.html>


More information about the PyQt mailing list