mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
add drop to open file
Change-Id: Icf959366f347533bf31b23b41cd61982583d1670
This commit is contained in:
parent
17ba0ae185
commit
96b46370f2
@ -89,6 +89,11 @@ public Q_SLOTS: // METHODS
|
||||
return asyncCall(QStringLiteral("HandleMenuItem"), item);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> HandleDragDrop(const QStringList &uriList)
|
||||
{
|
||||
return asyncCall(QStringLiteral("HandleDragDrop"), QVariant::fromValue(uriList));
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> RequestDock()
|
||||
{
|
||||
return asyncCall(QStringLiteral("RequestDock"));
|
||||
|
@ -185,7 +185,21 @@ void AppItem::resizeEvent(QResizeEvent *e)
|
||||
|
||||
void AppItem::dragEnterEvent(QDragEnterEvent *e)
|
||||
{
|
||||
qDebug() << e;
|
||||
// ignore drag from panel
|
||||
if (e->source())
|
||||
return;
|
||||
|
||||
e->accept();
|
||||
}
|
||||
|
||||
void AppItem::dropEvent(QDropEvent *e)
|
||||
{
|
||||
QStringList uriList;
|
||||
for (auto uri : e->mimeData()->urls())
|
||||
uriList << uri.toString();
|
||||
|
||||
// qDebug() << uriList;
|
||||
m_itemEntry->HandleDragDrop(uriList);
|
||||
}
|
||||
|
||||
void AppItem::invokedMenuItem(const QString &itemId, const bool checked)
|
||||
|
@ -25,6 +25,7 @@ private:
|
||||
void mouseMoveEvent(QMouseEvent *e);
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
void dragEnterEvent(QDragEnterEvent *e);
|
||||
void dropEvent(QDropEvent *e);
|
||||
|
||||
void invokedMenuItem(const QString &itemId, const bool checked);
|
||||
const QString contextMenu() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user