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

Qt6 port #9977

Merged
merged 1 commit into from Aug 5, 2023
Merged

Qt6 port #9977

merged 1 commit into from Aug 5, 2023

Conversation

wwmayer
Copy link
Contributor

@wwmayer wwmayer commented Jul 23, 2023

Fix deprecation warnings with version 6.3 or 6.4

Thank you for creating a pull request to contribute to FreeCAD! Place an "X" in between the brackets below to "check off" to confirm that you have satisfied the requirement, or ask for help in the FreeCAD forum if there is something you don't understand.

  • Your Pull Request meets the requirements outlined in section 5 of CONTRIBUTING.md for a Valid PR

Please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 1.0 Changelog Forum Thread.


Fix deprecation warnings with version 6.3 or 6.4
@github-actions github-actions bot added Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB Sketcher Related to the Sketcher Workbench labels Jul 23, 2023
@chennes
Copy link
Member

chennes commented Jul 23, 2023

This PR resolves those deprecation warnings for me. FYI, when compiling against 6.6.0a1 I get a new deprecation. Here is an example:

/home/chennes/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp:1083:13: warning: ‘constexpr typename std::add_const<_Tp>::type& qAsConst(T&) [with T = QToolButton*; typename std::add_const<_Tp>::type = QToolButton* const]’ is deprecated: Use std::as_const() instead. [-Wdeprecated-declarations]
 1083 |     qAsConst(ui->filterButton)->addAction(action);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~
/media/chennes/Qt/qt6-install/include/QtCore/qttypetraits.h:50:45: note: declared here
   50 | constexpr typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
      |                                             ^~~~~~~~

@luzpaz luzpaz added the 3rd party: Qt 6 Issue related to Qt 6 label Jul 23, 2023
@wwmayer
Copy link
Contributor Author

wwmayer commented Jul 24, 2023

TBH I don't understand the use of qAsConst in this context which was added with 15dd775.
IMO, it should be removed here.

@chennes chennes merged commit 5621a00 into FreeCAD:master Aug 5, 2023
7 checks passed
@wwmayer wwmayer deleted the qt_6_4_port branch August 5, 2023 12:35
@wwmayer
Copy link
Contributor Author

wwmayer commented Aug 5, 2023

@chennes
What about the line: qAsConst(ui->filterButton)->addAction(action); ? Shouldn't we replace it with ui->filterButton->addAction(action);

Btw, the same line occurs in TaskSketcherConstraints::TaskSketcherConstraints

@chennes
Copy link
Member

chennes commented Aug 5, 2023

Yes, I figured we'd do the forward-looking deprecations in a separate PR -- what we have now should work fine with Qt 6.4, I was testing on a version of 6.6 from git in my comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party: Qt 6 Issue related to Qt 6 Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB Sketcher Related to the Sketcher Workbench
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants