mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Fix repositioning guides on pages > 1
This commit is contained in:
parent
b594ecd7c5
commit
e9c0d29ff1
@ -41,11 +41,11 @@ QgsLayoutGuideWidget::QgsLayoutGuideWidget( QWidget *parent, QgsLayout *layout,
|
||||
mVertGuidesTableView->setEditTriggers( QAbstractItemView::AllEditTriggers );
|
||||
|
||||
|
||||
mHozGuidesTableView->setItemDelegateForColumn( 0, new QgsLayoutGuidePositionDelegate( mHozGuidesTableView, mLayout, mHozProxyModel ) );
|
||||
mHozGuidesTableView->setItemDelegateForColumn( 1, new QgsLayoutGuideUnitDelegate( mHozGuidesTableView, mLayout, mHozProxyModel ) );
|
||||
mHozGuidesTableView->setItemDelegateForColumn( 0, new QgsLayoutGuidePositionDelegate( mHozGuidesTableView, mLayout, &mLayout->guides() ) );
|
||||
mHozGuidesTableView->setItemDelegateForColumn( 1, new QgsLayoutGuideUnitDelegate( mHozGuidesTableView, mLayout, &mLayout->guides() ) );
|
||||
|
||||
mVertGuidesTableView->setItemDelegateForColumn( 0, new QgsLayoutGuidePositionDelegate( mVertGuidesTableView, mLayout, mVertProxyModel ) );
|
||||
mVertGuidesTableView->setItemDelegateForColumn( 1, new QgsLayoutGuideUnitDelegate( mVertGuidesTableView, mLayout, mVertProxyModel ) );
|
||||
mVertGuidesTableView->setItemDelegateForColumn( 0, new QgsLayoutGuidePositionDelegate( mVertGuidesTableView, mLayout, &mLayout->guides() ) );
|
||||
mVertGuidesTableView->setItemDelegateForColumn( 1, new QgsLayoutGuideUnitDelegate( mVertGuidesTableView, mLayout, &mLayout->guides() ) );
|
||||
|
||||
connect( mAddHozGuideButton, &QPushButton::clicked, this, &QgsLayoutGuideWidget::addHorizontalGuide );
|
||||
connect( mAddVertGuideButton, &QPushButton::clicked, this, &QgsLayoutGuideWidget::addVerticalGuide );
|
||||
|
@ -140,11 +140,11 @@ void QgsLayoutGuide::setLayoutPosition( double position )
|
||||
switch ( mOrientation )
|
||||
{
|
||||
case Qt::Horizontal:
|
||||
p = mLineItem->mapFromScene( QPointF( 0, position ) ).y();
|
||||
p = mPage->mapFromScene( QPointF( 0, position ) ).y();
|
||||
break;
|
||||
|
||||
case Qt::Vertical:
|
||||
p = mLineItem->mapFromScene( QPointF( position, 0 ) ).x();
|
||||
p = mPage->mapFromScene( QPointF( position, 0 ) ).x();
|
||||
break;
|
||||
}
|
||||
mPosition = mLayout->convertFromLayoutUnits( p, mPosition.units() );
|
||||
@ -299,6 +299,9 @@ bool QgsLayoutGuideCollection::setData( const QModelIndex &index, const QVariant
|
||||
return false;
|
||||
|
||||
QgsLayoutMeasurement m = guide->position();
|
||||
if ( m.length() == newPos )
|
||||
return true;
|
||||
|
||||
m.setLength( newPos );
|
||||
mLayout->undoStack()->beginCommand( mPageCollection, tr( "Move Guide" ), Move + index.row() );
|
||||
whileBlocking( guide )->setPosition( m );
|
||||
|
Loading…
x
Reference in New Issue
Block a user