Skip to content

refactor: remove Qt dependency from OpenMS core library - #8965

Merged
timosachsenberg merged 25 commits into
developfrom
remove-qt/string-api-and-core-dep
Mar 20, 2026
Merged

timosachsenberg merged 25 commits into
developfrom
remove-qt/string-api-and-core-dep

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Remove String(const QString&) constructor and toQString() method from core OpenMS::String class
  • Remove Qt6::Core from libOpenMS public dependencies — the core library no longer links or depends on Qt
  • Provide toQString()/fromQString() free functions in Qt5Port.h (openms_gui) as compatibility layer
  • Migrate ~60 GUI files to free functions, ~12 TOPP tools to inline conversions, remove ~17 stale Qt includes
  • Update CMake config so downstream consumers of only libOpenMS don't need Qt
  • Add explicit Qt6::Core link deps for TOPP tools and tests that directly use Qt headers

Breaking change: Downstream C++ code using String(qstr) or str.toQString() must switch to Qt5Port.h free functions or direct QString::fromStdString()/.toStdString() conversions.

Motivation

pyOpenMS and other non-GUI consumers should not require Qt as a transitive dependency. After prior PRs replaced QDir/QFile (#8938), QProcess (#8939), QDateTime (#8937), and QJson (#8936), only String/QString interop remained. This PR completes the effort.

Test plan

  • Full C++ build passes (OpenMS, OpenMS_GUI, all TOPP tools)
  • nm -D libOpenMS.so | grep qstring returns zero hits
  • pyOpenMS builds successfully
  • pyOpenMS test suite: 3830 passed
  • String_test passes with Qt test cases removed
  • ctest full suite passes

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Summary by CodeRabbit

  • Refactor

    • Core library no longer requires Qt6; Qt string interop moved to GUI compatibility helpers so core can build without Qt.
  • Build System

    • Qt discovery and AUTOMOC are now optional; Qt linkage is applied only when available for GUI/tools.
  • Documentation

    • Added a staged migration plan and detailed design spec for removing Qt from the core.
  • Chores / CI

    • macOS/Ubuntu CI and build scripts updated to make Qt/GUI packages optional.
  • Tests

    • Tests adjusted to remove or reduce Qt types where feasible.

timosachsenberg and others added 18 commits March 20, 2026 12:07
…ile counts)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Addresses reviewer feedback: TOPP tools and tests that directly include
Qt headers need explicit Qt6::Core link deps after removing it from
libOpenMS PUBLIC dependencies. Also removes false positive
OpenSwathWorkflow.cpp from String interop list.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Stale includes (PSMFeatureExtractor, NucleicAcidSearchEngine, 7 tests)
can simply be removed. Only targets actively using Qt need explicit
Qt6::Core link deps.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add Section 2: CMake config changes (cmake_findExternalLibs,
  OpenMSConfig.cmake.in, AUTOMOC)
- Move OpenSwathWorkflow.cpp to String interop migration list
- Expand stale includes list (MapStatistics, FeatureFinderMultiplex,
  LuciphorAdapter, MaRaClusterAdapter, QCExporter/Importer/Merger,
  Resampler)
- Correct active-Qt TOPP tools to 11 (not ~18)
- Note GUI header usage (FileWatcher.h)
- Add explicit <QString> include to Qt5Port.h

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
10 tasks covering: Qt5Port.h free functions, GUI lib migration (~60 files),
TOPP tool migration (12 files), stale include cleanup (~17 files),
core lib Qt removal, explicit Qt linking, CMake config updates,
and final verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Convert all .toQString() member calls in src/openms_gui/ to use the
toQString() free function from Qt5Port.h. Also convert String(qstring)
implicit conversions to fromQString(qstring) where the argument is a
QString. Add #include <OpenMS/VISUAL/MISC/Qt5Port.h> to all affected
files.

60 files changed, 346 .toQString() member calls converted plus
~15 String(qstring) implicit conversions.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace .toQString() calls with QString::fromStdString() for Qt-bound
values, and remove round-trip .toQString() calls where the result was
passed back to functions expecting String. Replace String(qstring_expr)
with qstring_expr.toStdString() for QString-to-String conversions.

These tools link only OpenMS (not OpenMS_GUI) and cannot use Qt5Port.h,
so the conversions are inlined directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Part A: Remove QString constructor and toQString() test sections from
  String_test.cpp; add cassert to replace Qt transitive include
- Part B: Replace .toQString() with QString::fromStdString() in
  MzMLSqliteHandler_test, PythonInfo_test, and ToolDescriptionFile_test
