Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Qt6 build failure on QDomDocument::ParseResult conversion error #4049

Closed
wants to merge 1 commit into from

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Aug 5, 2023

src/model/modelbase.cpp: In member function ‘ModelPart* ModelBase::createOldSchematicPartAux(ModelPart*, const QString&, const QString&, const QString&)’: src/model/modelbase.cpp:847:36: error: cannot convert ‘QDomDocument::ParseResult’ to ‘bool’ in initialization
  847 |         bool ok = oldDoc.setContent(&newFzp);
      |                   ~~~~~~~~~~~~~~~~~^~~~~~~~~
      |                                    |
      |                                    QDomDocument::ParseResult

Ensure Qt6 uses the deprecated:
bool QDomDocument::setContent(const QByteArray &buffer, QString *errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr)

which in Qt5 is:
bool QDomDocument::setContent(const QByteArray &buffer, QString *errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr)

src/model/modelbase.cpp: In member function ‘ModelPart* ModelBase::createOldSchematicPartAux(ModelPart*, const QString&, const QString&, const QString&)’:
src/model/modelbase.cpp:847:36: error: cannot convert ‘QDomDocument::ParseResult’ to ‘bool’ in initialization
  847 |         bool ok = oldDoc.setContent(&newFzp);
      |                   ~~~~~~~~~~~~~~~~~^~~~~~~~~
      |                                    |
      |                                    QDomDocument::ParseResult

Ensure Qt6 uses the deprecated:
bool QDomDocument::setContent(const QByteArray &buffer, QString
*errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr)

which in Qt5 is:
bool QDomDocument::setContent(const QByteArray &buffer, QString
*errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr)
@DanielBarie
Copy link

I just did a succesful build with Qt6.6.1. A ton of deprecation warnings but no build failure.

@cjmayo
Copy link
Contributor Author

cjmayo commented Jan 30, 2024

Yes, the code was updated: bd010ce.

@cjmayo cjmayo closed this Jan 30, 2024
@cjmayo cjmayo deleted the setcontent branch February 1, 2024 19:41
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