Skip to content
Permalink
Browse files

Refine z order for some new items

  • Loading branch information
nyalldawson committed Jul 25, 2017
1 parent 0d0a3c2 commit 3dbc1a0c2af06735469f66c16f18cc0067ed5f38
@@ -23,9 +23,10 @@ class QgsLayout : QGraphicsScene, QgsExpressionContextGenerator
enum ZValues
{
ZPage,
ZItem,
ZGrid,
ZMapTool,

ZSnapIndicator,
};

QgsLayout( QgsProject *project );
@@ -42,9 +42,10 @@ class CORE_EXPORT QgsLayout : public QGraphicsScene, public QgsExpressionContext
enum ZValues
{
ZPage = 0, //!< Z-value for page (paper) items
ZItem = 1, //!< Minimum z value for items
ZGrid = 9999, //!< Z-value for page grids
ZMapTool = 10000, //!< Z-value for temporary map tool items

ZSnapIndicator = 10001, //!< Z-value for snapping indicator
};

/**
@@ -29,6 +29,8 @@ QgsLayoutItem::QgsLayoutItem( QgsLayout *layout )
, QGraphicsRectItem( 0 )
, mUuid( QUuid::createUuid().toString() )
{
setZValue( QgsLayout::ZItem );

// needed to access current view transform during paint operations
setFlags( flags() | QGraphicsItem::ItemUsesExtendedStyleOption );
setCacheMode( QGraphicsItem::DeviceCoordinateCache );
@@ -439,6 +439,7 @@ QgsLayoutViewSnapMarker::QgsLayoutViewSnapMarker()
setPen( QPen( Qt::transparent, mSize ) );

setFlags( flags() | QGraphicsItem::ItemIgnoresTransformations );
setZValue( QgsLayout::ZSnapIndicator );
}

void QgsLayoutViewSnapMarker::paint( QPainter *p, const QStyleOptionGraphicsItem *, QWidget * )

0 comments on commit 3dbc1a0

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