moowy
10th October 2006, 10:43
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->setViewMode(QListView::IconMode);
iconList->setIconSize(siz);
//iconList->setSelectionMode(QAbstractItemView::SingleSelectio n);
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);
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...)
void MListView::dropEvent(QDropEvent * event) {
//QListView::dropEvent(event);
QAbstractItemView::dropEvent(event);
}
void MListView::dragMoveEvent(QDragMoveEvent * event) {
//QListView::dragMoveEvent(event);
QAbstractItemView::dragMoveEvent(event);
}
//just for reference
//QListView *iconList;
iconList->setDragEnabled(true);
iconList->setViewMode(QListView::IconMode);
iconList->setIconSize(siz);
//iconList->setSelectionMode(QAbstractItemView::SingleSelectio n);
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);
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...)
void MListView::dropEvent(QDropEvent * event) {
//QListView::dropEvent(event);
QAbstractItemView::dropEvent(event);
}
void MListView::dragMoveEvent(QDragMoveEvent * event) {
//QListView::dragMoveEvent(event);
QAbstractItemView::dragMoveEvent(event);
}