From c82aace7b6549cadce10365b5ea401a28be9b230 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 21 Feb 2025 12:20:15 +1000 Subject: [PATCH] Show tooltips for column headings in Execute SQL dialog --- src/core/qgsqueryresultmodel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/qgsqueryresultmodel.cpp b/src/core/qgsqueryresultmodel.cpp index 57f653714741..451b61cbf61d 100644 --- a/src/core/qgsqueryresultmodel.cpp +++ b/src/core/qgsqueryresultmodel.cpp @@ -143,9 +143,17 @@ QVariant QgsQueryResultModel::data( const QModelIndex &index, int role ) const QVariant QgsQueryResultModel::headerData( int section, Qt::Orientation orientation, int role ) const { - if ( orientation == Qt::Orientation::Horizontal && role == Qt::ItemDataRole::DisplayRole && section < mColumns.count() ) + if ( orientation == Qt::Orientation::Horizontal && section < mColumns.count() ) { - return mColumns.at( section ); + switch ( role ) + { + case Qt::ItemDataRole::DisplayRole: + case Qt::ItemDataRole::ToolTipRole: + return mColumns.at( section ); + + default: + break; + } } return QAbstractTableModel::headerData( section, orientation, role ); }