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. Excel autofilter-like feature possible with QTableView

Excel autofilter-like feature possible with QTableView

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.2k 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.
  • S Offline
    S Offline
    swivelhead
    wrote on last edited by
    #1

    I want to add a permanent button to my horizontal headers in the QTableView objects that will act like the Excel or Libre Office Calc "AutoFilter" feature. ("Permanent" meaning it is always on.)

    I've searched around and found a few hints at how to add this feature, but I'm still confused as where to start.

    I've found someone mention subclassing QHeaderView, rewrite the paintEvent method and then assigning it via QTableView::setHorizontalHeader.

    Otherwise, I have no idea how to

    add the filter button/icon to the header's right hand side,

    catch clicks in that part of the header versus the rest of the header which will catch sort clicks,

    and display a combo box/list view of the contents that is painted over the other rows, rather than expanding the height of the row to accommodate the list.

    I have an idea of how to populate the combo box, so that is not a problem (yet.)

    Any ideas would be appreciated. Otherwise, I plan on having a filter button/Text Box in QDialog to accomplish filters.

    Thanks!

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NeoQt
      wrote on last edited by
      #2

      jetimms,

      i would like to put same type of solution , QTableview header should have combobox, editbox, ..has you already have solution for this ..could you plz share ....since i m new to Qt...if minimalist runnable project is share would be good

      thankx in advance

      1 Reply Last reply
      0
      • N Offline
        N Offline
        NeoQt
        wrote on last edited by
        #3

        jetimms,

        i would like to put same type of solution , QTableview header should have combobox, editbox, ..has you already have solution for this ..could you plz share ....since i m new to Qt...if minimalist runnable project is share would be good

        thankx in advance

        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