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?
Forum Updated to NodeBB v4.3 + New Features

Receiving signal when pressing on QTableWidget header?

Scheduled Pinned Locked Moved Solved General and Desktop
qtablewidgetheader signal
3 Posts 2 Posters 2.8k Views 2 Watching
  • 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 2 Jul 2017, 21:22 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
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 2 Jul 2017, 21:40 last edited by mrjj 7 Feb 2017, 21:41
      #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 3 Jul 2017, 09:31
      4
      • M mrjj
        2 Jul 2017, 21:40

        @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 3 Jul 2017, 09:31 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

        1/3

        2 Jul 2017, 21:22

        • Login

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