Skip to content
Permalink
Browse files
[sipify] Handle enum values using bitshift operators
  • Loading branch information
nyalldawson committed Apr 3, 2017
1 parent 7db1913 commit 3e9c527dc7e324036ef3e5714efcb17a265c028e
Showing with 5 additions and 1 deletion.
  1. +1 −1 scripts/sipify.pl
  2. +2 −0 tests/scripts/sipifyheader.expected.sip
  3. +2 −0 tests/scripts/sipifyheader.h
@@ -266,7 +266,7 @@ sub processDoxygenLine
if ($line =~ m/\};/){
last;
}
$line =~ s/(\s*\w+)(\s*=\s*\w+.*?)?(,?).*$/$1$3/;
$line =~ s/(\s*\w+)(\s*=\s*[\w\s\d<]+.*?)?(,?).*$/$1$3/;
print $line;
}
print $line;
@@ -61,6 +61,8 @@ class QgsSipifyHeader : QtClass<QVariant>
{
Success,
NoSuccess,
ImaginarySuccess,
RecursiveSuccess,
};
typedef QFlags<QgsSipifyHeader::MyEnum> Flags;

@@ -98,6 +98,8 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla
{
Success = 0, //!< Edit operation was successful
NoSuccess = 1, //!< Edit operation resulted in an empty geometry
ImaginarySuccess = 1 << 3, //!< Edit operation resulted in an imaginary geometry
RecursiveSuccess = 1 << 4, //!< Edit operation resulted in an n-dimensional wormhole
};
Q_DECLARE_FLAGS( Flags, MyEnum )

0 comments on commit 3e9c527

Please sign in to comment.