qtopengl_lua_find_dialog.cpp
Go to the documentation of this file.
1 
8 
9 #include <QCheckBox>
10 #include <QDialogButtonBox>
11 #include <QGroupBox>
12 #include <QHBoxLayout>
13 #include <QLabel>
14 #include <QLineEdit>
15 #include <QPushButton>
16 #include <QVBoxLayout>
17 
18 namespace argos {
19 
20  /****************************************/
21  /****************************************/
22 
24  QDialog(parent) {
25  m_pcLabel = new QLabel(tr("&Find text:"));
26  m_pcLineEdit = new QLineEdit();
27  m_pcLabel->setBuddy(m_pcLineEdit);
28 
29  m_pcCaseCheckBox = new QCheckBox(tr("Match &case"));
30  m_pcFromStartCheckBox = new QCheckBox(tr("Search from &start"));
31  m_pcFromStartCheckBox->setChecked(true);
32 
33  m_pcFindButton = new QPushButton(tr("&Find"));
34  m_pcFindButton->setDefault(true);
35 
36  m_pcMoreButton = new QPushButton(tr("&More"));
37  m_pcMoreButton->setCheckable(true);
38  m_pcMoreButton->setAutoDefault(false);
39 
40  m_pcButtonBox = new QDialogButtonBox(Qt::Vertical);
41  m_pcButtonBox->addButton(m_pcFindButton, QDialogButtonBox::ActionRole);
42  m_pcButtonBox->addButton(m_pcMoreButton, QDialogButtonBox::ActionRole);
43 
44  m_pcExtension = new QWidget();
45 
46  m_pcWholeWordsCheckBox = new QCheckBox(tr("&Whole words"));
47  m_pcBackwardCheckBox = new QCheckBox(tr("Search &backward"));
48  m_pcSearchSelectionCheckBox = new QCheckBox(tr("Search se&lection"));
49 
50  connect(m_pcMoreButton, SIGNAL(toggled(bool)),
51  m_pcExtension, SLOT(setVisible(bool)));
52 
53  QVBoxLayout* m_pcExtensionLayout = new QVBoxLayout();
54  //m_pcExtensionLayout->setMargin(0);
55  m_pcExtensionLayout->addWidget(m_pcWholeWordsCheckBox);
56  m_pcExtensionLayout->addWidget(m_pcBackwardCheckBox);
57  m_pcExtensionLayout->addWidget(m_pcSearchSelectionCheckBox);
58  m_pcExtension->setLayout(m_pcExtensionLayout);
59 
60  QHBoxLayout* m_pcTopLeftLayout = new QHBoxLayout();
61  m_pcTopLeftLayout->addWidget(m_pcLabel);
62  m_pcTopLeftLayout->addWidget(m_pcLineEdit);
63 
64  QVBoxLayout* m_pcLeftLayout = new QVBoxLayout();
65  m_pcLeftLayout->addLayout(m_pcTopLeftLayout);
66  m_pcLeftLayout->addWidget(m_pcCaseCheckBox);
67  m_pcLeftLayout->addWidget(m_pcFromStartCheckBox);
68  m_pcLeftLayout->addStretch(1);
69 
70  QGridLayout* m_pcMainLayout = new QGridLayout();
71  m_pcMainLayout->setSizeConstraint(QLayout::SetFixedSize);
72  m_pcMainLayout->addLayout(m_pcLeftLayout, 0, 0);
73  m_pcMainLayout->addWidget(m_pcButtonBox, 0, 1);
74  m_pcMainLayout->addWidget(m_pcExtension, 1, 0, 1, 2);
75  setLayout(m_pcMainLayout);
76 
77  setWindowTitle(tr("Find/replace"));
78  m_pcExtension->hide();
79  }
80 
81  /****************************************/
82  /****************************************/
83 
84 }
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12