Skip to content

Commit

Permalink
fix builds with older compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 20, 2015
1 parent 90053c5 commit 22f0f25
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
43 changes: 26 additions & 17 deletions python/core/qgseditformconfig.sip
Expand Up @@ -57,7 +57,6 @@ class QgsEditFormConfig : QObject
SuppressOff = 2 //!< Do not suppress feature form
};


/**
* This is only useful in combination with EditorLayout::TabLayout.
*
Expand Down Expand Up @@ -93,12 +92,6 @@ class QgsEditFormConfig : QObject
void setUiForm( const QString& ui );








// Widget stuff

/**
Expand Down Expand Up @@ -126,7 +119,7 @@ class QgsEditFormConfig : QObject
* <li>WebView (QgsWebViewWidgetWrapper)</li>
* </ul>
*
* @param attrIdx Index of the field
* @param fieldIdx Index of the field
* @param widgetType Type id of the editor widget to use
*/
void setWidgetType( int fieldIdx, const QString& widgetType );
Expand Down Expand Up @@ -189,15 +182,13 @@ class QgsEditFormConfig : QObject
QgsEditorWidgetConfig widgetConfig( const QString& fieldName ) const;

/**
* If this returns true, the field is manually set to read only.
* This returns true if the field is manually set to read only or if the field
* does not support editing like joins or vitual fields.
*/
bool readOnly( int idx );

/**
* If set to false, the widget at the given index will be read-only, regardless of the
* layer's editable state and data provider capacities.
* If it is set to true, the widget's editable state will be synchronized with the layer's
* edit state.
* If set to false, the widget at the given index will be read-only.
*/
void setReadOnly(int idx, bool readOnly );

Expand Down Expand Up @@ -229,16 +220,32 @@ class QgsEditFormConfig : QObject
// Python stuff


/** Get python function for edit form initialization */
/**
* Get python function for edit form initialization.
* Will be looked up in a python file relative to the project folder if it
* includes a module name or if it's a pure function name it will searched
* in the python code set with @link setInitCode @endlink.
*/
QString initFunction() const;

/** Set python function for edit form initialization */
/**
* Set python function for edit form initialization.
* Will be looked up in a python file relative to the project folder if it
* includes a module name or if it's a pure function name it will searched
* in the python code set with @link setInitCode @endlink.
*/
void setInitFunction( const QString& function );

/** Get python code for edit form initialization */
/**
* Get python code for edit form initialization.
*/
QString initCode() const;

/** Set python code for edit form initialization */
/**
* Get python code for edit form initialization.
* Make sure that you also set the appropriate function name in
* @link setInitFunction @endlink
*/
void setInitCode( const QString& code );

/** Return if python code shall be loaded for edit form initialization */
Expand All @@ -247,6 +254,8 @@ class QgsEditFormConfig : QObject
/** Set if python code shall be used for edit form initialization */
void setUseInitCode( const bool useCode );

/** Type of feature form pop-up suppression after feature creation (overrides app setting) */
FeatureFormSuppress suppress() const;
/** Set type of feature form pop-up suppression after feature creation (overrides app setting) */
void setSuppress( FeatureFormSuppress s );
};
14 changes: 7 additions & 7 deletions src/app/qgsfieldsproperties.cpp
Expand Up @@ -43,9 +43,9 @@
QgsFieldsProperties::QgsFieldsProperties( QgsVectorLayer *layer, QWidget* parent )
: QWidget( parent )
, mLayer( layer )
, mDesignerTree( nullptr )
, mFieldsList( nullptr )
, mRelationsList( nullptr )
, mDesignerTree( 0 )
, mFieldsList( 0 )
, mRelationsList( 0 )
{
if ( !layer )
return;
Expand Down Expand Up @@ -921,12 +921,12 @@ QStringList QgsFieldsProperties::DragList::mimeTypes() const
QMimeData* QgsFieldsProperties::DragList::mimeData( const QList<QTableWidgetItem*> items ) const
{
if ( items.count() <= 0 )
return nullptr;
return 0;

QStringList types = mimeTypes();

if ( types.isEmpty() )
return nullptr;
return 0;

QMimeData* data = new QMimeData();
QString format = types.at( 0 );
Expand Down Expand Up @@ -1091,12 +1091,12 @@ QStringList QgsFieldsProperties::DesignerTree::mimeTypes() const
QMimeData* QgsFieldsProperties::DesignerTree::mimeData( const QList<QTreeWidgetItem*> items ) const
{
if ( items.count() <= 0 )
return nullptr;
return 0;

QStringList types = mimeTypes();

if ( types.isEmpty() )
return nullptr;
return 0;

QMimeData* data = new QMimeData();
QString format = types.at( 0 );
Expand Down
9 changes: 1 addition & 8 deletions src/core/qgseditformconfig.h
Expand Up @@ -343,12 +343,6 @@ class CORE_EXPORT QgsEditFormConfig : public QObject
void setUiForm( const QString& ui );








// Widget stuff

/**
Expand Down Expand Up @@ -505,7 +499,6 @@ class CORE_EXPORT QgsEditFormConfig : public QObject
*/
void setInitCode( const QString& code ) { mEditFormInitCode = code; }


/** Return if python code shall be loaded for edit form initialization */
bool useInitCode() const { return mUseInitCode; }

Expand All @@ -526,7 +519,7 @@ class CORE_EXPORT QgsEditFormConfig : public QObject
/**
* Create a new edit form config. Normally invoked by QgsVectorLayer
*/
explicit QgsEditFormConfig( QObject* parent = nullptr );
explicit QgsEditFormConfig( QObject* parent = 0 );

private:

Expand Down

0 comments on commit 22f0f25

Please sign in to comment.