Kstars
finddialog.cpp
79 QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
98 connect(KStars::Instance()->map(), &SkyMap::removeSkyObject, fModel, &SkyObjectListModel::removeSkyObject);
140 connect(ui->SearchList->selectionModel(), &QItemSelectionModel::selectionChanged, this, &FindDialog::slotUpdateButtons);
300 // JM 2022.08.28: Disabling use of async DB manager until further notice since it appears to cause a crash
304 // connect(m_asyncDBManager.get(), &CatalogsDB::AsyncDBManager::resultReady, &loop, &QEventLoop::quit);
315 bool exactMatchExists = objs.size() > 0 ? (QString::compare(objs.front().name(), SearchText, Qt::CaseInsensitive) == 0) : false;
324 ui->InternetSearchButton->setText(i18n("Search the Internet for %1", SearchText.isEmpty() ? i18nc("no text to search for",
334 fModel->filter(QRegularExpression('^' + SearchText, QRegularExpression::CaseInsensitiveOption));
351 SearchText, Qt::CaseInsensitive)); // Disable searching the internet when an exact match for SearchText exists in KStars
413 // If it is an NGC/IC/M catalog number, as in "M 76" or "NGC 5139", check for absence of the space
456 finishProcessing(selObj, Options::resolveNamesOnline() && ui->InternetSearchButton->isEnabled());
464CatalogObject *FindDialog::resolveAndAdd(CatalogsDB::DBManager &db_manager, const QString &query)
557 QModelIndex selectItem = sortModel->index(currentRow - 1, sortModel->filterKeyColumn(), QModelIndex());
558 ui->SearchList->selectionModel()->setCurrentIndex(selectItem, QItemSelectionModel::SelectCurrent);
567 QModelIndex selectItem = sortModel->index(currentRow + 1, sortModel->filterKeyColumn(), QModelIndex());
568 ui->SearchList->selectionModel()->setCurrentIndex(selectItem, QItemSelectionModel::SelectCurrent);
A simple container object to hold the minimum information for a Deep Sky Object to be drawn on the sk...
Definition catalogobject.h:41
CatalogObject & insertStaticObject(const CatalogObject &obj)
Insert an object obj into m_static_objects and return a reference to the newly inserted object.
Definition catalogscomponent.cpp:300
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`.
Definition catalogsdb.cpp:698
CatalogObjectList find_objects_by_name(const QString &name, const int limit=-1, const bool exactMatchOnly=false)
Find an objects by name.
Definition catalogsdb.cpp:499
CatalogObjectList get_objects(float maglim=default_maglim, int limit=-1)
Get limit objects with magnitude smaller than maglim (smaller = brighter) from the database.
Definition catalogsdb.cpp:572
std::pair< bool, CatalogObject > get_object(const CatalogObject::oid &oid)
Get an object by `oid`.
Definition catalogsdb.cpp:547
DetailDialog is a window showing detailed information for a selected object.
Definition detaildialog.h:71
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:464
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
void slotResolve()
This slot resolves the object on the internet, ignoring the selection on the list.
Definition finddialog.cpp:459
int execWithParent(QWidget *parent=nullptr)
exec overrides base's QDialog::exec() to provide a parent widget.
Definition finddialog.cpp:586
void slotOk()
Overloading the Standard QDialogBase slotOk() to show a "sorry" message box if no object is selected ...
Definition finddialog.cpp:441
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:403
void removeSkyObject(SkyObject *object)
Emitted when a sky object is removed from the database.
QStringList filter(const QRegularExpression ®Ex)
Filter the model.
Definition skyobjectlistmodel.cpp:54
int indexOf(const QString &objectName) const
Definition skyobjectlistmodel.cpp:25
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
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...)
void init(KXmlGuiWindow *window, KGameDifficulty *difficulty=nullptr)
std::pair< bool, CatalogObject > resolveName(const QString &name)
Resolve the name of the given DSO and extract data from various sources.
Definition nameresolver.cpp:30
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
ActionRole
QPushButton * addButton(StandardButton button)
QPushButton * button(StandardButton which) const const
void accept()
QList< Key > keys() const const
ClearAndSelect
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)
CaseInsensitiveOption
void setPattern(const QString &pattern)
void setPatternOptions(PatternOptions options)
virtual QVariant data(const QModelIndex &index, int role) const const override
filterKeyColumn
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
Tool
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
singleShot
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-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:57:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.