Skip to content

Commit

Permalink
#ifdef out dummy test item
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 6, 2017
1 parent 696b21a commit dbd5215
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/layout/qgslayoutapputils.cpp
Expand Up @@ -63,8 +63,9 @@ void QgsLayoutAppUtils::registerGuiForKnownItemTypes()
return new QgsLayoutViewTriangleRubberBand( view );
} );

#if 0
registry->addLayoutItemGuiMetadata( new QgsLayoutItemGuiMetadata( QgsLayoutItemRegistry::LayoutItem + 1002, QStringLiteral( "test" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddLabel.svg" ) ), nullptr, createRubberBand ) );

#endif

// map item

Expand Down
5 changes: 5 additions & 0 deletions src/core/layout/qgslayoutitemregistry.cpp
Expand Up @@ -49,13 +49,16 @@ bool QgsLayoutItemRegistry::populate()
if ( !mMetadata.isEmpty() )
return false;

#if 0
// add temporary item to register
auto createTemporaryItem = []( QgsLayout * layout )->QgsLayoutItem*
{
return new TestLayoutItem( layout );
};

addLayoutItemType( new QgsLayoutItemMetadata( QgsLayoutItemRegistry::LayoutItem + 1002, QStringLiteral( "temp type" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddLabel.svg" ) ), createTemporaryItem ) );
#endif

addLayoutItemType( new QgsLayoutItemMetadata( LayoutGroup, QStringLiteral( "Group" ), QIcon(), QgsLayoutItemGroup::create ) );
addLayoutItemType( new QgsLayoutItemMetadata( LayoutFrame, QStringLiteral( "Frame" ), QIcon(), QgsLayoutFrame::create ) );
addLayoutItemType( new QgsLayoutItemMetadata( LayoutPage, QStringLiteral( "Page" ), QgsApplication::getThemeIcon( QStringLiteral( "/mActionFileNew.svg" ) ), QgsLayoutItemPage::create ) );
Expand Down Expand Up @@ -154,6 +157,7 @@ QMap<int, QString> QgsLayoutItemRegistry::itemTypes() const
}

///@cond TEMPORARY
#if 0
TestLayoutItem::TestLayoutItem( QgsLayout *layout )
: QgsLayoutItem( layout )
{
Expand Down Expand Up @@ -202,4 +206,5 @@ void TestLayoutItem::draw( QgsRenderContext &context, const QStyleOptionGraphics
painter->restore();
stack.end( context );
}
#endif
///@endcond
2 changes: 2 additions & 0 deletions src/core/layout/qgslayoutitemregistry.h
Expand Up @@ -424,6 +424,7 @@ class CORE_EXPORT QgsLayoutItemRegistry : public QObject

};

#if 0
#ifndef SIP_RUN
///@cond TEMPORARY
//simple item for testing
Expand Down Expand Up @@ -452,6 +453,7 @@ class TestLayoutItem : public QgsLayoutItem
};
///@endcond
#endif
#endif

#endif //QGSLAYOUTITEMREGISTRY_H

Expand Down

0 comments on commit dbd5215

Please sign in to comment.