Skip to content

without this conversion the whole GUI cannot compile - #9174

Merged
jpfeuffer merged 2 commits into
OpenMS:developfrom
LuBox2K:macos_arm_compilefix
Apr 17, 2026
Merged

jpfeuffer merged 2 commits into
OpenMS:developfrom
LuBox2K:macos_arm_compilefix

Conversation

@LuBox2K

@LuBox2K LuBox2K commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor

I need to do this fix - else the VISUAL part of the project will not compile:

clang version:

Apple clang version 21.0.0 (clang-2100.0.123.102)
Target: arm64-apple-darwin25.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

MacOS version:

OS: macOS 26.3.1 25D2128 arm64
Host: MacBookPro17,1
Kernel: 25.3.0
Uptime: 29 days, 4 hours, 3 mins
Packages: 341 (brew)
Shell: zsh 5.9
Resolution: 2560x1440
DE: Aqua
WM: Quartz Compositor
WM Theme: Blue (Dark)
Terminal: ghostty
CPU: Apple M1
GPU: Apple M1
Memory: 2871MiB / 16384MiB

compiler output:

`

make -j 8 VISUAL_TEST
[ 0%] Built target sqlite3
[ 0%] Built target OpenSwathAlgo_autogen_timestamp_deps
[ 0%] Built target eol-bspline
[ 0%] Built target IsoSpec
[ 0%] Built target OpenSwathAlgo_autogen
[ 0%] Built target SQLiteCpp
[ 0%] Built target opentims_cpp
[ 5%] Built target yaml-cpp
[ 5%] Built target OpenSwathAlgo
[ 5%] Built target OpenMS_autogen_timestamp_deps
[ 5%] Built target OpenMS_autogen
[ 82%] Built target OpenMS
[ 82%] Built target OpenMS_GUI_autogen_timestamp_deps
[ 82%] Automatic MOC and UIC for target OpenMS_GUI
[ 82%] Built target OpenMS_GUI_autogen
[ 82%] Building CXX object src/openms_gui/CMakeFiles/OpenMS_GUI.dir/source/VISUAL/SpectraIDViewTab.cpp.o
/Users/XXXXXXX/openms-development/OpenMS/src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp:303:57: error: no viable overloaded operator[] for type 'std::unordered_map<String, std::vector<const PeptideIdentification *>>'
303 | for (auto pep_id_ptr : protein_to_peptide_id_map[current_accession])
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_map:1348:38: note: candidate function not viable: no known conversion from 'QString' to 'const key_type' (aka 'const OpenMS::String') for 1st argument
1348 | _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k);
| ^ ~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_map:1350:38: note: candidate function not viable: no known conversion from 'QString' to 'key_type' (aka 'OpenMS::String') for 1st argument
1350 | _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k);
| ^ ~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [src/openms_gui/CMakeFiles/OpenMS_GUI.dir/source/VISUAL/SpectraIDViewTab.cpp.o] Error 1
make[2]: *** [src/openms_gui/CMakeFiles/OpenMS_GUI.dir/all] Error 2
make[1]: *** [src/tests/class_tests/openms_gui/CMakeFiles/VISUAL_TEST.dir/rule] Error 2
make: *** [VISUAL_TEST] Error 2
`

the fix:

