Skip to content
Permalink
Browse files
[sipify] Always add virtual keyword for overridden methods
sip often requires the virtual keyword to be present, or
it chokes on covariant return types in overridden methods
  • Loading branch information
nyalldawson committed Apr 18, 2017
1 parent 1805a70 commit 87a670848bcdba77e68bba1fde553c6e2bf49027
@@ -31,7 +31,7 @@ class QgsHtmlAnnotation: QgsAnnotation

~QgsHtmlAnnotation();

QSizeF minimumFrameSize() const;
virtual QSizeF minimumFrameSize() const;

void setSourceFile( const QString &htmlFile );
%Docstring
@@ -49,7 +49,7 @@ class QgsHtmlAnnotation: QgsAnnotation
virtual void writeXml( QDomElement &elem, QDomDocument &doc ) const;
virtual void readXml( const QDomElement &itemElem, const QDomDocument &doc );

void setAssociatedFeature( const QgsFeature &feature );
virtual void setAssociatedFeature( const QgsFeature &feature );

static QgsHtmlAnnotation *create() /Factory/;
%Docstring
@@ -59,7 +59,7 @@ class QgsHtmlAnnotation: QgsAnnotation

protected:

void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;
virtual void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;

};

@@ -50,7 +50,7 @@ class QgsSvgAnnotation: QgsAnnotation

protected:

void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;
virtual void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;

};

@@ -52,7 +52,7 @@ class QgsTextAnnotation: QgsAnnotation

protected:

void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;
virtual void renderAnnotation( QgsRenderContext &context, QSizeF size ) const;

};

@@ -30,13 +30,13 @@ class QgsLayerTreeGroup : QgsLayerTreeNode
%End


QString name() const;
virtual QString name() const;
%Docstring
Returns the group's name.
:rtype: str
%End

void setName( const QString &n );
virtual void setName( const QString &n );
%Docstring
Sets the group's name.
%End
@@ -213,8 +213,13 @@ class QgsLayerTreeGroup : QgsLayerTreeNode




private:

QgsLayerTreeGroup( const QgsLayerTreeGroup &other );
%Docstring
Copies are not allowed
%End
};


@@ -35,7 +35,7 @@ class QgsLayerTreeLayer : QgsLayerTreeNode

explicit QgsLayerTreeLayer( const QString &layerId, const QString &name = QString(), const QString &source = QString(), const QString &provider = QString() );
%Docstring
Constructor for QgsLayerTreeLayer using weak references to layer ID, name, public source, and provider key.
Constructor for QgsLayerTreeLayer using weak references to layer ID, ``name``, public ``source``, and ``provider`` key.
%End

QString layerId() const;
@@ -48,14 +48,14 @@ class QgsLayerTreeLayer : QgsLayerTreeNode
:rtype: QgsMapLayer
%End

QString name() const;
virtual QString name() const;
%Docstring
Returns the layer's name.
.. versionadded:: 3.0
:rtype: str
%End

void setName( const QString &n );
virtual void setName( const QString &n );
%Docstring
Sets the layer's name.
.. versionadded:: 3.0
@@ -79,14 +79,8 @@ class QgsLayerTreeLayer : QgsLayerTreeNode
virtual void writeXml( QDomElement &parentElement );

virtual QString dump() const;
%Docstring
:rtype: str
%End

virtual QgsLayerTreeLayer *clone() const /Factory/;
%Docstring
:rtype: QgsLayerTreeLayer
%End

virtual void resolveReferences( const QgsProject *project, bool looseMatching = false );
%Docstring
@@ -112,7 +106,11 @@ class QgsLayerTreeLayer : QgsLayerTreeNode


private:

QgsLayerTreeLayer( const QgsLayerTreeLayer &other );
%Docstring
Copies are not allowed
%End
};


@@ -302,7 +302,7 @@ class QgsLimitedRandomColorRamp : QgsColorRamp
virtual QString type() const;
virtual QgsLimitedRandomColorRamp *clone() const /Factory/;
virtual QgsStringMap properties() const;
int count() const;
virtual int count() const;

