Bug 478763 - Document.setActiveNode method does nothing on FileLayer
Summary: Document.setActiveNode method does nothing on FileLayer
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 5.2.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-20 10:35 UTC by Leroy
Modified: 2023-12-20 10:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
This script reproduces the issue (1022 bytes, text/plain)
2023-12-20 10:35 UTC, Leroy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leroy 2023-12-20 10:35:39 UTC
Created attachment 164307 [details]
This script reproduces the issue

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Hello,

seems that the method "setActiveNode" doesn't work for FileLayer. I'm executing the attached script that simply creates a FileLayer, adds it as child of the rootNodes and makes it being the active node.
The issue is that after the last method (setActiveNode), the created FileLayer IS not the active node.

Note: Try with paint layer the behavior is a little bit different. The paint layer is selected after the end of the script so that when you execute the script twice, the active node of the second attempt is the layer created during the first attempt.

STEPS TO REPRODUCE
1. Create a new python script to be executed by the Scripter of Krita
2. Create a new File Layer
3. Add the new File Layer to the root node children list.
4. Call the method "setActiveNode" of the Document, with the new File Layer as argument

OBSERVED RESULT
The current active node is NOT the new File Layer but the node that was active before the call of the method "setActiveNode"

EXPECTED RESULT
The current active node should have been the new File Layer so that we can apply some actions on it.

SOFTWARE/OS VERSIONS
Windows: 11
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION