Page 1 of 1

Investigando sobre BROWSE

Posted: Mon Apr 06, 2015 8:29 pm
by jnavas
Antonio
Saludos Cordiales, hoy seguire evaluando las funcionalidaes de QT
Para manipular los browsese, encontre esta documentacion, necesito remover lineas del browse, encontre:

https://forum.qt.io/topic/23600/solved- ... ted-rows/3

Yea, I am using that one.

But I have solved that by decrementing (and removing from the end of the table view, not from the beginning):
I shouldn't increment over the list and remove the first items because table was shifting rows after I have removed one - and that was making issues. So I had to write decrementing cycle and removing from the end of the table view - after shifting I am able to remove the correct row.

From:
@
QList<int> rowIndexes;
for (int i = 0; i < rowIndexes.count(); ++i)
tableView->model()->removeRow(rowsIndexes); // shifting rows after removing causes "bad removing"
@

To:
@
QList<int> rowIndexes;
for (int i = rowIndexes.count(); i >= 0; --i)
tableView->model()->removeRow(rowsIndexes);

Re: Investigando sobre BROWSE

Posted: Mon Apr 06, 2015 8:35 pm
by jnavas
Antonio
Ya logre remover un elemento de la lista, refresca automaticamente.

Code: Select all

FUNCTION GETMODELRECORD(oBrw)
  LOCAL oIndex:=oBrw:currentIndex(1)
  LOCAL oModel:=oBrw:Model()
MSGINFO(oIndex:row(),oIndex:ClassName())

  oBrw:Model:removeRow(oIndex:row())

RETURN NIL