diff mbox series

[18/34] kernelshark: Fix detaching-temporary Clazy warning

Message ID 20240114171723.14092-19-dev@benjarobin.fr (mailing list archive)
State Accepted
Commit d19c721ea37bacd1fc93337653131f8a64049a7d
Headers show
Series Fix kernelshark issues introduced by the migration to Qt6 | expand

Commit Message

Benjamin ROBIN Jan. 14, 2024, 5:17 p.m. UTC
Use QList::at() instead of QList::operator[]()

Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr>
---
 src/KsTraceViewer.cpp | 4 ++--
 src/KsUtils.hpp       | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/KsTraceViewer.cpp b/src/KsTraceViewer.cpp
index 5e8e63f..86e9185 100644
--- a/src/KsTraceViewer.cpp
+++ b/src/KsTraceViewer.cpp
@@ -624,11 +624,11 @@  void KsTraceViewer::_resizeToContents()
 	 * column by hand.
 	 */
 	col = KsViewModel::TRACE_VIEW_COL_STREAM;
-	columnSize = STRING_WIDTH(_model.header()[col]) + FONT_WIDTH;
+	columnSize = STRING_WIDTH(_model.header().at(col)) + FONT_WIDTH;
 	_view.setColumnWidth(col, columnSize);
 
 	col = KsViewModel::TRACE_VIEW_COL_CPU;
-	columnSize = STRING_WIDTH(_model.header()[col]) + FONT_WIDTH * 2;
+	columnSize = STRING_WIDTH(_model.header().at(col)) + FONT_WIDTH * 2;
 	_view.setColumnWidth(col, columnSize);
 
 	col = KsViewModel::TRACE_VIEW_COL_INDEX;
diff --git a/src/KsUtils.hpp b/src/KsUtils.hpp
index 85f81c3..67af99a 100644
--- a/src/KsUtils.hpp
+++ b/src/KsUtils.hpp
@@ -25,10 +25,10 @@ 
 #include "KsPlotTools.hpp"
 
 /** Macro providing the height of the screen in pixels. */
-#define SCREEN_HEIGHT  QGuiApplication::screens()[0]->geometry().height()
+#define SCREEN_HEIGHT  QGuiApplication::screens().at(0)->geometry().height()
 
 /** Macro providing the width of the screen in pixels. */
-#define SCREEN_WIDTH   QGuiApplication::screens()[0]->geometry().width()
+#define SCREEN_WIDTH   QGuiApplication::screens().at(0)->geometry().width()
 
 //! @cond Doxygen_Suppress