static QList<QColor> randomColors( int count,
int hueMax = DEFAULT_RANDOM_HUE_MAX, int hueMin = DEFAULT_RANDOM_HUE_MIN,
@@ -420,11 +420,11 @@ class QgsRandomColorRamp: QgsColorRamp
public:
QgsRandomColorRamp();

int count() const;
virtual int count() const;

double value( int index ) const;
virtual double value( int index ) const;

QColor color( double value ) const;
virtual QColor color( double value ) const;

virtual void setTotalColorCount( const int colorCount );
%Docstring
@@ -435,7 +435,7 @@ class QgsRandomColorRamp: QgsColorRamp
.. versionadded:: 2.5
%End

QString type() const;
virtual QString type() const;

virtual QgsRandomColorRamp *clone() const /Factory/;

@@ -483,7 +483,7 @@ class QgsPresetSchemeColorRamp : QgsColorRamp, QgsColorScheme
:rtype: QgsColorRamp
%End

bool setColors( const QgsNamedColorList &colors, const QString & = QString(), const QColor & = QColor() );
virtual bool setColors( const QgsNamedColorList &colors, const QString & = QString(), const QColor & = QColor() );
%Docstring
Sets the list of colors used by the ramp.
\param colors list of colors
@@ -499,25 +499,16 @@ class QgsPresetSchemeColorRamp : QgsColorRamp, QgsColorScheme
%End

virtual double value( int index ) const;
%Docstring
QgsColorRamp interface
:rtype: float
%End
virtual QColor color( double value ) const;
virtual QString type() const;
virtual void invert();
virtual QgsPresetSchemeColorRamp *clone() const /Factory/;
virtual QgsStringMap properties() const;
int count() const;
virtual int count() const;

QString schemeName() const;
%Docstring
QgsColorScheme interface
:rtype: str
%End
QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor &baseColor = QColor() );
bool isEditable() const;
virtual QString schemeName() const;
virtual QgsNamedColorList fetchColors( const QString &context = QString(), const QColor &baseColor = QColor() );
virtual bool isEditable() const;

};

@@ -772,7 +772,7 @@ Return the provider type for this layer
:rtype: str
%End

bool readSymbology( const QDomNode &layerNode, QString &errorMessage );
virtual bool readSymbology( const QDomNode &layerNode, QString &errorMessage );
%Docstring
Read the symbology for the current layer from the Dom node supplied.
\param layerNode node that will contain the symbology definition for this layer.
@@ -781,7 +781,7 @@ Return the provider type for this layer
:rtype: bool
%End

bool readStyle( const QDomNode &node, QString &errorMessage );
virtual bool readStyle( const QDomNode &node, QString &errorMessage );
%Docstring
Read the style for the current layer from the Dom node supplied.
\param node node that will contain the style definition for this layer.
@@ -790,7 +790,7 @@ Return the provider type for this layer
:rtype: bool
%End

bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage ) const;
virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage ) const;
%Docstring
Write the symbology for the layer into the docment provided.
\param node the node that will have the style element added to it.
@@ -800,7 +800,7 @@ Return the provider type for this layer
:rtype: bool
%End

bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage ) const;
virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage ) const;
%Docstring
Write just the style information for the layer into the document
\param node the node that will have the style element added to it.
@@ -821,7 +821,7 @@ Return the provider type for this layer
:rtype: bool
%End

bool readSld( const QDomNode &node, QString &errorMessage );
virtual bool readSld( const QDomNode &node, QString &errorMessage );

long featureCount( const QString &legendKey ) const;
%Docstring
@@ -1099,7 +1099,7 @@ Synchronises with changes in the datasource
:rtype: QgsMapLayerRenderer
%End

QgsRectangle extent() const;
virtual QgsRectangle extent() const;
%Docstring
Return the extent of the layer
:rtype: QgsRectangle
@@ -1627,7 +1627,7 @@ Returns the current transparency for the vector layer
:rtype: int
%End

