dde-dock/frame/item/components/previewwidget.h
石博文 825b5695b1 pass get image for unchanged window
Change-Id: Id71b3b01aa783397b7a0b7a8d797bbad602af9c0
2017-05-04 16:51:51 +08:00

52 lines
1.1 KiB
C++

#ifndef PREVIEWWIDGET_H
#define PREVIEWWIDGET_H
#include <QWidget>
#include <QDebug>
#include <QPushButton>
#include <QDragEnterEvent>
#include <QTimer>
class PreviewWidget : public QWidget
{
Q_OBJECT
public:
explicit PreviewWidget(const WId wid, QWidget *parent = 0);
void setTitle(const QString &title);
signals:
void requestActivateWindow(const WId wid) const;
void requestPreviewWindow(const WId wid) const;
void requestCancelPreview() const;
void requestHidePreview() const;
private slots:
void refreshImage();
void closeWindow();
void showPreview();
private:
void paintEvent(QPaintEvent *e);
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void dragEnterEvent(QDragEnterEvent *e);
void dragLeaveEvent(QDragLeaveEvent *e);
void dropEvent(QDropEvent *e);
private:
const WId m_wid;
QImage m_image;
QString m_title;
QPushButton *m_closeButton;
QTimer *m_droppedDelay;
QTimer *m_mouseEnterTimer;
bool m_hovered;
};
#endif // PREVIEWWIDGET_H