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 additional warnings #1098

Merged
merged 12 commits into from
Jun 15, 2023
Merged

Fix additional warnings #1098

merged 12 commits into from
Jun 15, 2023

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented Jun 15, 2023

No description provided.

jcfr added 12 commits June 15, 2023 01:52
This commit fixes warnings like the following:

/path/to/CTK/Libs/Widgets/ctkRangeSlider.cpp:776:26: warning: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = ctkRangeSliderPrivate::Handle; QFlags<T>::Zero = int QFlags<ctkRangeSliderPrivate::Handle>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  776 |   d->m_SelectedHandles = 0;
      |                          ^
List of changes:

$ git shortlog 9c321151f..2e967e902 --no-merges
Jean-Christophe Fillion-Robin (10):
      COMP: Remove deprecated use of QLinkedList in Qt >= 5.15
      STYLE: Strip trailing spaces
      STYLE: Convert tabs into spaces
      STYLE: Improve attribution by ignoring bulk formatting
      STYLE: Ignore indentation and trailing space changes in blame history
      COMP: Remove deprecated use of QString::sprintf with  Qt >= 5.15
      STYLE: Convert CMake-language commands to lower case
      STYLE: Remove CMake-language block-end command arguments
      STYLE: Ignore cmake style changes in blame history
      COMP: Update CMake minimum required version from 2.8.12 to 3.0
This commit fixes warning like the following:

/path/to/CTK/Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppLogic.cpp:307:58: warning: ‘const QPixmap* QLabel::pixmap() const’ is deprecated: Use the other overload which returns QPixmap by-value [-Wdeprecated-declarations]
  307 |   const QPixmap* pixmap = ui.PlaceHolderForImage->pixmap();
      |                                                          ^
List of changes:

$ git shortlog b5324a213..a86bee551 --no-merges
Jean-Christophe Fillion-Robin (3):
      COMP: Fix split deprecation warnings using Qt::SkipEmptyParts
      COMP: Fix QString::null deprecation warnings
      COMP: Fix deprecated use of QWheelEvent functions delta(), pos(), x(), y()
This commit fixes the following warnings:

/path/to/CTK/Libs/Visualization/VTK/Widgets/ctkVTKRenderViewEventTranslator.cpp:77:45: warning: ‘int QWheelEvent::x() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   77 |         double normalized_x = wheelEvent->x()/static_cast<double>(size.width()/2.0);
      |                                             ^

/path/to/CTK/Libs/Visualization/VTK/Widgets/ctkVTKRenderViewEventTranslator.cpp:78:45: warning: ‘int QWheelEvent::y() const’ is deprecated: Use position() [-Wdeprecated-declarations]
   78 |         double normalized_y = wheelEvent->y()/static_cast<double>(size.height()/2.0);
      |                                             ^

/path/to/CTK/Libs/Visualization/VTK/Widgets/ctkVTKRenderViewEventTranslator.cpp:79:42: warning: ‘int QWheelEvent::delta() const’ is deprecated: Use angleDelta() [-Wdeprecated-declarations]
   79 |         int numStep = (wheelEvent->delta() > 0 ) ? 1 : 0;
      |                                          ^
This commit fixes a regression introduced in 8ec9136 (COMP: Fix Qt4
build adding fallback implementation for qUtf8Printable())

It addresses error like the following:

  In file included from /path/to/CTK/Libs/PluginFramework/ctkPluginConstants.h:27,
                   from /path/to/CTK/Plugins/org.commontk.eventadmin/Testing/Cpp/ctkEventAdminImplPerfTestMain.cpp:26:
  /path/to/CTK-build/CTK-build/Libs/PluginFramework/ctkPluginFrameworkExport.h:11:10: fatal error: ctkCompatibility_p.h: No such file or directory
     11 | #include "ctkCompatibility_p.h"
        |          ^~~~~~~~~~~~~~~~~~~~~~
…lters()

This commit fixes the following warning:

/path/to/CTK/Libs/Widgets/ctkPathLineEdit.cpp:212:13: warning: ‘QStringList {anonymous}::ctkFileCompleter::nameFilters() const’ defined but not used [-Wunused-function]
  212 | QStringList ctkFileCompleter::nameFilters() const
      |             ^~~~~~~~~~~~~~~~
…tings

This commit fixes the following warning:

/path/to/CTK/Libs/Widgets/ctkSettings.cpp:138:74: warning: ‘int QDesktopWidget::primaryScreen() const’ is deprecated: Use QGuiApplication::primaryScreen() [-Wdeprecated-declarations]
  138 |     QRect desktopRect = desktop.availableGeometry( desktop.primaryScreen() );
      |                                                                          ^
This commit fixes the following warning:

/path/to/CTK/Libs/Widgets/ctkTreeComboBox.cpp:243:48: warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
  243 |     QApplication::desktop()->screenNumber(this));
      |                                                ^
                                                                     ^
This commit fixes the following warning:

/path/to/CTK/Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKAbstractViewTest1.cpp:126:8: warning: unused variable ‘sliceViewWasPaused’ [-Wunused-variable]
  126 |   bool sliceViewWasPaused = sliceView.pauseRender();
      |        ^~~~~~~~~~~~~~~~~~
This commit fixes the following warning:

/path/to/CTK/Applications/ctkPluginBrowser/ctkQtResourcesTreeModel.cpp:195:12: warning: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = Qt::ItemFlag; QFlags<T>::Zero = int QFlags<Qt::ItemFlag>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
  195 |     return 0;
      |            ^
…tputTest1

This fixes the following warning:

/path/to/CTK/Libs/Widgets/Testing/Cpp/ctkErrorLogModelTerminalOutputTest1.cpp:127:87: warning: enum constant in boolean context [-Wint-in-bool-context]
  127 |                           currentTerminalOutputEnabled, ctkErrorLogTerminalOutput::All);
      |                                                                                       ^

It is a following of fc9a964 (Add multi-thread support to ErrorLog model)
where the boolean check was originally introduced.
@jcfr jcfr force-pushed the fix-additional-warnings branch from 61fca5e to 1e7646b Compare June 15, 2023 08:39
@jcfr jcfr enabled auto-merge (rebase) June 15, 2023 08:39
@jcfr jcfr merged commit aa4a717 into commontk:master Jun 15, 2023
@jcfr jcfr mentioned this pull request Jun 15, 2023
1 task
@jcfr jcfr deleted the fix-additional-warnings branch June 27, 2023 05: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.

1 participant