4
4
QgsEditFormConfig::QgsEditFormConfig ( QObject* parent )
5
5
: QObject( parent )
6
6
, mEditorLayout( GeneratedLayout )
7
- , mUseInitCode( false )
8
7
, mFeatureFormSuppress( SuppressDefault )
8
+ , mUseInitCode( false )
9
9
{
10
10
connect ( QgsProject::instance ()->relationManager (), SIGNAL ( relationsLoaded () ), this , SLOT ( onRelationsLoaded () ) );
11
11
}
@@ -72,17 +72,17 @@ void QgsEditFormConfig::setUiForm( const QString& ui )
72
72
mEditForm = ui;
73
73
}
74
74
75
- bool QgsEditFormConfig::fieldEditable ( int idx )
75
+ bool QgsEditFormConfig::readOnly ( int idx )
76
76
{
77
77
if ( idx >= 0 && idx < mFields .count () )
78
78
{
79
79
if ( mFields .fieldOrigin ( idx ) == QgsFields::OriginJoin
80
80
|| mFields .fieldOrigin ( idx ) == QgsFields::OriginExpression )
81
- return false ;
82
- return mFieldEditables .value ( mFields .at ( idx ).name (), true );
81
+ return true ;
82
+ return ! mFieldEditables .value ( mFields .at ( idx ).name (), true );
83
83
}
84
84
else
85
- return true ;
85
+ return false ;
86
86
}
87
87
88
88
bool QgsEditFormConfig::labelOnTop ( int idx )
@@ -93,10 +93,10 @@ bool QgsEditFormConfig::labelOnTop( int idx )
93
93
return false ;
94
94
}
95
95
96
- void QgsEditFormConfig::setFieldEditable ( int idx, bool editable )
96
+ void QgsEditFormConfig::setReadOnly ( int idx, bool readOnly )
97
97
{
98
98
if ( idx >= 0 && idx < mFields .count () )
99
- mFieldEditables [ mFields .at ( idx ).name ()] = editable ;
99
+ mFieldEditables [ mFields .at ( idx ).name ()] = !readOnly ;
100
100
}
101
101
102
102
void QgsEditFormConfig::setLabelOnTop ( int idx, bool onTop )
0 commit comments