why you can't use this method
?void QListWidget::insertItem ( int row, QListWidgetItem * item )
Inserts the item at the position in the list given by row.
why you can't use this method
?void QListWidget::insertItem ( int row, QListWidgetItem * item )
Inserts the item at the position in the list given by row.
I use this function initialy to add items to list,but function add an item to a specific row not to specific position (row and column) in list. My listWdiget is in Icon mode so i can set an item every where i wish . I search on net and i found just one example to add an item to a QListWidget at specified coordonites. they use in example a derrived class of QListWidget in whicjh they use to add items to list using this function:
QListView::setPositionForIndex(QPoint &point,const QModelIndex &index).
I compile the example and it works.I put the listWidget in designer and try to use same function above and i get error that :
1. i can't use listWidget->indexFromItem(QListWidgetItem *item) because is protected
2. so with setPositionForIndex
the compiler tells me that i can't use this function...i try to create a derivate class based on QListWidget an promote la listWidget from to designer to this classs...and nothig happens same message..I wander if there is another method to insert item to list to a specified coordonates.
thanks
I succed to use setPositionForIndex() to insert an intem to a specific position.the problem is that when i insert a second item tha first item is moved to 0,0 and last item remains at specific position.Mean always i insert a intem previous items lose their position and the last doesn't.i understan is about repaint() function...is any way to make previous items remain at their position while i insert a new item to the list?
please help
Thanks a lot.
Bookmarks