22 #include <QVBoxLayout>
23 #include <QHBoxLayout>
27 MyFindDialog::MyFindDialog(
QWidget* parent)
30 m_label =
new QLabel(
"Search for:",
this);
31 m_input =
new QLineEdit;
32 m_label->setBuddy(m_input);
34 m_match_case =
new QCheckBox(
"Match case");
36 m_close_button =
new QPushButton(
"Close");
37 m_find_button =
new QPushButton(
"Find");
38 m_find_button->setDefault(
true);
39 m_find_button->setAutoDefault(
true);
41 QHBoxLayout* input_layout =
new QHBoxLayout;
42 input_layout->addWidget(m_label);
43 input_layout->addWidget(m_input);
45 QHBoxLayout* button_layout =
new QHBoxLayout;
46 button_layout->addWidget(m_close_button);
47 button_layout->addWidget(m_find_button);
49 QVBoxLayout* layout =
new QVBoxLayout;
50 layout->addLayout(input_layout);
51 layout->addWidget(m_match_case);
52 layout->addLayout(button_layout);
55 setWindowTitle(
"Find");
58 connect(m_close_button, SIGNAL(clicked()),
this, SLOT(close()));
59 connect(m_find_button, SIGNAL(clicked()),
this, SLOT(Find()));
65 m_find_button->setDefault(
true);
68 void MyFindDialog::Find()
70 emit
FindNext(m_input->text(), m_match_case->isChecked());
void CorrectFocus()
Sets focus to the text input box so the user can start typing right away.
Interface for MyFindDialog.
see the online Qt documentation
void FindNext(QString const &text, bool match_case)
Emitted when user performs a search query by clicking 'Search' or pressing the Enter button...
Namespace for generic graphical shell for simulators.
see the online Qt documentation