Skip to content

Migrate from QDomDocument to QXmlStreamReader#18

Merged
ubruhin merged 1 commit intomasterfrom
qxmlstreamreader
Apr 18, 2026
Merged

Migrate from QDomDocument to QXmlStreamReader#18
ubruhin merged 1 commit intomasterfrom
qxmlstreamreader

Conversation

@ubruhin
Copy link
Copy Markdown
Member

@ubruhin ubruhin commented Sep 18, 2025

QDomDocument is deprecated in Qt6 and requires a separate Qt module (QtXml). Qt docs recommend to use QXmlStreamReader instead, which is even part of QtCore.

TODO: Do more testing.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the project’s XML parsing away from deprecated QDomDocument/QtXml toward a QXmlStreamReader-based parser in DomElement, reducing dependencies (QtCore-only) and aligning with Qt6 recommendations.

Changes:

  • Replace QDomDocument parsing in board/library/schematic loaders with DomElement::parse(...).
  • Rework DomElement internals to build the element tree using QXmlStreamReader.
  • Remove the QtXml component from CMake configuration and linking.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
parseagle/common/domelement.h Replaces QDom-based API with DomElement::parse(...) stream-based parsing entrypoints.
parseagle/common/domelement.cpp Implements the QXmlStreamReader-driven element tree parsing logic and new parse overloads.
parseagle/board/board.cpp Switches board loading to the new DomElement::parse(content) path.
parseagle/library.cpp Switches library loading to the new DomElement::parse(content) path.
parseagle/schematic/schematic.cpp Switches schematic loading to the new DomElement::parse(content) path.
CMakeLists.txt Drops QtXml from find_package and linking; links only Qt::Core.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread parseagle/common/domelement.cpp
Comment thread parseagle/common/domelement.cpp
Comment thread parseagle/common/domelement.cpp
Comment thread parseagle/common/domelement.cpp
Comment thread parseagle/common/domelement.cpp
QDomDocument is deprecated in Qt6 and requires a separate Qt module
(QtXml). Qt docs recommend to use QXmlStreamReader instead, which is
even part of QtCore.
@ubruhin ubruhin marked this pull request as ready for review April 18, 2026 18:45
@ubruhin ubruhin merged commit c3a5069 into master Apr 18, 2026
24 checks passed
@ubruhin ubruhin deleted the qxmlstreamreader branch April 18, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants