1 /* 2 * wpa_gui - StringQuery class 3 * Copyright (c) 2009, Atheros Communications 4 * 5 * This software may be distributed under the terms of the BSD license. 6 * See README for more details. 7 */ 8 9 #include <cstdio> 10 #include <QLabel> 11 12 #include "stringquery.h" 13 14 StringQuery(QString label)15StringQuery::StringQuery(QString label) 16 { 17 edit = new QLineEdit; 18 edit->setFocus(); 19 QGridLayout *layout = new QGridLayout; 20 layout->addWidget(new QLabel(label), 0, 0); 21 layout->addWidget(edit, 0, 1); 22 setLayout(layout); 23 24 connect(edit, SIGNAL(returnPressed()), this, SLOT(accept())); 25 } 26 27 get_string()28QString StringQuery::get_string() 29 { 30 return edit->text(); 31 } 32