reimplemented text field
This commit is contained in:
@@ -72,6 +72,8 @@ TextEditEx::TextEditEx(QWidget *parent) : QTextEdit(parent)
|
||||
{
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(text_edit_menu()));
|
||||
|
||||
connect(this, SIGNAL(textChanged()), this, SLOT(queue_text_modified()));
|
||||
}
|
||||
|
||||
void TextEditEx::text_edit_menu() {
|
||||
@@ -90,3 +92,8 @@ void TextEditEx::open_text_edit() {
|
||||
setHtml(result);
|
||||
}
|
||||
}
|
||||
|
||||
void TextEditEx::queue_text_modified()
|
||||
{
|
||||
emit textModified(toHtml());
|
||||
}
|
||||
|
||||
+3
-18
@@ -23,31 +23,16 @@
|
||||
|
||||
#include <QTextEdit>
|
||||
|
||||
/*
|
||||
class TextEditEx : public QTextEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TextEditEx(QWidget* parent = 0);
|
||||
void setPlainTextEx(const QString &text);
|
||||
const QString& getPreviousValue();
|
||||
const QString& getPlainTextEx();
|
||||
TextEditEx(QWidget* parent = nullptr);
|
||||
signals:
|
||||
void updateSelf();
|
||||
private slots:
|
||||
void updateInternals();
|
||||
void updateText();
|
||||
private:
|
||||
QString previousText;
|
||||
QString text;
|
||||
};
|
||||
*/
|
||||
|
||||
class TextEditEx : public QTextEdit {
|
||||
public:
|
||||
TextEditEx(QWidget* parent);
|
||||
void textModified(const QString& s);
|
||||
private slots:
|
||||
void text_edit_menu();
|
||||
void open_text_edit();
|
||||
void queue_text_modified();
|
||||
};
|
||||
|
||||
#endif // TEXTEDITEX_H
|
||||
|
||||
Reference in New Issue
Block a user