Kstars

finddialog.cpp
1 /*
2  SPDX-FileCopyrightText: 2001 Jason Harris <[email protected]>
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 
29 FindDialog *FindDialog::m_Instance = nullptr;
30 
31 FindDialogUI::FindDialogUI(QWidget *parent) : QFrame(parent)
32 {
33  setupUi(this);
34 
35  FilterType->addItem(i18n("Any"));
36  FilterType->addItem(i18n("Stars"));
37  FilterType->addItem(i18n("Solar System"));
38  FilterType->addItem(i18n("Open Clusters"));
39  FilterType->addItem(i18n("Globular Clusters"));
40  FilterType->addItem(i18n("Gaseous Nebulae"));
41  FilterType->addItem(i18n("Planetary Nebulae"));
42  FilterType->addItem(i18n("Galaxies"));
43  FilterType->addItem(i18n("Comets"));
44  FilterType->addItem(i18n("Asteroids"));
45  FilterType->addItem(i18n("Constellations"));
46  FilterType->addItem(i18n("Supernovae"));
47  FilterType->addItem(i18n("Satellites"));
48 
49  SearchList->setMinimumWidth(256);
50  SearchList->setMinimumHeight(320);
51 }
52 
53 FindDialog *FindDialog::Instance()
54 {
55  if (m_Instance == nullptr)
56  m_Instance = new FindDialog(KStars::Instance());
57 
58  return m_Instance;
59 }
60 
61 FindDialog::FindDialog(QWidget *parent)
62  : QDialog(parent)
63  , timer(nullptr)
64  , m_targetObject(nullptr)
65  , m_asyncDBManager(new CatalogsDB::AsyncDBManager(CatalogsDB::dso_db_path()))
66  , m_dbManager(CatalogsDB::dso_db_path())
67 {
68 #ifdef Q_OS_OSX
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  QPushButton *detailB = new QPushButton(i18n("Details..."));
88  buttonBox->addButton(detailB, QDialogButtonBox::ActionRole);
89  connect(detailB, 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 
151 void 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 
166 void FindDialog::showEvent(QShowEvent *e)
167 {
168  ui->SearchBox->setFocus();
169  e->accept();
170 }
171 
172 void 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 
227 void 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  QEventLoop loop;
301  QMutexLocker {&dbCallMutex}; // To prevent re-entrant calls into this
302  connect(m_asyncDBManager.get(), &CatalogsDB::AsyncDBManager::resultReady, &loop, &QEventLoop::quit);
303  QMetaObject::invokeMethod(m_asyncDBManager.get(), [&](){
304  m_asyncDBManager->find_objects_by_name(SearchText, 10); });
305  loop.exec();
306  std::unique_ptr<CatalogsDB::CatalogObjectList> objs = m_asyncDBManager->result();
307  if (m_currentSearchSequence != searchId) {
308  return; // Ignore this search since the search text has changed
309  }
310 
311  Q_ASSERT(bool(objs));
312 
313  bool exactMatchExists = objs->size() > 0 ? QString::compare(objs->front().name(), SearchText, Qt::CaseInsensitive) : false;
314 
315  for (const auto &obj : *objs)
316  {
317  KStarsData::Instance()->skyComposite()->catalogsComponent()->insertStaticObject(
318  obj);
319  }
320 
321  sortModel->setFilterFixedString(SearchText);
322  ui->InternetSearchButton->setText(i18n("Search the Internet for %1", SearchText.isEmpty() ? i18nc("no text to search for",
323  "(nothing)") : SearchText));
324  filterByType();
325  initSelection();
326 
327  bool enableInternetSearch = (!exactMatchExists) && (ui->FilterType->currentIndex() == 0);
328  //Select the first item in the list that begins with the filter string
329  if (!SearchText.isEmpty())
330  {
331  QStringList mItems =
332  fModel->filter(QRegExp('^' + SearchText, Qt::CaseInsensitive));
333  mItems.sort();
334 
335  if (mItems.size())
336  {
337  QModelIndex qmi = fModel->index(fModel->indexOf(mItems[0]));
338  QModelIndex selectItem = sortModel->mapFromSource(qmi);
339 
340  if (selectItem.isValid())
341  {
342  ui->SearchList->selectionModel()->select(
344  ui->SearchList->scrollTo(selectItem);
345  ui->SearchList->setCurrentIndex(selectItem);
346  }
347  }
348  ui->InternetSearchButton->setEnabled(enableInternetSearch && !mItems.contains(
349  SearchText, Qt::CaseInsensitive)); // Disable searching the internet when an exact match for SearchText exists in KStars
350  }
351  else
352  ui->InternetSearchButton->setEnabled(false);
353 
354  listFiltered = true;
355  slotUpdateButtons();
356 }
357 
358 void FindDialog::slotUpdateButtons()
359 {
360  okB->setEnabled(ui->SearchList->selectionModel()->hasSelection());
361 
362  if (okB->isEnabled())
363  {
364  okB->setDefault(true);
365  }
366  else if (ui->InternetSearchButton->isEnabled())
367  {
368  ui->InternetSearchButton->setDefault(true);
369  }
370 }
371 
373 {
374  QModelIndex i = ui->SearchList->currentIndex();
375  QVariant sObj = sortModel->data(sortModel->index(i.row(), 0), SkyObjectListModel::SkyObjectRole);
376 
377  return reinterpret_cast<SkyObject*>(sObj.value<void *>());
378 }
379 
380 void FindDialog::enqueueSearch()
381 {
382  listFiltered = false;
383  if (timer)
384  {
385  timer->stop();
386  }
387  else
388  {
389  timer = new QTimer(this);
390  timer->setSingleShot(true);
391  connect(timer, &QTimer::timeout, [&]() {
392  this->m_currentSearchSequence++;
393  this->filterList();
394  });
395  }
396  timer->start(500);
397 }
398 
399 // Process the search box text to replace equivalent names like "m93" with "m 93"
401 {
402  QRegExp re;
404 
405  // Remove multiple spaces and replace them by a single space
406  re.setPattern(" +");
407  searchText.replace(re, " ");
408 
409  // If it is an NGC/IC/M catalog number, as in "M 76" or "NGC 5139", check for absence of the space
410  re.setPattern("^(m|ngc|ic)\\s*\\d*$");
411  if (searchText.contains(re))
412  {
413  re.setPattern("\\s*(\\d+)");
414  searchText.replace(re, " \\1");
415  re.setPattern("\\s*$");
416  searchText.remove(re);
417  re.setPattern("^\\s*");
418  searchText.remove(re);
419  }
420 
421  // If it is a comet, and starts with c20## or c 20## make it c/20## (or similar with p).
422  re.setPattern("^(c|p)\\s*((19|20).*)");
423  if (searchText.contains(re))
424  {
425  if (searchText.at(0) == 'c' || searchText.at(0) == 'C')
426  searchText.replace(re, "c/\\2");
427  else searchText.replace(re, "p/\\2");
428  }
429 
430  // TODO after KDE 4.1 release:
431  // If it is a IAU standard three letter abbreviation for a constellation, then go to that constellation
432  // Check for genetive names of stars. Example: alp CMa must go to alpha Canis Majoris
433 
434  return searchText;
435 }
436 
438 {
439  // JM 2022.04.20 Below does not work when a user is simply browsing
440  // and selecting an item without entering any text in the search box.
441  //If no valid object selected, show a sorry-box. Otherwise, emit accept()
442  // if (ui->SearchBox->text().isEmpty())
443  // {
444  // return;
445  // }
446  SkyObject *selObj;
447  if (!listFiltered)
448  {
449  filterList();
450  }
451  selObj = selectedObject();
452  finishProcessing(selObj, Options::resolveNamesOnline() && ui->InternetSearchButton->isEnabled());
453 }
454 
456 {
457  finishProcessing(nullptr, true);
458 }
459 
461 {
462  CatalogObject *dso = nullptr;
463  const auto &cedata = NameResolver::resolveName(query);
464 
465  if (cedata.first)
466  {
467  db_manager.add_object(CatalogsDB::user_catalog_id, cedata.second);
468  const auto &added_object =
469  db_manager.get_object(cedata.second.getId(), CatalogsDB::user_catalog_id);
470 
471  if (added_object.first)
472  {
473  dso = &KStarsData::Instance()
474  ->skyComposite()
475  ->catalogsComponent()
476  ->insertStaticObject(added_object.second);
477  }
478  }
479  return dso;
480 }
481 
482 void FindDialog::finishProcessing(SkyObject *selObj, bool resolve)
483 {
484  if (!selObj && resolve)
485  {
486  selObj = resolveAndAdd(m_dbManager, processSearchText());
487  }
488  m_targetObject = selObj;
489  if (selObj == nullptr)
490  {
491  QString message = i18n("No object named %1 found.", ui->SearchBox->text());
492  KSNotification::sorry(message, i18n("Bad object name"));
493  }
494  else
495  {
496  selObj->updateCoordsNow(KStarsData::Instance()->updateNum());
497  if (m_HistoryList.contains(selObj) == false)
498  {
499  switch (selObj->type())
500  {
501  case SkyObject::OPEN_CLUSTER:
502  case SkyObject::GLOBULAR_CLUSTER:
503  case SkyObject::GASEOUS_NEBULA:
504  case SkyObject::PLANETARY_NEBULA:
505  case SkyObject::SUPERNOVA_REMNANT:
506  case SkyObject::GALAXY:
507  if (selObj->name() != selObj->longname())
508  m_HistoryCombo->addItem(QString("%1 (%2)")
509  .arg(selObj->name())
510  .arg(selObj->longname()));
511  else
512  m_HistoryCombo->addItem(QString("%1").arg(selObj->longname()));
513  break;
514 
515  case SkyObject::STAR:
516  case SkyObject::CATALOG_STAR:
517  case SkyObject::PLANET:
518  case SkyObject::COMET:
519  case SkyObject::ASTEROID:
520  case SkyObject::CONSTELLATION:
521  case SkyObject::MOON:
522  case SkyObject::ASTERISM:
523  case SkyObject::GALAXY_CLUSTER:
524  case SkyObject::DARK_NEBULA:
525  case SkyObject::QUASAR:
526  case SkyObject::MULT_STAR:
527  case SkyObject::RADIO_SOURCE:
528  case SkyObject::SATELLITE:
529  case SkyObject::SUPERNOVA:
530  default:
531  m_HistoryCombo->addItem(QString("%1").arg(selObj->longname()));
532  break;
533  }
534 
535  m_HistoryList.append(selObj);
536  }
537  ui->clearHistoryB->setEnabled(true);
538  accept();
539  }
540 }
542 {
543  switch (e->key())
544  {
545  case Qt::Key_Escape:
546  reject();
547  break;
548  case Qt::Key_Up:
549  {
550  int currentRow = ui->SearchList->currentIndex().row();
551  if (currentRow > 0)
552  {
553  QModelIndex selectItem = sortModel->index(currentRow - 1, sortModel->filterKeyColumn(), QModelIndex());
554  ui->SearchList->selectionModel()->setCurrentIndex(selectItem, QItemSelectionModel::SelectCurrent);
555  }
556  break;
557  }
558  case Qt::Key_Down:
559  {
560  int currentRow = ui->SearchList->currentIndex().row();
561  if (currentRow < sortModel->rowCount() - 1)
562  {
563  QModelIndex selectItem = sortModel->index(currentRow + 1, sortModel->filterKeyColumn(), QModelIndex());
564  ui->SearchList->selectionModel()->setCurrentIndex(selectItem, QItemSelectionModel::SelectCurrent);
565  }
566  break;
567  }
568  }
569 }
570 
571 void FindDialog::slotDetails()
572 {
573  if (selectedObject())
574  {
575  QPointer<DetailDialog> dd = new DetailDialog(selectedObject(), KStarsData::Instance()->ut(),
576  KStarsData::Instance()->geo(), KStars::Instance());
577  dd->exec();
578  delete dd;
579  }
580 }
581 
583 {
584  QWidget * const oldParent = parentWidget();
585 
586  if (nullptr != parent)
587  {
588  setParent(parent);
589  setWindowFlag(Qt::Dialog, true);
590  }
591 
592  int const result = QDialog::exec();
593 
594  if (nullptr != parent)
595  {
596  setParent(oldParent);
597  setWindowFlag(Qt::Dialog, true);
598  }
599 
600  return result;
601 }
void keyPressEvent(QKeyEvent *e) override
Process Keystrokes.
Definition: finddialog.cpp:541
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
DisplayRole
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.
Definition: catalogsdb.cpp:677
CaseInsensitive
QCA_EXPORT void init()
T value() const const
QList< Key > keys() const const
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
void append(const T &value)
void clicked(bool checked)
virtual QString name(void) const
Definition: skyobject.h:145
Manages the catalog database and provides an interface to provide an interface to query and modify th...
Definition: catalogsdb.h:181
static CatalogObject * resolveAndAdd(CatalogsDB::DBManager &db_manager, const QString &query)
Resolves an object using the internet and adds it to the database.
Definition: finddialog.cpp:460
int exec(QEventLoop::ProcessEventsFlags flags)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
static KStars * Instance()
Definition: kstars.h:125
int type(void) const
Definition: skyobject.h:188
SkyObject * selectedObject() const
Definition: finddialog.cpp:372
int size() const const
QStringList filter(QStringView str, Qt::CaseSensitivity cs) const const
QString i18n(const char *text, const TYPE &arg...)
CatalogObject & insertStaticObject(const CatalogObject &obj)
Insert an object obj into m_static_objects and return a reference to the newly inserted object.
void quit()
void currentTextChanged(const QString &text)
void textChanged(const QString &text)
void timeout()
bool isEmpty() const const
void removeSkyObject(SkyObject *object)
Emitted when a sky object is removed from the database.
void returnPressed()
void addButton(QAbstractButton *button, QDialogButtonBox::ButtonRole role)
virtual void updateCoordsNow(const KSNumbers *num)
updateCoordsNow Shortcut for updateCoords( const KSNumbers *num, false, nullptr, nullptr,...
Definition: skypoint.h:382
virtual int exec()
Key_Escape
void setCaseSensitivity(Qt::CaseSensitivity cs)
bool isValid() const const
void setEnabled(bool)
void slotResolve()
This slot resolves the object on the internet, ignoring the selection on the list.
Definition: finddialog.cpp:455
QString & replace(int position, int n, QChar after)
QString & remove(int position, int n)
int row() const const
SkyMapComposite * skyComposite()
Definition: kstarsdata.h:165
void filterList()
When Text is entered in the QLineEdit, filter the List of objects so that only objects which start wi...
Definition: finddialog.cpp:295
std::pair< bool, CatalogObject > get_object(const CatalogObject::oid &oid)
Get an object by oid.
Definition: catalogsdb.cpp:536
std::pair< bool, CatalogObject > resolveName(const QString &name)
Resolve the name of the given DSO and extract data from various sources.
int key() const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QPushButton * button(QDialogButtonBox::StandardButton which) const const
int execWithParent(QWidget *parent=nullptr)
exec overrides base's QDialog::exec() to provide a parent widget.
Definition: finddialog.cpp:582
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
const QChar at(int position) const const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
virtual QString longname(void) const
Definition: skyobject.h:164
void setPattern(const QString &pattern)
int compare(const QString &other, Qt::CaseSensitivity cs) const const
void slotOk()
Overloading the Standard QDialogBase slotOk() to show a "sorry" message box if no object is selected ...
Definition: finddialog.cpp:437
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
QFuture< void > map(Sequence &sequence, MapFunctor function)
static QString processSearchText(QString searchText)
Do some post processing on the search text to interpret what the user meant This could include replac...
Definition: finddialog.cpp:400
A simple container object to hold the minimum information for a Deeb Sky Object to be drawn on the sk...
Definition: catalogobject.h:40
void activated(int index)
Model that is used in Find Object Dialog.
Information about an object in the sky.
Definition: skyobject.h:41
QString message
void accept()
void sort(Qt::CaseSensitivity cs)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Aug 14 2022 04:13:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.