- Part C: Remove unused Qt includes from MzMLSqliteSwathHandler_test,
  StringListUtils_test, SqMassFile_test, OPXLHelper_test, DataValue_test,
  SiriusFragmentAnnotation_test, and XQuestResultXMLFile_test

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
After removing Qt6::Core from libOpenMS PUBLIC deps, TOPP tools and tests
that directly include Qt headers need explicit Qt6::Core linkage. Also fix
three latent QString->OpenMS::String assignment errors in QCEmbedder,
QCExtractor, QCShrinker, ToolDescriptionFile_test, and PeptideIndexing_test
that were exposed by the stricter dependency boundary.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace all implicit/explicit QString-to-OpenMS::String conversions with
fromQString() calls after removal of String(const QString&) constructor.
Adds #include <OpenMS/VISUAL/MISC/Qt5Port.h> where needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Fix implicit String(const QString&) constructor usages that were missed
in the initial GUI migration. Includes signal/slot adapter in TOPPView,
fromQString() calls in 57 GUI files, and inline .toStdString() in
QCEmbedder/Extractor/Shrinker and 2 test files.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Remove OpenMS_QT_COMPONENTS cache variable and Qt6 find_dependency from
OpenMSConfig.cmake.in so downstream consumers of only libOpenMS are not
forced to find Qt. Make AUTOMOC conditional on Qt6::moc being available.
Update knime_package_support.cmake to use literal Core instead of the
removed variable.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- deps-macos.sh: move qtbase into --skip-gui-deps conditional
- deps-ubuntu.sh: add --skip-gui-deps flag, move Qt6 packages into
  conditional block
- pyproject.toml: remove qtbase/qtsvg from macOS wheel build deps
  (pyOpenMS builds with WITH_GUI=OFF)
- knime_package_support.cmake: remove redundant find_package(Qt6)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d11a572a-f19d-41a8-a9db-2759ef8b7a8e

📥 Commits

Reviewing files that changed from the base of the PR and between 85592f9 and 4e4478a.

📒 Files selected for processing (1)
  • src/tests/class_tests/openms/source/ToolDescriptionFile_test.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tests/class_tests/openms/source/ToolDescriptionFile_test.cpp

📝 Walkthrough

Walkthrough

Removed Qt6::Core as a transitive dependency of libOpenMS, deleted QString-based OpenMS::String APIs, added GUI-only conversion helpers, migrated GUI/TOPP call sites to use helpers or explicit std/QString conversions, and made Qt discovery/linkage conditional in CMake and CI.

Changes

