Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Receiving signal when pressing on QTableWidget header?
QtWS25 Last Chance

Receiving signal when pressing on QTableWidget header?

Scheduled Pinned Locked Moved Solved General and Desktop
qtablewidgetheader signal
3 Posts 2 Posters 2.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by
    #1

    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?

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      @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)

      K 1 Reply Last reply
      4
      • mrjjM mrjj

        @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)

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        @mrjj

        Thanks 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.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved