]> git.lyx.org Git - features.git/commitdiff
Replace Q_WS_WIN with appropriate guards to account for Qt5.
authorEnrico Forestieri <forenr@lyx.org>
Mon, 25 Aug 2014 17:27:45 +0000 (19:27 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 25 Aug 2014 17:27:45 +0000 (19:27 +0200)
This commit replaces almost all occurrences of Q_WS_WIN to comply
with Qt5. The remaining occurrences should *not* be replaced,
because the guarded code won't compile on Qt5.

src/frontends/qt4/FileDialog.cpp
src/frontends/qt4/GuiClipboard.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/Menus.cpp
src/frontends/qt4/qt_helpers.cpp

index 8f63d2e18a89584f8c6d45227804cf95c4081dcf..2b60fbf9510203b171a22373cf2ecc75d85c3c54 100644 (file)
@@ -35,7 +35,7 @@
  *
  * Therefore there is a tradeoff in enabling or disabling this (JMarc)
  */
-#if defined(Q_WS_MACX) || (defined(Q_WS_WIN) && !defined(Q_OS_CYGWIN))
+#if defined(Q_WS_MACX) || defined(Q_OS_WIN)
 #define USE_NATIVE_FILEDIALOG 1
 #endif
 
index d96dd26f0be90fdaa5fe793208fbd7fa8a0a3981..7aad7a95604774d4bb10beb8823f38a26dda3f32 100644 (file)
@@ -541,7 +541,7 @@ bool GuiClipboard::hasInternal() const
        // are notified of changes. However, on Windows ownership is
        // emulated by Qt through the OleIsCurrentClipboard() API, while
        // on Mac OS X we deal with this issue by ourself.
-#if (defined(Q_WS_X11) || defined(Q_WS_WIN))
+#if defined(Q_WS_X11) || defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
        return true;
 #else
        return false;
index a7cbbe49fed44c0026419e1a63c88d1aa6974ee4..08b9c35e0e77a9d89def4e76a14aefc5fe6cd92b 100644 (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_WS_WIN) && !defined(Q_WS_MACX))
+#if !(defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)) && !defined(Q_WS_MACX)
        // 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,
index 5a901d8acc64273abc5e1f01d487209066dcbe05..ece5eed6b9c4717eb7e14fcda3db802b3014f3e6 100644 (file)
@@ -1774,7 +1774,7 @@ void Menu::Impl::populate(QMenu & qMenu, MenuDefinition const & menu)
        }
 }
 
-#if defined(Q_WS_WIN) && (QT_VERSION >= 0x040600)
+#if (defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)) && (QT_VERSION >= 0x040600)
 class AlwaysMnemonicStyle : public QProxyStyle {
 public:
        int styleHint(StyleHint hint, const QStyleOption *opt = 0, const QWidget *widget = 0,
@@ -1794,7 +1794,7 @@ public:
 Menu::Menu(GuiView * gv, QString const & name, bool top_level, bool keyboard)
 : QMenu(gv), d(new Menu::Impl)
 {
-#if defined(Q_WS_WIN) && (QT_VERSION >= 0x040600)
+#if (defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)) && (QT_VERSION >= 0x040600)
        if (keyboard)
                setStyle(new AlwaysMnemonicStyle);
 #else
index 2b6237188568c0df47e9610bb4a0982e79a6649c..dc78b9dbac8927e0da0043dc4e89a60a49910684 100644 (file)
@@ -301,7 +301,7 @@ QString const externalLineEnding(docstring const & str)
 #ifdef Q_WS_MACX
        // The MAC clipboard uses \r for lineendings, and we use \n
        return toqstr(subst(str, '\n', '\r'));
-#elif defined(Q_WS_WIN)
+#elif defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
        // Windows clipboard uses \r\n for lineendings, and we use \n
        return toqstr(subst(str, from_ascii("\n"), from_ascii("\r\n")));
 #else