Skip to content

Instantly share code, notes, and snippets.

@dakcarto
Last active December 30, 2015 02:39
Show Gist options
  • Save dakcarto/7764118 to your computer and use it in GitHub Desktop.
Save dakcarto/7764118 to your computer and use it in GitHub Desktop.
qgis-20_sip-fixes
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index e5f4c27..1e298ea 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -91,6 +91,12 @@ INCLUDE_DIRECTORIES(
FILE(GLOB_RECURSE sip_files_gui gui/*.sip)
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_gui})
SET(SIP_EXTRA_OPTIONS ${PYQT4_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.gui.api)
+
+IF(UNIX AND NOT SIP_VERSION_NUM LESS 265984)
+ SET(SIP_EXTRA_OPTIONS -P ${SIP_EXTRA_OPTIONS})
+ ADD_DEFINITIONS(-Dprotected=public)
+ENDIF(UNIX AND NOT SIP_VERSION_NUM LESS 265984)
+
ADD_SIP_PYTHON_MODULE(qgis.gui gui/gui.sip qgis_core qgis_gui)
# additional analysis includes
diff --git a/src/core/qgsmaplayerregistry.h b/src/core/qgsmaplayerregistry.h
index 98ce29b..59621bd 100644
--- a/src/core/qgsmaplayerregistry.h
+++ b/src/core/qgsmaplayerregistry.h
@@ -239,19 +239,15 @@ class CORE_EXPORT QgsMapLayerRegistry : public QObject
//! protected constructor
QgsMapLayerRegistry( QObject * parent = 0 );
- private:
-
- static QgsMapLayerRegistry* mInstance;
-
- QMap<QString, QgsMapLayer*> mMapLayers;
- QSet<QgsMapLayer*> mOwnedLayers;
-
/** debugging member
invoked when a connect() is made to this object
*/
void connectNotify( const char * signal );
-
+ private:
+ static QgsMapLayerRegistry *mInstance;
+ QMap<QString, QgsMapLayer*> mMapLayers;
+ QSet<QgsMapLayer*> mOwnedLayers;
}; // class QgsMapLayerRegistry
#endif //QgsMapLayerRegistry_H
diff --git a/src/gui/qgsattributedialog.h b/src/gui/qgsattributedialog.h
index 647e76c..e721445 100644
--- a/src/gui/qgsattributedialog.h
+++ b/src/gui/qgsattributedialog.h
@@ -59,9 +59,10 @@ class GUI_EXPORT QgsAttributeDialog : public QObject
void dialogDestroyed();
- private:
+ protected:
bool eventFilter( QObject *obj, QEvent *event );
+ private:
QDialog *mDialog;
QString mSettingsPath;
// Used to sync multiple widgets for the same field
diff --git a/src/gui/qgsmapcanvas.h b/src/gui/qgsmapcanvas.h
index 131ffd3..09e6256 100644
--- a/src/gui/qgsmapcanvas.h
+++ b/src/gui/qgsmapcanvas.h
@@ -410,6 +410,11 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
/// Handle pattern for implementation object
std::auto_ptr<CanvasProperties> mCanvasProperties;
+ /**debugging member
+ invoked when a connect() is made to this object
+ */
+ void connectNotify( const char * signal );
+
private slots:
void crsTransformEnabled( bool );
@@ -459,11 +464,6 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
the last entry in case a lot of resize events arrive in short time*/
QList< QPair<int, int> > mResizeQueue;
- /**debugging member
- invoked when a connect() is made to this object
- */
- void connectNotify( const char * signal );
-
//! current layer in legend
QgsMapLayer* mCurrentLayer;
diff --git a/src/gui/qgsmessagelogviewer.h b/src/gui/qgsmessagelogviewer.h
index 148edf7..01b4834 100644
--- a/src/gui/qgsmessagelogviewer.h
+++ b/src/gui/qgsmessagelogviewer.h
@@ -42,10 +42,11 @@ class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessageLogV
public slots:
void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
- private:
+ protected:
void showEvent( QShowEvent * );
void hideEvent( QHideEvent * );
+ private:
QToolButton *mButton;
int mCount;
diff --git a/python/gui/qgsfieldvalidator.sip b/python/gui/qgsfieldvalidator.sip
index 5d5de30..6237e3e 100644
--- a/python/gui/qgsfieldvalidator.sip
+++ b/python/gui/qgsfieldvalidator.sip
@@ -9,6 +9,8 @@ class QgsFieldValidator : QValidator
QgsFieldValidator( QObject *parent, const QgsField &field, QString dateFormat = "yyyy-MM-dd" );
~QgsFieldValidator();
- virtual State validate( QString &, int & ) const;
- virtual void fixup( QString & ) const;
+ virtual State validate(QString & /In,Out/, int & /In,Out/) const = 0 /API=QString:2 - /;
+ virtual State validate(QString & /Constrained/, int & /In,Out/) const = 0 /API=QString: - 2/;
+ virtual void fixup(QString &input /In,Out/) const /API=QString:2 - /;
+ virtual void fixup(QString & /Constrained/) const /API=QString: - 2/;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment