Hello, I have a problem with a qlistview. I have some custom made slides in it and I have a problem with dragging them around qlistview. I enabled the drag&drop on the qlistview like this:
//just for reference
//QListView *iconList;
iconList->setDragEnabled(true);
iconList->setIconSize(siz);
//iconList->setSelectionMode(QAbstractItemView::SingleSelection);
iconList->setGridSize(isiz);
iconList->setSpacing(inc_size);
iconList->setUniformItemSizes(true);
//iconList->setMovement(QListView::Snap);
iconList->setAcceptDrops(true);
iconList->setDropIndicatorShown(true);
//just for reference
//QListView *iconList;
iconList->setDragEnabled(true);
iconList->setViewMode(QListView::IconMode);
iconList->setIconSize(siz);
//iconList->setSelectionMode(QAbstractItemView::SingleSelection);
iconList->setGridSize(isiz);
iconList->setSpacing(inc_size);
iconList->setUniformItemSizes(true);
iconList->setMovement(QListView::Free);
//iconList->setMovement(QListView::Snap);
iconList->setAcceptDrops(true);
iconList->setDropIndicatorShown(true);
iconList->setResizeMode(QListView::Adjust);
To copy to clipboard, switch view to plain text mode
If i start dragging from the top item it shows the marker but it's in the top left position. If i continue dragging (and move outside the widget area and than back -still dragging), the marker appears at the right position and stays that way until i realease the item All of the following dragging continued by the previous dragging is made completely ok (the marker is right where it should be.
Does anyone have any idea??
ps. I use this for the drag events... ( if I use qlistview events the result is absolutely awfull...)
//QListView::dropEvent(event);
}
//QListView::dragMoveEvent(event);
}
void MListView::dropEvent(QDropEvent * event) {
//QListView::dropEvent(event);
QAbstractItemView::dropEvent(event);
}
void MListView::dragMoveEvent(QDragMoveEvent * event) {
//QListView::dragMoveEvent(event);
QAbstractItemView::dragMoveEvent(event);
}
To copy to clipboard, switch view to plain text mode
Bookmarks