Results 1 to 2 of 2

Thread: QTableView - Enable Clicking for some columns only

  1. #1
    Join Date
    Feb 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question QTableView - Enable Clicking for some columns only

    I'm using Qt 4.1.3 in WinXP and I made a table using QTableModel & QTableView.
    I've implemented the model "sort" virtual function and it works fine.
    I show the sort indicator on the horizontal header.
    Now my question:

    I want to enable clicking & sorting just in some columns and disable this behavior it in others.

    How can I do that ?
    (Show a sort indicator in a non sorting column is horrible )

    Gabriel.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView - Enable Clicking for some columns only

    When user clicks a header section, QHeaderView::sectionClicked() signal is emitted and to sort the table you have to invoke the QTableView::sortByColumn() slot. I guess you have to put something between them and just check whether that slot should be invoked or not.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.