Skip to content

Commit

Permalink
Fix clashing inherited methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 5, 2018
1 parent 3e12ec9 commit b862db0
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions python/core/layout/qgsabstractreportsection.sip
Expand Up @@ -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``.
Expand All @@ -80,7 +80,7 @@ Subclasses should call copyCommonProperties() in their clone()
implementations.
%End

QgsAbstractReportSection *parent();
QgsAbstractReportSection *parentSection();
%Docstring
Returns the parent report section.
%End
Expand Down
4 changes: 2 additions & 2 deletions python/core/layout/qgsreportsectionfieldgroup.sip
Expand Up @@ -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``.
Expand Down Expand Up @@ -103,7 +103,7 @@ ascending, or false for descending sort.

virtual void reset();

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


protected:
Expand Down
2 changes: 1 addition & 1 deletion python/core/layout/qgsreportsectionlayout.sip
Expand Up @@ -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``.
Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgsabstractreportsection.cpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/core/layout/qgsabstractreportsection.h
Expand Up @@ -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;

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/core/layout/qgsreportsectionfieldgroup.h
Expand Up @@ -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" ); }

Expand Down Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgsreportsectionlayout.h
Expand Up @@ -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" ); }

Expand Down
12 changes: 6 additions & 6 deletions tests/src/python/test_qgsreport.py
Expand Up @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b862db0

Please sign in to comment.