Preferences Dialog in Modeless mode

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Preferences Dialog in Modeless mode

Post by vm4dim »

Now main Preferences Dialog run in Modal mode (all last 11 years of GitHub history).
I wanted suggest use Modeless mode.

In Qt Docs https://doc.qt.io/qt-5/qdialog.html#modeless-dialogs
says to use show() instead of exec() for Modeless mode.

For FreeCAD it is there: https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L371

Code: Select all

    cDlg.exec();
But use only show() not works for me, the Dialog is not displayed.

It works if add show() before exec().

Code: Select all

    cDlg.show();
    cDlg.exec();
And set false there: https://github.com/FreeCAD/FreeCAD/blob ... ui#L19-L21

Not sure that is very right.
It works for me on Debian Sid. Maybe on other systems this is not the case.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Preferences Dialog in Modeless mode

Post by openBrain »

We perfectly know how to do it technically speaking.
The question is : what's the user/usage interest in doing so? I see no rational there. ;)

BTW : the standard wording is modal/non-modal ('modeless' is a bit strange to understand -- maybe only as non-native English speaker -- even if used in Qt doc :P).
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: Preferences Dialog in Modeless mode

Post by vm4dim »

To apply different settings without closing Dialog.
Now [Apply] button is actually not working.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Preferences Dialog in Modeless mode

Post by openBrain »

vm4dim wrote: Wed Jun 29, 2022 11:56 am To apply different settings without closing Dialog.
Now [Apply] button is actually not working.
Ok, so maybe a good solution is just that 'Apply' works...
Notice that using non-modal dialog won't change anything as 'Ok' button will still close the dialog. ;)

Last time I used 'Apply' it worked well, but I didn't test for a pretty long time.
Could you:
* Give your full FreeCAD info?
* Give an example of a preference that admittedly don't work with 'Apply'?
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: Preferences Dialog in Modeless mode

Post by vm4dim »

Code: Select all

OS: Debian GNU/Linux bookworm/sid
Word size of FreeCAD: 64-bit
Version: 0.21.29359 (Git)
Build type: Release
Branch: mplus
Hash: 850c2b29c5120da144827ddf0d868fedf1464614
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.7.0.dev
Locale: Russian/Russia (ru_RU)
I try create Preference page for Part_Measure
https://github.com/FreeCAD/FreeCAD/pull ... 1166353215
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Preferences Dialog in Modeless mode

Post by openBrain »

vm4dim wrote: Wed Jun 29, 2022 12:33 pm I try create Preference page for Part_Measure
https://github.com/FreeCAD/FreeCAD/pull ... 1166353215
There is absolutely nothing in your PR regarding a Preference page. You just added a parameter.
And...can't see any link with Preference dialog modality...
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Preferences Dialog in Modeless mode

Post by adrianinsaval »

I don't think the modal dialog has much to do there, most likely it is the measure feature that doesn't do live update of those values, do they auto update when you manually change the parameter?
Post Reply