Skip to content
Permalink
Browse files

fix builds with older compilers

  • Loading branch information
jef-n committed Nov 20, 2015
1 parent 90053c5 commit 22f0f253641fb4cdce07bc41a433e304149eb0c3
Showing with 34 additions and 32 deletions.
  1. +26 −17 python/core/qgseditformconfig.sip
  2. +7 −7 src/app/qgsfieldsproperties.cpp
  3. +1 −8 src/core/qgseditformconfig.h
@@ -57,7 +57,6 @@ class QgsEditFormConfig : QObject
SuppressOff = 2 //!< Do not suppress feature form
};


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








// Widget stuff

/**
@@ -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 );
@@ -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 );

@@ -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 */
@@ -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 );
};
@@ -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;
@@ -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 );
@@ -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 );
@@ -343,12 +343,6 @@ class CORE_EXPORT QgsEditFormConfig : public QObject
void setUiForm( const QString& ui );








// Widget stuff

/**
@@ -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; }

@@ -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:

0 comments on commit 22f0f25

Please sign in to comment.
You can’t perform that action at this time.