Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
|
@@ -61,7 +61,7 @@ void QgsLayoutItemPropertiesDialog::setItemPosition( QgsLayoutPoint position ) |
|
|
position = mLayout->convertFromLayoutUnits( mLayout->pageCollection()->positionOnPage( layoutPoint ), position.units() ); |
|
|
|
|
|
mPageSpin->setValue( page + 1 ); |
|
|
mPosUnitsComboBox->setUnit( position.units() ); |
|
|
whileBlocking( mPosUnitsComboBox )->setUnit( position.units() ); |
|
|
mXPosSpin->setValue( position.x() ); |
|
|
mYPosSpin->setValue( position.y() ); |
|
|
} |
|
@@ -80,7 +80,7 @@ void QgsLayoutItemPropertiesDialog::setItemSize( QgsLayoutSize size ) |
|
|
{ |
|
|
mWidthSpin->setValue( size.width() ); |
|
|
mHeightSpin->setValue( size.height() ); |
|
|
mSizeUnitsComboBox->setUnit( size.units() ); |
|
|
whileBlocking( mSizeUnitsComboBox )->setUnit( size.units() ); |
|
|
} |
|
|
|
|
|
QgsLayoutSize QgsLayoutItemPropertiesDialog::itemSize() const |
|
|
|
@@ -14,7 +14,7 @@ |
|
|
|
|
|
import qgis # NOQA |
|
|
|
|
|
from qgis.core import QgsUnitTypes, QgsLayoutSize, QgsLayoutPoint, QgsLayoutItem |
|
|
from qgis.core import QgsUnitTypes, QgsLayoutSize, QgsLayoutPoint, QgsLayoutItem, QgsProject, QgsLayout |
|
|
from qgis.gui import QgsLayoutItemPropertiesDialog |
|
|
|
|
|
from qgis.testing import start_app, unittest |
|
@@ -28,6 +28,10 @@ def testGettersSetters(self): |
|
|
""" test dialog getters/setters """ |
|
|
dlg = qgis.gui.QgsLayoutItemPropertiesDialog() |
|
|
|
|
|
l = QgsLayout(QgsProject.instance()) |
|
|
l.initializeDefaults() |
|
|
dlg.setLayout(l) |
|
|
|
|
|
dlg.setItemPosition(QgsLayoutPoint(5, 6, QgsUnitTypes.LayoutPixels)) |
|
|
self.assertEqual(dlg.itemPosition().x(), 5.0) |
|
|
self.assertEqual(dlg.itemPosition().y(), 6.0) |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.