@@ -1192,6 +1192,7 @@ void QgsAttributeForm::init()
1192
1192
tabWidget = nullptr ;
1193
1193
WidgetInfo widgetInfo = createWidgetFromDef ( widgDef, container, mLayer , mContext );
1194
1194
QLabel *label = new QLabel ( widgetInfo.labelText );
1195
+ label->setToolTip ( QStringLiteral ( " <b>%1</b><p>%2</p>" ).arg ( widgetInfo.labelText , widgetInfo.hint ) );
1195
1196
if ( columnCount > 1 && !widgetInfo.labelOnTop )
1196
1197
{
1197
1198
label->setAlignment ( Qt::AlignRight | Qt::AlignVCenter );
@@ -1277,6 +1278,7 @@ void QgsAttributeForm::init()
1277
1278
1278
1279
// This will also create the widget
1279
1280
QLabel *l = new QLabel ( fieldName );
1281
+ l->setToolTip ( QStringLiteral ( " <b>%1</b><p>%2</p>" ).arg ( fieldName, field.comment () ) );
1280
1282
QSvgWidget *i = new QSvgWidget ();
1281
1283
i->setFixedSize ( 18 , 18 );
1282
1284
@@ -1599,6 +1601,7 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
1599
1601
1600
1602
newWidgetInfo.labelOnTop = mLayer ->editFormConfig ().labelOnTop ( fieldDef->idx () );
1601
1603
newWidgetInfo.labelText = mLayer ->attributeDisplayName ( fieldDef->idx () );
1604
+ newWidgetInfo.hint = mLayer ->fields ().at ( fieldDef->idx () ).comment ();
1602
1605
newWidgetInfo.showLabel = widgetDef->showLabel ();
1603
1606
1604
1607
break ;
@@ -1687,6 +1690,7 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
1687
1690
else
1688
1691
{
1689
1692
QLabel *mypLabel = new QLabel ( widgetInfo.labelText );
1693
+ mypLabel->setToolTip ( QStringLiteral ( " <b>%1</b><p>%2</p>" ).arg ( widgetInfo.labelText , widgetInfo.hint ) );
1690
1694
if ( columnCount > 1 && !widgetInfo.labelOnTop )
1691
1695
{
1692
1696
mypLabel->setAlignment ( Qt::AlignRight | Qt::AlignVCenter );
0 commit comments