6#include <QtGui/qevent.h>
7#include <QtWidgets/qmenu.h>
11using namespace Qt::StringLiterals;
15 QLineEdit(parent), m_wantNewLine(
false)
22 if (e->type() == QEvent::ShortcutOverride && !isReadOnly()) {
23 QKeyEvent* ke =
static_cast<QKeyEvent*> (e);
24 if (ke->modifiers() & Qt::ControlModifier) {
25 if(ke->key() == Qt::Key_A) {
31 return QLineEdit::event(e);
40 const int oldCursorPosition = cursorPosition ();
42 setCursorPosition (oldCursorPosition + text.size());
43 setFocus(Qt::OtherFocusReason);
47 QMenu *menu = createStandardContextMenu ();
51 menu->addAction(tr(
"Insert line break"),
this, &PropertyLineEdit::insertNewLine);
54 menu->exec(event->globalPos());
void contextMenuEvent(QContextMenuEvent *event) override
This event handler, for event event, can be reimplemented in a subclass to receive widget context men...
bool event(QEvent *e) override
This virtual function receives events to an object and should return true if the event e was recogniz...
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.