Skip to content

Commit

Permalink
PG source select: remove initial newlines from table comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 23, 2019
1 parent 5ec15b8 commit 312ac93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/providers/postgres/qgspgtablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty &layerProper
if ( ! layerProperty.tableComment.isEmpty() )
{
// word wrap
commentItem->setToolTip( QStringLiteral( "<span>%1</span>" ).arg( layerProperty.tableComment ).replace( '\n', QStringLiteral( "<br/>" ) ) );
QString commentText { layerProperty.tableComment };
commentText.replace( QRegularExpression( QStringLiteral( "^\n*" ) ), QString() );
commentItem->setText( commentText );
commentItem->setToolTip( QStringLiteral( "<span>%1</span>" ).arg( commentText.replace( '\n', QStringLiteral( "<br/>" ) ) ) );
commentItem->setTextAlignment( Qt::AlignTop );
}
QStandardItem *geomItem = new QStandardItem( layerProperty.geometryColName );
Expand Down

0 comments on commit 312ac93

Please sign in to comment.