#9245 replace Q_WS_MACX with Q_OS_MAC - the Q_OS_MAC macro is usable with Qt4 and Qt5.

This commit is contained in:
Stephan Witt 2014-08-25 20:08:59 +02:00
parent 4521fc757b
commit 3aa428fdea
19 changed files with 36 additions and 36 deletions

View File

@ -33,7 +33,7 @@
#include <map>
#include <ctime>
// FIXME: Q_WS_MACX is not available, it's in Qt
// FIXME: Q_OS_MAC is not available, it's in Qt
#ifdef USE_MACOSX_PACKAGING
#include "support/linkback/LinkBackProxy.h"
#endif

View File

@ -455,7 +455,7 @@ bool CategorizedCombo::eventFilter(QObject * o, QEvent * e)
void CategorizedCombo::setIconSize(QSize size)
{
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
bool small = size.height() < 20;
setAttribute(Qt::WA_MacSmallSize, small);
setAttribute(Qt::WA_MacNormalSize, !small);

View File

@ -35,7 +35,7 @@
*
* Therefore there is a tradeoff in enabling or disabling this (JMarc)
*/
#if defined(Q_WS_MACX) || defined(Q_OS_WIN)
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
#define USE_NATIVE_FILEDIALOG 1
#endif

View File

@ -613,7 +613,7 @@ void FindAndReplaceWidget::updateGUI()
Dialog * createGuiSearchAdv(GuiView & lv)
{
FindAndReplace * gui = new FindAndReplace(lv, Qt::RightDockWidgetArea);
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// On Mac show and floating
gui->setFloating(true);
#endif

View File

@ -77,7 +77,7 @@
#include "support/Systemcall.h"
#include "support/TempFile.h"
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
#include "support/AppleScript.h"
#include "support/linkback/LinkBackProxy.h"
#endif
@ -133,9 +133,9 @@
#include <objidl.h>
#endif // Q_WS_WIN
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
#include <QMacPasteboardMime>
#endif // Q_WS_MACX
#endif // Q_OS_MAC
#include "support/bind.h"
#include <boost/crc.hpp>
@ -652,7 +652,7 @@ public:
}
};
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// QMacPasteboardMimeGraphics can only be compiled on Mac.
class QMacPasteboardMimeGraphics : public QMacPasteboardMime
@ -932,7 +932,7 @@ struct GuiApplication::Private
/// Only used on mac.
QMenuBar * global_menubar_;
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
/// Linkback mime handler for MacOSX.
QMacPasteboardMimeGraphics mac_pasteboard_mime_;
#endif
@ -951,7 +951,7 @@ GuiApplication * guiApp;
GuiApplication::~GuiApplication()
{
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
closeAllLinkBackLinks();
#endif
delete d;
@ -979,7 +979,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
if (lyxrc.quit_on_last_window_closed)
setQuitOnLastWindowClosed(false);
*/
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// FIXME: Do we need a lyxrc setting for this on Mac? This behaviour
// seems to be the default case for applications like LyX.
setQuitOnLastWindowClosed(false);
@ -2346,7 +2346,7 @@ void GuiApplication::execBatchCommands()
// Gives some error box here.
return;
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
#if QT_VERSION > 0x040600
setAttribute(Qt::AA_MacDontSwapCtrlAndMeta,lyxrc.mac_dontswap_ctrl_meta);
#endif

View File

@ -213,7 +213,7 @@ GuiCharacter::GuiCharacter(GuiView & lv)
bc().addReadOnly(toggleallCB);
bc().addReadOnly(autoapplyCB);
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// On Mac it's common to have tool windows which are always in the
// foreground and are hidden when the main window is not focused.
setWindowFlags(Qt::Tool);

View File

@ -30,9 +30,9 @@
#include "support/lstrings.h"
#include "support/lyxtime.h"
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
#include "support/linkback/LinkBackProxy.h"
#endif // Q_WS_MACX
#endif // Q_OS_MAC
#include "frontends/alert.h"
@ -313,7 +313,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
// write the (LinkBack) PDF data
f.write(ar);
if (type == LinkBackGraphicsType) {
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
void const * linkBackData;
unsigned linkBackLen;
getLinkBackData(&linkBackData, &linkBackLen);
@ -324,7 +324,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
#else
// only non-Mac this should never happen
LATTEST(false);
#endif // Q_WS_MACX
#endif // Q_OS_MAC
}
f.close();
@ -488,11 +488,11 @@ bool GuiClipboard::hasGraphicsContents(Clipboard::GraphicsType type) const
// handle LinkBack for Mac
if (type == LinkBackGraphicsType)
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
return isLinkBackDataInPasteboard();
#else
return false;
#endif // Q_WS_MACX
#endif // Q_OS_MAC
// get mime data
QStringList const & formats = cache_.formats();

View File

@ -265,7 +265,7 @@ GuiFontInfo::GuiFontInfo(FontInfo const & f)
QString family = makeFontName(toqstr(lyxrc.roman_font_name),
toqstr(lyxrc.roman_font_foundry));
font.setFamily(family);
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
#if QT_VERSION >= 0x040300 //&& QT_VERSION < 0x040800
// Workaround for a Qt bug, see http://www.lyx.org/trac/ticket/3684
// and http://bugreports.qt.nokia.com/browse/QTBUG-11145.
@ -341,7 +341,7 @@ bool FontLoader::available(FontInfo const & f)
static vector<int> cache(NUM_FAMILIES, false);
FontFamily family = f.family();
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// Apple ships a font name "Symbol", which has more or less the same
// glyphs as the original PostScript Symbol font, but it uses a different
// encoding (see https://en.wikipedia.org/wiki/Symbol_(typeface)#cite_note-2).

View File

@ -704,7 +704,7 @@ docstring const KeySymbol::print(KeyModifier mod, bool forgui) const
if (forgui)
str = seq.toString(QKeySequence::NativeText);
else {
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// Qt/Mac does not use Command and friends in the
// portable case, but the windows-like Control+x (bug 5421).
str = seq.toString(QKeySequence::NativeText);

View File

@ -9,7 +9,7 @@
* Full author contact details are available in file CREDITS.
*/
#ifdef Q_WS_MAC
#ifdef Q_OS_MAC
#define USE_RTL_OVERRIDE 1
#endif

View File

@ -61,7 +61,7 @@ GuiParagraph::GuiParagraph(GuiView & lv)
connect(labelWidth, SIGNAL(textChanged(QString)),
this, SLOT(changed()));
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// On Mac it's common to have tool windows which are always in the
// foreground and are hidden when the main window is not focused.
setWindowFlags(Qt::Tool);

View File

@ -500,7 +500,7 @@ PrefInput::PrefInput(GuiPreferences * form)
// reveal checkbox for switching Ctrl and Meta on Mac:
bool swapcb = false;
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
#if QT_VERSION > 0x040600
swapcb = true;
#endif

View File

@ -614,7 +614,7 @@ void GuiSpellchecker::updateView()
Dialog * createGuiSpellchecker(GuiView & lv)
{
GuiSpellchecker * gui = new GuiSpellchecker(lv, Qt::RightDockWidgetArea);
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
gui->setFloating(true);
#endif
return gui;

View File

@ -98,7 +98,7 @@ bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd,
Dialog * createGuiToc(GuiView & lv)
{
GuiToc * toc;
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// On Mac show at the right and floating
toc = new GuiToc(lv, Qt::RightDockWidgetArea);
toc->setFloating(true);

View File

@ -448,7 +448,7 @@ GuiView::GuiView(int id)
// We don't want to keep the window in memory if it is closed.
setAttribute(Qt::WA_DeleteOnClose, true);
#if !(defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)) && !defined(Q_WS_MACX)
#if !(defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)) && !defined(Q_OS_MAC)
// QIcon::fromTheme was introduced in Qt 4.6
#if (QT_VERSION >= 0x040600)
// assign an icon to main form. We do not do it under Qt/Win or Qt/Mac,
@ -1064,7 +1064,7 @@ void GuiView::on_lastWorkAreaRemoved()
return;
}
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// On Mac we also close the last window because the application stay
// resident in memory. On other platforms we don't close the last
// window because this would quit the application.

View File

@ -61,7 +61,7 @@
#endif
#include <QDrag>
#include <QHelpEvent>
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
#include <QProxyStyle>
#endif
#include <QMainWindow>
@ -1487,7 +1487,7 @@ void EmbeddedWorkArea::disable()
//
////////////////////////////////////////////////////////////////////
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
class NoTabFrameMacStyle : public QProxyStyle {
public:
///
@ -1518,7 +1518,7 @@ NoTabFrameMacStyle noTabFrameMacStyle;
TabWorkArea::TabWorkArea(QWidget * parent)
: QTabWidget(parent), clicked_tab_(-1)
{
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
setStyle(&noTabFrameMacStyle);
#endif

View File

@ -522,7 +522,7 @@ bool LayoutBox::eventFilter(QObject * o, QEvent * e)
void LayoutBox::setIconSize(QSize size)
{
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
bool small = size.height() < 20;
setAttribute(Qt::WA_MacSmallSize, small);
setAttribute(Qt::WA_MacNormalSize, !small);

View File

@ -2231,7 +2231,7 @@ bool Menus::searchMenu(FuncRequest const & func,
void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
{
if (initial) {
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// setup special mac specific menu items, but only do this
// the first time a QMenuBar is created. Otherwise Qt will
// create duplicate items in the application menu. It seems
@ -2282,7 +2282,7 @@ void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
Menu * menu = new Menu(view, m->submenuname(), true);
menu->setTitle(label(*m));
#if defined(Q_WS_MACX) && (defined(QT_MAC_USE_COCOA) || (QT_VERSION >= 0x050000))
#if defined(Q_OS_MAC) && (defined(QT_MAC_USE_COCOA) || (QT_VERSION >= 0x050000))
// On Mac OS with QT/cocoa, the menu is not displayed if there is no action
// so we create a temporary one here
QAction * action = new QAction(menu);

View File

@ -298,7 +298,7 @@ QStringList texFileList(QString const & filename)
QString const externalLineEnding(docstring const & str)
{
#ifdef Q_WS_MACX
#ifdef Q_OS_MAC
// The MAC clipboard uses \r for lineendings, and we use \n
return toqstr(subst(str, '\n', '\r'));
#elif defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)