mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
ed014b0d34
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8063 b45a01b8-16f6-495d-af2f-9b41ad6348cc
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#ifndef RSBUTTONONTEXT_H
|
|
#define RSBUTTONONTEXT_H
|
|
|
|
#include <QHelpEvent>
|
|
#include <QPushButton>
|
|
#include <QTextEdit>
|
|
|
|
class RSButtonOnText : public QPushButton
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit RSButtonOnText(QWidget *parent = 0);
|
|
explicit RSButtonOnText(const QString &text, QWidget *parent=0);
|
|
RSButtonOnText(const QIcon& icon, const QString &text, QWidget *parent=0);
|
|
RSButtonOnText(QTextEdit *textEdit, QWidget *parent = 0);
|
|
RSButtonOnText(const QString &text, QTextEdit *textEdit, QWidget *parent = 0);
|
|
RSButtonOnText(const QIcon& icon, const QString &text, QTextEdit *textEdit, QWidget *parent = 0);
|
|
~RSButtonOnText();
|
|
|
|
QString uuid();
|
|
QString htmlText();
|
|
void appendToText(QTextEdit *textEdit);
|
|
void clear();
|
|
void updateImage();
|
|
|
|
signals:
|
|
void mouseEnter();
|
|
void mouseLeave();
|
|
|
|
protected:
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
private:
|
|
bool isEventForThis(QObject *obj, QEvent *event, QPoint &point);
|
|
|
|
QString _uuid;
|
|
int _lenght;//Because cursor end position move durring editing
|
|
QTextEdit* _textEdit;
|
|
QWidget* _textEditViewPort;
|
|
QTextCursor* _textCursor;
|
|
bool _mouseOver;
|
|
bool _pressed;
|
|
|
|
};
|
|
|
|
#endif // RSBUTTONONTEXT_H
|