Cohort / File(s) Summary
Core library
src/openms/include/OpenMS/DATASTRUCTURES/String.h, src/openms/source/DATASTRUCTURES/String.cpp, src/openms/CMakeLists.txt, src/openms/source/APPLICATIONS/TOPPBase.cpp
Removed QString forward-decl, String(const QString&), toQString() API; dropped Qt6::Core from core link list; removed a QDateTime include.
GUI compat helpers
src/openms_gui/include/OpenMS/VISUAL/MISC/Qt5Port.h
Added <QString> include and free helpers toQString(const String&) / fromQString(const QString&) to centralize GUI-only conversions.
GUI migration (many files)
src/openms_gui/include/OpenMS/VISUAL/*, src/openms_gui/source/VISUAL/*
Updated ~90+ GUI sources: replaced .toQString()/implicit Qt conversions with toQString(...) / fromQString(...), added Qt5Port.h includes where needed.
TOPP tools & callsites
src/topp/*, src/topp/CMakeLists.txt
Replaced Qt conversion patterns with QString::fromStdString/.toStdString() or Qt5Port helpers, removed unused Qt includes, and conditionally link Qt6::Core to specific TOPP executables if available.
CMake / packaging
cmake/OpenMSConfig.cmake.in, cmake/cmake_findExternalLibs.cmake, cmake/add_library_macros.cmake, cmake/knime_package_support.cmake
Removed exported find_dependency(Qt6...); made Qt6 discovery QUIET/Core-only and non-fatal; enabled AUTOMOC only when Qt6::moc target exists; narrowed KNIME runtime Qt copy to Core.
CI & pyOpenMS build config
tools/ci/deps-ubuntu.sh, tools/ci/deps-macos.sh, src/pyOpenMS/pyproject.toml
Made GUI Qt packages optional in CI (--skip-gui-deps / SKIP_GUI_DEPS); moved qtbase/qtsvg to conditional install paths on Ubuntu/macOS and removed unconditional macOS installs.
Tests
src/tests/class_tests/openms/*
Removed stale Qt includes and Qt-dependent test sections; migrated several tests to std::filesystem/std::string and simplified temp-file cleanup.
Docs / migration plan & spec
docs/superpowers/plans/2026-03-20-remove-qt-from-core.md, docs/superpowers/specs/2026-03-20-remove-qt-from-core-lib-design.md
Added detailed spec and staged migration plan documenting API removals, GUI compat layer, CMake/CI changes, TOPP adjustments, and verification steps.

Sequence Diagram(s)

sequenceDiagram
    participant Consumer as Downstream Consumer
    participant OpenMS as libOpenMS
    participant CMake as OpenMS CMake config
    participant GUI as openms_gui / TOPP
    participant Qt as Qt6

    Consumer->>OpenMS: find_package(OpenMS)
    OpenMS->>CMake: load OpenMSConfig.cmake
    CMake-->>Consumer: expose libOpenMS targets (without Qt6::Core)
    opt GUI/TOPP needs Qt
        Consumer->>GUI: build/link GUI or TOPP tool
        GUI->>CMake: request Qt discovery (conditional)
        CMake->>Qt: find_package(Qt6 Core) (QUIET)
        Qt-->>GUI: provide Qt targets (if present)
    end
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers

  • jpfeuffer
  • cbielow

Poem

🐰 I hopped through headers, nibbling Qt away,

Moved string bridges to helpers, tidy as hay.
Core sheds heavy bindings, GUI hums along,
CMake politely asks for Qt only when strong.
Hop, build, and celebrate clean code all day!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-qt/string-api-and-core-dep

@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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/openms_gui/source/VISUAL/TOPPASOutputVertex.cpp (1)

69-85: ⚠️ Potential issue | 🔴 Critical

Guard empty incoming-edge lists before dereferencing them.

Lines 74-75 dereference inEdgesBegin() before checking whether any input edge exists. An unconnected output vertex can therefore hit undefined behavior when resolving the folder path instead of throwing MissingInformation.

Suggested fix
     if (output_folder_name_.isEmpty())
     {
-      TOPPASEdge* e = *inEdgesBegin();
-      if (e == nullptr)
+      const auto it = inEdgesBegin();
+      if (it == inEdgesEnd())
       {
         throw Exception::MissingInformation(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
                                             "To open the output folder, an input edge is required to knit a folder name.");
       }
+      TOPPASEdge* e = *it;
       const TOPPASVertex* tv = e->getSourceVertex();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openms_gui/source/VISUAL/TOPPASOutputVertex.cpp` around lines 69 - 85,
getOutputDir() dereferences *inEdgesBegin() before ensuring there is any
incoming edge, causing UB for unconnected vertices; modify the function to check
for no incoming edges (e.g. compare inEdgesBegin() to inEdgesEnd() or use the
container's empty() check) before dereferencing, and if empty throw the same
Exception::MissingInformation used later; update the branch that currently does
TOPPASEdge* e = *inEdgesBegin() to only dereference after that guard so the
error path is taken for unconnected output vertices.
src/openms_gui/source/VISUAL/TVIdentificationViewController.cpp (1)

241-265: ⚠️ Potential issue | 🔴 Critical

Fix the off-by-one color index before rendering multi-formula annotations.

i is pre-incremented here, so the first visible formula skips cols[0], and on Line 247 the fifth formula hits cols[5], which is out of bounds for a 5-element array. That is UB in the annotation path.

🛠️ Proposed fix
-      Size i = 0;
+      Size shown = 0;
       for (map<String, StringList>::iterator ith = formula_to_names.begin();
            ith!= formula_to_names.end(); ++ith)
       {
-        if (++i == cols.size())
-        { // at this point, this is the 4th entry.. which we don't show any more...
-          text += String("<b><span style=\"color:") + fromQString(cols[i].name()) + "\">..." + Size(distance(formula_to_names.begin(), formula_to_names.end()) - 4 + 1) + " more</span></b><br>";
+        if (shown == 4)
+        {
+          text += String("<b><span style=\"color:") + fromQString(cols.back().name()) + "\">..." + Size(formula_to_names.size() - shown) + " more</span></b><br>";
           break;
         }
-        text += String("<b><span style=\"color:") + fromQString(cols[i].name()) + "\">" + ith->first + "</span></b><br>\n";
+        const QColor& current_color = cols[shown];
+        text += String("<b><span style=\"color:") + fromQString(current_color.name()) + "\">" + ith->first + "</span></b><br>\n";
         // carets for isotope profile
         EmpiricalFormula ef(ith->first);
         IsotopeDistribution id = ef.getIsotopeDistribution(CoarseIsotopePatternGenerator(3)); // three isotopes at most
         double int_factor = peak_int / id.begin()->getIntensity();
         Annotation1DCaret<Peak1D>::PositionsType points;
@@
         auto ditem = new Annotation1DCaret<Peak1D>(points,
                                                    QString(),
-                                                   cols[i],
+                                                   current_color,
                                                    toQString(String(getCurrentLayer().param.getValue("peak_color").toString())));
+        ++shown;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openms_gui/source/VISUAL/TVIdentificationViewController.cpp` around lines
241 - 265, The loop currently pre-increments i (using ++i) which skips cols[0]
and can index past cols (UB); change the loop to not pre-increment: treat i as
the current color index (start i = 0), replace the pre-increment condition if
(++i == cols.size()) with a check if (i == cols.size() - 1) (or if (i+1 ==
cols.size()) when computing the "more" count) to detect the final visible slot,
use cols[i] and cols[i].name() for rendering the current formula, and then
increment i++ at the end of the loop body (before continuing) so the next
iteration uses the next color; update usages around formula_to_names iteration
and the Annotation1DCaret<Peak1D> creation to rely on this corrected index
behavior.
🧹 Nitpick comments (7)
src/openms_gui/source/VISUAL/TOPPASSplitterVertex.cpp (1)

14-14: Include added for commented-out code only.

Qt5Port.h is included but only used in a commented-out line (line 48). Consider removing this include unless you plan to uncomment that code.

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

In `@src/openms_gui/source/VISUAL/TOPPASSplitterVertex.cpp` at line 14, The
include Qt5Port.h is currently only referenced by commented-out code in
TOPPASSplitterVertex.cpp (the commented line around line 48), so remove the
unnecessary `#include` <OpenMS/VISUAL/MISC/Qt5Port.h> to avoid dead includes;
alternatively, if the commented code is intended to be re-enabled, uncomment and
update the code that relies on Qt5Port.h (search for the commented usage near
the TOPPASSplitterVertex class) — prefer removing the include if the code
remains commented.
src/openms_gui/include/OpenMS/VISUAL/FileWatcher.h (2)

18-19: Duplicate #include <map> detected.

The header <map> is included twice: once on line 19 and again on line 25. Remove one of them.

♻️ Proposed fix
 `#include` <OpenMS/VISUAL/MISC/Qt5Port.h>
-#include <map>
 
 //Qt
 `#include` <QtCore/QFileSystemWatcher>
 
 //STL
 `#include` <map>

Also applies to: 25-25

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

In `@src/openms_gui/include/OpenMS/VISUAL/FileWatcher.h` around lines 18 - 19,
Remove the duplicated include of the C++ header <map> in FileWatcher.h: locate
the two occurrences of "#include <map>" (one near the top alongside "#include
<OpenMS/VISUAL/MISC/Qt5Port.h>") and delete one so only a single "#include
<map>" remains in the header; ensure no other includes or forward declarations
are accidentally altered.

29-29: Redundant forward declaration.

class String; is forward-declared on line 29, but OpenMS/DATASTRUCTURES/String.h is already included on line 17, making this forward declaration unnecessary.

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

In `@src/openms_gui/include/OpenMS/VISUAL/FileWatcher.h` at line 29, Remove the
redundant forward declaration "class String;" from FileWatcher.h; since
OpenMS/DATASTRUCTURES/String.h is already included (providing the String type),
delete the standalone forward declaration in the OpenMS::FileWatcher header to
avoid redundancy and potential confusion.
src/openms_gui/source/VISUAL/LayerListView.cpp (1)

82-82: Minor: Redundant String() wrapper.

DataValue::toString() already returns OpenMS::String, so the explicit String(...) wrapper is unnecessary.

♻️ Suggested simplification
-        icon.fill(QColor(toQString(String(layer.param.getValue("peak_color").toString()))));
+        icon.fill(QColor(toQString(layer.param.getValue("peak_color").toString())));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openms_gui/source/VISUAL/LayerListView.cpp` at line 82, Remove the
redundant String(...) wrapper around the DataValue::toString() call in
LayerListView.cpp: replace
icon.fill(QColor(toQString(String(layer.param.getValue("peak_color").toString()))));
with a call that passes the existing OpenMS::String directly, e.g.
icon.fill(QColor(toQString(layer.param.getValue("peak_color").toString()))); so
the code uses layer.param.getValue("peak_color").toString() without the extra
String(...) construction.
src/openms_gui/source/VISUAL/TableView.cpp (1)

151-153: Pre-existing duplicate condition detected.

Lines 151-153 are an exact duplicate of lines 147-149 (both check Qt::DisplayRole). This second branch is unreachable dead code. While not introduced by this PR, consider removing it in a follow-up cleanup.

♻️ Suggested removal
           else if (ti->data(Qt::DisplayRole).isValid())
           {
             str_list << ti->data(Qt::DisplayRole).toString();
           }
-          else if (ti->data(Qt::DisplayRole).isValid())
-          {
-            str_list << ti->data(Qt::DisplayRole).toString();
-          }
           else
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openms_gui/source/VISUAL/TableView.cpp` around lines 151 - 153, Remove
the unreachable duplicate branch that checks ti->data(Qt::DisplayRole) and
appends to str_list: locate the second "else if
(ti->data(Qt::DisplayRole).isValid()) { str_list <<
ti->data(Qt::DisplayRole).toString(); }" in TableView.cpp (inside the method
handling item data collection where variable ti and str_list are used) and
delete that entire else-if block so only the first DisplayRole branch remains;
ensure surrounding else/if flow remains syntactically correct and no other
behavior is altered.
src/openms_gui/source/VISUAL/OutputDirectory.cpp (1)

58-58: Consider extracting repeated conversion to avoid duplication.

The expression calls fromQString(getDirectory()) twice. While functionally correct, this could be simplified for clarity and minor efficiency.

♻️ Optional refactor to reduce duplication
 void OutputDirectory::showFileDialog()
 {
-  QString dir = File::exists(File::path(fromQString(getDirectory()))) ? toQString(File::path(fromQString(getDirectory()))) : "";
+  String path = File::path(fromQString(getDirectory()));
+  QString dir = File::exists(path) ? toQString(path) : "";
   QString selected_dir = QFileDialog::getExistingDirectory(this, tr("Select output directory"), dir);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/openms_gui/source/VISUAL/OutputDirectory.cpp` at line 58, The line in
OutputDirectory.cpp duplicates the conversion from QString to std::string by
calling fromQString(getDirectory()) twice when initializing dir; store the
result of fromQString(getDirectory()) in a local variable (e.g., auto dirStr =
fromQString(getDirectory())), then call File::path(dirStr) and
File::exists(File::path(dirStr)) and use toQString(File::path(dirStr)) to set
dir, eliminating the duplicated fromQString call and improving clarity and minor
performance.
src/openms_gui/source/VISUAL/TOPPASScene.cpp (1)

1309-1315: Use the OpenMS logging path here too.

This error branch still writes straight to std::cerr and uses std::endl. Since this function is part of the TOPPAS logging flow, please keep it on the OpenMS logging utilities as well and avoid the forced flush.

As per coding guidelines, "Use OpenMS logging macros and OpenMS::LogStream; avoid std::cout/err directly; avoid std::endl for performance (use \n) in C++".

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

In `@src/openms_gui/source/VISUAL/TOPPASScene.cpp` around lines 1309 - 1315,
Replace the direct std::cerr write in TOPPASScene::writeToLogFile_ with the
OpenMS logging utilities: use OpenMS logging macros or OpenMS::LogStream (e.g.
OPENMS_LOG_ERROR or LogStream) to log the "Could not write to logfile" message
and append '\n' instead of using std::endl; keep the same file name payload
(fromQString(logfile.fileName())) so the error text is unchanged but routed
through OpenMS logging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp`:
- Line 911: Remove the unused local variable assignment by deleting the line
that declares "String s = fromQString(headers.join(';'));" in
SpectraIDViewTab.cpp (the unused variable "s" created from headers.join(';') is
leftover debug code); if the string was intended for further use, instead use
the result directly where needed (e.g., pass fromQString(headers.join(';')) to
the consumer) or store it in a properly named variable that is used.

In `@src/openms_gui/source/VISUAL/VISUALIZER/ContactPersonVisualizer.cpp`:
- Around line 49-58: ContactPersonVisualizer::store currently persists last
name, institution, email, contact info, URL and address but forgets to save the
first name; modify ContactPersonVisualizer::store to read firstname_->text(),
convert via fromQString and call ptr_->setFirstName(...) before assigning temp_
= (*ptr_) so edits to the firstname_ field are persisted (this mirrors update_()
which sets firstname_->setText(...)).

In `@src/topp/INIUpdater.cpp`:
- Around line 214-221: The backup-failure branch for in-place TOPPAS updates
does not record the failed infile in the failed_ collection, so add the same
failure tracking used in the INI path: before returning in the QFile::rename
failure block inside the TOPPAS branch (where outfile.empty(), variables infile,
new_name are used), append the infile (or its normalized form used elsewhere) to
failed_ (e.g., failed_.push_back(infile)) so the failed update is included in
the final summary.

---

Outside diff comments:
In `@src/openms_gui/source/VISUAL/TOPPASOutputVertex.cpp`:
- Around line 69-85: getOutputDir() dereferences *inEdgesBegin() before ensuring
there is any incoming edge, causing UB for unconnected vertices; modify the
function to check for no incoming edges (e.g. compare inEdgesBegin() to
inEdgesEnd() or use the container's empty() check) before dereferencing, and if
empty throw the same Exception::MissingInformation used later; update the branch
that currently does TOPPASEdge* e = *inEdgesBegin() to only dereference after
that guard so the error path is taken for unconnected output vertices.

In `@src/openms_gui/source/VISUAL/TVIdentificationViewController.cpp`:
- Around line 241-265: The loop currently pre-increments i (using ++i) which
skips cols[0] and can index past cols (UB); change the loop to not
pre-increment: treat i as the current color index (start i = 0), replace the
pre-increment condition if (++i == cols.size()) with a check if (i ==
cols.size() - 1) (or if (i+1 == cols.size()) when computing the "more" count) to
detect the final visible slot, use cols[i] and cols[i].name() for rendering the
current formula, and then increment i++ at the end of the loop body (before
continuing) so the next iteration uses the next color; update usages around
formula_to_names iteration and the Annotation1DCaret<Peak1D> creation to rely on
this corrected index behavior.

---

Nitpick comments:
In `@src/openms_gui/include/OpenMS/VISUAL/FileWatcher.h`:
- Around line 18-19: Remove the duplicated include of the C++ header <map> in
FileWatcher.h: locate the two occurrences of "#include <map>" (one near the top
alongside "#include <OpenMS/VISUAL/MISC/Qt5Port.h>") and delete one so only a
single "#include <map>" remains in the header; ensure no other includes or
forward declarations are accidentally altered.
- Line 29: Remove the redundant forward declaration "class String;" from
FileWatcher.h; since OpenMS/DATASTRUCTURES/String.h is already included
(providing the String type), delete the standalone forward declaration in the
OpenMS::FileWatcher header to avoid redundancy and potential confusion.

In `@src/openms_gui/source/VISUAL/LayerListView.cpp`:
- Line 82: Remove the redundant String(...) wrapper around the
DataValue::toString() call in LayerListView.cpp: replace
icon.fill(QColor(toQString(String(layer.param.getValue("peak_color").toString()))));
with a call that passes the existing OpenMS::String directly, e.g.
icon.fill(QColor(toQString(layer.param.getValue("peak_color").toString()))); so
the code uses layer.param.getValue("peak_color").toString() without the extra
String(...) construction.

In `@src/openms_gui/source/VISUAL/OutputDirectory.cpp`:
- Line 58: The line in OutputDirectory.cpp duplicates the conversion from
QString to std::string by calling fromQString(getDirectory()) twice when
initializing dir; store the result of fromQString(getDirectory()) in a local
variable (e.g., auto dirStr = fromQString(getDirectory())), then call
File::path(dirStr) and File::exists(File::path(dirStr)) and use
toQString(File::path(dirStr)) to set dir, eliminating the duplicated fromQString
call and improving clarity and minor performance.

In `@src/openms_gui/source/VISUAL/TableView.cpp`:
- Around line 151-153: Remove the unreachable duplicate branch that checks
ti->data(Qt::DisplayRole) and appends to str_list: locate the second "else if
(ti->data(Qt::DisplayRole).isValid()) { str_list <<
ti->data(Qt::DisplayRole).toString(); }" in TableView.cpp (inside the method
handling item data collection where variable ti and str_list are used) and
delete that entire else-if block so only the first DisplayRole branch remains;
ensure surrounding else/if flow remains syntactically correct and no other
behavior is altered.

In `@src/openms_gui/source/VISUAL/TOPPASScene.cpp`:
- Around line 1309-1315: Replace the direct std::cerr write in
TOPPASScene::writeToLogFile_ with the OpenMS logging utilities: use OpenMS
logging macros or OpenMS::LogStream (e.g. OPENMS_LOG_ERROR or LogStream) to log
the "Could not write to logfile" message and append '\n' instead of using
std::endl; keep the same file name payload (fromQString(logfile.fileName())) so
the error text is unchanged but routed through OpenMS logging.

In `@src/openms_gui/source/VISUAL/TOPPASSplitterVertex.cpp`:
- Line 14: The include Qt5Port.h is currently only referenced by commented-out
code in TOPPASSplitterVertex.cpp (the commented line around line 48), so remove
the unnecessary `#include` <OpenMS/VISUAL/MISC/Qt5Port.h> to avoid dead includes;
alternatively, if the commented code is intended to be re-enabled, uncomment and
update the code that relies on Qt5Port.h (search for the commented usage near
the TOPPASSplitterVertex class) — prefer removing the include if the code
remains commented.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c79219ed-549b-4d9d-adb7-9dc500899835

📥 Commits

Reviewing files that changed from the base of the PR and between 3ef1a3b and fb5f52f.

📒 Files selected for processing (130)
  • cmake/OpenMSConfig.cmake.in
  • cmake/add_library_macros.cmake
  • cmake/cmake_findExternalLibs.cmake
  • cmake/knime_package_support.cmake
  • docs/superpowers/plans/2026-03-20-remove-qt-from-core.md
  • docs/superpowers/specs/2026-03-20-remove-qt-from-core-lib-design.md
  • src/openms/CMakeLists.txt
  • src/openms/include/OpenMS/DATASTRUCTURES/String.h
  • src/openms/source/APPLICATIONS/TOPPBase.cpp
  • src/openms/source/DATASTRUCTURES/String.cpp
  • src/openms_gui/include/OpenMS/VISUAL/ANNOTATION/Annotation1DPeakItem.h
  • src/openms_gui/include/OpenMS/VISUAL/FileWatcher.h
  • src/openms_gui/include/OpenMS/VISUAL/MISC/Qt5Port.h
  • src/openms_gui/source/VISUAL/APPLICATIONS/GUITOOLS/TOPPAS.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/GUITOOLS/TOPPView.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/INIFileEditorWindow.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/MISC/QApplicationTOPP.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp
  • src/openms_gui/source/VISUAL/APPLICATIONS/TOPPViewBase.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/DataFilterDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/FLASHDeconvTabWidget.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/LayerStatisticsDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/Plot2DGoToDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/PythonModuleRequirement.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/PythonSelector.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/SpectrumAlignmentDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/SwathTabWidget.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/TOPPASIOMappingDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/TOPPASToolConfigDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/TOPPViewOpenDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/TOPPViewPrefDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/TheoreticalSpectrumGenerationDialog.cpp
  • src/openms_gui/source/VISUAL/DIALOGS/ToolsDialog.cpp
  • src/openms_gui/source/VISUAL/EnhancedTabBarWidgetInterface.cpp
  • src/openms_gui/source/VISUAL/FileWatcher.cpp
  • src/openms_gui/source/VISUAL/FilterList.cpp
  • src/openms_gui/source/VISUAL/InputFile.cpp
  • src/openms_gui/source/VISUAL/InputFileList.cpp
  • src/openms_gui/source/VISUAL/LayerData1DPeak.cpp
  • src/openms_gui/source/VISUAL/LayerDataBase.cpp
  • src/openms_gui/source/VISUAL/LayerListView.cpp
  • src/openms_gui/source/VISUAL/ListEditor.cpp
  • src/openms_gui/source/VISUAL/LogWindow.cpp
  • src/openms_gui/source/VISUAL/MISC/ExternalProcessMBox.cpp
  • src/openms_gui/source/VISUAL/MISC/FilterableList.cpp
  • src/openms_gui/source/VISUAL/MISC/GUIHelpers.cpp
  • src/openms_gui/source/VISUAL/OutputDirectory.cpp
  • src/openms_gui/source/VISUAL/Painter1DBase.cpp
  • src/openms_gui/source/VISUAL/Painter2DBase.cpp
  • src/openms_gui/source/VISUAL/ParamEditor.cpp
  • src/openms_gui/source/VISUAL/Plot1DCanvas.cpp
  • src/openms_gui/source/VISUAL/Plot2DCanvas.cpp
  • src/openms_gui/source/VISUAL/Plot3DCanvas.cpp
  • src/openms_gui/source/VISUAL/Plot3DOpenGLCanvas.cpp
  • src/openms_gui/source/VISUAL/PlotCanvas.cpp
  • src/openms_gui/source/VISUAL/PlotWidget.cpp
  • src/openms_gui/source/VISUAL/RecentFilesMenu.cpp
  • src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp
  • src/openms_gui/source/VISUAL/SpectraTreeTab.cpp
  • src/openms_gui/source/VISUAL/TOPPASEdge.cpp
  • src/openms_gui/source/VISUAL/TOPPASInputFileListVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASMergerVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASOutputFileListVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASOutputFolderVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASOutputVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASResources.cpp
  • src/openms_gui/source/VISUAL/TOPPASScene.cpp
  • src/openms_gui/source/VISUAL/TOPPASSplitterVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASToolVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASVertex.cpp
  • src/openms_gui/source/VISUAL/TOPPASWidget.cpp
  • src/openms_gui/source/VISUAL/TVDIATreeTabController.cpp
  • src/openms_gui/source/VISUAL/TVIdentificationViewController.cpp
  • src/openms_gui/source/VISUAL/TVToolDiscovery.cpp
  • src/openms_gui/source/VISUAL/TableView.cpp
  • src/openms_gui/source/VISUAL/TreeView.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/AcquisitionInfoVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/AcquisitionVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/ContactPersonVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/DataProcessingVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/DocumentIdentifierVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/ExperimentalSettingsVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/GradientVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/HPLCVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/InstrumentVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/MetaInfoVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/PeptideIdentificationVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/ProteinIdentificationVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/SampleVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/SoftwareVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/SourceFileVisualizer.cpp
  • src/openms_gui/source/VISUAL/VISUALIZER/SpectrumSettingsVisualizer.cpp
  • src/tests/class_tests/openms/CMakeLists.txt
  • src/tests/class_tests/openms/source/DataValue_test.cpp
  • src/tests/class_tests/openms/source/MzMLSqliteHandler_test.cpp
  • src/tests/class_tests/openms/source/MzMLSqliteSwathHandler_test.cpp
  • src/tests/class_tests/openms/source/OPXLHelper_test.cpp
  • src/tests/class_tests/openms/source/PeptideIndexing_test.cpp
  • src/tests/class_tests/openms/source/PythonInfo_test.cpp
  • src/tests/class_tests/openms/source/SiriusFragmentAnnotation_test.cpp
  • src/tests/class_tests/openms/source/SqMassFile_test.cpp
  • src/tests/class_tests/openms/source/StringListUtils_test.cpp
  • src/tests/class_tests/openms/source/String_test.cpp
  • src/tests/class_tests/openms/source/ToolDescriptionFile_test.cpp
  • src/tests/class_tests/openms/source/XQuestResultXMLFile_test.cpp
  • src/topp/AssayGeneratorMetaboSirius.cpp
  • src/topp/CMakeLists.txt
  • src/topp/CometAdapter.cpp
  • src/topp/ExecutePipeline.cpp
  • src/topp/FeatureFinderMultiplex.cpp
  • src/topp/GenericWrapper.cpp
  • src/topp/IDRipper.cpp
  • src/topp/INIUpdater.cpp
  • src/topp/ImageCreator.cpp
  • src/topp/LuciphorAdapter.cpp
  • src/topp/MaRaClusterAdapter.cpp
  • src/topp/MapStatistics.cpp
  • src/topp/MetaProSIP.cpp
  • src/topp/MzMLSplitter.cpp
  • src/topp/NucleicAcidSearchEngine.cpp
  • src/topp/OpenSwathFileSplitter.cpp
  • src/topp/OpenSwathWorkflow.cpp
  • src/topp/PSMFeatureExtractor.cpp
  • src/topp/QCEmbedder.cpp
  • src/topp/QCExporter.cpp
  • src/topp/QCExtractor.cpp
  • src/topp/QCImporter.cpp
  • src/topp/QCMerger.cpp
  • src/topp/QCShrinker.cpp
  • src/topp/Resampler.cpp
💤 Files with no reviewable changes (21)
  • src/tests/class_tests/openms/source/SqMassFile_test.cpp
  • src/topp/QCExporter.cpp
  • cmake/OpenMSConfig.cmake.in
  • src/tests/class_tests/openms/source/XQuestResultXMLFile_test.cpp
  • src/topp/NucleicAcidSearchEngine.cpp
  • src/tests/class_tests/openms/source/SiriusFragmentAnnotation_test.cpp
  • src/tests/class_tests/openms/source/MzMLSqliteSwathHandler_test.cpp
  • src/topp/QCImporter.cpp
  • src/tests/class_tests/openms/source/StringListUtils_test.cpp
  • src/topp/Resampler.cpp
  • src/tests/class_tests/openms/source/DataValue_test.cpp
  • src/topp/MapStatistics.cpp
  • src/topp/PSMFeatureExtractor.cpp
  • src/openms/CMakeLists.txt
  • src/tests/class_tests/openms/source/OPXLHelper_test.cpp
  • src/topp/QCMerger.cpp
  • src/openms/source/APPLICATIONS/TOPPBase.cpp
  • src/topp/LuciphorAdapter.cpp
  • src/openms/source/DATASTRUCTURES/String.cpp
  • src/topp/FeatureFinderMultiplex.cpp
  • src/openms/include/OpenMS/DATASTRUCTURES/String.h

Comment thread src/topp/INIUpdater.cpp Resolved
Qt6::Core find_package is now QUIET instead of REQUIRED — when Qt is
not installed (e.g., pyOpenMS wheel builds), cmake configures
successfully and only libOpenMS is built. TOPP tools and tests that
need Qt6::Core are guarded with if(TARGET Qt6::Core).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace Qt types (QDir, QFile, QStringList) with std equivalents
(std::filesystem, std::vector<std::string>) and remove Qt6::Core
link dependency from these test targets.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/tests/class_tests/openms/source/FIAMSScheduler_test.cpp`:
- Line 49: Replace the use of std::filesystem::current_path().string() when
building tmp_dir in FIAMSScheduler_test.cpp with
std::filesystem::current_path().generic_string() so the constructed String
tmp_dir uses forward-slash separators consistently (i.e., change the expression
that sets tmp_dir to use generic_string() + "/" to avoid mixed
backslash/forward-slash paths).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f3eb9b1d-3b3a-4e15-b195-fbb3511c31b0

📥 Commits

Reviewing files that changed from the base of the PR and between 431b24c and 6d1a3ed.

📒 Files selected for processing (6)
  • src/tests/class_tests/openms/CMakeLists.txt
  • src/tests/class_tests/openms/source/FIAMSScheduler_test.cpp
  • src/tests/class_tests/openms/source/MzMLSqliteHandler_test.cpp
  • src/tests/class_tests/openms/source/PeptideIndexing_test.cpp
  • src/tests/class_tests/openms/source/PythonInfo_test.cpp
  • src/tests/class_tests/openms/source/ToolDescriptionFile_test.cpp
✅ Files skipped from review due to trivial changes (3)
  • src/tests/class_tests/openms/CMakeLists.txt
  • src/tests/class_tests/openms/source/MzMLSqliteHandler_test.cpp
  • src/tests/class_tests/openms/source/PeptideIndexing_test.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/tests/class_tests/openms/source/PythonInfo_test.cpp
  • src/tests/class_tests/openms/source/ToolDescriptionFile_test.cpp

timosachsenberg and others added 5 commits March 20, 2026 17:13
…arators)

- ContactPersonVisualizer::store(): persist first name field (was skipped)
- INIUpdater: track TOPPAS backup failures in failed_ list for summary
- FIAMSScheduler_test: use generic_string() to avoid mixed path separators

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
On Windows, std::filesystem::path uses wstring internally and cannot
implicitly convert from OpenMS::String. Wrap with std::string() to
match the pattern used in other test files.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Use brace initialization for std::filesystem::path to prevent the
compiler from interpreting the declaration as a function prototype.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@timosachsenberg
timosachsenberg merged commit c23b814 into develop Mar 20, 2026
41 checks passed
@timosachsenberg
timosachsenberg deleted the remove-qt/string-api-and-core-dep branch March 20, 2026 20:25
github-actions Bot pushed a commit that referenced this pull request Mar 21, 2026
Add missing changelog entries for:
- BREAKING: Qt string API removal from String/DataValue (#8940)
- BREAKING: Qt6::Core removed from libOpenMS PUBLIC CMake deps (#8965)
- BREAKING: Transitive includes trimmed from KERNEL/METADATA headers (#8946)
- Fix: segfault in FeatureLinkerUnlabeledKD with charge_merging=Any (#8944)

Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit that referenced this pull request Mar 21, 2026
Add missing changelog entries for:
- BREAKING: Qt string API removal from String/DataValue (#8940)
- BREAKING: Qt6::Core removed from libOpenMS PUBLIC CMake deps (#8965)
- BREAKING: Transitive includes trimmed from KERNEL/METADATA headers (#8946)
- Fix: segfault in FeatureLinkerUnlabeledKD with charge_merging=Any (#8944)

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
github-actions Bot pushed a commit that referenced this pull request Mar 24, 2026
After the Qt removal refactoring (#8937-#8940, #8965), Qt6::Core is no
longer a dependency of libOpenMS itself. Update AGENTS.md to reflect
that Qt6 is required only for TOPP tools and GUI (openms_gui) builds,
and is optional when building only the core library or pyOpenMS.

Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit that referenced this pull request Mar 24, 2026
…8977)

After the Qt removal refactoring (#8937-#8940, #8965), Qt6::Core is no
longer a dependency of libOpenMS itself. Update AGENTS.md to reflect
that Qt6 is required only for TOPP tools and GUI (openms_gui) builds,
and is optional when building only the core library or pyOpenMS.

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
timosachsenberg added a commit that referenced this pull request May 21, 2026
… throws (#9334)

- Drop the "If you want safe conversions, use QtByteArray" line -- Qt
  has been removed from OpenMS core (PR #8965), the reference is stale
  and misleading.
- Add @InGroup FileIO.
- Surface the three throw paths on compressString / compressData
  (OutOfMemory, InvalidValue, ConversionError), verified against
  ZlibCompression.cpp:36-48.
- Tighten the uncompressData doc: spell out the two code paths (known
  vs unknown output size) and document the nr_bytes==0 shortcut
  (ZlibCompression.cpp:55-58). Note that the "actual size smaller than
  output_size" path resizes and logs informational (not a throw)
  (ZlibCompression.cpp:64-71).
- Promote uncompressString from a one-line "Convencience" (typo)
  summary to a proper block that delegates @throws to uncompressData.

No behaviour change.

Co-authored-by: Claude Opus 4.7 (1M context) <[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