Below is the relevant code. I am using QgsProjectionSelectionWidget to get the CRS.
canvas_extent = self.canvas.extent()
transformer = QgsCoordinateTransform(
self.canvas.mapSettings().destinationCrs(),
self.input_projection_cbo.crs(),
QgsProject.instance()
)
transformer.setDestinationCrs(
self.input_projection_cbo.crs()
)
transformed_extent = transformer.transform(canvas_extent)
self.extent_box.setOriginalExtent(
transformed_extent,
QgsCoordinateReferenceSystem(
self.input_projection_cbo.crs().authid()
)
)
self.extent_box.setOutputCrs(
QgsCoordinateReferenceSystem(
self.input_projection_cbo.crs().authid()
)
)
self.extent_box.setOutputExtentFromOriginal()
self.extent_box.setCurrentExtent(
transformed_extent,
QgsCoordinateReferenceSystem(
self.input_projection_cbo.crs().authid()
)
)
Below is the entire report.
h2. User Feedback h2. Report Details *Crash ID*: 8e827b9e58264385e7a945fbe0ac6df5b4daf9a5 *Stack Trace* QgsExtentGroupBox::setOriginalExtent : PyInit__gui : PyCFunction_FastCallDict : PyObject_GenericGetAttr : PyEval_EvalFrameDefault : PyFunction_FastCallDict : PyObject_CallFunctionObjArgs : PyObject_Call : PyInit_QtCore : PyInit_QtCore : PyInit_QtCore : PyInit_QtCore : PyInit_QtCore : QMetaObject::activate : QGroupBox::childEvent : QGroupBox::mouseReleaseEvent : QgsPresetSchemeColorRamp::clone : QWidget::event : QGroupBox::event : QgsPresetSchemeColorRamp::clone : QApplicationPrivate::notify_helper : QApplication::notify : QgsApplication::notify : QCoreApplication::notifyInternal2 : QApplicationPrivate::sendMouseEvent : QSizePolicy::QSizePolicy : QSizePolicy::QSizePolicy : QApplicationPrivate::notify_helper : QApplication::notify : QgsApplication::notify : QCoreApplication::notifyInternal2 : QGuiApplicationPrivate::processMouseEvent : QWindowSystemInterface::sendWindowSystemEvents : QEventDispatcherWin32::processEvents : CallWindowProcW : DispatchMessageW : QEventDispatcherWin32::processEvents : qt_plugin_query_metadata : QEventLoop::exec : QCoreApplication::exec : main : BaseThreadInitThunk : RtlUserThreadStart : *QGIS Info* QGIS Version: 3.2.1-Bonn QGIS code revision: commit:1edf372fb8 Compiled against Qt: 5.9.2 Running against Qt: 5.9.2 Compiled against GDAL: 2.2.4 Running against GDAL: 2.2.4 *System Info* CPU Type: x86_64 Kernel Type: winnt Kernel Version: 10.0.17134
When using the widget, make sure to call setOriginalExtent(), setCurrentExtent() and setOutputCrs() during initialization.
qgis.org/pyqgis/master/gui/other/QgsExtentGroupBox.html Have you checked this?setOriginalExtent(), setCurrentExtent() and setOutputCrs()
but the error still happens. The error happens when a checkbox is checked.