capture_gif/xygifframe.h

77 lines
1.6 KiB
C
Raw Permalink Normal View History

2021-09-13 06:08:34 +00:00
#ifndef XYGIFFRAME_H
#define XYGIFFRAME_H
#include "xymovablewidget.h"
#include "xygifcreator.h"
#include <QTimer>
#include <QSystemTrayIcon>
namespace Ui {
class XYGifFrame;
}
class XYGifFrame : public XYMovableWidget
{
Q_OBJECT
public:
explicit XYGifFrame(QWidget *parent = nullptr);
~XYGifFrame() override;
public slots:
void doResize();
void packImages();
void setGifFile();
void active();
void start();
void stop();
void frame();
void TrayIconAction(QSystemTrayIcon::ActivationReason reason)
{
if(reason == QSystemTrayIcon::Trigger)
this->showNormal();
}
void restory(){
this->showNormal();
}
protected:
bool eventFilter(QObject *watched, QEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
private slots:
void on_quit_clicked();
private:
QImage getCurScreenImage();
// 用于resize窗口
private:
bool mStartResize;
QRect mStartGeometry;
private:
Ui::XYGifFrame *ui;
QRect mRecordRect;
XYGifCreator *mGifCreator;
QTimer mTimer;
int mPixs;
QString mGifFile;
QSystemTrayIcon* m_tray; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
QMenu* m_menu; //<2F><><EFBFBD>̲˵<CCB2>
QAction* m_resetAction; //<2F><><EFBFBD>̰<EFBFBD>ť
QAction* m_quitAction; //<2F><><EFBFBD>̰<EFBFBD>ť
};
#endif // XYGIFFRAME_H