Skip to content

Commit c82aace

Browse files
committed
Show tooltips for column headings in Execute SQL dialog
1 parent 6e79352 commit c82aace

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/core/qgsqueryresultmodel.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,17 @@ QVariant QgsQueryResultModel::data( const QModelIndex &index, int role ) const
143143

144144
QVariant QgsQueryResultModel::headerData( int section, Qt::Orientation orientation, int role ) const
145145
{
146-
if ( orientation == Qt::Orientation::Horizontal && role == Qt::ItemDataRole::DisplayRole && section < mColumns.count() )
146+
if ( orientation == Qt::Orientation::Horizontal && section < mColumns.count() )
147147
{
148-
return mColumns.at( section );
148+
switch ( role )
149+
{
150+
case Qt::ItemDataRole::DisplayRole:
151+
case Qt::ItemDataRole::ToolTipRole:
152+
return mColumns.at( section );
153+
154+
default:
155+
break;
156+
}
149157
}
150158
return QAbstractTableModel::headerData( section, orientation, role );
151159
}

0 commit comments

Comments
 (0)