Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
19void Window::dragMoveEvent(QDragMoveEvent *event)
20{
21 if (event->mimeData()->hasFormat("text/plain")
22 && event->answerRect().intersects(dropFrame->geometry()))
23
24 event->acceptProposedAction();
25}
27
28
29} // droprectangle
The QFrame class is the base class of widgets that can have a frame.
Definition qframe.h:17
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition qwidget.h:106
struct _cl_event * event
void dragMoveEvent(QDragMoveEvent *event)
[0]
Definition window.cpp:19