Skip to content

Add obj type in search result and indicating SIMBAD result#4635

Merged
alex-w merged 6 commits intoStellarium:masterfrom
henrysky:search_objtype
Nov 11, 2025
Merged

Add obj type in search result and indicating SIMBAD result#4635
alex-w merged 6 commits intoStellarium:masterfrom
henrysky:search_objtype

Conversation

@henrysky
Copy link
Copy Markdown
Contributor

@henrysky henrysky commented Nov 5, 2025

Description

I have

  • added which module the objects come from in the search result
  • indicating which results are from SIMBAD and what are their SIMBAD obejct types

Fixes #4531

Screenshots (if appropriate):

Searching Hercules:
Screenshot 2025-11-04 at 11 53 14 PM

Searching M31 which can be from local or SIMBAD:
Screenshot 2025-11-04 at 11 53 22 PM

Searching Kepler-451 which exists locally (with Gaia DR3 ID from SIMBAD):
Screenshot 2025-11-04 at 11 53 32 PM

Searching Kepler-452b which does not exist locally:
Screenshot 2025-11-04 at 11 53 39 PM

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • Housekeeping

How Has This Been Tested?

See above

Test Configuration:

  • Operating system: MacOS 26.1
  • Graphics Card: Apple M3

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 5, 2025

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

@alex-w alex-w added this to the 25.4 milestone Nov 5, 2025
@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 5, 2025

I’m not sure - should be object type translatable in list of matches (in a DisplayRole list)?

P.S. Of course, user can find objects by their designation, English name or localized name

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 5, 2025

Searching Kepler-451 which exists locally (with Gaia DR3 ID from SIMBAD):

I see answer from SIMBAD only and I should ask - where is locally item?

Copy link
Copy Markdown
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@henrysky
Copy link
Copy Markdown
Contributor Author

henrysky commented Nov 5, 2025

Searching Kepler-451 which exists locally (with Gaia DR3 ID from SIMBAD):

I see answer from SIMBAD only and I should ask - where is locally item?

What I meant is Kepler-451 is Gaia DR3 2080063931448749824 (Gaia ID retrieved from SIMBAD). So searching Kepler-451 will get you to Gaia DR3 2080063931448749824 which has proper motion, distance, etc. in Stellarium. As opposed to searching Kepler-452b which will point to a custom object.

Comment thread src/gui/SearchDialog.hpp
class SimbadSearcher* simbadSearcher;
class SimbadLookupReply* simbadReply;
QMap<QString, Vec3d> simbadResults; //! Simbad object name and J2000.0 coordinates
QMap<QString, QString> simbadObjectTypes; //! Simbad object name and object type
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this have to be kept as a data member? The only time it's used is when it's just been written, never re-used anywhere else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simbadObjectTypes is used in onSimbadStatusChanged() and gotoObject() now (after you made the review).

@10110111
Copy link
Copy Markdown
Contributor

10110111 commented Nov 6, 2025

If SIMBAD object types is a stable list, it may make sense to declare all of them with QT_TR_NOOP and use q_() to translate them.

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 6, 2025

If SIMBAD object types is a stable list, it may make sense to declare all of them with QT_TR_NOOP and use q_() to translate them.

It's not very stable, but yes, it has a low temp of changes and we can add all these items as data for translations (to use in q_() to translate).

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 6, 2025

I fear the feature for recent objects should be updated too to avoid troubles of search the synonyms - at the moment it storing the list of names only.

@alex-w alex-w added the enhancement Improve existing functionality label Nov 6, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 6, 2025

Hello @henrysky!

Thank you for the suggested improvement.

- SIMBAD object types are translatable now
- added few SIMBAD object types with context
@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 8, 2025

@henrysky SIMBAD object types are translatable now (the taxonomy is not completed yet)

@10110111
Copy link
Copy Markdown
Contributor

10110111 commented Nov 8, 2025

the taxonomy is not completed yet

What are the obstacles?

The following should complete the list, according to the otypes.list downloadable from the link you gave.

diff --git a/src/translations.h b/src/translations.h
index 54dd07e16e..7b178b2909 100644
--- a/src/translations.h
+++ b/src/translations.h
@@ -634,6 +634,72 @@ class Translations
         NC_("LBV=Luminous Blue Variable", "SIMBAD object type");
         NC_("Neutron Star", "SIMBAD object type");
         NC_("Pulsar", "SIMBAD object type");
