Add the optional Qt::MSWindowsFixedSizeDialogHint parameter to all uses of the QInputDialog::getX static functions to silence a Qt/Windows debug mode warning about QWindowsWindow::setGeometry: Unable to set geometry. Increase the size of the unit calculator to eliminate the same warning. Finally, call adjustSize() on the "Unsaved Changes" dialog to silence the warning.
These values are calculated exactly from (diameter-pitch), and are
included here only to silence warnings from some compilers about missing
initializers. These values are not (currently) used in the code, which
directly calculates the core hole as needed in this case.
- there is the ISO 273 describing clearance holes, so we need to take these values. Only if we have a size not defined in the norm, we calculate
- add the coarse (wide) type for clearance holes from ISO 273
- add all screw thread sizes defined in DIN 13/ISO 261
- rearrange thread dialog to make it more compact
- change name "fit" to "clearance" as discussed
- add tooltips to the dialog
- fix issue with TaperedAngle dialog field
- change a size name because the norms define "M1" not "M1.0"
- fix bug that custom angles were overwritten
- the norms only define screw heads, not the cut for them, so also a custom angle is possible to sink a metric screw
- use better step in UI since one changes the presets only in fractions of a millimeter (otherwise it would be a different hole size)
- handle case of no cut
- calculate change in diameter when adding depth to countersinks
- propose cut values also for UTS profiles
- the UTS defines coarse and fine while for ISO it is regular and fine, thus fix the name
- for the dialog: set minimum values to zero (angles etc. cannot be negative)
- add definitions for IS 2009, 7046 and 12474
- remove useless file for a ISO 14583 since there are no such screws on the market
- rename "coarse" to "regular" since this what it actually is according to the norms
- uniform the x1 threads (for x2.0 etc we use a trailing zero and for some we use x1, for some already x1.0, thus consistently use x1.0)
- add some ISO 10642 entries
- correct ISO 4762:
- correct some values
- the does does not define a size M27
- add the two missing sizes
- propose valid values for the cut depth and diameter when creating new holes
- add new definitions for metric fine
- some code simplification and comments
‣ Make countersink and counterbore on metric holes freely definable by user.
‣ Fixed the Naming of M1.6, M2, M2.5 and M3.5
‣ Added constructor for custom enums from Enums to PropertyEnumeration
‣ Put definitions of cut-types (counterbore/countersink) for
screwtypes into json-files for easy modification.
‣ Allow users to put its own definitions in json-files in
[UserDir]/Mod/PartDesign/Resources/Hole
‣ Contains several examples of cut-type definition json-files that are
propably not production-ready.
This uses a local copy of nlohmann::json¹ to read json-files.
__________
¹ This is a very nice,header-only C++ library under the MIT License
(https://github.com/nlohmann/json). I copied the single-file-version
and the forward-declaration-header into …/PartDesign/App/ so no new
dependencies arise.
fix a problem with counterbore and countersink in PartDesign Hole feature.
It was not possible to custom define counterbores or countersinks if a
metric thread hole was selected.
Handle the cut-types None, Counterbore and Countersink euqal
regardless of type of thread and let the user customize:
None: none
Counterbore: diameter and depth
Countersink: diameter and angle
- initialization: thread direction only sensible if there is a thread
- initialization: hole diameter can only be changed if there is no profile
- initialization: only enable allowed hole cut parameters
- also for the ISO profiles it is allowed to countersink/bore deeper/less deep
- UI file: add some tooltips (the other changes were done automatically by Qt's designer)
- initialization: if a threaded, the fit must not be enabled
- when changing the profile type setReadOnly for the fit and class according to if threaded or not
- when changing if threaded or not, setReadOnly accordingly for the fit and class
as described in https://forum.freecadweb.org/viewtopic.php?f=3&t=50611, the task dialog should just read out the parameters on initialization and not invoke automatically change actions.
This PR also fixes a bug that opening a document with a cheesehead hole leads to an error about an invalid index. The reason is that we access the hole cut type before we set its enums. Thus initialize the cut type with all possible enums since, if necessary, the reduced enum set will be set later on parsing the file.
+ do not rely on translated strings but set user data for the items of the combo box
+ do not use tr() to convert the C strings to QString of the hole feature, use QString::fromLatin1
+ do not use findText() twice for the same search but store the result
as mentioned in https://forum.freecadweb.org/viewtopic.php?f=13&t=47584&start=10#p433116
a typical use case is that one changes the hole type from e.g. ISO normal to ISO fine. The size should however be the same.
This PR enables this and also takes care for the thread class and cut type, see the attached screencast.
+ Fix hard crash when selecting an edge or face of the created feature before selecting option to choose a reference.
+ In ProfileBased::getAxis() convert OCCT into FreeCAD exception to simplify handling of calling instances.
+ Change return value of getReferencedSelection() from void to bool to mkae it easier for calling instance to detect if the selection failed.
This is needed to avoid to add invalid items to the combo box of the revolution task panel
In v0.17 this was needed to fix bug 2503 and was done with commit d4ff570bf9.
Now a more sensible view frustum is already set on document creation.
The automatic adjustment is even annoying now if the document is not empty and nothing is selected because
the view frustum can become too big and thus the objects appear quite small.