change "+" symbol to other symbol when dragging an item from listview to treeview .
-
@Chris-Kawa
I tried these ways . But none of the two is working.myWindow::myWindow(QWidget *parent,QMdiArea *mdiParent): QWidget(parent), QListView(parent) ui(new Ui::myWindow) { ui->setupUi(this); // }
nor this as suggested here .
class myWindow: public QWidget { Q_OBJECT public: explicit myWindow(QWidget *parent = 0, QMdiArea *mdiParent=0) : QListView (paren,mdiParent ){} ......
Is there any document giving info about subclass?
-
I used
dragMoveEvent
to restrict the+
symbol.void dragMoveEvent(QDragMoveEvent *event) { QPoint cursorPosition = event->pos() ; QModelIndex index = indexAt(cursorPosition); if(index.parent().isValid()) { event->acceptProposedAction(); } else event->ignore(); }