返回介绍

QStoredDrag Class

发布于 2019-10-04 15:03:03 字数 2017 浏览 863 评论 0 收藏 0

The QStoredDrag class provides a simple stored-value drag object for arbitrary MIME data. More...

#include <qdragobject.h>

Inherits QDragObject.

Inherited by QUriDrag and QColorDrag.

List of all member functions.

Public Members

  • QStoredDrag ( constchar*mimeType, QWidget*dragSource = 0, constchar*name = 0 )
  • ~QStoredDrag ()
  • virtual void setEncodedData ( constQByteArray&encodedData )
  • virtual QByteArray encodedData ( constchar*m ) const

Detailed Description

The QStoredDrag class provides a simple stored-value drag object for arbitrary MIME data.

When a block of data has only one representation, you can use a QStoredDrag to hold it.

For more information about drag and drop, see the QDragObject class and the drag and drop documentation.

See also Drag And Drop Classes.


Member Function Documentation

QStoredDrag::QStoredDrag ( constchar*mimeType, QWidget*dragSource = 0, constchar*name = 0 )

Constructs a QStoredDrag. The dragSource and name are passed to the QDragObject constructor, and the format is set to mimeType.

The data will be unset. Use setEncodedData() to set it.

QStoredDrag::~QStoredDrag ()

Destroys the drag object and frees up all allocated resources.

QByteArray QStoredDrag::encodedData ( constchar*m ) const [virtual]

Returns the stored data. m contains the data's format.

See also setEncodedData().

Reimplemented from QMimeSource.

void QStoredDrag::setEncodedData ( constQByteArray&encodedData ) [virtual]

Sets the encoded data of this drag object to encodedData. The encoded data is what's delivered to the drop sites. It must be in a strictly defined and portable format.

The drag object can't be dropped (by the user) until this function has been called.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文