Added ability to add newline into the text edit panel with Shift+Enter
This commit is contained in:
parent
883cb99c0f
commit
16a744d55e
@ -1059,10 +1059,16 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
ui->spotButton->setChecked(m_config.spot_to_psk_reporter());
|
||||
|
||||
auto enterFilter = new EnterKeyPressEater();
|
||||
connect(enterFilter, &EnterKeyPressEater::enterKeyPressed, this, [this](QKeyEvent *, QObject *){
|
||||
if(ui->extFreeTextMsgEdit->isReadOnly()){
|
||||
connect(enterFilter, &EnterKeyPressEater::enterKeyPressed, this, [this](QObject *, QKeyEvent *, bool *pProcessed){
|
||||
if(QApplication::keyboardModifiers() & Qt::ShiftModifier){
|
||||
if(pProcessed) *pProcessed = false;
|
||||
return;
|
||||
}
|
||||
if(ui->extFreeTextMsgEdit->isReadOnly()){
|
||||
if(pProcessed) *pProcessed = false;
|
||||
return;
|
||||
}
|
||||
if(pProcessed) *pProcessed = true;
|
||||
toggleTx(true);
|
||||
});
|
||||
ui->extFreeTextMsgEdit->installEventFilter(enterFilter);
|
||||
|
@ -920,8 +920,11 @@ protected:
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
|
||||
if(keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return){
|
||||
emit this->enterKeyPressed(keyEvent, obj);
|
||||
return true;
|
||||
bool processed = false;
|
||||
emit this->enterKeyPressed(obj, keyEvent, &processed);
|
||||
if(processed){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -930,7 +933,7 @@ protected:
|
||||
}
|
||||
|
||||
public:
|
||||
Q_SIGNAL void enterKeyPressed(QKeyEvent *evt, QObject *obj);
|
||||
Q_SIGNAL void enterKeyPressed(QObject *obj, QKeyEvent *evt, bool *pProcessed);
|
||||
};
|
||||
|
||||
extern int killbyname(const char* progName);
|
||||
|
Loading…
Reference in New Issue
Block a user