Skip to content
Permalink
Browse files

Fix clashing inherited methods

  • Loading branch information
nyalldawson committed Dec 30, 2017
1 parent 3e12ec9 commit b862db06f05f1785cb938ec3703e95945e373a52
@@ -56,7 +56,7 @@ exposed to the Python bindings for unit testing purposes only.
%End
public:

QgsAbstractReportSection( QgsAbstractReportSection *parent = 0 );
QgsAbstractReportSection( QgsAbstractReportSection *parentSection = 0 );
%Docstring
Constructor for QgsAbstractReportSection, attached to the specified ``parent`` section.
Note that ownership is not transferred to ``parent``.
@@ -80,7 +80,7 @@ Subclasses should call copyCommonProperties() in their clone()
implementations.
%End

QgsAbstractReportSection *parent();
QgsAbstractReportSection *parentSection();
%Docstring
Returns the parent report section.
%End
@@ -28,7 +28,7 @@ exposed to the Python bindings for unit testing purposes only.
%End
public:

QgsReportSectionFieldGroup( QgsAbstractReportSection *parent = 0 );
QgsReportSectionFieldGroup( QgsAbstractReportSection *parentSection = 0 );
%Docstring
Constructor for QgsReportSectionFieldGroup, attached to the specified ``parent`` section.
Note that ownership is not transferred to ``parent``.
@@ -103,7 +103,7 @@ ascending, or false for descending sort.

virtual void reset();

virtual void setParentSection( QgsAbstractReportSection *parent );
virtual void setParentSection( QgsAbstractReportSection *parentSection );


protected:
@@ -27,7 +27,7 @@ exposed to the Python bindings for unit testing purposes only.
%End
public:

QgsReportSectionLayout( QgsAbstractReportSection *parent = 0 );
QgsReportSectionLayout( QgsAbstractReportSection *parentSection = 0 );
%Docstring
Constructor for QgsReportSectionLayout, attached to the specified ``parent`` section.
Note that ownership is not transferred to ``parent``.
@@ -34,7 +34,7 @@ QgsAbstractReportSection::~QgsAbstractReportSection()
QgsProject *QgsAbstractReportSection::project()
{
QgsAbstractReportSection *current = this;
while ( QgsAbstractReportSection *parent = current->parent() )
while ( QgsAbstractReportSection *parent = current->parentSection() )
{
if ( !parent )
return nullptr;
@@ -70,7 +70,7 @@ class CORE_EXPORT QgsAbstractReportSection : public QgsAbstractLayoutIterator
* Constructor for QgsAbstractReportSection, attached to the specified \a parent section.
* Note that ownership is not transferred to \a parent.
*/
QgsAbstractReportSection( QgsAbstractReportSection *parent = nullptr );
QgsAbstractReportSection( QgsAbstractReportSection *parentSection = nullptr );

~QgsAbstractReportSection() override;

@@ -97,7 +97,7 @@ class CORE_EXPORT QgsAbstractReportSection : public QgsAbstractLayoutIterator
/**
* Returns the parent report section.
*/
QgsAbstractReportSection *parent() { return mParent; }
QgsAbstractReportSection *parentSection() { return mParent; }

/**
* Returns the associated project.
@@ -42,7 +42,7 @@ class CORE_EXPORT QgsReportSectionFieldGroup : public QgsAbstractReportSection
* Constructor for QgsReportSectionFieldGroup, attached to the specified \a parent section.
* Note that ownership is not transferred to \a parent.
*/
QgsReportSectionFieldGroup( QgsAbstractReportSection *parent = nullptr );
QgsReportSectionFieldGroup( QgsAbstractReportSection *parentSection = nullptr );

QString type() const override { return QStringLiteral( "SectionFieldGroup" ); }

@@ -101,7 +101,7 @@ class CORE_EXPORT QgsReportSectionFieldGroup : public QgsAbstractReportSection
bool beginRender() override;
QgsLayout *nextBody( bool &ok ) override;
void reset() override;
void setParentSection( QgsAbstractReportSection *parent ) override;
void setParentSection( QgsAbstractReportSection *parentSection ) override;

protected:

@@ -39,7 +39,7 @@ class CORE_EXPORT QgsReportSectionLayout : public QgsAbstractReportSection
* Constructor for QgsReportSectionLayout, attached to the specified \a parent section.
* Note that ownership is not transferred to \a parent.
*/
QgsReportSectionLayout( QgsAbstractReportSection *parent = nullptr );
QgsReportSectionLayout( QgsAbstractReportSection *parentSection = nullptr );

QString type() const override { return QStringLiteral( "SectionLayout" ); }

@@ -74,14 +74,14 @@ def testchildSections(self):
self.assertEqual(r.childCount(), 1)
self.assertEqual(r.childSections(), [child1])
self.assertEqual(r.childSection(0), child1)
self.assertEqual(child1.parent(), r)
self.assertEqual(child1.parentSection(), r)
self.assertEqual(child1.project(), p)
child2 = QgsReportSectionLayout()
r.appendChild(child2)
self.assertEqual(r.childCount(), 2)
self.assertEqual(r.childSections(), [child1, child2])
self.assertEqual(r.childSection(1), child2)
self.assertEqual(child2.parent(), r)
self.assertEqual(child2.parentSection(), r)

def testInsertChild(self):
p = QgsProject()
@@ -91,12 +91,12 @@ def testInsertChild(self):
r.insertChild(11, child1)
self.assertEqual(r.childCount(), 1)
self.assertEqual(r.childSections(), [child1])
self.assertEqual(child1.parent(), r)
self.assertEqual(child1.parentSection(), r)
child2 = QgsReportSectionLayout()
r.insertChild(-1, child2)
self.assertEqual(r.childCount(), 2)
self.assertEqual(r.childSections(), [child2, child1])
self.assertEqual(child2.parent(), r)
self.assertEqual(child2.parentSection(), r)

def testRemoveChild(self):
p = QgsProject()
@@ -136,10 +136,10 @@ def testClone(self):
self.assertEqual(cloned.childCount(), 2)
self.assertTrue(cloned.childSection(0).headerEnabled())
self.assertFalse(cloned.childSection(0).footerEnabled())
self.assertEqual(cloned.childSection(0).parent(), cloned)
self.assertEqual(cloned.childSection(0).parentSection(), cloned)
self.assertFalse(cloned.childSection(1).headerEnabled())
self.assertTrue(cloned.childSection(1).footerEnabled())
self.assertEqual(cloned.childSection(1).parent(), cloned)
self.assertEqual(cloned.childSection(1).parentSection(), cloned)

def testReportSectionLayout(self):
r = QgsReportSectionLayout()

0 comments on commit b862db0

Please sign in to comment.
You can’t perform that action at this time.