+        NC_("Young Stellar Object", "SIMBAD object type");
+        NC_("Orion Variable", "SIMBAD object type");
+        NC_("T Tauri Star", "SIMBAD object type");
+        NC_("Herbig Ae/Be Star", "SIMBAD object type");
+        NC_("Outflow", "SIMBAD object type");
+        NC_("Herbig-Haro Object", "SIMBAD object type");
+        NC_("Main Sequence Star", "SIMBAD object type");
+        NC_("Be Star", "SIMBAD object type");
+        NC_("Blue Straggler", "SIMBAD object type");
+        NC_("SX Phe Variable", "SIMBAD object type");
+        NC_("gamma Dor Variable", "SIMBAD object type");
+        NC_("delta Sct Variable", "SIMBAD object type");
+        NC_("Evolved Star", "SIMBAD object type");
+        NC_("Red Giant Branch star", "SIMBAD object type");
+        NC_("Hot Subdwarf", "SIMBAD object type");
+        NC_("Horizontal Branch Star", "SIMBAD object type");
+        NC_("RR Lyrae Variable", "SIMBAD object type");
+        NC_("Red Clump Star", "SIMBAD object type");
+        NC_("Type II Cepheid Variable", "SIMBAD object type");
+        NC_("Cepheid Variable", "SIMBAD object type");
+        NC_("Classical Cepheid Variable", "SIMBAD object type");
+        NC_("Carbon Star", "SIMBAD object type");
+        NC_("S Star", "SIMBAD object type");
+        NC_("Long-Period Variable", "SIMBAD object type");
+        NC_("Asymptotic Giant Branch Star", "SIMBAD object type");
+        NC_("Mira Variable", "SIMBAD object type");
+        NC_("O-rich AGB Star", "SIMBAD object type");
+        NC_("OH/IR Star", "SIMBAD object type");
+        NC_("Post-AGB Star", "SIMBAD object type");
+        NC_("RV Tauri Variable", "SIMBAD object type");
+        NC_("Planetary Nebula", "SIMBAD object type");
+        NC_("White Dwarf", "SIMBAD object type");
+        NC_("ELMWD=Extremely Low Mass White Dwarf", "SIMBAD object type");
+        NC_("Chemically Peculiar Star", "SIMBAD object type");
+        NC_("alpha2 CVn Variable", "SIMBAD object type");
+        NC_("R CrB Variable", "SIMBAD object type");
+        NC_("CH Star", "SIMBAD object type");
+        NC_("Barium Star", "SIMBAD object type");
+        NC_("Dwarf Carbon Star", "SIMBAD object type");
+        NC_("Carbon-Enhanced Metal Poor Star", "SIMBAD object type");
+        NC_("Double or Multiple Star", "SIMBAD object type");
+        NC_("Eclipsing Binary", "SIMBAD object type");
+        NC_("Ellipsoidal Variable", "SIMBAD object type");
+        NC_("Spectroscopic Binary", "SIMBAD object type");
+        NC_("RS CVn Variable", "SIMBAD object type");
+        NC_("BY Dra Variable", "SIMBAD object type");
+        NC_("Symbiotic Star", "SIMBAD object type");
+        NC_("X-ray Binary", "SIMBAD object type");
+        NC_("Low Mass X-ray Binary", "SIMBAD object type");
+        NC_("High Mass X-ray Binary", "SIMBAD object type");
+        NC_("Cataclysmic Binary", "SIMBAD object type");
+        NC_("Classical Nova", "SIMBAD object type");
+        NC_("SuperNova", "SIMBAD object type");
+        NC_("Low-mass Star", "SIMBAD object type");
+        NC_("Brown Dwarf", "SIMBAD object type");
+        NC_("Extra-solar Planet", "SIMBAD object type");
+        NC_("Variable Star", "SIMBAD object type");
+        NC_("Irregular Variable", "SIMBAD object type");
+        NC_("Irregular Variable with rapid variations", "SIMBAD object type");
+        NC_("Eruptive Variable", "SIMBAD object type");
+        NC_("Rotating Variable", "SIMBAD object type");
+        NC_("Pulsating Variable", "SIMBAD object type");
+        NC_("Star showing Eclipses by its Planet", "SIMBAD object type");
+        NC_("Emission-line Star", "SIMBAD object type");
+        NC_("High Proper Motion Star", "SIMBAD object type");
+        NC_("High Velocity Star", "SIMBAD object type");
         NC_("Cluster of Stars", "SIMBAD object type");
         NC_("Globular Cluster", "SIMBAD object type");
         NC_("Open Cluster", "SIMBAD object type");
@@ -671,6 +737,11 @@ class Translations
         NC_("Quasar", "SIMBAD object type");
         NC_("Blazar", "SIMBAD object type");
         NC_("BL Lac", "SIMBAD object type");
