[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Wed, 30 Nov 2022 13:36:43 -0500 (EST) |
branch: old/qt-info
commit ab728407e6267840b9e6cfd9a3238dd7117e11aa
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Apr 19 14:56:21 2019 +0100
press return to search for index entry
---
js/docbrowser/mainwindow.cpp | 15 ++++++++++++++-
js/docbrowser/mainwindow.h | 3 ++-
js/docbrowser/mainwindow.ui | 3 +++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/js/docbrowser/mainwindow.cpp b/js/docbrowser/mainwindow.cpp
index 9bb318424c..8f64730fcf 100644
--- a/js/docbrowser/mainwindow.cpp
+++ b/js/docbrowser/mainwindow.cpp
@@ -25,6 +25,9 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->actionQuit, &QAction::triggered, this, &MainWindow::quit);
connect(qApp, &QApplication::focusChanged, this,
&MainWindow::focusChanged);
+ connect(ui->promptCombo->lineEdit(), &QLineEdit::returnPressed,
+ this, &MainWindow::promptReturnPressed);
+
this->datadir = getenv ("QTINFO_DATADIR");
if (!this->datadir)
QCoreApplication::quit();
@@ -214,7 +217,9 @@ void MainWindow::on_loadButton_clicked()
void MainWindow::on_promptCombo_activated(const QString &str)
{
- core->activate_input(str);
+ ; // core->activate_input(str);
+ // Only do it for return press, otherwise the up and down
+ // keys cause the index entry to be activated.
}
/* Hide the text prompt.
@@ -277,6 +282,14 @@ MainWindow::hide_search()
ui->searchEdit->setVisible(false);
}
+void
+MainWindow::promptReturnPressed()
+{
+ core->activate_input(ui->promptCombo->currentText());
+ hide_prompt();
+ ui->webEngineView->setFocus();
+}
+
void
MainWindow::on_manualEdit_returnPressed()
diff --git a/js/docbrowser/mainwindow.h b/js/docbrowser/mainwindow.h
index 97461a890e..c7253edf7c 100644
--- a/js/docbrowser/mainwindow.h
+++ b/js/docbrowser/mainwindow.h
@@ -34,9 +34,10 @@ private slots:
void on_loadButton_clicked();
void on_promptCombo_activated(const QString &arg1);
void on_searchEdit_returnPressed();
-
void on_manualEdit_returnPressed();
+ void promptReturnPressed();
+
private:
Ui::MainWindow *ui;
diff --git a/js/docbrowser/mainwindow.ui b/js/docbrowser/mainwindow.ui
index b779935fe4..00c2783589 100644
--- a/js/docbrowser/mainwindow.ui
+++ b/js/docbrowser/mainwindow.ui
@@ -41,6 +41,9 @@
<property name="editable">
<bool>true</bool>
</property>
+ <property name="insertPolicy">
+ <enum>QComboBox::NoInsert</enum>
+ </property>
</widget>
</item>
</layout>
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30