-
Notifications
You must be signed in to change notification settings - Fork 491
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 warnings #1087
Merged
Merged
Fix warnings #1087
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merged
jcfr
force-pushed
the
fix-warnings
branch
2 times, most recently
from
April 17, 2023 08:04
535bb84
to
693b85c
Compare
This commit adds the comment recognized by the GCC when using Qt < 5.8. See https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough It fixes warnings like the following: /path/to/CTK/Libs/PluginFramework/ctkPlugin_p.cpp:350:5: warning: this statement may fall through [-Wimplicit-fallthrough=] 350 | if (operation.fetchAndAddOrdered(0) == ACTIVATING) return; // finalization already in progress. | ^~
This commit fixes warnings like the following: /path/to/CTK/Libs/PluginFramework/ctkPlugin_p.cpp:532:29: warning: ‘T* QWeakPointer<T>::data() const [with T = ctkPlugin]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations] 532 | this->q_func().data()->start(); | ^
This commit fixes the following warning: /path/to/CTK/Libs/PluginFramework/ctkPlugin_p.cpp:544:17: warning: catching polymorphic type ‘class std::bad_cast’ by value [-Wcatch-value=] 544 | catch (std::bad_cast) | ^~~~~~~~
This commit fixes warnings like the following: /path/to/CTK/Libs/Widgets/Testing/Cpp/ctkCheckableHeaderViewTest1.cpp:76:73: warning: passing ‘Qt::CheckState’ chooses ‘int’ over ‘uint’ {aka ‘unsigned int’} [-Wsign-promo] 76 | model.setHeaderData(0, Qt::Horizontal, Qt::Checked, Qt::CheckStateRole); |
This commit removes function that became obsolete in b9d0ab9 (Apply ValueProxy to widgets min and max ) and fixes the following warning: /path/to/CTK/Libs/Widgets/Testing/Cpp/ctkCoordinatesWidgetValueProxyTest.cpp:75:9: warning: ‘QString {anonymous}::coordinatesFromValue(double)’ defined but not used [-Wunused-function] 75 | QString coordinatesFromValue(double val) | ^~~~~~~~~~~~~~~~~~~~
… std::list This commit fixes the following warning: /path/to/CTK/Libs/PluginFramework/ctkPluginAbstractTracked_p.h:251:3: warning: ‘template<class T> class QLinkedList’ is deprecated: Use std::list instead [-Wdeprecated-declarations] 251 | QLinkedList<S> initial; | ^~~~~~~~~~~
This commit fixes warnings like the following by leveraging ctkUtils functions. /path/to/CTK/Libs/PluginFramework/ctkPluginAbstractTracked_p.h:251:3: warning: ‘template<class T> class QLinkedList’ is deprecated: Use std::list instead [-Wdeprecated-declarations] 251 | QLinkedList<S> initial; | ^~~~~~~~~~~
This commit fixes the following warning: /path/to/CTK/Libs/DICOM/Core/ctkDICOMItem.cpp: In member function ‘QString ctkDICOMItem::Decode(const DcmTag&, const OFString&) const’: /path/to/CTK/Libs/DICOM/Core/ctkDICOMItem.cpp:432:38: warning: comparison is always true due to limited range of data type [-Wtype-limits] if (32 <= raw[i] && raw[i] < 128) ^
This commit fixes the following warning introduced in 7b48c48 (ENH: Add support for PBR material properties in material property widgets): In file included from /path/to/CTK/Libs/Visualization/VTK/Widgets/ctkVTKSurfaceMaterialPropertyWidget.h:25:0, from /path/to/CTK-build/CTK-build/Libs/Visualization/VTK/Widgets/ui_ctkVTKPropertyWidget.h:27, from /path/to/CTK/Libs/Visualization/VTK/Widgets/ctkVTKPropertyWidget.cpp:26: /path/to/CTK/Libs/Widgets/ctkMaterialPropertyWidget.h:183:16: warning: ‘virtual void ctkMaterialPropertyWidget::onInterpolationModeChanged(int)’ was hidden [-Woverloaded-virtual] virtual void onInterpolationModeChanged(int interpolationModeIndex); ^ In file included from /path/to/CTK-build/CTK-build/Libs/Visualization/VTK/Widgets/ui_ctkVTKPropertyWidget.h:27:0, from /path/to/CTK/Libs/Visualization/VTK/Widgets/ctkVTKPropertyWidget.cpp:26: /path/to/CTK/Libs/Visualization/VTK/Widgets/ctkVTKSurfaceMaterialPropertyWidget.h:59:16: warning: by ‘virtual void ctkVTKSurfaceMaterialPropertyWidget::onInterpolationModeChanged(ctkMaterialPropertyWidget::InterpolationMode)’ [-Woverloaded-virtual] virtual void onInterpolationModeChanged(ctkMaterialPropertyWidget::InterpolationMode newMode); ^
This commit fixes the following warning using QAtomicInteger::loadRelaxed introduced in Qt 5.14: /path/to/CTK/Libs/PluginFramework/ctkPluginAbstractTracked.tpp:284:28: warning: ‘T QBasicAtomicInteger<T>::load() const [with T = int]’ is deprecated: Use loadRelaxed [-Wdeprecated-declarations] 284 | return trackingCount.load(); | ~~~~~~~~~~~~~~~~~~^~
This commit fixes the following warning: /path/to/CTK/Libs/Widgets/ctkTransferFunctionView.cpp: In member function ‘virtual void ctkTransferFunctionView::resizeEvent(QResizeEvent*)’: /path/to/CTK/Libs/Widgets/ctkTransferFunctionView.cpp:96:29: warning: ‘void QGraphicsView::setMatrix(const QMatrix&, bool)’ is deprecated: Use setTransform() [-Wdeprecated-declarations] 96 | this->setMatrix(zoomMatrix); | ^ In file included from /path/to/Qt/5.15.2/gcc_64/include/QtWidgets/QGraphicsView:1, from /path/to/CTK/Libs/Widgets/ctkTransferFunctionView.h:25, from /path/to/CTK/Libs/Widgets/ctkTransferFunctionView.cpp:33: /path/to/Qt/5.15.2/gcc_64/include/QtWidgets/qgraphicsview.h:170:48: note: declared here 170 | QT_DEPRECATED_X("Use setTransform()") void setMatrix(const QMatrix &matrix, bool combine = false); |
This commit fixes warnings like the following: /path/to/CTK/Libs/Widgets/ctkTreeComboBox.cpp:294:68: warning: ‘void QWidget::getContentsMargins(int*, int*, int*, int*) const’ is deprecated: use contentsMargins() [-Wdeprecated-declarations] 294 | container->getContentsMargins(0, &marginTop, 0, &marginBottom); | ^
This commit fixes warning like the following: /path/to/CTK/Applications/ctkDICOMHost/Testing/Cpp/ctkDICOMHostTest1.cpp:34:24: warning: ‘void QProcess::start(const QString&, QIODevice::OpenMode)’ is deprecated: Use QProcess::start(const QString &program, const QStringList &arguments,OpenMode mode = ReadWrite) instead [-Wdeprecated-declarations] 34 | process.start(command); | ^
This commit fixes warnings like the following: /path/to/CTK/Libs/CommandLineModules/Backend/LocalProcess/ctkCmdLineModuleProcessWatcher.cpp:104:26: warning: ‘Q_PID QProcess::pid() const’ is deprecated: Use processId() instead [-Wdeprecated-declarations] 104 | if (::kill(process.pid(), SIGSTOP)) | ^
jamesobutler
force-pushed
the
fix-warnings
branch
from
June 3, 2023 18:54
693b85c
to
b83b84a
Compare
jamesobutler
approved these changes
Jun 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These fixes are confirmed to build with all CTK options enabled for both Qt4 and Qt5