Fixed QT_NO_DRAGANDDROP build for the windows plugin
Change-Id: Ieb987105bdcc08118a1b83cf3b74a93fa402264a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
09e972884e
commit
b06363886d
@ -59,8 +59,10 @@
|
||||
#include "qwindowsguieventdispatcher.h"
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
# include "qwindowsclipboard.h"
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
# include "qwindowsdrag.h"
|
||||
# endif
|
||||
#endif
|
||||
#include "qwindowsdrag.h"
|
||||
#include "qwindowsinputcontext.h"
|
||||
#include "qwindowskeymapper.h"
|
||||
# ifndef QT_NO_ACCESSIBILITY
|
||||
@ -266,8 +268,10 @@ struct QWindowsIntegrationPrivate
|
||||
QWindowsNativeInterface m_nativeInterface;
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
QWindowsClipboard m_clipboard;
|
||||
#endif
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
QWindowsDrag m_drag;
|
||||
# endif
|
||||
#endif
|
||||
QWindowsGuiEventDispatcher *m_eventDispatcher;
|
||||
#if defined(QT_OPENGL_ES_2)
|
||||
QEGLStaticContextPtr m_staticEGLContext;
|
||||
@ -529,12 +533,13 @@ QPlatformClipboard * QWindowsIntegration::clipboard() const
|
||||
{
|
||||
return &d->m_clipboard;
|
||||
}
|
||||
#endif // !QT_NO_CLIPBOARD
|
||||
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
QPlatformDrag *QWindowsIntegration::drag() const
|
||||
{
|
||||
return &d->m_drag;
|
||||
}
|
||||
# endif // !QT_NO_DRAGANDDROP
|
||||
#endif // !QT_NO_CLIPBOARD
|
||||
|
||||
QPlatformInputContext * QWindowsIntegration::inputContext() const
|
||||
{
|
||||
|
@ -75,8 +75,10 @@ public:
|
||||
virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const;
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
virtual QPlatformClipboard *clipboard() const;
|
||||
#endif
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
virtual QPlatformDrag *drag() const;
|
||||
# endif
|
||||
#endif !QT_NO_CLIPBOARD
|
||||
virtual QPlatformInputContext *inputContext() const;
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
virtual QPlatformAccessibility *accessibility() const;
|
||||
|
@ -815,21 +815,29 @@ void QWindowsWindow::destroyWindow()
|
||||
|
||||
void QWindowsWindow::registerDropSite()
|
||||
{
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
if (m_data.hwnd && !m_dropTarget) {
|
||||
m_dropTarget = new QWindowsOleDropTarget(window());
|
||||
RegisterDragDrop(m_data.hwnd, m_dropTarget);
|
||||
CoLockObjectExternal(m_dropTarget, true, true);
|
||||
}
|
||||
# endif // !QT_NO_DRAGANDDROP
|
||||
#endif // !QT_NO_CLIPBOARD
|
||||
}
|
||||
|
||||
void QWindowsWindow::unregisterDropSite()
|
||||
{
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
# ifndef QT_NO_DRAGANDDROP
|
||||
if (m_data.hwnd && m_dropTarget) {
|
||||
m_dropTarget->Release();
|
||||
CoLockObjectExternal(m_dropTarget, false, true);
|
||||
RevokeDragDrop(m_data.hwnd);
|
||||
m_dropTarget = 0;
|
||||
}
|
||||
# endif // !QT_NO_DRAGANDDROP
|
||||
#endif // !QT_NO_CLIPBOARD
|
||||
}
|
||||
|
||||
// Returns topmost QWindowsWindow ancestor even if there are embedded windows in the chain.
|
||||
|
@ -45,7 +45,6 @@ SOURCES += \
|
||||
qwindowsguieventdispatcher.cpp \
|
||||
qwindowsole.cpp \
|
||||
qwindowsmime.cpp \
|
||||
qwindowsdrag.cpp \
|
||||
qwindowsinternalmimedata.cpp \
|
||||
qwindowscursor.cpp \
|
||||
qwindowsinputcontext.cpp \
|
||||
@ -69,7 +68,6 @@ HEADERS += \
|
||||
qtwindows_additional.h \
|
||||
qwindowsole.h \
|
||||
qwindowsmime.h \
|
||||
qwindowsdrag.h \
|
||||
qwindowsinternalmimedata.h \
|
||||
qwindowscursor.h \
|
||||
array.h \
|
||||
@ -94,6 +92,16 @@ contains(QT_CONFIG, opengles2) {
|
||||
HEADERS += qwindowsclipboard.h
|
||||
}
|
||||
|
||||
# drag and drop on windows only works if a clipboard is available
|
||||
!contains( DEFINES, QT_NO_DRAGANDDROP ) {
|
||||
!win32:SOURCES += qwindowsdrag.cpp
|
||||
!win32:HEADERS += qwindowsdrag.h
|
||||
win32:!contains( DEFINES, QT_NO_CLIPBOARD ) {
|
||||
HEADERS += qwindowsdrag.h
|
||||
SOURCES += qwindowsdrag.cpp
|
||||
}
|
||||
}
|
||||
|
||||
# Enable access to HB_Face in harfbuzz includes included by qfontengine_p.h.
|
||||
DEFINES *= QT_COMPILES_IN_HARFBUZZ
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user