Results 1 to 8 of 8

Thread: QTreeView problem scrolling to end.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    132
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question QTableView problem scrolling to end.

    [Qt 4.1.0, windows]

    In a QTableView I want to add a new row at the end, scroll to it and open the first column for editing. However it only scrolls down to the second last row (the one that was the last one before the new row was added). The new row remains outside of visibility. I have also tried with scrollToBottom(), but exactly the same.

    Qt Code:
    1. if (act == iActionAddValue) {
    2. ALocalvalueModel* model = (ALocalvalueModel*)iTable->model();
    3. model->insertRow(model->rowCount());
    4. iTable->resizeRowsToContents();
    5. iTable->clearSelection();
    6. QModelIndex index(model->index(model->rowCount()-1,0));
    7. iTable->scrollTo(index);
    8. iTable->edit(index);
    9. } // if
    To copy to clipboard, switch view to plain text mode 
    Last edited by seneca; 24th January 2006 at 11:26.

Similar Threads

  1. QTreeView and QDirmodel 's problem?
    By ggs0110 in forum Qt Programming
    Replies: 8
    Last Post: 31st July 2012, 12:11
  2. QGraphicsView scrolling problem with 4.3.0
    By hb in forum Qt Programming
    Replies: 8
    Last Post: 30th August 2007, 22:18
  3. Problem with index in a QTreeView
    By hubert_p in forum Qt Programming
    Replies: 4
    Last Post: 22nd October 2006, 15:54
  4. Replies: 2
    Last Post: 8th October 2006, 20:14
  5. Selection problem in QTreeView
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 7th October 2006, 16:02

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.