This fixes segfault that was caused by changing settings in
FirstStartWidget that triggered change event on not fully intialized
StartView.
It is quick and dirty fix that just disables handling of the event
causing segfault until widget is fully ready. The correct solution would
be to remove the logic that changes settings from the widget (as it
should not be there) and instad move it to another place in pipeline.
This would be however much more work and segfault should be fixed ASAP.
"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
* Gui: Remove references to the Addon Manager if no Std_AddonMgr
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Gui: Switch to disabling controls rather than hiding
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
only 4 of these warnings are still relevant, CMake shall be used to disable them
Compiler definitions:
NOMINMAX:
* is already globally defined in SetGlobalCompilerAndLinkerSettings.cmake
WIN32_LEAN_AND_MEAN:
* use CMake target_compile_options on relevant targets
Warnings that still occur:
C4251, C4273, C4275: all related to dllimport / export
* use CMake target_compile_options on relevant targets
C4661: no suitable definition provied for explicit template instantiation request
* triggered in Mesh because of Vector3D in Base - not all functions are defined in header
* use CMake target_compile_options on relevant targets
Warnings that are Currently not triggered (fix code if they appear again):
C4005: macro redefinition
C4244: argument conversion, possible loss of data
C4267: conversion from size_t to type, possible loss of data
C4305: truncation from type1 to type2
* only occurrence disabled in Reader.cpp
C4522: multiple assignment operator specified
C5208: unnamed class in typedef name
Obsolete Compiler warnings:
C4181: not mentioned in Microsoft docs anymore
C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
* throw(optional_type_list) deprecated in C++17
C4482: nonstandard extension used: enum 'enumeration' used in qualified name
* not generated for compilers that support C++11
C4503: 'identifier': decorated name length exceeded, name was truncated
* obsolete since Visual Studio 2017
C4786: not mentioned in Microsoft docs anymore
Updated PropertyEditor QLabel and QPushButton styles for better visual consistency
and usability, including specific pushbutton styling for the Placement tool. Adjusted
QCheckBox disabled indicator styles to use consistent border and background colors,
and fixed background color for checked and indeterminate disabled states.
Gave inactive and active tab their own token. Fixed missing hover for
scrollbar.
Changed the value of EditedEdgeColor in the FreeCAD Light preference
pack Due to contrast issues with default shape color.
Refreshed Theme_thumbnail_dark.png and Theme_thumbnail_light.png images.
Updated Thumbnails_themes.svg with new Inkscape version metadata, export
paths, and visual adjustments, including color and layout changes to
theme preview rectangles.
Refreshed Theme_thumbnail_dark.png and Theme_thumbnail_light.png images.
Updated Thumbnails_themes.svg with new export filenames, DPI settings,
and adjusted some SVG properties for improved export consistency.
Changed the TextDisabledColor to fix issue with lighten full black.
Adjusted the QComboBox padding-right from 2px to 18px in FreeCAD.qss to
provide space for the check-mark indicating the active item.
Changed the 'HighlightColor' value in the FreeCAD Light preference pack
configuration to dark green to solve contrast issues.
Introduces InActiveTabBackgroundColor and ActiveTabBackgroundColor to
both FreeCAD Dark and FreeCAD Light preference packs for improved tab
appearance customization.
* Start: Add caching for performance for thumbnails on start page
So currently we can have a problem where we are trying to load whole
image as a thumbnail, which can result in over 256MB~ of internal buffer
memory. Also, even if we load smaller size - every now and then start
page gets refreshed, so to check if any file got modified and refresh it
in recent files. This is okay, but with large files it loads them over
and over, resulting in start page lagging.
Solution for that is first - load image thumbnails as scaled, small
images instead of full image.
Second - for performance, use caching by using `path:modtime:size` key.
If the item fits this key, it means it didn't change, so just proceed
further and get this item from the cache. If the key is different, it
means it has been changed on the disk, so reload it.
* Start: Deactivate Start page if it loses focus to stop receiving events
As the title says. This prevents Start page from processing unnecessary
events (mostly paint ones that were causing extreme lag previously) if
it is not opened.
* Start: Preserve aspect ratio of the image for the thumbnail
* Start: use brace initialization when returning QString
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Start: Walks the parent tree to close the tab
We're currently closing the entire app, it seems a mistake.
Instead, we should look up the widget tree to find the tab
(QMdiSubWindow) and close it instead.
The way I put if we don't find it we don't do anything.
Might be unexpected but at least harmless.
A side effect of this fix is a required drop of constness of
multiple helper methods that call postStart().
* Start: Minor code cleanup and PCH fix
---------
Co-authored-by: Carlos Nihelton <cn@ubuntu.com>
Co-authored-by: Chris Hennes <chennes@gmail.com>
Procedure to trigger the crash:
* Create a document
* Create a spreadsheet and open it
* Close the 3D view
* Open the Start page
* It may or may not crash but the program is in an undefined state
The reason of the crash is caused by an inappropriate use of static_cast.
This bug is caused by PR 17152.
To fix the crash use dynamic_cast instead. If the cast fails it returns
a null pointer instead of a dangling pointer.
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