qt_rtmp_demo/components/toast.h

32 lines
535 B
C++
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef __TOAST__
#define __TOAST__
#include <QWidget>
#include "ui_toast.h"
class ToastWidget : public QWidget
{
Q_OBJECT
public:
ToastWidget(QWidget *parent = Q_NULLPTR);
~ToastWidget();
void setText(const QString& text);
void showAnimation(int timeout = 2000);// 动画方式show出默认2秒后消失
public:
// 静态调用
static void showTip(const QString& text, QWidget* parent = nullptr);
protected:
virtual void paintEvent(QPaintEvent *event);
private:
Ui::Form ui;
};
#endif