Change modality of window

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

Change modality of window

Post by vishnu »

Hi,
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 :)
Attachments
ccBoundingBoxEditorDlg.cpp
ccBoundingBoxEditorDlg.cpp
Capture2.PNG (7.03 KiB) Viewed 2796 times
mainwindow.cpp
mainwindow.cpp
Capture.PNG (8.03 KiB) Viewed 2796 times
daniel
Site Admin
Posts: 7747
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Change modality of window

Post by daniel »

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
Post Reply