這篇文章給大家分享的是有關(guān)QT實現(xiàn)提示右下角冒泡效果的方法是什么的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考。一起跟隨小編過來看看吧。
實現(xiàn)原理:
1、顯示
定時器啟動,右下角緩慢彈出,逐漸改變位置。
2、駐留
讓界面停留一定的時間,時間過后自動關(guān)閉。
3、退出
可以直接點擊關(guān)閉退出,也可以采用改變透明度的形式模糊退出。
#ifndef _QTOOLTIPS_ #define _QTOOLTIPS_ #include#include #include "ui_QToolTips.h" class QToolTips:public QDialog { Q_OBJECT public: QToolTips(QWidget *parent = 0); ~QToolTips(); void showMessage(const char* str); private slots: void onMove(); void onStay();- void onClose(); private: Ui::QToolTips ui; QTimer * m_pShowTimer; QTimer * m_pStayTimer; QTimer * m_pCloseTimer; QPoint m_point; int m_nDesktopHeight; double m_dTransparent; }; #endif