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. filter. header of a qtablewidget
QtWS25 Last Chance

filter. header of a qtablewidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 531 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.
  • W Offline
    W Offline
    Weimars
    wrote on last edited by
    #1

    Hello greetings to all.
    For days I have had the idea of ​​making a filter by column header as seen in the image
    3cbfc84b-c1e6-45a0-9846-b1b82f6bec4c-filtro.png filtro
    The thing is that I can't put the qLineEdit in the header. I have seen examples but nothing works in the version I am using, which is 6.7
    any idea how to do it?

    thank you

    1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      What examples have you seen which do not work in Qt 6.7?

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Weimars
        wrote on last edited by
        #3

        I try to do this and others

        https://stackoverflow.com/questions/11596267/qtablewidget-personal-widget-as-header

        JonBJ 1 Reply Last reply
        0
        • W Weimars

          I try to do this and others

          https://stackoverflow.com/questions/11596267/qtablewidget-personal-widget-as-header

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Weimars
          And what happens with Qt 6.7 that is problematic?
          I don't know. There is a one ;line comment in response to that stackoverflow question:

          Why you didn't write MyHeader : public QWidget, public QTableWidgetItem? Construct widget like usual widget and then use in header. –

          dmr

          Jul 24, 2012 at 13:14

          Might be as simple as that? Or there is the long example code from one responder, or the code at https://forum.qt.io/topic/145727/adding-qbuttons-to-a-qtablewidget-header .

          W 1 Reply Last reply
          0
          • W Offline
            W Offline
            Weimars
            wrote on last edited by Weimars
            #5

            Hi,
            Now I'm on a better path and I can paint it.

            f7d5cad6-0446-4e28-bf92-56aea5c47074-filtrotable.png
            filtrotable

            today or tomorrow I copy the code
            I base it on the following link

            https://stackoverflow.com/questions/11596267/qtablewidget-personal-widget-as-header

            1 Reply Last reply
            0
            • JonBJ JonB

              @Weimars
              And what happens with Qt 6.7 that is problematic?
              I don't know. There is a one ;line comment in response to that stackoverflow question:

              Why you didn't write MyHeader : public QWidget, public QTableWidgetItem? Construct widget like usual widget and then use in header. –

              dmr

              Jul 24, 2012 at 13:14

              Might be as simple as that? Or there is the long example code from one responder, or the code at https://forum.qt.io/topic/145727/adding-qbuttons-to-a-qtablewidget-header .

              W Offline
              W Offline
              Weimars
              wrote on last edited by
              #6

              @JonB That one was a bit complex, you can see below how the other one turns out. Later when I have it more elegant I will share the code

              thanks

              1 Reply Last reply
              0

              • Login

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