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 IMAGEITEM_H
|
|
|
|
#define IMAGEITEM_H
|
|
|
|
|
|
|
|
#include <QtCore>
|
2011-05-07 20:57:49 +00:00
|
|
|
#include <QtWidgets/QGraphicsPixmapItem>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class ImageItem : public QObject, public QGraphicsPixmapItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-03-06 06:29:12 +00:00
|
|
|
enum { Type = UserType + 1 };
|
|
|
|
|
2017-07-20 14:39:01 +00:00
|
|
|
ImageItem(int id, const QPixmap &pixmap, QGraphicsItem *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2020-03-06 06:29:12 +00:00
|
|
|
int type() const override { return Type; }
|
2011-04-27 10:05:43 +00:00
|
|
|
void adjust();
|
2017-07-20 14:39:01 +00:00
|
|
|
int id() const;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 08:12:35 +00:00
|
|
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
|
|
|
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void setFrame(int frame);
|
|
|
|
void updateItemPosition();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QTimeLine timeLine;
|
|
|
|
int recordId;
|
|
|
|
double z;
|
|
|
|
};
|
|
|
|
//! [0]
|
|
|
|
|
|
|
|
#endif
|