+        NC_("ULIRG, Ultra Luminous Infrared Galaxy", "SIMBAD object type");
+        NC_("Galaxy in Pair of Galaxies", "SIMBAD object type");
+        NC_("Galaxy towards a Group of Galaxies", "SIMBAD object type");
+        NC_("Galaxy towards a Cluster of Galaxies", "SIMBAD object type");
+        NC_("Brightest Galaxy in a Cluster (BCG)", "SIMBAD object type");
         NC_("Interacting Galaxies", "SIMBAD object type");
         NC_("Pair of Galaxies", "SIMBAD object type");
         NC_("Group of Galaxies", "SIMBAD object type");
@@ -680,12 +751,42 @@ class Translations
         NC_("Supercluster of Galaxies", "SIMBAD object type");
         NC_("Underdense Region of the Universe", "SIMBAD object type");
         NC_("Gravitational Source", "SIMBAD object type");
+        NC_("(Micro)Lensing Event", "SIMBAD object type");
+        NC_("Gravitational Lens System (lens+images)", "SIMBAD object type");
         NC_("Gravitational Lens", "SIMBAD object type");
+        NC_("Gravitationally Lensed Image", "SIMBAD object type");
+        NC_("Gravitationally Lensed Image of a Galaxy", "SIMBAD object type");
+        NC_("Gravitationally Lensed Image of a Quasar", "SIMBAD object type");
         NC_("Black Hole", "SIMBAD object type");
-        NC_("Gamma-ray Source", "SIMBAD object type");
-        NC_("X-ray Source ", "SIMBAD object type");
-        NC_("UV-emission Source", "SIMBAD object type");
+        NC_("Gravitational Wave Event", "SIMBAD object type");
+        NC_("Transient Event", "SIMBAD object type");
+        NC_("Variable source", "SIMBAD object type");
+        NC_("Radio Source", "SIMBAD object type");
+        NC_("Metric Radio Source", "SIMBAD object type");
+        NC_("Centimetric Radio Source", "SIMBAD object type");
+        NC_("Millimetric Radio Source", "SIMBAD object type");
+        NC_("Sub-Millimetric Source", "SIMBAD object type");
+        NC_("HI (21cm) Source", "SIMBAD object type");
+        NC_("Radio Burst", "SIMBAD object type");
         NC_("Maser", "SIMBAD object type");
+        NC_("Infra-Red Source", "SIMBAD object type");
+        NC_("Far-IR source (λ >= 30 µm)", "SIMBAD object type");
+        NC_("Mid-IR Source (3 to 30 µm)", "SIMBAD object type");
+        NC_("Near-IR Source (λ < 3 µm)", "SIMBAD object type");
+        NC_("Optical Source", "SIMBAD object type");
+        NC_("Emission Object", "SIMBAD object type");
+        NC_("Blue Object", "SIMBAD object type");
+        NC_("UV-emission Source", "SIMBAD object type");
+        NC_("X-ray Source", "SIMBAD object type");
+        NC_("Ultra-luminous X-ray Source", "SIMBAD object type");
+        NC_("Gamma-ray Source", "SIMBAD object type");
+        NC_("Gamma-ray Burst", "SIMBAD object type");
+        NC_("Composite Object, Blend", "SIMBAD object type");
+        NC_("Not an Object (Error, Artefact, ...)", "SIMBAD object type");
+        NC_("Part of Cloud", "SIMBAD object type");
+        NC_("Part of a Galaxy", "SIMBAD object type");
+        NC_("Object of Unknown Nature", "SIMBAD object type");
+        NC_("Region defined in the Sky", "SIMBAD object type");
 
         // =====================================================================
         // Translatable UI elements with comments for translators (extracomments)

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 8, 2025

What are the obstacles?

I'm not sure that all of them are needed.

The following should complete the list, according to the otypes.list downloadable from the link you gave.

Good patch, please commit it

@10110111
Copy link
Copy Markdown
Contributor

10110111 commented Nov 8, 2025

Good patch, please commit it

How do I push to this branch? GitHub starts asking for a password when I try...

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 8, 2025

How do I push to this branch? GitHub starts asking for a password when I try...

Ouch... GH allowing do it to me

@10110111
Copy link
Copy Markdown
Contributor

10110111 commented Nov 8, 2025

I was trying to check what type ULIRGs would have, and discovered that Gaia DR3 6286990861805968384 (AKA IRAS 14348-1447) is shown as a "custom object" in the info panel. Why is it so?

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 8, 2025

