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.
*
* Therefore there is a tradeoff in enabling or disabling this (JMarc)
*/
*
* 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
#define USE_NATIVE_FILEDIALOG 1
#endif
// 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.
// 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;
return true;
#else
return false;
// We don't want to keep the window in memory if it is closed.
setAttribute(Qt::WA_DeleteOnClose, true);
// 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,
// 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,
-#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,
class AlwaysMnemonicStyle : public QProxyStyle {
public:
int styleHint(StyleHint hint, const QStyleOption *opt = 0, const QWidget *widget = 0,
Menu::Menu(GuiView * gv, QString const & name, bool top_level, bool keyboard)
: QMenu(gv), d(new Menu::Impl)
{
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
if (keyboard)
setStyle(new AlwaysMnemonicStyle);
#else
#ifdef Q_WS_MACX
// The MAC clipboard uses \r for lineendings, and we use \n
return toqstr(subst(str, '\n', '\r'));
#ifdef Q_WS_MACX
// 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)
// Windows clipboard uses \r\n for lineendings, and we use \n
return toqstr(subst(str, from_ascii("\n"), from_ascii("\r\n")));
#else
// Windows clipboard uses \r\n for lineendings, and we use \n
return toqstr(subst(str, from_ascii("\n"), from_ascii("\r\n")));
#else