GUI: Update MacOS detection macros

For GUI-specific things use Q_OS_MACOS, and for other things use
Q_OS_APPLE.
This commit is contained in:
Chris Hennes
2024-08-02 16:31:22 -04:00
committed by Chris Hennes
parent f846cc7acf
commit e52ef2a525
13 changed files with 18 additions and 18 deletions

View File

@@ -2026,7 +2026,7 @@ void setAppNameAndIcon()
else {
QApplication::setApplicationName(QString::fromStdString(App::Application::getExecutableName()));
}
#ifndef Q_OS_MACX
#ifndef Q_OS_MACOS
QApplication::setWindowIcon(
Gui::BitmapFactory().pixmap(App::Application::Config()["AppIcon"].c_str()));
#endif

View File

@@ -80,7 +80,7 @@ bool Assistant::startAssistant()
QString app;
app = QDir::toNativeSeparators(QString::fromStdString
(App::Application::getHomePath()) + QLatin1String("bin/"));
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_APPLE)
QString app = QCoreApplication::applicationDirPath() + QDir::separator();
#else
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)

View File

@@ -2690,7 +2690,7 @@ public:
qreal pRatio = widget->devicePixelRatioF();
qreal hotXF = hotX;
qreal hotYF = hotY;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACOS)
if (qApp->platformName() == QLatin1String("xcb")) {
hotXF *= pRatio;
hotYF *= pRatio;

View File

@@ -94,7 +94,7 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path,
("User parameter:BaseApp/Preferences/Expression")->GetBool("NoSystemBackground", false);
if (noBackground) {
#if defined(Q_OS_MAC)
#if defined(Q_OS_MACOS)
setWindowFlags(Qt::Widget | Qt::Popup | Qt::FramelessWindowHint);
#else
setWindowFlags(Qt::SubWindow | Qt::Widget | Qt::Popup | Qt::FramelessWindowHint);

View File

@@ -673,7 +673,7 @@ FileChooser::FileChooser ( QWidget * parent )
button = new QPushButton(QLatin1String("..."), this);
#if defined (Q_OS_MAC)
#if defined (Q_OS_MACOS)
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // layout size from QMacStyle was not correct
#endif

View File

@@ -41,7 +41,7 @@
#endif
#elif defined(Q_OS_WIN)
#include "3Dconnexion/GuiNativeEventWin32.h"
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
#include "3Dconnexion/GuiNativeEventMac.h"
#endif // Platform switch
#endif // Spacemice

View File

@@ -1264,7 +1264,7 @@ void PythonConsole::runSourceFromMimeData(const QString& source)
#elif defined(Q_OS_WIN32)
// Need to convert CRLF to LF
text.replace(QLatin1String("\r\n"), QLatin1String("\n"));
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_APPLE)
//need to convert CR to LF
text.replace(QLatin1Char('\r'), QLatin1Char('\n'));
#endif

View File

@@ -137,7 +137,7 @@ FreeCADPanelScheme::FreeCADPanelScheme() : ActionPanelScheme()
ActionPanelScheme* panelStyle = WinXPPanelScheme2::defaultScheme();
actionStyle = QString(ActionPanelFreeCAD);
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
ActionPanelScheme* panelStyle = MacPanelScheme::defaultScheme();
actionStyle = panelStyle->actionStyle;

View File

@@ -96,7 +96,7 @@ TDragger::TDragger()
{
SO_KIT_CONSTRUCTOR(TDragger);
#if defined(Q_OS_MAC)
#if defined(Q_OS_APPLE)
this->ref();
#endif
@@ -400,7 +400,7 @@ void TPlanarDragger::initClass()
TPlanarDragger::TPlanarDragger()
{
SO_KIT_CONSTRUCTOR(TPlanarDragger);
#if defined(Q_OS_MAC)
#if defined(Q_OS_APPLE)
this->ref();
#endif
@@ -698,7 +698,7 @@ void RDragger::initClass()
RDragger::RDragger()
{
SO_KIT_CONSTRUCTOR(RDragger);
#if defined(Q_OS_MAC)
#if defined(Q_OS_APPLE)
this->ref();
#endif

View File

@@ -123,7 +123,7 @@ void ToolHandler::setSvgCursor(const QString& cursorName,
qreal defaultCursorSize = isRatioOne ? 64 : 32;
qreal hotX = x;
qreal hotY = y;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
#if !defined(Q_OS_WIN32) && !defined(Q_OS_APPLE)
if (qGuiApp->platformName() == QLatin1String("xcb")) {
hotX *= pRatio;
hotY *= pRatio;
@@ -157,7 +157,7 @@ void ToolHandler::setCursor(const QPixmap& p, int x, int y, bool autoScale)
p1.setDevicePixelRatio(pRatio);
qreal hotX = x;
qreal hotY = y;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
#if !defined(Q_OS_WIN32) && !defined(Q_OS_APPLE)
if (qGuiApp->platformName() == QLatin1String("xcb")) {
hotX *= pRatio;
hotY *= pRatio;

View File

@@ -1069,7 +1069,7 @@ LabelButton::LabelButton (QWidget * parent)
layout->addWidget(label);
button = new QPushButton(QLatin1String("..."), this);
#if defined (Q_OS_MAC)
#if defined (Q_OS_MACOS)
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // layout size from QMacStyle was not correct
#endif
layout->addWidget(button);
@@ -1456,7 +1456,7 @@ LabelEditor::LabelEditor (QWidget * parent)
this, &LabelEditor::validateText);
button = new QPushButton(QLatin1String("..."), this);
#if defined (Q_OS_MAC)
#if defined (Q_OS_MACOS)
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // layout size from QMacStyle was not correct
#endif
layout->addWidget(button);

View File

@@ -1600,7 +1600,7 @@ PropertyEditorWidget::PropertyEditorWidget (QWidget * parent)
layout->addWidget(lineEdit);
button = new QPushButton(QLatin1String("..."), this);
#if defined (Q_OS_MAC)
#if defined (Q_OS_MACOS)
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // layout size from QMacStyle was not correct
#endif
layout->addWidget(button);
@@ -4574,7 +4574,7 @@ LinkLabel::LinkLabel (QWidget * parent, const App::Property *prop)
layout->addWidget(label);
editButton = new QPushButton(QLatin1String("..."), this);
#if defined (Q_OS_MAC)
#if defined (Q_OS_MACOS)
editButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // layout size from QMacStyle was not correct
#endif
editButton->setToolTip(tr("Change the linked object"));

View File

@@ -586,7 +586,7 @@ QPixmap QGVPage::prepareCursorPixmap(const char* iconName, QPoint& hotspot)
// the 64x64 based hotspot position for our 32x32 based cursor pixmaps accordingly
floatHotspot *= 0.5;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACOS)
// On XCB platform, the pixmap device pixel ratio is not taken into account for cursor hot spot,
// therefore we must take care of the transformation ourselves...
// Refer to QTBUG-68571 - https://bugreports.qt.io/browse/QTBUG-68571