MCPcopy Create free account
hub / github.com/KDE/labplot / initSearchWidget

Method initSearchWidget

src/frontend/spreadsheet/SearchReplaceWidget.cpp:164–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164void SearchReplaceWidget::initSearchWidget() {
165 m_searchWidget = new QWidget(this);
166 uiSearch.setupUi(m_searchWidget);
167 uiSearch.cbFind->lineEdit()->setClearButtonEnabled(true);
168 static_cast<QVBoxLayout*>(layout())->insertWidget(0, m_searchWidget);
169
170 // restore saved settings if available
171 KConfigGroup conf = Settings::group(QLatin1String("SearchReplaceWidget"));
172 uiSearch.cbFind->addItems(conf.readEntry(QLatin1String("SimpleValueHistory"), QStringList()));
173 uiSearch.cbFind->setCurrentText(QString()); // will be set to the initial search pattern later
174 uiSearch.tbMatchCase->setChecked(conf.readEntry(QLatin1String("SimpleMatchCase"), false));
175
176 // connections
177 connect(uiSearch.cbFind->lineEdit(), &QLineEdit::returnPressed, this, [=]() {
178 findNextSimple(true);
179 addCurrentTextToHistory(uiSearch.cbFind);
180 });
181 connect(uiSearch.cbFind->lineEdit(), &QLineEdit::textChanged, this, [=]() {
182 m_patternFound = false;
183 findNextSimple(false);
184 });
185
186 connect(uiSearch.tbFindNext, &QToolButton::clicked, this, [=]() {
187 findNextSimple(true);
188 addCurrentTextToHistory(uiSearch.cbFind);
189 });
190 connect(uiSearch.tbFindPrev, &QToolButton::clicked, this, [=]() {
191 findPreviousSimple(true);
192 addCurrentTextToHistory(uiSearch.cbFind);
193 });
194
195 connect(uiSearch.tbMatchCase, &QToolButton::toggled, this, [=]() {
196 findNextSimple(false);
197 });
198 connect(uiSearch.tbSwitchFindReplace, &QToolButton::clicked, this, &SearchReplaceWidget::switchFindReplace);
199 connect(uiSearch.bCancel, &QPushButton::clicked, this, &SearchReplaceWidget::cancel);
200}
201
202void SearchReplaceWidget::initSearchReplaceWidget() {
203 // init UI

Callers

nothing calls this directly

Calls 5

groupFunction · 0.85
setClearButtonEnabledMethod · 0.80
lineEditMethod · 0.80
QStringClass · 0.50
insertWidgetMethod · 0.45

Tested by

no test coverage detected