qt5base-lts/examples/widgets/draganddrop/dropsite/droparea.h
Friedemann Kleint 33bee95910 Brush up the drop site example
- Use qsizetype
- Use new string literals instead of deprecated QLatin1String()
- Streamline some code
- Remove unused member variable
- Remove module include

Pick-to: 6.4
Change-Id: Ia96424a23f3ae10e57db942de49949ce3aef8876
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-21 20:52:14 +02:00

38 lines
796 B
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef DROPAREA_H
#define DROPAREA_H
#include <QLabel>
QT_BEGIN_NAMESPACE
class QMimeData;
QT_END_NAMESPACE
//! [DropArea header part1]
class DropArea : public QLabel
{
Q_OBJECT
public:
explicit DropArea(QWidget *parent = nullptr);
public slots:
void clear();
signals:
void changed(const QMimeData *mimeData = nullptr);
//! [DropArea header part1]
//! [DropArea header part2]
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dragLeaveEvent(QDragLeaveEvent *event) override;
void dropEvent(QDropEvent *event) override;
};
//! [DropArea header part2]
#endif // DROPAREA_H