Gui: use CMake to generate precompiled headers on all platforms

"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
This commit is contained in:
Markus Reitböck
2025-09-13 11:39:05 +02:00
parent d05e2a0431
commit 6ef07bb358
343 changed files with 399 additions and 983 deletions

View File

@@ -21,15 +21,12 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <limits>
# include <Inventor/sensors/SoNodeSensor.h>
# include <Inventor/nodes/SoAnnotation.h>
# include <Inventor/nodes/SoOrthographicCamera.h>
# include <Inventor/nodes/SoTransform.h>
# include <Inventor/nodes/SoSwitch.h>
#endif // _PreComp_
#include <QEvent>
#include <QKeyEvent>
@@ -270,7 +267,7 @@ void EditableDatumLabel::stopEdit()
spinBox->deleteLater();
spinBox = nullptr;
// Lock icon will be automatically destroyed as it's a child of spinbox
lockIconLabel = nullptr;
}
@@ -351,7 +348,7 @@ void EditableDatumLabel::positionSpinbox()
pxCoord.setX(posX);
pxCoord.setY(posY);
spinBox->move(pxCoord);
// Update lock icon position inside the spinbox if it exists and is visible
if (lockIconLabel && lockIconLabel->isVisible()) {
int iconSize = 14;
@@ -498,7 +495,7 @@ void EditableDatumLabel::setLockedAppearance(bool locked)
{
if (locked) {
if (spinBox) {
// create lock icon label it it doesn't exist, if it does - show it
if (!lockIconLabel) {
lockIconLabel = new QLabel(spinBox);
@@ -536,7 +533,7 @@ void EditableDatumLabel::setLockedAppearance(bool locked)
// if spinbox exists, reset its appearance
if (spinBox) {
spinBox->setStyleSheet(QString());
// hide lock icon if it exists for later reuse
if (lockIconLabel) {
lockIconLabel->hide();