mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix bug #9217: [Qt5] QWindowsMime class not available
The support for QWindowsMime has been reintroduced in Qt 5.4.0. The class name has been changed to QWinMime but the interface is exactly the same.
This commit is contained in:
parent
903917f3b8
commit
9126a99e97
@ -556,6 +556,7 @@ if(LYX_USE_QT MATCHES "QT5")
|
|||||||
find_package(Qt5MacExtras REQUIRED)
|
find_package(Qt5MacExtras REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
find_package(Qt5X11Extras QUIET)
|
find_package(Qt5X11Extras QUIET)
|
||||||
|
find_package(Qt5WinExtras QUIET)
|
||||||
set(QTVERSION ${Qt5Core_VERSION})
|
set(QTVERSION ${Qt5Core_VERSION})
|
||||||
macro (qt_use_modules)
|
macro (qt_use_modules)
|
||||||
qt5_use_modules(${ARGN})
|
qt5_use_modules(${ARGN})
|
||||||
|
@ -201,6 +201,11 @@ AC_DEFUN([QT_DO_PKG_CONFIG],
|
|||||||
if test "x$USE_QT5" != "xno" ; then
|
if test "x$USE_QT5" != "xno" ; then
|
||||||
qt_corelibs="Qt5Core"
|
qt_corelibs="Qt5Core"
|
||||||
qt_guilibs="Qt5Core Qt5Concurrent Qt5Gui Qt5Widgets"
|
qt_guilibs="Qt5Core Qt5Concurrent Qt5Gui Qt5Widgets"
|
||||||
|
lyx_use_winextras=false
|
||||||
|
PKG_CHECK_EXISTS(Qt5WinExtras, [lyx_use_winextras=true], [])
|
||||||
|
if $lyx_use_winextras; then
|
||||||
|
qt_guilibs="$qt_guilibs Qt5WinExtras"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
PKG_CHECK_MODULES(QT_CORE, $qt_corelibs,,[:])
|
PKG_CHECK_MODULES(QT_CORE, $qt_corelibs,,[:])
|
||||||
if test "$pkg_failed" = "no" ; then
|
if test "$pkg_failed" = "no" ; then
|
||||||
|
@ -175,6 +175,13 @@ if(LYX_USE_QT MATCHES "QT5")
|
|||||||
"
|
"
|
||||||
QT_USES_X11)
|
QT_USES_X11)
|
||||||
endif()
|
endif()
|
||||||
|
if (Qt5WinExtras_FOUND)
|
||||||
|
get_target_property(_winextra_prop Qt5::WinExtras IMPORTED_CONFIGURATIONS)
|
||||||
|
get_target_property(_winextra_link_libraries Qt5::WinExtras IMPORTED_LOCATION_${_winextra_prop})
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${_winextra_link_libraries})
|
||||||
|
set(CMAKE_REQUIRED_INCLUDES ${Qt5WinExtras_INCLUDE_DIRS})
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${Qt5WinExtras_EXECUTABLE_COMPILE_FLAGS})
|
||||||
|
endif()
|
||||||
elseif(LYX_USE_QT MATCHES "QT4")
|
elseif(LYX_USE_QT MATCHES "QT4")
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${QT_QTGUI_LIBRARY})
|
set(CMAKE_REQUIRED_LIBRARIES ${QT_QTGUI_LIBRARY})
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES})
|
set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES})
|
||||||
|
@ -58,7 +58,11 @@ set_target_properties(frontend_qt PROPERTIES FOLDER "applications/LyX")
|
|||||||
if(Qt5Core_FOUND AND APPLE)
|
if(Qt5Core_FOUND AND APPLE)
|
||||||
qt_use_modules(frontend_qt Core Gui Widgets Concurrent MacExtras)
|
qt_use_modules(frontend_qt Core Gui Widgets Concurrent MacExtras)
|
||||||
else()
|
else()
|
||||||
qt_use_modules(frontend_qt Core Gui Widgets Concurrent)
|
if (Qt5WinExtras_FOUND)
|
||||||
|
qt_use_modules(frontend_qt Core Gui Widgets Concurrent WinExtras)
|
||||||
|
else()
|
||||||
|
qt_use_modules(frontend_qt Core Gui Widgets Concurrent)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(frontend_qt
|
target_link_libraries(frontend_qt
|
||||||
frontends
|
frontends
|
||||||
|
@ -124,13 +124,21 @@
|
|||||||
#undef None
|
#undef None
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_WS_WIN
|
#if (QT_VERSION < 0x050000) || (QT_VERSION >= 0x050400)
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
|
||||||
|
#if (QT_VERSION < 0x050000)
|
||||||
#include <QWindowsMime>
|
#include <QWindowsMime>
|
||||||
|
#define QWINDOWSMIME QWindowsMime
|
||||||
|
#else
|
||||||
|
#include <QWinMime>
|
||||||
|
#define QWINDOWSMIME QWinMime
|
||||||
|
#endif
|
||||||
#ifdef Q_CC_GNU
|
#ifdef Q_CC_GNU
|
||||||
#include <wtypes.h>
|
#include <wtypes.h>
|
||||||
#endif
|
#endif
|
||||||
#include <objidl.h>
|
#include <objidl.h>
|
||||||
#endif // Q_WS_WIN
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include <QMacPasteboardMime>
|
#include <QMacPasteboardMime>
|
||||||
@ -716,7 +724,8 @@ public:
|
|||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// Windows specific stuff goes here...
|
// Windows specific stuff goes here...
|
||||||
|
|
||||||
#ifdef Q_WS_WIN
|
#if (QT_VERSION < 0x050000) || (QT_VERSION >= 0x050400)
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
|
||||||
// QWindowsMimeMetafile can only be compiled on Windows.
|
// QWindowsMimeMetafile can only be compiled on Windows.
|
||||||
|
|
||||||
static FORMATETC cfFromMime(QString const & mimetype)
|
static FORMATETC cfFromMime(QString const & mimetype)
|
||||||
@ -736,7 +745,7 @@ static FORMATETC cfFromMime(QString const & mimetype)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class QWindowsMimeMetafile : public QWindowsMime {
|
class QWindowsMimeMetafile : public QWINDOWSMIME {
|
||||||
public:
|
public:
|
||||||
QWindowsMimeMetafile() {}
|
QWindowsMimeMetafile() {}
|
||||||
|
|
||||||
@ -813,7 +822,8 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // Q_WS_WIN
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/// Allows to check whether ESC was pressed during a long operation
|
/// Allows to check whether ESC was pressed during a long operation
|
||||||
@ -877,9 +887,11 @@ struct GuiApplication::Private
|
|||||||
Private(): language_model_(0), meta_fake_bit(NoModifier),
|
Private(): language_model_(0), meta_fake_bit(NoModifier),
|
||||||
global_menubar_(0)
|
global_menubar_(0)
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_WIN
|
#if (QT_VERSION < 0x050000) || (QT_VERSION >= 0x050400)
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
|
||||||
/// WMF Mime handler for Windows clipboard.
|
/// WMF Mime handler for Windows clipboard.
|
||||||
wmf_mime_ = new QWindowsMimeMetafile;
|
wmf_mime_ = new QWindowsMimeMetafile;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
initKeySequences(&theTopLevelKeymap());
|
initKeySequences(&theTopLevelKeymap());
|
||||||
}
|
}
|
||||||
@ -941,9 +953,11 @@ struct GuiApplication::Private
|
|||||||
QMacPasteboardMimeGraphics mac_pasteboard_mime_;
|
QMacPasteboardMimeGraphics mac_pasteboard_mime_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_WS_WIN
|
#if (QT_VERSION < 0x050000) || (QT_VERSION >= 0x050400)
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_CYGWIN_WIN)
|
||||||
/// WMF Mime handler for Windows clipboard.
|
/// WMF Mime handler for Windows clipboard.
|
||||||
QWindowsMimeMetafile * wmf_mime_;
|
QWindowsMimeMetafile * wmf_mime_;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Allows to check whether ESC was pressed during a long operation
|
/// Allows to check whether ESC was pressed during a long operation
|
||||||
|
Loading…
Reference in New Issue
Block a user