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
8
namespace
droprectangle
{
9
10
struct
Window
:
public
QWidget
11
{
12
void
dragMoveEvent
(QDragMoveEvent *
event
);
13
14
QFrame
*
dropFrame
=
nullptr
;
15
};
16
17
19
void
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
QFrame
The QFrame class is the base class of widgets that can have a frame.
Definition
qframe.h:17
QWidget
The QWidget class is the base class of all user interface objects.
Definition
qwidget.h:99
QWidget::geometry
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition
qwidget.h:106
droprectangle
Definition
window.cpp:8
event
struct _cl_event * event
Definition
qopenglext.h:2998
droprectangle::Window
Definition
window.cpp:11
droprectangle::Window::dragMoveEvent
void dragMoveEvent(QDragMoveEvent *event)
[0]
Definition
window.cpp:19
droprectangle::Window::dropFrame
QFrame * dropFrame
Definition
window.cpp:14
qtbase
src
gui
doc
snippets
droprectangle
window.cpp
Generated by
1.10.0