[sipify] Handle enum values using bitshift operators

This commit is contained in:
Nyall Dawson 2017-04-03 14:09:28 +10:00
parent 7db1913c07
commit 3e9c527dc7
3 changed files with 5 additions and 1 deletions

View File

@ -266,7 +266,7 @@ while(!eof $header){
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;

View File

@ -61,6 +61,8 @@ class QgsSipifyHeader : QtClass<QVariant>
{
Success,
NoSuccess,
ImaginarySuccess,
RecursiveSuccess,
};
typedef QFlags<QgsSipifyHeader::MyEnum> Flags;

View File

@ -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 )