in SpectraIDViewTab.cpp:303:57:
change :
or (auto pep_id_ptr : protein_to_peptide_id_map[current_accession])
to :
or (auto pep_id_ptr : protein_to_peptide_id_map[current_accession.toStdSring()])
`
... explicitly convert to std::String instead of implicitly converting from Qstring to OpenMS::String

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

Advanced commands (admins / reviewer only)

Click to expand
  • /reformat (experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed peptide data retrieval and display in the spectrum identification view tab, ensuring accurate visualization of sequence information during protein analysis workflows.

@github-actions

Copy link
Copy Markdown
Contributor

@LuBox2K The following names might be missing from the AUTHORS file:

  • luik42

Please consider applying the following patch:

--- AUTHORS	2026-04-17 10:04:47.178313662 +0000
+++ AUTHORS.new	2026-04-17 10:04:51.648764785 +0000
@@ -5,17 +5,18 @@
 The following authors contributed to OpenMS at some point. For the
 authors contributing to a specific piece of code, please refer to
 the authors tag in the respective file header.
+ - Michael R. Crusoe
  - Achal Bajpai
  - Aditya Muzumdar
  - Ahmed Khalil
  - Alexandra Scherbart
- - Axel Walter
  - Alexandra Zerck
  - Amanda Wein
  - Andreas Bertsch
  - Andreas Simon
  - Anton Kriese
  - Anton Pervukhin
+ - Axel Walter
  - Bastian Blank
  - Chenghao Zhu
  - Chirag Dave
@@ -26,8 +27,8 @@
  - Cornelia Friedle
  - Daniel Jameson
  - Darren Kessner
- - David Wojnar
  - David Voigt
+ - David Wojnar
  - Dhanmoni Nath
  - Dilek Dere
  - Dimitri Schachmann
@@ -54,14 +55,14 @@
  - Jang Jang Jin
  - Jeremi Maciejewski
  - Jihyung Kim
- - Johan Teleman
  - Johannes Junker
  - Johannes Veit
  - Johannes von Kleist
+ - Johan Teleman
  - Joshua Charkow
- - Julia Thueringer
  - Juliane Schmachtenberg
  - Julianus Pfeuffer
+ - Julia Thueringer
  - Justin Sing
  - Katharina Albers
  - Khue Nguyen
@@ -73,6 +74,7 @@
  - Leon Bichmann
  - Leon Kuchenbecker
  - Lucia Espona
+ - luik42
  - Lukas Mueller
  - Lukas Zimmermann
  - Marcel Schilling
@@ -84,7 +86,6 @@
  - Matteo Pilz
  - Matthew The
  - Matthias Bernt
- - Michael R. Crusoe
  - Michał Startek
  - Mohamed Ali
  - Nico Pfeifer
@@ -110,11 +111,11 @@
  - Sven Nahnsen
  - Svetlana Kutuzova
  - Swenja Wagner
- - Taraneh Strunk
  - Tapasweni Pathak
+ - Taraneh Strunk
+ - Till Englert
  - Timo Sachsenberg
  - Tinatin Kasradze
- - Till Englert
  - Tom David Müller
  - Tom Lukas Lankenau
  - Tom Waschischeck

@coderabbitai

coderabbitai Bot commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Updated the protein-to-peptide map lookup in SpectraIDViewTab::proteinCellClicked_ to use current_accession.toStdString() as the key instead of current_accession directly when building peptide data for the sequence visualizer.

Changes

Cohort / File(s) Summary
SpectraID View Map Key Lookup
src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp
Changed map key from current_accession to current_accession.toStdString() when iterating over protein_to_peptide_id_map in the QT_WEBENGINEWIDGETS_LIB code block.

Suggested reviewers

  • timosachsenberg

Poem

🐰 A accession key did change its way,
From QString bright to string today,
In peptide maps we hop about,
No more confusion, cast away doubt! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: fixing a compilation error by converting QString to std::String in the map lookup. It accurately conveys the critical nature and purpose of the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp (1)

303-303: Fix is correct; consider fromQString for consistency.

The toStdString() change resolves the Apple clang build error and is functionally equivalent (the std::string is implicitly promoted to OpenMS::String for the map key). For consistency with the rest of this file, which already uses the fromQString helper for QString→OpenMS::String conversions (e.g. lines 223 and 993), you could write:

♻️ Suggested tweak
-      for (auto pep_id_ptr : protein_to_peptide_id_map[current_accession.toStdString()])
+      for (auto pep_id_ptr : protein_to_peptide_id_map[fromQString(current_accession)])

Not a blocker — the current change is fine to merge as-is.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp` at line 303, Replace the
current conversion using current_accession.toStdString() with the project's
helper to maintain consistency: use fromQString(current_accession) as the map
key when iterating protein_to_peptide_id_map (e.g., in the loop that references
protein_to_peptide_id_map[current_accession...]) so the QString→OpenMS::String
conversion matches other uses in this file and avoids implicit promotions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp`:
- Line 303: Replace the current conversion using current_accession.toStdString()
with the project's helper to maintain consistency: use
fromQString(current_accession) as the map key when iterating
protein_to_peptide_id_map (e.g., in the loop that references
protein_to_peptide_id_map[current_accession...]) so the QString→OpenMS::String
conversion matches other uses in this file and avoids implicit promotions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ec92d05e-ae23-41fc-95a1-a0e18ac62d1b

📥 Commits

Reviewing files that changed from the base of the PR and between bc479b4 and 417a457.

📒 Files selected for processing (1)
  • src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp

@jpfeuffer
jpfeuffer enabled auto-merge April 17, 2026 10:28
@jpfeuffer
jpfeuffer merged commit 3a6ad57 into OpenMS:develop Apr 17, 2026
39 checks passed
timosachsenberg pushed a commit that referenced this pull request Apr 22, 2026
Add two missing entries for changes merged after the last CHANGELOG sync (#9193):

- #9196: CMake now accepts Arrow/Parquet 24.x and later; Ubuntu 24.04 CI
  runners ship Arrow 24.0.0 which broke builds with the previous
  find_package(Arrow 23) version constraint. pyarrow 24.0.0 excluded from
  pyOpenMS dependencies (cp310-only wheels on PyPI).

- #9174: Fix SpectraIDViewTab GUI compilation failure on macOS Apple Silicon
  (Tahoe); accession key lookup now converts to std::string after Qt string
  interop removal.

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants