<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Kyle,</p>
<p><br>
</p>
<p>Thanks for the response which solved my problem.</p>
<p><br>
</p>
<p>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.</p>
<p><br>
</p>
<p>Eric.</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Kyle Altendorf <sda@fstab.net><br>
<b>Sent:</b> Friday, 18 August 2017 12:56 a.m.<br>
<b>To:</b> Eric A<br>
<b>Cc:</b> pyqt@riverbankcomputing.com<br>
<b>Subject:</b> Re: [PyQt] How to Generate a "Header Clicked" event for a QTableWidget in PyQt5</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On 2017-08-16 23:45, Eric A wrote:<br>
<br>
> I am using PyQt5 and Python 3.5<br>
> <br>
> I see that in PyQt4 there's a "sectionClicked" event for the header in <br>
> a<br>
> QTableWidget in PyQt4, but I don't seem to be able to find that method<br>
> to generate the event signal in PyQt5.<br>
<br>
I'm thinking it will be:<br>
your_table_widget.horizontalHeader().sectionClicked.connect(your_callable)<br>
<br>
<a href="http://doc.qt.io/qt-5/qtableview.html#horizontalHeader" id="LPlnk818728" previewremoved="true">http://doc.qt.io/qt-5/qtableview.html#horizontalHeader</a>
<div id="LPBorder_GT_15034350117240.11377065929136543" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15034350117220.176215501307595" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15034350117230.9422348742114379" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15034350117230.422988975234321"></div>
<div id="LPTitle_15034350117230.8914750077121356" style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15034350117230.48616206556968256" href="http://doc.qt.io/qt-5/qtableview.html#horizontalHeader" target="_blank" style="text-decoration: none;">QTableView Class | Qt Widgets 5.9</a></div>
<div id="LPMetadata_15034350117230.7099902474071471" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
doc.qt.io</div>
<div id="LPDescription_15034350117230.292834257456817" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
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 ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
<a href="http://doc.qt.io/qt-5/qheaderview.html#sectionClicked" id="LPlnk261353" previewremoved="true">http://doc.qt.io/qt-5/qheaderview.html#sectionClicked</a>
<div id="LPBorder_GT_15034350117710.3660099515625832" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15034350117690.21029446807101215" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15034350117700.5833691948984889" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15034350117700.06448547922615688"></div>
<div id="LPTitle_15034350117700.1373294965958538" style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15034350117700.07594823758902547" href="http://doc.qt.io/qt-5/qheaderview.html#sectionClicked" target="_blank" style="text-decoration: none;">QHeaderView Class | Qt Widgets 5.9</a></div>
<div id="LPMetadata_15034350117700.9596616043364248" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
doc.qt.io</div>
<div id="LPDescription_15034350117700.32209735380250093" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
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 ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
<br>
Cheers,<br>
-kyle<br>
</div>
</span></font></div>
</div>
</body>
</html>