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 deprecations #2192

Merged
merged 13 commits into from Dec 7, 2020
Merged

Fix deprecations #2192

merged 13 commits into from Dec 7, 2020

Conversation

txtsd
Copy link
Contributor

@txtsd txtsd commented Nov 28, 2020

I've replaced most of the deprecated methods with recommended ones.

I haven't touched any QTime methods since QElapsedTimer is monotonic and doesn't allow for conversion to human readable time. I've seen at least one instance of conversion to human readable time.
I also haven't touched QJSEngine because there is no alternative for the deprecated method.
There is another deprecation warning, but it didn't make sense to me so I left it alone. It's just a return nullptr but the output is this:

/home/txtsd/git/imgbrd-grabber/src/gui/src/ui/fixed-size-grid-layout.cpp: In member function ‘virtual Qt::Orientations FixedSizeGridLayout::expandingDirections() const’:
/home/txtsd/git/imgbrd-grabber/src/gui/src/ui/fixed-size-grid-layout.cpp:89:9: warning: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = Qt::Orientation; QFlags<T>::Zero = int QFlags<Qt::Orientation>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
   89 |  return nullptr;
      |         ^~~~~~~
In file included from /usr/include/qt/QtCore/qglobal.h:1304,
                 from /usr/include/qt/QtGui/qtguiglobal.h:43,
                 from /usr/include/qt/QtWidgets/qtwidgetsglobal.h:43,
                 from /usr/include/qt/QtWidgets/qlayout.h:43,
                 from /usr/include/qt/QtWidgets/QLayout:1,
                 from /home/txtsd/git/imgbrd-grabber/src/gui/src/ui/fixed-size-grid-layout.h:4,
                 from /home/txtsd/git/imgbrd-grabber/src/gui/src/ui/fixed-size-grid-layout.cpp:1:
/usr/include/qt/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |       

Let me know if any behavior has changed.

@lgtm-com
Copy link

lgtm-com bot commented Nov 28, 2020

This pull request fixes 12 alerts when merging fb3ce09 into 6f4d5c1 - view on LGTM.com

fixed alerts:

  • 7 for FIXME comment
  • 3 for Resource not released in destructor
  • 1 for Multiplication result converted to larger type
  • 1 for Comparison result is always the same

@Bionus Bionus self-requested a review November 28, 2020 17:16
@Bionus Bionus added the build label Nov 28, 2020
@lgtm-com
Copy link

lgtm-com bot commented Nov 28, 2020

This pull request fixes 12 alerts when merging fb3ce09 into 6f4d5c1 - view on LGTM.com

fixed alerts:

  • 7 for FIXME comment
  • 3 for Resource not released in destructor
  • 1 for Multiplication result converted to larger type
  • 1 for Comparison result is always the same

Copy link
Owner

@Bionus Bionus left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

I'll see how much it prevents earlier systems from building it. Even though I don't mind dropping support for building on old systems.

src/gui/src/viewer/zoom-window.cpp Outdated Show resolved Hide resolved
src/gui/src/viewer/zoom-window.cpp Outdated Show resolved Hide resolved
src/gui/src/viewer/zoom-window.cpp Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Nov 29, 2020

This pull request fixes 12 alerts when merging a764cf9 into 6f4d5c1 - view on LGTM.com

fixed alerts:

  • 7 for FIXME comment
  • 3 for Resource not released in destructor
  • 1 for Multiplication result converted to larger type
  • 1 for Comparison result is always the same

@Bionus Bionus merged commit f63b71a into Bionus:develop Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants