Skip to content
Permalink
Browse files

Constification

  • Loading branch information
m-kuhn committed Nov 20, 2015
1 parent 4180c1e commit 182dd8a36941918cf19640f0fdb9ac6d2b7c0375
Showing with 88 additions and 88 deletions.
  1. +3 −3 src/gui/editorwidgets/core/qgseditorwidgetwrapper.cpp
  2. +4 −4 src/gui/editorwidgets/core/qgseditorwidgetwrapper.h
  3. +4 −4 src/gui/editorwidgets/core/qgswidgetwrapper.cpp
  4. +5 −5 src/gui/editorwidgets/core/qgswidgetwrapper.h
  5. +2 −2 src/gui/editorwidgets/qgscheckboxwidgetwrapper.cpp
  6. +2 −2 src/gui/editorwidgets/qgscheckboxwidgetwrapper.h
  7. +2 −2 src/gui/editorwidgets/qgsclassificationwidgetwrapper.cpp
  8. +2 −2 src/gui/editorwidgets/qgsclassificationwidgetwrapper.h
  9. +2 −2 src/gui/editorwidgets/qgscolorwidgetwrapper.cpp
  10. +2 −2 src/gui/editorwidgets/qgscolorwidgetwrapper.h
  11. +2 −2 src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp
  12. +2 −2 src/gui/editorwidgets/qgsdatetimeeditwrapper.h
  13. +1 −1 src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.cpp
  14. +1 −1 src/gui/editorwidgets/qgsdefaultsearchwidgetwrapper.h
  15. +2 −2 src/gui/editorwidgets/qgsenumerationwidgetwrapper.cpp
  16. +2 −2 src/gui/editorwidgets/qgsenumerationwidgetwrapper.h
  17. +2 −2 src/gui/editorwidgets/qgsfilenamewidgetwrapper.cpp
  18. +2 −2 src/gui/editorwidgets/qgsfilenamewidgetwrapper.h
  19. +2 −2 src/gui/editorwidgets/qgshiddenwidgetwrapper.cpp
  20. +2 −2 src/gui/editorwidgets/qgshiddenwidgetwrapper.h
  21. +2 −2 src/gui/editorwidgets/qgsphotowidgetwrapper.cpp
  22. +2 −2 src/gui/editorwidgets/qgsphotowidgetwrapper.h
  23. +2 −2 src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
  24. +2 −2 src/gui/editorwidgets/qgsrangewidgetwrapper.h
  25. +2 −2 src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.cpp
  26. +2 −2 src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.h
  27. +1 −1 src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
  28. +1 −1 src/gui/editorwidgets/qgsrelationwidgetwrapper.h
  29. +2 −2 src/gui/editorwidgets/qgstexteditwrapper.cpp
  30. +2 −2 src/gui/editorwidgets/qgstexteditwrapper.h
  31. +2 −2 src/gui/editorwidgets/qgsuniquevaluewidgetwrapper.cpp
  32. +2 −2 src/gui/editorwidgets/qgsuniquevaluewidgetwrapper.h
  33. +2 −2 src/gui/editorwidgets/qgsuuidwidgetwrapper.cpp
  34. +2 −2 src/gui/editorwidgets/qgsuuidwidgetwrapper.h
  35. +1 −1 src/gui/editorwidgets/qgsvaluemapsearchwidgetwrapper.cpp
  36. +1 −1 src/gui/editorwidgets/qgsvaluemapsearchwidgetwrapper.h
  37. +2 −2 src/gui/editorwidgets/qgsvaluemapwidgetwrapper.cpp
  38. +2 −2 src/gui/editorwidgets/qgsvaluemapwidgetwrapper.h
  39. +1 −1 src/gui/editorwidgets/qgsvaluerelationsearchwidgetwrapper.cpp
  40. +1 −1 src/gui/editorwidgets/qgsvaluerelationsearchwidgetwrapper.h
  41. +2 −2 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
  42. +2 −2 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.h
  43. +2 −2 src/gui/editorwidgets/qgswebviewwidgetwrapper.cpp
  44. +2 −2 src/gui/editorwidgets/qgswebviewwidgetwrapper.h
