Generic auto-focusing for first line edit of popup
[pulseview.git] / pv / view / trace.cpp
index 896fdec5a5ee50bb40409ad9bed7154b3c955e0d..f23de2ff50b33cb2771468584b8b4c5051bf3fab 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <QApplication>
 #include <QFormLayout>
+#include <QKeyEvent>
 #include <QLineEdit>
 
 #include "trace.h"
@@ -263,8 +264,6 @@ void Trace::populate_popup_form(QWidget *parent, QFormLayout *form)
 {
        QLineEdit *const name_edit = new QLineEdit(parent);
        name_edit->setText(_name);
-       name_edit->selectAll();
-       name_edit->setFocus();
        connect(name_edit, SIGNAL(textChanged(const QString&)),
                this, SLOT(on_text_changed(const QString&)));
        form->addRow(tr("Name"), name_edit);
@@ -272,11 +271,6 @@ void Trace::populate_popup_form(QWidget *parent, QFormLayout *form)
        add_colour_option(parent, form);
 }
 
-void Trace::close_popup()
-{
-       _popup->close();
-}
-
 void Trace::on_popup_closed()
 {
        _popup = NULL;