New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to edit elements in the print layout after locking an element #57331
Comments
To add more details, this behaviour happens (at least on my end) when you lock ANY element in a layout. Like other things in the layout, the situation is fixed by closing the layout and reopening it. This makes the state change behave as intended. This is probably related to a larger set of issues with state change in the layout and the complex dependencies betweeen everything. A refresh/reinitialization might be better for those breaking elements (atlas changes, locking and possibly some tother) than hoping the user closes and reopen the layout to 'fix' it manually. |
Indeed it's when you lock any element, not just the group. Reopening the windows is a quick fix, but not a good one as I have a rather complex print template with a locked header, so the chance of pressing a locked element is very likely and leads to a lot of frustration for the users using this printtemplate. This behavior seems new I do not remember having this issue with the previous LTR |
Assuming I understood the report correctly and following the test I did here (3.36), the issue I see is that you are unable to graphically SELECT an item in the print layout once you have locked any item in the layout. Unlocking the item by unchecking the box or using the corresponding buttons does not fix the issue. Like if the "Select/move item" tool has been deactivated from interacting with the layout or ALL the items have been locked. However it is technically still possible to edit elements. Locked items can be selected by clicking on their name in the "Items" panel and editing their properties is still possible. The issue is on selecting with the "select/move item" tool not about editing the items properties, as implied by the report title. |
For the record, this warning appears when clicking on the locked group and triggers the issue: cannot grab mouse while invisible I think it's related to the group graphic item not being visible, I have a fix but I'm not 100% sure it's the right one: diff --git a/src/gui/layout/qgslayoutviewtoolselect.cpp b/src/gui/layout/qgslayoutviewtoolselect.cpp
index b7f9fab96dc..e395e368e1b 100644
--- a/src/gui/layout/qgslayoutviewtoolselect.cpp
+++ b/src/gui/layout/qgslayoutviewtoolselect.cpp
@@ -130,6 +130,12 @@ void QgsLayoutViewToolSelect::layoutPressEvent( QgsLayoutViewMouseEvent *event )
return;
}
+ if ( selectedItem->isLocked() )
+ {
+ //locked items cannot be selected
+ return;
+ }
+
if ( ( event->modifiers() & Qt::ShiftModifier ) && ( selectedItem->isSelected() ) )
{
//SHIFT-clicking a selected item deselects it
I am making a PR with the patch. |
What is the bug or the crash?
When you group elements and locking them, and then press on the locked group afterwards you are unable to edit any other elements. It's as if all other elements gets locked as well.
Steps to reproduce the issue
Versions
QGIS-version
3.34.4-Prizren
QGIS-koderevision
decd43d
Qt version
5.15.3
Python version
3.9.18
GDAL/OGR version
3.8.4
PROJ version
9.3.1
EPSG Registry database version
v10.098 (2023-11-24)
GEOS version
3.12.1-CAPI-1.18.1
SQLite version
3.41.1
PDAL version
2.6.0
PostgreSQL klient version
16.1
SpatiaLite version
5.1.0
QWT version
6.1.6
QScintilla2 version
2.13.4
OS version
Windows 10 Version 2009
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: