PG source select: remove initial newlines from table comments

This commit is contained in:
Alessandro Pasotti 2019-10-23 15:06:58 +02:00
parent 5ec15b8ea2
commit 312ac93b58

View File

@ -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 );