I was trying to check what type ULIRGs would have, and discovered that Gaia DR3 6286990861805968384 (AKA IRAS 14348-1447) is shown as a "custom object" in the info panel. Why is it so?

The type “custom object” is assigned to any object, which found via SIMBAD and not exists in our local databases. But (!) now search tool retrieved object type and we can set correct object type for these objects (at least for actual session).

@henrysky
Copy link
Copy Markdown
Contributor Author

henrysky commented Nov 8, 2025

(Update) Fixed in 1ed8077.

When I search for Kepler-452b and get the result from SIMBAD, it points to a location very
close to its host star (see below, with 25.3):
first_time

However, when I close and reopen Stellarium and simply click on Kepler-452b from the recent search list, it points to a slightly different location, a bit farther from its host star 🤔 (see below, with 25.3):
second_Time

@10110111
Copy link
Copy Markdown
Contributor

10110111 commented Nov 8, 2025

With this PR, when I type a name into the Search input field, Stellarium hangs for a couple seconds, while without it it's much more responsive (although not smooth either).

@henrysky
Copy link
Copy Markdown
Contributor Author

henrysky commented Nov 9, 2025

Now bothrecentObjectSearches.json and persistentCustomObjects.json store the retrieved object type from SIMBAD.
Screenshot 2025-11-09 at 5 46 15 PM

Comment thread src/gui/SearchDialog.cpp Outdated
if (!objType.isEmpty())
recentObjectSearchesData.objectTypes[nameI18n] = QString("SIMBAD; %1").arg(qc_(objType, "SIMBAD object type"));
else
recentObjectSearchesData.objectTypes[nameI18n] = q_("SIMBAD");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SIMBAD shouldn't be translated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 10, 2025

@henrysky please fix compiling with Qt5

P.S. The solution is acceptable, but I fear in future it will need cosmetic fix for l10n support

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Nov 11, 2025

Thanks!

@alex-w alex-w merged commit 5483017 into Stellarium:master Nov 11, 2025
15 of 16 checks passed
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Nov 19, 2025
@github-actions
Copy link
Copy Markdown

Hello @henrysky!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Dec 29, 2025
@github-actions
Copy link
Copy Markdown

Hello @henrysky!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

10110111 added a commit that referenced this pull request Mar 17, 2026
The Search dialog is currently implemented in a very suboptimal way,
especially since #4635, when it started triggering searches by name in
its CompletionListModel::data method. The search is supposed to get
object type for each item found, which is only a name of the object.

What the dialog would really want is to have object pointers in the
search results, not simply names. This requires a huge refactoring of
the search API in StelObjectModule, so that the object listing methods
return the object pointers. This is exactly what this change does. In
addition to the pointers the API still returns the names, because it
looks like the right names for search results are not always trivial
to find out from the object itself.

Fixes #4655.
10110111 added a commit that referenced this pull request Mar 17, 2026
The Search dialog is currently implemented in a very suboptimal way,
especially since #4635, when it started triggering searches by name in
its CompletionListModel::data method. The search is supposed to get
object type for each item found, which is only a name of the object.

What the dialog would really want is to have object pointers in the
search results, not simply names. This requires a huge refactoring of
the search API in StelObjectModule, so that the object listing methods
return the object pointers. This is exactly what this change does. In
addition to the pointers the API still returns the names, because it
looks like the right names for search results are not always trivial
to find out from the object itself.

Fixes #4655.
10110111 added a commit that referenced this pull request Mar 21, 2026
The Search dialog is currently implemented in a very suboptimal way,
especially since #4635, when it started triggering searches by name in
its CompletionListModel::data method. The search is supposed to get
object type for each item found, which is only a name of the object.

What the dialog would really want is to have object pointers in the
search results, not simply names. This requires a huge refactoring of
the search API in StelObjectModule, so that the object listing methods
return the object pointers. This is exactly what this change does. In
addition to the pointers the API still returns the names, because it
looks like the right names for search results are not always trivial
to find out from the object itself.

Fixes #4655.
alex-w pushed a commit that referenced this pull request Mar 26, 2026
The Search dialog is currently implemented in a very suboptimal way,
especially since #4635, when it started triggering searches by name in
its CompletionListModel::data method. The search is supposed to get
object type for each item found, which is only a name of the object.

What the dialog would really want is to have object pointers in the
search results, not simply names. This requires a huge refactoring of
the search API in StelObjectModule, so that the object listing methods
return the object pointers. This is exactly what this change does. In
addition to the pointers the API still returns the names, because it
looks like the right names for search results are not always trivial
to find out from the object itself.

Fixes #4655.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to find both stars and constellations when their names coincide

3 participants