Results 1 to 2 of 2

Thread: QTableView header dragging

  1. #1
    Join Date
    Jun 2006
    Posts
    6
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default QTableView header dragging

    How can I override the behavior of movable columns and rows in a table? It seems like the consistent thing to do is have them respond to Ctrl-click move. However, Trolls have single click move. I want to be able to click once on header and open an editor, to change lable, then Ctrl-click to move.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView header dragging

    Are we talking Qt4 here? First of all you should connect to the QHeaderView::sectionClicked() signal of the header and implement showing the editor there. Moving columns shouldn't interfere with that. You can disable section moving with QHeaderView::setMovable() just to make sure. If you'll still want to move headers, it should be enough to reimplement mouseMoveEvent for the header to call appropriate methods from the header class which handle moving.

Similar Threads

  1. QTableView currentChanged <> selecting header
    By Everall in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2009, 08:24
  2. Replies: 0
    Last Post: 10th November 2006, 13:46
  3. QTableView header in corner
    By danstr in forum Qt Programming
    Replies: 3
    Last Post: 18th May 2006, 20:16
  4. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 13:49
  5. QTableView: disable row header
    By mattie in forum Qt Programming
    Replies: 6
    Last Post: 8th March 2006, 12:16

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.