Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
window.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QDragMoveEvent>
4#include <QFrame>
5#include <QMimeData>
6#include <QWidget>
7
8namespace droprectangle {
9
10struct Window : public QWidget
11{
12 void dragMoveEvent(QDragMoveEvent *event);
13
14 QFrame *dropFrame = nullptr;
15};
16
17
18//! [0]
19void Window::dragMoveEvent(QDragMoveEvent *event)
20{
21 if (event->mimeData()->hasFormat("text/plain")
22 && event->answerRect().intersects(dropFrame->geometry()))
23
24 event->acceptProposedAction();
25}
26//! [0]
27
28
29} // droprectangle
void dragMoveEvent(QDragMoveEvent *event)
[0]
Definition window.cpp:19