Kstars

finddialog.cpp
1/*
2 SPDX-FileCopyrightText: 2001 Jason Harris <jharris@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "finddialog.h"
8
9#include "kstars.h"
10#include "kstarsdata.h"
11#include "ksnotification.h"
12#include "Options.h"
13#include "detaildialog.h"
14#include "skymap.h"
15#include "skyobjects/skyobject.h"
16#include "skycomponents/starcomponent.h"
17#include "skycomponents/skymapcomposite.h"
18#include "tools/nameresolver.h"
19#include "skyobjectlistmodel.h"
20#include "catalogscomponent.h"
21#include <KMessageBox>
22
23#include <QSortFilterProxyModel>
24#include <QStringListModel>
25#include <QTimer>
26#include <QComboBox>
27#include <QLineEdit>
28#include <QPointer>
29
30FindDialog *FindDialog::m_Instance = nullptr;
31
32FindDialogUI::FindDialogUI(QWidget *parent) : QFrame(parent)
33{
34 setupUi(this);
35
36 FilterType->addItem(i18n("Any"));
37 FilterType->addItem(i18n("Stars"));
38 FilterType->addItem(i18n("Solar System"));
39 FilterType->addItem(i18n("Open Clusters"));
40 FilterType->addItem(i18n("Globular Clusters"));
41 FilterType->addItem(i18n("Gaseous Nebulae"));
42 FilterType->addItem(i18n("Planetary Nebulae"));
43 FilterType->addItem(i18n("Galaxies"));
44 FilterType->addItem(i18n("Comets"));
45 FilterType->addItem(i18n("Asteroids"));
46 FilterType->addItem(i18n("Constellations"));
47 FilterType->addItem(i18n("Supernovae"));
48 FilterType->addItem(i18n("Satellites"));
49
50 SearchList->setMinimumWidth(256);
51 SearchList->setMinimumHeight(320);
52}
53
54FindDialog *FindDialog::Instance()
55{
56 if (m_Instance == nullptr)
57 m_Instance = new FindDialog(KStars::Instance());
58
59 return m_Instance;
60}
61
62FindDialog::FindDialog(QWidget *parent)
63 : QDialog(parent)
64 , timer(nullptr)
65 , m_targetObject(nullptr)
66 , m_dbManager(CatalogsDB::dso_db_path())
67{
68#ifdef Q_OS_MACOS
69 setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);
70#endif
71 ui = new FindDialogUI(this);
72
73 setWindowTitle(i18nc("@title:window", "Find Object"));
74
75 QVBoxLayout *mainLayout = new QVBoxLayout;
76 mainLayout->addWidget(ui);
77 setLayout(mainLayout);
78
80 mainLayout->addWidget(buttonBox);
81 connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
82 connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
83
84 okB = buttonBox->button(QDialogButtonBox::Ok);
85 okB->setEnabled(false);
86
87 m_DetailsB = new QPushButton(i18n("Details..."));
88 buttonBox->addButton(m_DetailsB, QDialogButtonBox::ActionRole);
89 connect(m_DetailsB, SIGNAL(clicked()), this, SLOT(slotDetails()));
90
91 ui->InternetSearchButton->setVisible(Options::resolveNamesOnline());
92 ui->InternetSearchButton->setEnabled(false);
93 connect(ui->InternetSearchButton, SIGNAL(clicked()), this, SLOT(slotResolve()));
94
95 ui->FilterType->setCurrentIndex(0); // show all types of objects
96
97 fModel = new SkyObjectListModel(this);
98 connect(KStars::Instance()->map(), &SkyMap::removeSkyObject, fModel, &SkyObjectListModel::removeSkyObject);
99 sortModel = new QSortFilterProxyModel(ui->SearchList);
100 sortModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
101 sortModel->setSourceModel(fModel);
102 sortModel->setSortRole(Qt::DisplayRole);
103 sortModel->setFilterRole(Qt::DisplayRole);
104 sortModel->setDynamicSortFilter(true);
105 sortModel->sort(0);
106
107 ui->SearchList->setModel(sortModel);
108
109 // Connect signals to slots
110 connect(ui->clearHistoryB, &QPushButton::clicked, [&]()
111 {
112 ui->clearHistoryB->setEnabled(false);
113 m_HistoryCombo->clear();
114 m_HistoryList.clear();
115 });
116
117 m_HistoryCombo = new QComboBox(ui->showHistoryB);
118 m_HistoryCombo->move(0, ui->showHistoryB->height());
119 connect(ui->showHistoryB, &QPushButton::clicked, [&]()
120 {
121 if (m_HistoryList.empty() == false)
122 {
123 m_HistoryCombo->showPopup();
124 }
125 });
126
127 connect(m_HistoryCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
128 [&](int index)
129 {
130 m_targetObject = m_HistoryList[index];
131 m_targetObject->updateCoordsNow(KStarsData::Instance()->updateNum());
132 m_HistoryCombo->setCurrentIndex(-1);
133 m_HistoryCombo->hidePopup();
134 accept();
135 });
136 connect(ui->SearchBox, &QLineEdit::textChanged, this, &FindDialog::enqueueSearch);
137 connect(ui->SearchBox, &QLineEdit::returnPressed, this, &FindDialog::slotOk);
138 connect(ui->FilterType, &QComboBox::currentTextChanged, this, &FindDialog::enqueueSearch);
139 connect(ui->SearchList, SIGNAL(doubleClicked(QModelIndex)), SLOT(slotOk()));
140 connect(ui->SearchList->selectionModel(), &QItemSelectionModel::selectionChanged, this, &FindDialog::slotUpdateButtons);
141
142 // Set focus to object name edit
143 ui->SearchBox->setFocus();
144
145 // First create and paint dialog and then load list
146 QTimer::singleShot(0, this, SLOT(init()));
147
148 listFiltered = false;
149}
150
151void FindDialog::init()
152{
153 const auto &objs = m_dbManager.get_objects(Options::magLimitDrawDeepSky(), 100);
154 for (const auto &obj : objs)
155 {
156 KStarsData::Instance()->skyComposite()->catalogsComponent()->insertStaticObject(
157 obj);
158 }
159 ui->SearchBox->clear();
160 filterByType();
161 sortModel->sort(0);
162 initSelection();
163 m_targetObject = nullptr;
164}
165
166void FindDialog::showEvent(QShowEvent *e)
167{
168 ui->SearchBox->setFocus();
169 e->accept();
170}
171
172void FindDialog::initSelection()
173{
174 if (sortModel->rowCount() <= 0)
175 {
176 okB->setEnabled(false);
177 return;
178 }
179
180 // ui->SearchBox->setModel(sortModel);
181 // ui->SearchBox->setModelColumn(0);
182
183 if (ui->SearchBox->text().isEmpty())
184 {
185 //Pre-select the first item
186 QModelIndex selectItem = sortModel->index(0, sortModel->filterKeyColumn(), QModelIndex());
187 switch (ui->FilterType->currentIndex())
188 {
189 case 0: //All objects, choose Andromeda galaxy
190 {
191 QModelIndex qmi = fModel->index(fModel->indexOf(i18n("Andromeda Galaxy")));
192 selectItem = sortModel->mapFromSource(qmi);
193 break;
194 }
195 case 1: //Stars, choose Aldebaran
196 {
197 QModelIndex qmi = fModel->index(fModel->indexOf(i18n("Aldebaran")));
198 selectItem = sortModel->mapFromSource(qmi);
199 break;
200 }
201 case 2: //Solar system or Asteroids, choose Aaltje
202 case 9:
203 {
204 QModelIndex qmi = fModel->index(fModel->indexOf(i18n("Aaltje")));
205 selectItem = sortModel->mapFromSource(qmi);
206 break;
207 }
208 case 8: //Comets, choose 'Aarseth-Brewington (1989 W1)'
209 {
210 QModelIndex qmi = fModel->index(fModel->indexOf(i18n("Aarseth-Brewington (1989 W1)")));
211 selectItem = sortModel->mapFromSource(qmi);
212 break;
213 }
214 }
215
216 if (selectItem.isValid())
217 {
218 ui->SearchList->selectionModel()->select(selectItem, QItemSelectionModel::ClearAndSelect);
219 ui->SearchList->scrollTo(selectItem);
220 ui->SearchList->setCurrentIndex(selectItem);
221 }
222 }
223
224 listFiltered = true;
225}
226
227void FindDialog::filterByType()
228{
229 KStarsData *data = KStarsData::Instance();
230
231 switch (ui->FilterType->currentIndex())
232 {
233 case 0: // All object types
234 {
236 foreach (int type, data->skyComposite()->objectLists().keys())
237 {
238 allObjects.append(data->skyComposite()->objectLists(SkyObject::TYPE(type)));
239 }
240 fModel->setSkyObjectsList(allObjects);
241 break;
242 }
243 case 1: //Stars
244 {
246 starObjects.append(data->skyComposite()->objectLists(SkyObject::STAR));
247 starObjects.append(data->skyComposite()->objectLists(SkyObject::CATALOG_STAR));
248 fModel->setSkyObjectsList(starObjects);
249 break;
250 }
251 case 2: //Solar system
252 {
254 ssObjects.append(data->skyComposite()->objectLists(SkyObject::PLANET));
255 ssObjects.append(data->skyComposite()->objectLists(SkyObject::COMET));
256 ssObjects.append(data->skyComposite()->objectLists(SkyObject::ASTEROID));
257 ssObjects.append(data->skyComposite()->objectLists(SkyObject::MOON));
258
259 fModel->setSkyObjectsList(ssObjects);
260 break;
261 }
262 case 3: //Open Clusters
263 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::OPEN_CLUSTER));
264 break;
265 case 4: //Globular Clusters
266 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::GLOBULAR_CLUSTER));
267 break;
268 case 5: //Gaseous nebulae
269 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::GASEOUS_NEBULA));
270 break;
271 case 6: //Planetary nebula
272 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::PLANETARY_NEBULA));
273 break;
274 case 7: //Galaxies
275 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::GALAXY));
276 break;
277 case 8: //Comets
278 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::COMET));
279 break;
280 case 9: //Asteroids
281 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::ASTEROID));
282 break;
283 case 10: //Constellations
284 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::CONSTELLATION));
285 break;
286 case 11: //Supernovae
287 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::SUPERNOVA));
288 break;
289 case 12: //Satellites
290 fModel->setSkyObjectsList(data->skyComposite()->objectLists(SkyObject::SATELLITE));
291 break;
292 }
293}
294
296{
297 QString SearchText = processSearchText();
298 //const std::size_t searchId = m_currentSearchSequence;
299
300 // JM 2022.08.28: Disabling use of async DB manager until further notice since it appears to cause a crash
301 // on MacOS and some embedded systems.
302 // QEventLoop loop;
303 // QMutexLocker {&dbCallMutex}; // To prevent re-entrant calls into this
304 // connect(m_asyncDBManager.get(), &CatalogsDB::AsyncDBManager::resultReady, &loop, &QEventLoop::quit);
305 // QMetaObject::invokeMethod(m_asyncDBManager.get(), [&](){
306 // m_asyncDBManager->find_objects_by_name(SearchText, 10); });
307 // loop.exec();
308 // std::unique_ptr<CatalogsDB::CatalogObjectList> objs = m_asyncDBManager->result();
309 // if (m_currentSearchSequence != searchId) {
310 // return; // Ignore this search since the search text has changed
311 // }
312
313 auto objs = m_dbManager.find_objects_by_name(SearchText, 10);
314
315 bool exactMatchExists = objs.size() > 0 ? (QString::compare(objs.front().name(), SearchText,
316 Qt::CaseInsensitive) == 0) : false;
317
318 for (const auto &obj : objs)
319 {
320 KStarsData::Instance()->skyComposite()->catalogsComponent()->insertStaticObject(
321 obj);
322 }
323
324 sortModel->setFilterFixedString(SearchText);
325 ui->InternetSearchButton->setText(i18n("Search the Internet for %1", SearchText.isEmpty() ? i18nc("no text to search for",
326 "(nothing)") : SearchText));
327 filterByType();
328 initSelection();
329
330 bool enableInternetSearch = (!exactMatchExists) && (ui->FilterType->currentIndex() == 0);
331 //Select the first item in the list that begins with the filter string
332 if (!SearchText.isEmpty())
333 {
334 QStringList mItems =
336 mItems.sort();
337
338 if (mItems.size())
339 {
340 QModelIndex qmi = fModel->index(fModel->indexOf(mItems[0]));
341 QModelIndex selectItem = sortModel->mapFromSource(qmi);
342
343 if (selectItem.isValid())
344 {
345 ui->SearchList->selectionModel()->select(
347 ui->SearchList->scrollTo(selectItem);
348 ui->SearchList->setCurrentIndex(selectItem);
349 }
350 }
351 ui->InternetSearchButton->setEnabled(enableInternetSearch && !mItems.contains(
352 SearchText, Qt::CaseInsensitive)); // Disable searching the internet when an exact match for SearchText exists in KStars
353 }
354 else
355 ui->InternetSearchButton->setEnabled(false);
356
357 listFiltered = true;
358 slotUpdateButtons();
359}
360
361void FindDialog::slotUpdateButtons()
362{
363 okB->setEnabled(ui->SearchList->selectionModel()->hasSelection());
364
365 if (okB->isEnabled())
366 {
367 okB->setDefault(true);
368 }
369 else if (ui->InternetSearchButton->isEnabled())
370 {
371 ui->InternetSearchButton->setDefault(true);
372 }
373}
374
376{
377 QModelIndex i = ui->SearchList->currentIndex();
378 QVariant sObj = sortModel->data(sortModel->index(i.row(), 0), SkyObjectListModel::SkyObjectRole);
379
380 return reinterpret_cast<SkyObject*>(sObj.value<void *>());
381}
382
383void FindDialog::enqueueSearch()
384{
385 listFiltered = false;
386 if (timer)
387 {
388 timer->stop();
389 }
390 else
391 {
392 timer = new QTimer(this);
393 timer->setSingleShot(true);
394 connect(timer, &QTimer::timeout, [&]()
395 {
396 this->m_currentSearchSequence++;
397 this->filterList();
398 });
399 }
400 timer->start(500);
401}
402
403// Process the search box text to replace equivalent names like "m93" with "m 93"
405{
408
409
410 // Remove multiple spaces and replace them by a single space
411 re.setPattern(" +");
412 searchText.replace(re, " ");
413
414 // If it is an NGC/IC/M catalog number, as in "M 76" or "NGC 5139", check for absence of the space
415 re.setPattern("^(m|ngc|ic)\\s*\\d*$");
416 if (searchText.contains(re))
417 {
418 re.setPattern("\\s*(\\d+)");
419 searchText.replace(re, " \\1");
420 re.setPattern("\\s*$");
421 searchText.remove(re);
422 re.setPattern("^\\s*");
423 searchText.remove(re);
424 }
425
426 // If it is a comet, and starts with c20## or c 20## make it c/20## (or similar with p).
427 re.setPattern("^(c|p)\\s*((19|20).*)");
428 if (searchText.contains(re))
429 {
430 if (searchText.at(0) == 'c' || searchText.at(0) == 'C')
431 searchText.replace(re, "c/\\2");
432 else searchText.replace(re, "p/\\2");
433 }
434
435 // TODO after KDE 4.1 release:
436 // If it is a IAU standard three letter abbreviation for a constellation, then go to that constellation
437 // Check for genetive names of stars. Example: alp CMa must go to alpha Canis Majoris
438
439 return searchText;
440}
441
443{
444 // JM 2022.04.20 Below does not work when a user is simply browsing
445 // and selecting an item without entering any text in the search box.
446 //If no valid object selected, show a sorry-box. Otherwise, emit accept()
447 // if (ui->SearchBox->text().isEmpty())
448 // {
449 // return;
450 // }
451 SkyObject *selObj;
452 if (!listFiltered)
453 {
454 filterList();
455 }
456 selObj = selectedObject();
457 finishProcessing(selObj, Options::resolveNamesOnline() && ui->InternetSearchButton->isEnabled());
458}
459
461{
462 finishProcessing(nullptr, true);
463}
464
466{
467 CatalogObject *dso = nullptr;
468 const auto &cedata = NameResolver::resolveName(query);
469
470 if (cedata.first)
471 {
472 db_manager.add_object(CatalogsDB::user_catalog_id, cedata.second);
473 const auto &added_object =
474 db_manager.get_object(cedata.second.getId(), CatalogsDB::user_catalog_id);
475
476 if (added_object.first)
477 {
478 dso = &KStarsData::Instance()
479 ->skyComposite()
480 ->catalogsComponent()
481 ->insertStaticObject(added_object.second);
482 }
483 }
484 return dso;
485}
486
487void FindDialog::finishProcessing(SkyObject *selObj, bool resolve)
488{
489 if (!selObj && resolve)
490 {
491 QString message = i18n("Searching the internet for \"%1\"", ui->SearchBox->text());
492 QSharedPointer<QMessageBox> popup = KSNotification::closeableMessage(message, "");
493 selObj = resolveAndAdd(m_dbManager, processSearchText());
494 if (popup) popup->close();
495 }
496 m_targetObject = selObj;
497 if (selObj == nullptr)
498 {
499 QString message = i18n("No object named %1 found.", ui->SearchBox->text());
500 KSNotification::sorry(message, i18n("Bad object name"));
501 }
502 else
503 {
504 selObj->updateCoordsNow(KStarsData::Instance()->updateNum());
505 if (m_HistoryList.contains(selObj) == false)
506 {
507 switch (selObj->type())
508 {
509 case SkyObject::OPEN_CLUSTER:
510 case SkyObject::GLOBULAR_CLUSTER:
511 case SkyObject::GASEOUS_NEBULA:
512 case SkyObject::PLANETARY_NEBULA:
513 case SkyObject::SUPERNOVA_REMNANT:
514 case SkyObject::GALAXY:
515 if (selObj->name() != selObj->longname())
516 m_HistoryCombo->addItem(QString("%1 (%2)")
517 .arg(selObj->name())
518 .arg(selObj->longname()));
519 else
520 m_HistoryCombo->addItem(QString("%1").arg(selObj->longname()));
521 break;
522
523 case SkyObject::STAR:
524 case SkyObject::CATALOG_STAR:
525 case SkyObject::PLANET:
526 case SkyObject::COMET:
527 case SkyObject::ASTEROID:
528 case SkyObject::CONSTELLATION:
529 case SkyObject::MOON:
530 case SkyObject::ASTERISM:
531 case SkyObject::GALAXY_CLUSTER:
532 case SkyObject::DARK_NEBULA:
533 case SkyObject::QUASAR:
534 case SkyObject::MULT_STAR:
535 case SkyObject::RADIO_SOURCE:
536 case SkyObject::SATELLITE:
537 case SkyObject::SUPERNOVA:
538 default:
539 m_HistoryCombo->addItem(QString("%1").arg(selObj->longname()));
540 break;
541 }
542
543 m_HistoryList.append(selObj);
544 }
545 ui->clearHistoryB->setEnabled(true);
546 accept();
547 }
548}
550{
551 switch (e->key())
552 {
553 case Qt::Key_Escape:
554 reject();
555 break;
556 case Qt::Key_Up:
557 {
558 int currentRow = ui->SearchList->currentIndex().row();
559 if (currentRow > 0)
560 {
561 QModelIndex selectItem = sortModel->index(currentRow - 1, sortModel->filterKeyColumn(), QModelIndex());
562 ui->SearchList->selectionModel()->setCurrentIndex(selectItem, QItemSelectionModel::SelectCurrent);
563 }
564 break;
565 }
566 case Qt::Key_Down:
567 {
568 int currentRow = ui->SearchList->currentIndex().row();
569 if (currentRow < sortModel->rowCount() - 1)
570 {
571 QModelIndex selectItem = sortModel->index(currentRow + 1, sortModel->filterKeyColumn(), QModelIndex());
572 ui->SearchList->selectionModel()->setCurrentIndex(selectItem, QItemSelectionModel::SelectCurrent);
573 }
574 break;
575 }
576 }
577}
578
579void FindDialog::slotDetails()
580{
581 if (selectedObject())
582 {
583 QPointer<DetailDialog> dd = new DetailDialog(selectedObject(), KStarsData::Instance()->ut(),
584 KStarsData::Instance()->geo(), KStars::Instance());
585 dd->exec();
586 delete dd;
587 }
588}
589
591{
592 QWidget * const oldParent = parentWidget();
593
594 if (nullptr != parent)
595 {
598 }
599
600 int const result = QDialog::exec();
601
602 if (nullptr != parent)
603 {
604 setParent(oldParent);
606 }
607
608 return result;
609}
610
612{
613 m_DetailsB->setEnabled(false);
614 m_DetailsB->setVisible(false);
615 int const result = QDialog::exec();
616 m_DetailsB->setVisible(true);
617 m_DetailsB->setEnabled(true);
618 return result;
619}
620
A simple container object to hold the minimum information for a Deep Sky Object to be drawn on the sk...
CatalogObject & insertStaticObject(const CatalogObject &obj)
Insert an object obj into m_static_objects and return a reference to the newly inserted object.
Manages the catalog database and provides an interface to provide an interface to query and modify th...
Definition catalogsdb.h:183
std::pair< bool, QString > add_object(const int catalog_id, const SkyObject::TYPE t, const CachingDms &r, const CachingDms &d, const QString &n, const float m=NaN::f, const QString &lname=QString(), const QString &catalog_identifier=QString(), const float a=0.0, const float b=0.0, const double pa=0.0, const float flux=0)
Add a CatalogObject to a table with `catalog_id`.
CatalogObjectList find_objects_by_name(const QString &name, const int limit=-1, const bool exactMatchOnly=false)
Find an objects by name.
CatalogObjectList get_objects(float maglim=default_maglim, int limit=-1)
Get limit objects with magnitude smaller than maglim (smaller = brighter) from the database.
std::pair< bool, CatalogObject > get_object(const CatalogObject::oid &oid)
Get an object by `oid`.
DetailDialog is a window showing detailed information for a selected object.
Dialog window for finding SkyObjects by name.
Definition finddialog.h:43
static CatalogObject * resolveAndAdd(CatalogsDB::DBManager &db_manager, const QString &query)
Resolves an object using the internet and adds it to the database.
void filterList()
When Text is entered in the QLineEdit, filter the List of objects so that only objects which start wi...
void slotResolve()
This slot resolves the object on the internet, ignoring the selection on the list.
int execWithParent(QWidget *parent=nullptr)
exec overrides base's QDialog::exec() to provide a parent widget.
SkyObject * selectedObject() const
void slotOk()
Overloading the Standard QDialogBase slotOk() to show a "sorry" message box if no object is selected ...
int execWithoutDetails()
removes the Details... button from this exec.
static QString processSearchText(QString searchText)
Do some post processing on the search text to interpret what the user meant This could include replac...
void keyPressEvent(QKeyEvent *e) override
Process Keystrokes.
KStarsData is the backbone of KStars.
Definition kstarsdata.h:74
SkyMapComposite * skyComposite()
Definition kstarsdata.h:168
static KStars * Instance()
Definition kstars.h:121
void removeSkyObject(SkyObject *object)
Emitted when a sky object is removed from the database.
A model used in Find Object Dialog in QML.
QStringList filter(const QRegularExpression &regEx)
Filter the model.
int indexOf(const QString &objectName) const
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
virtual QString name(void) const
Definition skyobject.h:146
virtual QString longname(void) const
Definition skyobject.h:165
int type(void) const
Definition skyobject.h:189
TYPE
The type classification of the SkyObject.
Definition skyobject.h:112
virtual void updateCoordsNow(const KSNumbers *num)
updateCoordsNow Shortcut for updateCoords( const KSNumbers *num, false, nullptr, nullptr,...
Definition skypoint.h:391
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
std::pair< bool, CatalogObject > resolveName(const QString &name)
Resolve the name of the given DSO and extract data from various sources.
QCA_EXPORT void init()
void clicked(bool checked)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
void activated(int index)
void addItem(const QIcon &icon, const QString &text, const QVariant &userData)
void currentTextChanged(const QString &text)
virtual void accept()
virtual int exec()
virtual void reject()
int result() const const
QPushButton * addButton(StandardButton button)
QPushButton * button(StandardButton which) const const
void accept()
QList< Key > keys() const const
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
int key() const const
void returnPressed()
void textChanged(const QString &text)
void append(QList< T > &&value)
bool contains(const AT &value) const const
qsizetype size() const const
bool isValid() const const
int row() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
void setDefault(bool)
void setPattern(const QString &pattern)
void setPatternOptions(PatternOptions options)
virtual QVariant data(const QModelIndex &index, int role) const const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const const override
virtual int rowCount(const QModelIndex &parent) const const override
void setFilterFixedString(const QString &pattern)
virtual void sort(int column, Qt::SortOrder order) override
QString arg(Args &&... args) const const
const QChar at(qsizetype position) const const
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
void sort(Qt::CaseSensitivity cs)
CaseInsensitive
DisplayRole
Key_Escape
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void timeout()
T value() const const
void setEnabled(bool)
QWidget * parentWidget() const const
void setFocus()
void setParent(QWidget *parent)
void setWindowFlag(Qt::WindowType flag, bool on)
virtual void setVisible(bool visible)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 3 2025 11:47:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.