Results 1 to 3 of 3

Thread: Solved-Select first row after QTableView is created and make it active?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2014
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Default How automatically Select first row after QTableView is created

    I have a single QTableView(model based).I need to give focus on first row of QTableview while data displaying.While selecting first row, data will displays in line edit boxes.
    I am not able to foucus on the first row selection. QSqlQueryModel i am using
    If I manually clicked then its working,means first row data displaying in Line edit boxes.please suggest.

    my code below

    ui->TbleViewUserMgmt->setSelectionMode(QAbstractItemView::SingleSelecti on);
    ui->TbleViewUserMgmt->selectRow(0);
    ui->TbleViewUserMgmt->setFocus();
    Last edited by jijoadoor71; 15th May 2014 at 15:20. Reason: heading change

Similar Threads

  1. Replies: 1
    Last Post: 2nd April 2013, 09:07
  2. QTableView select a whole row?
    By qlands in forum Qt Programming
    Replies: 1
    Last Post: 22nd August 2011, 11:22
  3. Replies: 1
    Last Post: 15th October 2010, 22:30
  4. How select next row in QTableView
    By estanisgeyer in forum Qt Programming
    Replies: 8
    Last Post: 17th June 2009, 20:02
  5. Select row in QTableView after insert.
    By fede in forum Newbie
    Replies: 1
    Last Post: 14th April 2009, 15:18

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
  •  
Qt is a trademark of The Qt Company.