Skip to content

Commit dce5b59

Browse files
raymondnijssen3nids
authored andcommittedMay 1, 2017
sipified qgsadvanceddigitizingdockwidget
1 parent 113ab01 commit dce5b59

File tree

6 files changed

+318
-266
lines changed

6 files changed

+318
-266
lines changed
 

‎python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ gui/qgsblendmodecombobox.sip
266266
gui/qgisinterface.sip
267267
gui/qgsactionmenu.sip
268268
gui/qgsadvanceddigitizingcanvasitem.sip
269-
gui/qgsadvanceddigitizingdockwidget.sip
270269
gui/qgsattributedialog.sip
271270
gui/qgsattributeeditorcontext.sip
272271
gui/qgsattributeform.sip

‎python/gui/qgsadvanceddigitizingdockwidget.sip

Lines changed: 299 additions & 253 deletions
Large diffs are not rendered by default.

‎scripts/sipify.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,9 @@ sub remove_constructor_or_body {
326326
# top level should stasy public
327327
dbg_info
328328
$ACCESS[$#ACCESS] = PUBLIC;
329-
$comment = '';
330329
}
330+
$comment = '';
331+
$return_type = '';
331332
$private_section_line = '';
332333
}
333334
dbg_info("new bracket balance: @global_bracket_nesting_index");
@@ -572,7 +573,7 @@ sub remove_constructor_or_body {
572573
# https://regex101.com/r/uvCt4M/1
573574
do {no warnings 'uninitialized';
574575
$line =~ s/\/(\w+(=\w+)?)\/\s*\/(\w+(=\w+)?)\/\s*;(\s*(\/\/.*)?)$/\/$1,$3\/$5;/;
575-
($3 == undef) or dbg_info("combine multiple annotations -- works only for 2");
576+
(! $3) or dbg_info("combine multiple annotations -- works only for 2");
576577
};
577578

578579
# unprinted annotations

‎src/gui/qgsadvanceddigitizingdockwidget.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222

2323
#include <ui_qgsadvanceddigitizingdockwidgetbase.h>
2424
#include "qgis_gui.h"
25+
#include "qgis.h"
2526
#include <memory>
2627

28+
2729
class QgsAdvancedDigitizingCanvasItem;
2830
class QgsMapCanvas;
2931
class QgsMapTool;
@@ -32,8 +34,8 @@ class QgsPoint;
3234

3335
// tolerances for soft constraints (last values, and common angles)
3436
// for angles, both tolerance in pixels and degrees are used for better performance
35-
static const double SOFT_CONSTRAINT_TOLERANCE_PIXEL = 15;
36-
static const double SOFT_CONSTRAINT_TOLERANCE_DEGREES = 10;
37+
static const double SOFT_CONSTRAINT_TOLERANCE_PIXEL = 15 SIP_SKIP;
38+
static const double SOFT_CONSTRAINT_TOLERANCE_DEGREES = 10 SIP_SKIP;
3739

3840
/** \ingroup gui
3941
* \brief The QgsAdvancedDigitizingDockWidget class is a dockable widget
@@ -423,7 +425,8 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
423425
bool filterKeyPress( QKeyEvent *e );
424426

425427
//! event filter for line edits in the dock UI (angle/distance/x/y line edits)
426-
bool eventFilter( QObject *obj, QEvent *event ) override;
428+
//! \note defined as private in Python bindings
429+
bool eventFilter( QObject *obj, QEvent *event ) override SIP_SKIP;
427430

428431
//! trigger fake mouse move event to update map tool rubber band and/or show new constraints
429432
void triggerMouseMoveEvent();
@@ -477,6 +480,11 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
477480
QMap< QAction *, int > mCommonAngleActions; // map the common angle actions with their angle values
478481
QMap< QAction *, QgsMapMouseEvent::SnappingMode > mSnappingActions; // map the snapping mode actions with their values
479482

483+
private:
484+
#ifdef SIP_RUN
485+
//! event filter for line edits in the dock UI (angle/distance/x/y line edits)
486+
bool eventFilter( QObject *obj, QEvent *event );
487+
#endif
480488
};
481489

482490
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAdvancedDigitizingDockWidget::CadCapacities )

‎tests/scripts/sipifyheader.expected.sip

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ remove argument
306306
void position( bool keep );
307307

308308
Whatever &operator[]( int i ) /Factory/;
309-
%MethodCode
309+
%MethodCode
310310
....
311-
%End
311+
%End
312312

313313
void ZshouldBeShown();
314314

@@ -355,7 +355,6 @@ class ClassWithPrivateInheritanceOnly
355355
%Docstring
356356
A constructor with definition in header on several lines
357357
%End
358-
359358
};
360359

361360

‎tests/scripts/sipifyheader.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
316316
VertexType type;
317317
}
318318

319-
void combinedAnnotations() SIP_FACTORY SIP_PYNAME(otherName);
319+
void combinedAnnotations() SIP_FACTORY SIP_PYNAME( otherName );
320320

321321
//! remove argument
322322
void simple( bool test SIP_PYARGREMOVE );
@@ -332,9 +332,9 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
332332
//! Some comment
333333
Whatever &operator[]( int i ) SIP_FACTORY;
334334
#ifdef SIP_RUN
335-
%MethodCode
335+
% MethodCode
336336
....
337-
%End
337+
% End
338338
#endif
339339

340340
#if 0
@@ -418,7 +418,6 @@ class CORE_EXPORT ClassWithPrivateInheritanceOnly : private QgsBaseClass
418418
doWhatYouLike();
419419
haveFun();
420420
}
421-
422421
};
423422

424423
/**

0 commit comments

Comments
 (0)
Please sign in to comment.