2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef PIECESLIST_H
|
|
|
|
#define PIECESLIST_H
|
|
|
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
|
|
|
class PiecesList : public QListWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-08-24 09:19:21 +00:00
|
|
|
explicit PiecesList(int pieceSize, QWidget *parent = nullptr);
|
|
|
|
void addPiece(const QPixmap &pixmap, const QPoint &location);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-10-07 10:03:05 +00:00
|
|
|
static QString puzzleMimeType() { return QStringLiteral("image/x-puzzle-piece"); }
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
protected:
|
2016-06-15 08:12:35 +00:00
|
|
|
void dragEnterEvent(QDragEnterEvent *event) override;
|
|
|
|
void dragMoveEvent(QDragMoveEvent *event) override;
|
|
|
|
void dropEvent(QDropEvent *event) override;
|
|
|
|
void startDrag(Qt::DropActions supportedActions) override;
|
2011-04-27 17:16:41 +00:00
|
|
|
|
|
|
|
int m_PieceSize;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
2012-11-23 13:27:50 +00:00
|
|
|
#endif // PIECESLIST_H
|