Skip to content

Commit

Permalink
Show tooltips for column headings in Execute SQL dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 21, 2025
1 parent 6e79352 commit c82aace
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/qgsqueryresultmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down

0 comments on commit c82aace

Please sign in to comment.