@@ -14,7 +14,7 @@ email : matthias@opengis.ch
14
14
***************************************************************************/
15
15
16
16
#include < QButtonGroup>
17
-
17
+ # include < QToolButton >
18
18
19
19
#include " qgsgeometryvalidationdock.h"
20
20
#include " qgsgeometryvalidationmodel.h"
@@ -39,6 +39,7 @@ QgsGeometryValidationDock::QgsGeometryValidationDock( const QString &title, QgsM
39
39
QFont font = mProblemDescriptionLabel ->font ();
40
40
font.setBold ( true );
41
41
mProblemDescriptionLabel ->setFont ( font );
42
+ mErrorListView ->setAlternatingRowColors ( true );
42
43
43
44
connect ( mNextButton , &QPushButton::clicked, this , &QgsGeometryValidationDock::gotoNextError );
44
45
connect ( mPreviousButton , &QPushButton::clicked, this , &QgsGeometryValidationDock::gotoPreviousError );
@@ -166,20 +167,24 @@ void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex ¤
166
167
QgsGeometryCheckError *error = current.data ( QgsGeometryValidationModel::GeometryCheckErrorRole ).value <QgsGeometryCheckError *>();
167
168
if ( error )
168
169
{
169
- while ( QPushButton *btn = mResolutionWidget ->findChild <QPushButton *>() )
170
- delete btn;
171
170
const QStringList resolutionMethods = error->check ()->resolutionMethods ();
171
+ QGridLayout *layout = new QGridLayout ( mResolutionWidget );
172
172
int resolutionIndex = 0 ;
173
173
for ( const QString &resolutionMethod : resolutionMethods )
174
174
{
175
- QPushButton *resolveBtn = new QPushButton ( resolutionMethod );
175
+ QToolButton *resolveBtn = new QToolButton ( mResolutionWidget );
176
+ resolveBtn->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /algorithms/mAlgorithmCheckGeometry.svg" ) ) );
177
+ layout->addWidget ( resolveBtn, resolutionIndex, 0 );
178
+ QLabel *resolveLabel = new QLabel ( resolutionMethod, mResolutionWidget );
179
+ resolveLabel->setWordWrap ( true );
180
+ layout->addWidget ( resolveLabel, resolutionIndex, 1 );
176
181
connect ( resolveBtn, &QPushButton::clicked, this , [resolutionIndex, error, this ]()
177
182
{
178
183
mGeometryValidationService ->fixError ( error, resolutionIndex );
179
184
} );
180
- mResolutionWidget ->layout ()->addWidget ( resolveBtn );
181
185
resolutionIndex++;
182
186
}
187
+ mResolutionWidget ->setLayout ( layout );
183
188
}
184
189
185
190
bool hasFeature = !FID_IS_NULL ( current.data ( QgsGeometryValidationModel::ErrorFeatureIdRole ) );
0 commit comments