Hi There,

just playing around with Qtableview.
What I want to do is insert a new row, scroll to it, and show it selected.

I have a working insert with the following code connected to a button

Qt Code:
  1. private void insert()
  2. {
  3. String Nr="999";
  4. model.insertRow(model.rowCount());
  5. model.setData(model.index(model.rowCount()-1,0), Integer.parseInt(Nr));
  6. }
To copy to clipboard, switch view to plain text mode 

I achieved to scroll down the view by doing:

Qt Code:
  1. insertButton.clicked.connect(view, "scrollToBottom()");
To copy to clipboard, switch view to plain text mode 

But I can't accomplish to select the inserted row automaticly.
Tried view.selectrow in my insert routine and fumbled with a selectionmodel but all failed in the end
with a NullPointerException.

I' am aware this is a very basic question and tried my best to squeeze the answer out of google, but
nothing got me on track, so any hint would be greatly appreciated.

Thanks