diff options
| author | Silarn <jrim@rimpo.org> | 2018-04-18 03:41:53 -0500 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2018-04-18 03:41:53 -0500 |
| commit | 08b56ee783131537d3f87e60819e88316ea1e062 (patch) | |
| tree | a04f27fd6cbe91cee2b09a0eb84c91c9bfa3ae79 /src/modidlineedit.cpp | |
| parent | 85faed5de109c0d5773626370bb6dbd338293f63 (diff) | |
Improve and fix handling of external links
Diffstat (limited to 'src/modidlineedit.cpp')
| -rw-r--r-- | src/modidlineedit.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modidlineedit.cpp b/src/modidlineedit.cpp new file mode 100644 index 00000000..7d1f0c38 --- /dev/null +++ b/src/modidlineedit.cpp @@ -0,0 +1,19 @@ +#include "modidlineedit.h" +#include <QWhatsThis> + +#include <QEvent> +#include <QWhatsThisClickedEvent> + +ModIDLineEdit::ModIDLineEdit(QWidget *parent) : QLineEdit(parent) {} +ModIDLineEdit::ModIDLineEdit(const QString &text, QWidget *parent) : QLineEdit(text, parent) {} + +bool ModIDLineEdit::event(QEvent *event) +{ + if (event->type() == QEvent::WhatsThisClicked) + { + QWhatsThisClickedEvent *wtcEvent = static_cast<QWhatsThisClickedEvent*>(event); + emit linkClicked(wtcEvent->href().trimmed()); + } + + return QLineEdit::event(event); +}
\ No newline at end of file |