QString htmlMetadata() const;
virtual QString htmlMetadata() const;


void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod );
@@ -1695,7 +1695,7 @@ Returns the current transparency for the vector layer
.. versionadded:: 3.0
%End

QgsExpressionContext createExpressionContext() const;
virtual QgsExpressionContext createExpressionContext() const;

QgsEditFormConfig editFormConfig() const;
%Docstring
@@ -2041,7 +2041,7 @@ Signal emitted when setLayerTransparency() is called


protected:
void setExtent( const QgsRectangle &rect );
virtual void setExtent( const QgsRectangle &rect );
%Docstring
Set the extent
%End
@@ -346,48 +346,48 @@ class QgsColorButton : QToolButton

protected:

bool event( QEvent *e );
void changeEvent( QEvent *e );
void showEvent( QShowEvent *e );
void resizeEvent( QResizeEvent *event );
virtual bool event( QEvent *e );
virtual void changeEvent( QEvent *e );
virtual void showEvent( QShowEvent *e );
virtual void resizeEvent( QResizeEvent *event );

static const QPixmap &transparentBackground();
%Docstring
Returns a checkboard pattern pixmap for use as a background to transparent colors
:rtype: QPixmap
%End

void mousePressEvent( QMouseEvent *e );
virtual void mousePressEvent( QMouseEvent *e );
%Docstring
Reimplemented to detect right mouse button clicks on the color button and allow dragging colors
%End

void mouseMoveEvent( QMouseEvent *e );
virtual void mouseMoveEvent( QMouseEvent *e );
%Docstring
Reimplemented to allow dragging colors from button
%End

void mouseReleaseEvent( QMouseEvent *e );
virtual void mouseReleaseEvent( QMouseEvent *e );
%Docstring
Reimplemented to allow color picking
%End

void keyPressEvent( QKeyEvent *e );
virtual void keyPressEvent( QKeyEvent *e );
%Docstring
Reimplemented to allow canceling color pick via keypress, and sample via space bar press
%End

void dragEnterEvent( QDragEnterEvent *e );
virtual void dragEnterEvent( QDragEnterEvent *e );
%Docstring
Reimplemented to accept dragged colors
%End

void dragLeaveEvent( QDragLeaveEvent *e );
virtual void dragLeaveEvent( QDragLeaveEvent *e );
%Docstring
Reimplemented to reset button appearance after drag leave
%End

void dropEvent( QDropEvent *e );
virtual void dropEvent( QDropEvent *e );
%Docstring
Reimplemented to accept dropped colors
%End
@@ -257,12 +257,12 @@ class QgsColorRampButton : QToolButton

protected:

bool event( QEvent *e );
void changeEvent( QEvent *e );
void showEvent( QShowEvent *e );
void resizeEvent( QResizeEvent *event );
virtual bool event( QEvent *e );
virtual void changeEvent( QEvent *e );
virtual void showEvent( QShowEvent *e );
virtual void resizeEvent( QResizeEvent *event );

void mousePressEvent( QMouseEvent *e );
virtual void mousePressEvent( QMouseEvent *e );
%Docstring
Reimplemented to detect right mouse button clicks on the color ramp button
%End
@@ -35,8 +35,8 @@ class QgsMessageLogViewer: QDialog
%End

protected:
void closeEvent( QCloseEvent *e );
void reject();
virtual void closeEvent( QCloseEvent *e );
virtual void reject();

};

@@ -27,7 +27,7 @@ class CharacterWidget : QWidget
Constructor for CharacterWidget.
%End

QSize sizeHint() const;
virtual QSize sizeHint() const;

int columns() const;
%Docstring
@@ -101,9 +101,9 @@ class CharacterWidget : QWidget
%End

protected:
void mouseMoveEvent( QMouseEvent *event );
void mousePressEvent( QMouseEvent *event );
void paintEvent( QPaintEvent *event );
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
virtual void paintEvent( QPaintEvent *event );

};

Loading

0 comments on commit 87a6708

Please sign in to comment.