1313* *
1414***************************************************************************/
1515
16+ #include < QFont>
17+
1618#include " qgsfieldmodel.h"
1719#include " qgsmaplayermodel.h"
1820#include " qgsmaplayerproxymodel.h"
@@ -51,7 +53,7 @@ void QgsFieldModel::setLayer( QgsMapLayer *layer )
5153{
5254 if ( mLayer )
5355 {
54- disconnect ( mLayer , SIGNAL ( updatedFields () ), this , SLOT ( updateFields () ) );
56+ disconnect ( mLayer , SIGNAL ( updatedFields () ), this , SLOT ( updateModel () ) );
5557 disconnect ( mLayer , SIGNAL ( layerDeleted () ), this , SLOT ( layerDeleted () ) );
5658 }
5759
@@ -70,7 +72,7 @@ void QgsFieldModel::setLayer( QgsMapLayer *layer )
7072 }
7173
7274 mLayer = vl;
73- connect ( mLayer , SIGNAL ( updatedFields () ), this , SLOT ( updateFields () ) );
75+ connect ( mLayer , SIGNAL ( updatedFields () ), this , SLOT ( updateModel () ) );
7476 connect ( mLayer , SIGNAL ( layerDeleted () ), this , SLOT ( layerDeleted () ) );
7577 updateModel ();
7678}
@@ -241,7 +243,7 @@ QVariant QgsFieldModel::data( const QModelIndex &index, int role ) const
241243 return alias;
242244 }
243245
244- case Qt::BackgroundRole :
246+ case Qt::ForegroundRole :
245247 {
246248 if ( exprIdx >= 0 )
247249 {
@@ -253,7 +255,7 @@ QVariant QgsFieldModel::data( const QModelIndex &index, int role ) const
253255 exp.evaluate ( &mFeature , mLayer ->pendingFields () );
254256 if ( exp.hasEvalError () )
255257 {
256- return QBrush ( QColor ( 240 , 60 , 60 , 180 ) );
258+ return QBrush ( QColor ( Qt::red ) );
257259 }
258260 }
259261 }
@@ -265,7 +267,7 @@ QVariant QgsFieldModel::data( const QModelIndex &index, int role ) const
265267 if ( exprIdx >= 0 )
266268 {
267269 // if the line is an expression, set it as italic
268- QFont font;
270+ QFont font = QFont () ;
269271 font.setItalic ( true );
270272 return font;
271273 }
0 commit comments