Investigando sobre BROWSE

Post Reply
User avatar
jnavas
Posts: 399
Joined: Wed Nov 16, 2005 12:03 pm
Location: Caracas - Venezuela
Contact:

Investigando sobre BROWSE

Post 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);
User avatar
jnavas
Posts: 399
Joined: Wed Nov 16, 2005 12:03 pm
Location: Caracas - Venezuela
Contact:

Re: Investigando sobre BROWSE

Post 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
 
Post Reply