Change modality of window

For any question about plugins!
Posts: 1
Joined: Sun May 21, 2017 4:09 pm

Change modality of window

Postby vishnu » Fri Jun 30, 2017 9:52 am

I am trying to add a simple functionality to the "crop" tool in CloudCompare. Currently in crop tool user needs to manually enter the x,y,z coordinates to crop the cloud. I am trying to implement a picking option in the same, so that x,y,z can be obtained from the pick. Since the crop window is modal,i am not able to pick the cloud point when the crop window is active. I tried several methods to change the modality of the window but not working!!!. So my question is...Is it possible to change the modality of the crop window without much edit in code?(because i am not expertise in c++ and Qt)...if yes... how?.
Thanks in advance :)
Capture2.PNG (7.03 KiB) Viewed 495 times
Capture.PNG (8.03 KiB) Viewed 495 times

Site Admin
Posts: 3516
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France

Re: Change modality of window

Postby daniel » Fri Jun 30, 2017 10:30 am

Properly handling point picking in a dialog is not an easy task (see how the 'Camera options' dialog works. There's a new mechanism called 'ccPickingHub' that helps in this process, but you still need to handle the window modality properly and register and unregister the dialog from the picking hub.

Anyway, in your case I think the issue is that 'exec' makes the dialog modal by definition. You would have to use 'start' instead. However, the call to 'start' is not blocking, so you need to wait for the user to click on Ok (for instance) and transfer all the code that is done after 'exec' to another function (slot) that will only be called when the dialog is closed.

This is basically what is done in the overlay tools (interactive segmentation, transformation, etc.) as well as in the camera parameters dialog in a way.
Daniel, CloudCompare admin

Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest