It looks like you're new here. If you want to get involved, click one of these buttons!
Hi, following our effort to integrate klayout within qucs, we are developing a new plugin (entire framework is C++ and we link directly KLayout libraries).
Now, in this plugin (child of edt::Service) we create a lay::Marker to follow some "drag" activity by the mouse.
Here there is something we don't comprehend: at the beginning (blank layout) everything works fine.
After loading a gds in the current layoutView, we switch again the view mode to the new plugin but the marker is not shown anymore.
All events are handled correctly to the plugin and we enforce the layoutView->show_markers(true).
Apparently, loading a gds into the view changes some behaviour of the view itself but we cannot figure out what.
Any hint? Thanks!
Alessio
Comments
Hi Alessio,
do you have some code you can share?
Right now, markers do not survive a change of the files inside the view. Markers are not intended as persisting objects, but rather short-lived annotations - such as error markers.
Maybe you can register your plugin to listen to events on the view and regenerate the markers after such a change, or you use a QTimer to regularly check if the marker is still alive. But I have not tried one of these options myself.
I guess it's possible to change the KLayout code to have markers survive a file operation. But that's worth a ticket on GitHub.
Regards,
Matthias
Hi Matthias,
Thanks for the prompt follow up.
The issue is that, even if we create a new marker (after the layout has been loaded), it's not visible.
Here follows the relevant code:
1. at beginning (empty layout) and
2. after layout load we switch to our plugin which is created from its factory with top (0) priority
Then here the handler of mouse event (overriding edt::Service)
Procedure to update mouse cursor and (hopefully) marker:
Procedure to update the marker
This is called each time mouse is pressed
This is called each time mouse is release (delete the marker)
At mouse release we cancel the marker
So, as you can see, the code is (or should be) pretty straightforward. This means that we are doing something wrong but we really cannot figure out what.
Thank you very much!
Alessio