Receiving signal when pressing on QTableWidget header?
-
wrote on 2 Jul 2017, 21:22 last edited by
Is there a direct way to receive a signal when the user clicks on the header row to QTableWidget?
For the different table items this is very easy to handle, but I miss the possibility when the click/press is on the header line. Any suggestions?
-
Lifetime Qt Championwrote on 2 Jul 2017, 21:40 last edited by mrjj 7 Feb 2017, 21:41
@koahnig said in Receiving signal when pressing on QTableWidget header?:
QTableWidget
Hi
What about
http://doc.qt.io/qt-5/qheaderview.html#sectionPressed
and
QTableWidget::horizontalHeader() or QTableWidget::verticalHeader().
To hook up signal ?
Might also need void QHeaderView::setSectionsClickable(bool clickable) -
@koahnig said in Receiving signal when pressing on QTableWidget header?:
QTableWidget
Hi
What about
http://doc.qt.io/qt-5/qheaderview.html#sectionPressed
and
QTableWidget::horizontalHeader() or QTableWidget::verticalHeader().
To hook up signal ?
Might also need void QHeaderView::setSectionsClickable(bool clickable)wrote on 3 Jul 2017, 09:31 last edited byThanks for your response.
I have to admit that I figured that part already, but it looked a bit out of style for Qt. Therefore, I was not sure, if I simply overlooked a more obvious way. Sometimes one dos not recognize the forest, because of the wood the around ;)
Finally the implementation looked less complicated than I thought initially. And it works.
3/3