src/Gui/QuantitySpinBox.cpp:
- Call updateExpression() after setExpression() in QuantitySpinBox
src/Gui/SpinBox.cpp:
- Call updateExpression() after setExpression() in ExpressionSpinBox
src/Gui/Widgets.cpp:
- Call onChange() after setExpression() in ExpLineEdit
src/Mod/CAM/Path/Base/Gui/Util.py:
- Connect to showFormulaDialog signal and refresh CAM QuantitySpinBox Python wrapper when dialog closes
"Professional CMake" book suggest the following:
"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."
Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
User defined precision and fractional inch are stored on QuantityFormat
construction making changes persistent to object life time.
Change that so until not explicitely overriden, user defined values
are always returned.
Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
* Core: Fix Expression dialog outhanging main window
Expression dialog is now fully shown inside main window, even if opened from model panel positioned on right side. If Model panel is outside main window, dialog is opened over this panel.
* Core: Fix Vectors dialog outhanging main window
Vectors dialog is now fully shown inside main window, even if opened from model panel positioned on right side. If Model panel is outside main window, dialog is opened over this panel.
* Core: Simplify 'adjustDialogPosition()'
Change suggested and authored by @hyarion
Small regression of mine, basically this signal to remove set/locked
state of EditableDatumLabel should be only sent out if current text in
the label is empty or it doesn't contain digits.
Previously it was emitted every intermediate wrong state, so stuff like
"71." was also being matched, and it resulted in resetting the locked
state of the label, which in turn resulted in keeping user from entering
float values.
Currently if user tries to reset OVP, they can only do that by entering
"0" for example, and then the parameters will get unset in
unsetOnViewParameter. But that will only happen if user types a value
that's under confusion point (typically 1e^-7). In my opinion, it would
be cool to reset that state if user deletes all content in the label, to
allow them to specify coordinates with mouse once again.
Also, this patch fixes a regression with backspace, where deleting stuff
from OVP was working on unix systems, but seems like on Windows it
doesn't pass the check.
Quantity is often queried for Unit just to see if it has a dimension.
Ask Quantity directly using isDimensionless() method and modify that
method not to care about Quantity value validity; no user was ever
asking for value validity.
Fixes: Maintaining schemas is difficult and error-prone
- Facilitate easy schemas add, remove, change, etc.
- Remove 14 files containing approx 2,190 lines of if/else code and data
- Place data in one file (UnitsSchemasData.h) using a normalized structure (including special functions)
- Isolate and simplify data operations (code)
- Remove schemas enum to keep data independent of code
- Separate responsibilities: Specifications, data, schemas, schema
- Add schema data 'isDefault'
- Add schema data name
- Prefer algorithms to raw loops
- Add schemas unit tests
- Tweak quantity unit tests
==============================================
Problem:
When the value set is a double, a new Quantity is created, which does not follow
the previously configured format (setDecimals).
Solution:
To copy the old format to the newly created quantity.
* Constructor of QFontDatabase is deprecated, use static functions instead
* Fix QuantitySpinBox::selectNumber()
* Fix InputField::selectNumber()
* Make InputField::fixup() compatible with Qt6
* QFont::setWeight requires an enum now
* QInputEvent reuires a pointing device now
* QAbstractItemView::viewOptions() has been renamed to QAbstractItemView::initViewItemOption()
* Explicitly include some missing headers
* Use 'static const char*' for XPM icon
* Skip template parameters for qMakePair
* Constructor of QFileInfo is marked as 'explicit' now
* QString::fromLatin1() also accepts a QByteArray
* QDateTime::fromTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::fromSecsSinceEpoch()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QApplication::globalStrut() is deprecated. Don't use it any more.
* QWidget::isTopLevel() is deprecated, use QWidget::isWindow()
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto.
* When possible use a ranged for loop instead of begin() and end() iterators