+ drag and drop on tree widget
This commit is contained in:
parent
2db31c97ec
commit
8b901df068
|
@ -307,12 +307,6 @@ void TreeWidget::onActivateDocument(QAction* active)
|
|||
getMainWindow()->setActiveWindow(view);
|
||||
}
|
||||
|
||||
bool TreeWidget::dropMimeData(QTreeWidgetItem *parent, int index,
|
||||
const QMimeData *data, Qt::DropAction action)
|
||||
{
|
||||
return QTreeWidget::dropMimeData(parent, index, data, action);
|
||||
}
|
||||
|
||||
Qt::DropActions TreeWidget::supportedDropActions () const
|
||||
{
|
||||
return QTreeWidget::supportedDropActions();
|
||||
|
@ -365,6 +359,11 @@ void TreeWidget::mouseDoubleClickEvent (QMouseEvent * event)
|
|||
}
|
||||
}
|
||||
|
||||
void TreeWidget::startDrag(Qt::DropActions supportedActions)
|
||||
{
|
||||
QTreeWidget::startDrag(supportedActions);
|
||||
}
|
||||
|
||||
QMimeData * TreeWidget::mimeData (const QList<QTreeWidgetItem *> items) const
|
||||
{
|
||||
// all selected items must reference an object from the same document
|
||||
|
@ -394,6 +393,22 @@ QMimeData * TreeWidget::mimeData (const QList<QTreeWidgetItem *> items) const
|
|||
return QTreeWidget::mimeData(items);
|
||||
}
|
||||
|
||||
bool TreeWidget::dropMimeData(QTreeWidgetItem *parent, int index,
|
||||
const QMimeData *data, Qt::DropAction action)
|
||||
{
|
||||
return QTreeWidget::dropMimeData(parent, index, data, action);
|
||||
}
|
||||
|
||||
void TreeWidget::dragEnterEvent(QDragEnterEvent * event)
|
||||
{
|
||||
QTreeWidget::dragEnterEvent(event);
|
||||
}
|
||||
|
||||
void TreeWidget::dragLeaveEvent(QDragLeaveEvent * event)
|
||||
{
|
||||
QTreeWidget::dragLeaveEvent(event);
|
||||
}
|
||||
|
||||
void TreeWidget::dragMoveEvent(QDragMoveEvent *event)
|
||||
{
|
||||
QTreeWidget::dragMoveEvent(event);
|
||||
|
|
|
@ -78,12 +78,18 @@ protected:
|
|||
void onSelectionChanged(const SelectionChanges& msg);
|
||||
void contextMenuEvent (QContextMenuEvent * e);
|
||||
void drawRow(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const;
|
||||
/** @name Drag and drop */
|
||||
//@{
|
||||
void startDrag(Qt::DropActions supportedActions);
|
||||
bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data,
|
||||
Qt::DropAction action);
|
||||
Qt::DropActions supportedDropActions () const;
|
||||
QMimeData * mimeData (const QList<QTreeWidgetItem *> items) const;
|
||||
void dragEnterEvent(QDragEnterEvent * event);
|
||||
void dragLeaveEvent(QDragLeaveEvent * event);
|
||||
void dragMoveEvent(QDragMoveEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
//@}
|
||||
bool event(QEvent *e);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void mouseDoubleClickEvent(QMouseEvent * event);
|
||||
|
|
Loading…
Reference in New Issue
Block a user