@@ -26,20 +26,20 @@ QgsEditorWidgetWrapper::QgsEditorWidgetWrapper( QgsVectorLayer* vl, int fieldIdx
{
}

int QgsEditorWidgetWrapper::fieldIdx()
int QgsEditorWidgetWrapper::fieldIdx() const
{
return mFieldIdx;
}

QgsField QgsEditorWidgetWrapper::field()
QgsField QgsEditorWidgetWrapper::field() const
{
if ( mFieldIdx < layer()->fields().count() )
return layer()->fields().at( mFieldIdx );
else
return QgsField();
}

QVariant QgsEditorWidgetWrapper::defaultValue()
QVariant QgsEditorWidgetWrapper::defaultValue() const
{
return layer()->dataProvider()->defaultValue( mFieldIdx );
}
@@ -61,7 +61,7 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper
*
* @return The current value the widget represents
*/
virtual QVariant value() = 0;
virtual QVariant value() const = 0;

/**
* Access the field index.
@@ -70,7 +70,7 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper
*
* @see layer()
*/
int fieldIdx();
int fieldIdx() const;

/**
* Access the field.
@@ -79,7 +79,7 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper
*
* @see layer()
*/
QgsField field();
QgsField field() const;

/**
* Access the default value of the field.
@@ -88,7 +88,7 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper
*
* @see layer()
*/
QVariant defaultValue();
QVariant defaultValue() const;

/**
* Will return a wrapper for a given widget
@@ -52,7 +52,7 @@ void QgsWidgetWrapper::setContext( const QgsAttributeEditorContext &context )
mContext = context;
}

const QVariant QgsWidgetWrapper::config( const QString& key, const QVariant& defaultVal )
QVariant QgsWidgetWrapper::config( const QString& key, const QVariant& defaultVal ) const
{
if ( mConfig.contains( key ) )
{
@@ -61,17 +61,17 @@ const QVariant QgsWidgetWrapper::config( const QString& key, const QVariant& def
return defaultVal;
}

const QgsEditorWidgetConfig QgsWidgetWrapper::config()
QgsEditorWidgetConfig QgsWidgetWrapper::config() const
{
return mConfig;
}

const QgsAttributeEditorContext& QgsWidgetWrapper::context()
const QgsAttributeEditorContext& QgsWidgetWrapper::context() const
{
return mContext;
}

QgsVectorLayer* QgsWidgetWrapper::layer()
QgsVectorLayer* QgsWidgetWrapper::layer() const
{
return mLayer;
}
@@ -87,21 +87,21 @@ class GUI_EXPORT QgsWidgetWrapper : public QObject
*
* @return the value assigned to this configuration option
*/
const QVariant config( const QString& key, const QVariant& defaultVal = QVariant() );
QVariant config( const QString& key, const QVariant& defaultVal = QVariant() ) const;

/**
* Returns the whole config
*
* @return The configuration
*/
const QgsEditorWidgetConfig config();
QgsEditorWidgetConfig config() const;

/**
* Returns information about the context in which this widget is shown
*
* @return context information
*/
const QgsAttributeEditorContext& context();
const QgsAttributeEditorContext& context() const;

/**
* Access the QgsVectorLayer, you are working on
@@ -110,7 +110,7 @@ class GUI_EXPORT QgsWidgetWrapper : public QObject
*
* @see field()
*/
QgsVectorLayer* layer();
QgsVectorLayer* layer() const;

/**
* Will return a wrapper for a given widget
@@ -130,7 +130,7 @@ class GUI_EXPORT QgsWidgetWrapper : public QObject
*
* @note Added in 2.12
*/
virtual bool valid() = 0;
virtual bool valid() const = 0;

protected:
/**
@@ -23,7 +23,7 @@ QgsCheckboxWidgetWrapper::QgsCheckboxWidgetWrapper( QgsVectorLayer* vl, int fiel
}


QVariant QgsCheckboxWidgetWrapper::value()
QVariant QgsCheckboxWidgetWrapper::value() const
{
QVariant v;

@@ -53,7 +53,7 @@ void QgsCheckboxWidgetWrapper::initWidget( QWidget* editor )
connect( mGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( valueChanged( bool ) ) );
}

bool QgsCheckboxWidgetWrapper::valid()
bool QgsCheckboxWidgetWrapper::valid() const
{
return mCheckBox || mGroupBox;
}
@@ -41,12 +41,12 @@ class GUI_EXPORT QgsCheckboxWidgetWrapper : public QgsEditorWidgetWrapper

// QgsEditorWidgetWrapper interface
public:
QVariant value() override;
QVariant value() const override;

protected:
QWidget* createWidget( QWidget* parent ) override;
void initWidget( QWidget* editor ) override;
bool valid() override;
bool valid() const override;

public slots:
void setValue( const QVariant& value ) override;
@@ -24,7 +24,7 @@ QgsClassificationWidgetWrapper::QgsClassificationWidgetWrapper( QgsVectorLayer*
{
}

QVariant QgsClassificationWidgetWrapper::value()
QVariant QgsClassificationWidgetWrapper::value() const
{
return mComboBox->itemData( mComboBox->currentIndex() );
}
@@ -59,7 +59,7 @@ void QgsClassificationWidgetWrapper::initWidget( QWidget* editor )
}
}

bool QgsClassificationWidgetWrapper::valid()
bool QgsClassificationWidgetWrapper::valid() const
{
return mComboBox;
}
@@ -32,12 +32,12 @@ class GUI_EXPORT QgsClassificationWidgetWrapper : public QgsEditorWidgetWrapper

// QgsEditorWidgetWrapper interface
public:
QVariant value() override;
QVariant value() const override;

protected:
QWidget*createWidget( QWidget* parent ) override;
void initWidget( QWidget* editor ) override;
bool valid() override;
bool valid() const override;

public slots:
void setValue( const QVariant& value ) override;
@@ -22,7 +22,7 @@ QgsColorWidgetWrapper::QgsColorWidgetWrapper( QgsVectorLayer* vl, int fieldIdx,
}


QVariant QgsColorWidgetWrapper::value()
QVariant QgsColorWidgetWrapper::value() const
{
QVariant v;

@@ -46,7 +46,7 @@ void QgsColorWidgetWrapper::initWidget( QWidget* editor )
connect( mColorButton, SIGNAL( colorChanged( QColor ) ), this, SLOT( valueChanged() ) );
}

bool QgsColorWidgetWrapper::valid()
bool QgsColorWidgetWrapper::valid() const
{
return mColorButton;
}
@@ -34,12 +34,12 @@ class GUI_EXPORT QgsColorWidgetWrapper : public QgsEditorWidgetWrapper

// QgsEditorWidgetWrapper interface
public:
QVariant value() override;
QVariant value() const override;

protected:
QWidget* createWidget( QWidget* parent ) override;
void initWidget( QWidget* editor ) override;
bool valid() override;
bool valid() const override;

public slots:
void setValue( const QVariant& value ) override;
@@ -90,7 +90,7 @@ void QgsDateTimeEditWrapper::initWidget( QWidget *editor )
}
}

bool QgsDateTimeEditWrapper::valid()
bool QgsDateTimeEditWrapper::valid() const
{
return mQgsDateTimeEdit || mQDateTimeEdit;
}
@@ -101,7 +101,7 @@ void QgsDateTimeEditWrapper::dateTimeChanged( const QDateTime& dateTime )
emit valueChanged( dateTime.toString( fieldFormat ) );
}

QVariant QgsDateTimeEditWrapper::value()
QVariant QgsDateTimeEditWrapper::value() const
{
if ( !mQDateTimeEdit )
return QVariant( field().type() );
@@ -51,10 +51,10 @@ class GUI_EXPORT QgsDateTimeEditWrapper : public QgsEditorWidgetWrapper

// QgsEditorWidgetWrapper interface
public:
QVariant value() override;
QVariant value() const override;
QWidget *createWidget( QWidget *parent ) override;
void initWidget( QWidget *editor ) override;
bool valid() override;
bool valid() const override;

public slots:
void setValue( const QVariant &value ) override;
@@ -101,7 +101,7 @@ void QgsDefaultSearchWidgetWrapper::initWidget( QWidget* widget )
mCaseString = "ILIKE";
}

bool QgsDefaultSearchWidgetWrapper::valid()
bool QgsDefaultSearchWidgetWrapper::valid() const
{
return true;
}
@@ -47,7 +47,7 @@ class GUI_EXPORT QgsDefaultSearchWidgetWrapper : public QgsSearchWidgetWrapper
protected:
QWidget* createWidget( QWidget* parent ) override;
void initWidget( QWidget* editor ) override;
bool valid() override;
bool valid() const override;

private:
QgsFilterLineEdit* mLineEdit;
@@ -25,7 +25,7 @@ QgsEnumerationWidgetWrapper::QgsEnumerationWidgetWrapper( QgsVectorLayer* vl, in
}


QVariant QgsEnumerationWidgetWrapper::value()
QVariant QgsEnumerationWidgetWrapper::value() const
{
QVariant value;

@@ -57,7 +57,7 @@ void QgsEnumerationWidgetWrapper::initWidget( QWidget* editor )
}
}

bool QgsEnumerationWidgetWrapper::valid()
bool QgsEnumerationWidgetWrapper::valid() const
{
return mComboBox;
}
@@ -32,12 +32,12 @@ class GUI_EXPORT QgsEnumerationWidgetWrapper : public QgsEditorWidgetWrapper

// QgsEditorWidgetWrapper interface
public:
QVariant value() override;
QVariant value() const override;

protected:
QWidget* createWidget( QWidget* parent ) override;
void initWidget( QWidget* editor ) override;
bool valid() override;
bool valid() const override;

public slots:
void setValue( const QVariant& value ) override;
@@ -30,7 +30,7 @@ QgsFileNameWidgetWrapper::QgsFileNameWidgetWrapper( QgsVectorLayer* vl, int fiel
{
}

QVariant QgsFileNameWidgetWrapper::value()
QVariant QgsFileNameWidgetWrapper::value() const
{
QVariant value;

@@ -48,7 +48,7 @@ QVariant QgsFileNameWidgetWrapper::value()
return value;
}

bool QgsFileNameWidgetWrapper::valid()
bool QgsFileNameWidgetWrapper::valid() const
{
return mLineEdit || mLabel;
}
@@ -39,8 +39,8 @@ class GUI_EXPORT QgsFileNameWidgetWrapper : public QgsEditorWidgetWrapper

// QgsEditorWidgetWrapper interface
public:
QVariant value() override;
bool valid() override;
QVariant value() const override;
bool valid() const override;

protected:
QWidget* createWidget( QWidget* parent ) override;
@@ -23,7 +23,7 @@ QgsHiddenWidgetWrapper::QgsHiddenWidgetWrapper( QgsVectorLayer* vl, int fieldIdx
}


QVariant QgsHiddenWidgetWrapper::value()
QVariant QgsHiddenWidgetWrapper::value() const
{
return mValue;
}
@@ -40,7 +40,7 @@ void QgsHiddenWidgetWrapper::initWidget( QWidget* editor )
editor->setVisible( false );
}

bool QgsHiddenWidgetWrapper::valid()
bool QgsHiddenWidgetWrapper::valid() const
{
return true;
}
@@ -31,12 +31,12 @@ class GUI_EXPORT QgsHiddenWidgetWrapper : public QgsEditorWidgetWrapper

// QgsEditorWidgetWrapper interface
public:
QVariant value() override;
QVariant value() const override;

protected:
QWidget* createWidget( QWidget* parent ) override;
void initWidget( QWidget* editor ) override;
bool valid() override;
bool valid() const override;

public slots:
void setValue( const QVariant& value ) override;
@@ -100,7 +100,7 @@ void QgsPhotoWidgetWrapper::loadPixmap( const QString& fileName )
}
}

QVariant QgsPhotoWidgetWrapper::value()
QVariant QgsPhotoWidgetWrapper::value() const
{
QVariant v;

@@ -186,7 +186,7 @@ void QgsPhotoWidgetWrapper::initWidget( QWidget* editor )
}
}

bool QgsPhotoWidgetWrapper::valid()
bool QgsPhotoWidgetWrapper::valid() const
{
#ifdef WITH_QTWEBKIT
return mPhotoLabel || mLineEdit || mButton || mWebView;

0 comments on commit 182dd8a

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