Results 1 to 5 of 5

Thread: QTableView currentChanged <> selecting header

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    99
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default QTableView currentChanged <> selecting header <SOLVED>

    Hi,

    I'm experimenting a little with QTableViews selection behaviour.
    The default is when you click on an item it gets selected (blue), but editing doesn't start yet. When you click on a column , the entire column gets selected (blue).

    If you alter the editTrigger property for the view to CurrentChanged, then clicking on a cell starts editing immediately. Ok that's what I want.

    But when you click a vertical header now, the first cell is in editing state (the delegate shows up) and that is not what I want.

    Does anyone know a simple way to use the currentChanged property without getting the first cell in editing state when clicking on a header?



    You can see this behaviour yourself if you want:
    in the relationaltablemodel example I added a line to the createview function

    Qt Code:
    1. QTableView *createView(const QString &title, QSqlTableModel *model)
    2. {
    3. QTableView *view = new QTableView;
    4. ...
    5. view->setEditTriggers ( QAbstractItemView::CurrentChanged );
    6. return view;
    7. }
    To copy to clipboard, switch view to plain text mode 

    Maybe i'm not seeing the obvious...
    All suggestions are welcome
    Last edited by Everall; 6th February 2006 at 08: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.