From 8b17b911711d250f09fe81c7fe5ee380d252b919 Mon Sep 17 00:00:00 2001 From: saturneric Date: Thu, 17 Apr 2025 22:56:38 +0200 Subject: fix: qt5 build issues --- src/core/model/GpgKeyTableModel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/model/GpgKeyTableModel.cpp') diff --git a/src/core/model/GpgKeyTableModel.cpp b/src/core/model/GpgKeyTableModel.cpp index d5de3844..0938fbe0 100644 --- a/src/core/model/GpgKeyTableModel.cpp +++ b/src/core/model/GpgKeyTableModel.cpp @@ -53,7 +53,14 @@ GpgKeyTableModel::GpgKeyTableModel(int channel, auto GpgKeyTableModel::index(int row, int column, const QModelIndex &parent) const -> QModelIndex { if (!hasIndex(row, column, parent) || parent.isValid()) return {}; - return createIndex(row, column, &cached_items_[row]); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return createIndex(row, column, + static_cast(&cached_items_[row])); +#else + return createIndex( + row, column, + const_cast(static_cast(&cached_items_[row]))); +#endif } auto GpgKeyTableModel::rowCount(const QModelIndex & /*parent*/) const -> int { -- cgit v1.2.3