On this page

Utils::DropSupport Class

class Utils::DropSupport

The DropSupport class makes it easy for a QWidget to accept drops without subclassing QWidget and overriding methods. More...

Header: #include <utils/dropsupport.h>
Inherits: QObject

Signals

void filesDropped(const QList<Utils::DropSupport::FileSpec> &files, const QPoint &dropPos)
void valuesDropped(const QList<QVariant> &values, const QPoint &dropPos)

Static Public Members

bool enforceCopyAction(QDropEvent *event, Utils::DropSupport *ds)

Detailed Description

Member Function Documentation

[static] bool DropSupport::enforceCopyAction(QDropEvent *event, Utils::DropSupport *ds)

A DropFilterFunction that enforces the Qt::CopyAction on the drop, even if the drag source would support the move action. Useful for drop targets that just want to do something with e.g. the file path without actually "taking over" the source.

When the DropSupport ds reports a drop event, it sets the override file drop action of its MIME data to the copy action.

Returns true, meaning that it by default accepts the drop event.

[signal] void DropSupport::filesDropped(const QList<Utils::DropSupport::FileSpec> &files, const QPoint &dropPos)

[signal] void DropSupport::valuesDropped(const QList<QVariant> &values, const QPoint &dropPos)

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.