summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.cpp8
-rw-r--r--src/plugins/platforms/windows/qtwindowsglobal.h2
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h6
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
-rw-r--r--src/plugins/platforms/windows/windows.pri17
10 files changed, 37 insertions, 44 deletions
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
index d9c3d6ac14..9239facb0c 100644
--- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp
+++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
@@ -638,7 +638,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_background(IA2Color *backgr
/**************************************************************\
* IAccessibleEditableText *
**************************************************************/
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
/*!
\internal
@@ -681,7 +681,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::copyText(long startOffset, long
{
QAccessibleInterface *accessible = accessibleInterface();
accessibleDebugClientCalls(accessible);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
const QString t = textForRange(startOffset, endOffset);
QGuiApplication::clipboard()->setText(t);
return S_OK;
@@ -717,7 +717,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::cutText(long startOffset, long
{
QAccessibleInterface *accessible = accessibleInterface();
accessibleDebugClientCalls(accessible);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
const QString t = textForRange(startOffset, endOffset);
if (QAccessibleEditableTextInterface *editableTextIface = accessible->editableTextInterface())
editableTextIface->deleteText(startOffset, endOffset);
@@ -734,7 +734,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::pasteText(long offset)
{
QAccessibleInterface *accessible = accessibleInterface();
accessibleDebugClientCalls(accessible);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
const QString txt = QGuiApplication::clipboard()->text();
if (QAccessibleEditableTextInterface *editableTextIface = accessible->editableTextInterface())
editableTextIface->insertText(offset, txt);
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index 34fe114d0e..d9c342be27 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -263,12 +263,10 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
if ((wParamIn & 0xfff0) == SC_CONTEXTHELP)
return QtWindows::WhatsThisEvent;
break;
-#if !defined(QT_NO_SESSIONMANAGER)
case WM_QUERYENDSESSION:
return QtWindows::QueryEndSessionApplicationEvent;
case WM_ENDSESSION:
return QtWindows::EndSessionApplicationEvent;
-#endif
#if defined(WM_APPCOMMAND)
case WM_APPCOMMAND:
return QtWindows::AppCommandEvent;
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 7f5f9d0768..ddd779bbac 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -53,7 +53,7 @@
#ifndef QT_NO_ACCESSIBILITY
# include "accessible/qwindowsaccessibility.h"
#endif
-#if !defined(QT_NO_SESSIONMANAGER)
+#if QT_CONFIG(sessionmanager)
# include <private/qsessionmanager_p.h>
# include "qwindowssessionmanager.h"
#endif
@@ -249,7 +249,7 @@ struct QWindowsContextPrivate {
QWindowsMimeConverter m_mimeConverter;
QWindowsScreenManager m_screenManager;
QSharedPointer<QWindowCreationContext> m_creationContext;
-#if !defined(QT_NO_TABLETEVENT)
+#if QT_CONFIG(tabletevent)
QScopedPointer<QWindowsTabletSupport> m_tabletSupport;
#endif
const HRESULT m_oleInitializeResult;
@@ -290,7 +290,7 @@ QWindowsContext::QWindowsContext() :
const QByteArray bv = qgetenv("QT_QPA_VERBOSE");
if (!bv.isEmpty())
QLoggingCategory::setFilterRules(QString::fromLocal8Bit(bv));
-#if !defined(QT_NO_TABLETEVENT)
+#if QT_CONFIG(tabletevent)
d->m_tabletSupport.reset(QWindowsTabletSupport::create());
qCDebug(lcQpaTablet) << "Tablet support: " << (d->m_tabletSupport.isNull() ? QStringLiteral("None") : d->m_tabletSupport->description());
#endif
@@ -298,7 +298,7 @@ QWindowsContext::QWindowsContext() :
QWindowsContext::~QWindowsContext()
{
-#if !defined(QT_NO_TABLETEVENT)
+#if QT_CONFIG(tabletevent)
d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes.
#endif
unregisterWindowClasses();
@@ -346,7 +346,7 @@ bool QWindowsContext::initTouch(unsigned integrationOptions)
void QWindowsContext::setTabletAbsoluteRange(int a)
{
-#if !defined(QT_NO_TABLETEVENT)
+#if QT_CONFIG(tabletevent)
if (!d->m_tabletSupport.isNull())
d->m_tabletSupport->setAbsoluteRange(a);
#else
@@ -720,7 +720,7 @@ QWindowsScreenManager &QWindowsContext::screenManager()
QWindowsTabletSupport *QWindowsContext::tabletSupport() const
{
-#if !defined(QT_NO_TABLETEVENT)
+#if QT_CONFIG(tabletevent)
return d->m_tabletSupport.data();
#else
return 0;
@@ -1128,7 +1128,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
platformWindow->clearFlag(QWindowsWindow::WithinDpiChanged);
return true;
}
-#if !defined(QT_NO_SESSIONMANAGER)
+#if QT_CONFIG(sessionmanager)
case QtWindows::QueryEndSessionApplicationEvent: {
QWindowsSessionManager *sessionManager = platformSessionManager();
if (sessionManager->isActive()) { // bogus message from windows
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index b9c320fd8f..e7ba08b719 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -56,7 +56,7 @@
static bool initResources()
{
-#if !defined (QT_NO_IMAGEFORMAT_PNG)
+#if QT_CONFIG(imageformat_png)
Q_INIT_RESOURCE(cursors);
#endif
return true;
@@ -203,7 +203,7 @@ static QSize systemCursorSize(const QPlatformScreen *screen = Q_NULLPTR)
return primaryScreenCursorSize;
}
-#if defined (QT_NO_IMAGEFORMAT_PNG)
+#if !QT_CONFIG(imageformat_png)
static inline QSize standardCursorSize() { return QSize(32, 32); }
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index a326ccac3e..857db7a65c 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -40,7 +40,7 @@
#include "qwindowsdrag.h"
#include "qwindowscontext.h"
#include "qwindowsscreen.h"
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
# include "qwindowsclipboard.h"
#endif
#include "qwindowsintegration.h"
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index eb7ad5ecd8..a9143a3052 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -51,9 +51,9 @@
#ifndef QT_NO_FREETYPE
# include <QtFontDatabaseSupport/private/qwindowsfontdatabase_ft_p.h>
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
# include "qwindowsclipboard.h"
-# ifndef QT_NO_DRAGANDDROP
+# if QT_CONFIG(draganddrop)
# include "qwindowsdrag.h"
# endif
#endif
@@ -65,7 +65,7 @@
#include <qpa/qplatformnativeinterface.h>
#include <qpa/qwindowsysteminterface.h>
-#ifndef QT_NO_SESSIONMANAGER
+#if QT_CONFIG(sessionmanager)
# include "qwindowssessionmanager.h"
#endif
#include <QtGui/qtouchdevice.h>
@@ -139,9 +139,9 @@ struct QWindowsIntegrationPrivate
unsigned m_options = 0;
QWindowsContext m_context;
QPlatformFontDatabase *m_fontDatabase = nullptr;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
QWindowsClipboard m_clipboard;
-# ifndef QT_NO_DRAGANDDROP
+# if QT_CONFIG(draganddrop)
QWindowsDrag m_drag;
# endif
#endif
@@ -258,7 +258,7 @@ QWindowsIntegration::QWindowsIntegration(const QStringList &paramList) :
d(new QWindowsIntegrationPrivate(paramList))
{
m_instance = this;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
d->m_clipboard.registerViewer();
#endif
d->m_context.screenManager().handleScreenChanges();
@@ -557,12 +557,12 @@ QList<int> QWindowsIntegration::possibleKeys(const QKeyEvent *e) const
return d->m_context.possibleKeys(e);
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
QPlatformClipboard * QWindowsIntegration::clipboard() const
{
return &d->m_clipboard;
}
-# ifndef QT_NO_DRAGANDDROP
+# if QT_CONFIG(draganddrop)
QPlatformDrag *QWindowsIntegration::drag() const
{
return &d->m_drag;
@@ -587,7 +587,7 @@ unsigned QWindowsIntegration::options() const
return d->m_options;
}
-#if !defined(QT_NO_SESSIONMANAGER)
+#if QT_CONFIG(sessionmanager)
QPlatformSessionManager *QWindowsIntegration::createPlatformSessionManager(const QString &id, const QString &key) const
{
return new QWindowsSessionManager(id, key);
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index 11320332bb..23f3d9ef4e 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -83,9 +83,9 @@ public:
#endif
QAbstractEventDispatcher *createEventDispatcher() const override;
void initialize() override;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
QPlatformClipboard *clipboard() const override;
-# ifndef QT_NO_DRAGANDDROP
+# if QT_CONFIG(draganddrop)
QPlatformDrag *drag() const override;
# endif
#endif // !QT_NO_CLIPBOARD
@@ -111,7 +111,7 @@ public:
void beep() const override;
-#if !defined(QT_NO_SESSIONMANAGER)
+#if QT_CONFIG(sessionmanager)
QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override;
#endif
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index eb53dc921b..b892f1610d 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -1252,7 +1252,7 @@ bool QBuiltInMimes::convertFromMime(const FORMATETC &formatetc, const QMimeData
r[byteLength+1] = 0;
data = r;
} else {
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
data = QInternalMimeData::renderDataHelper(outFormats.value(getCf(formatetc)), mimeData);
#endif //QT_NO_DRAGANDDROP
}
@@ -1352,7 +1352,7 @@ QLastResortMimes::QLastResortMimes()
bool QLastResortMimes::canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const
{
// really check
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
return formatetc.tymed & TYMED_HGLOBAL
&& (formats.contains(formatetc.cfFormat)
&& QInternalMimeData::hasFormatHelper(formats.value(formatetc.cfFormat), mimeData));
@@ -1366,7 +1366,7 @@ bool QLastResortMimes::canConvertFromMime(const FORMATETC &formatetc, const QMim
bool QLastResortMimes::convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const
{
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
return canConvertFromMime(formatetc, mimeData)
&& setData(QInternalMimeData::renderDataHelper(formats.value(getCf(formatetc)), mimeData), pmedium);
#else
@@ -1467,7 +1467,7 @@ QString QLastResortMimes::mimeForFormat(const FORMATETC &formatetc) const
const QString clipFormat = QWindowsMimeConverter::clipboardFormatName(getCf(formatetc));
if (!clipFormat.isEmpty()) {
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (QInternalMimeData::canReadData(clipFormat))
format = clipFormat;
else if((formatetc.cfFormat >= 0xC000)){
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 9ac31c45df..1bd7b06c8e 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1195,7 +1195,7 @@ void QWindowsWindow::setDropSiteEnabled(bool dropEnabled)
if (isDropSiteEnabled() == dropEnabled)
return;
qCDebug(lcQpaMime) << __FUNCTION__ << window() << dropEnabled;
-#if !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_DRAGANDDROP)
+#if QT_CONFIG(clipboard) && QT_CONFIG(draganddrop)
if (dropEnabled) {
Q_ASSERT(m_data.hwnd);
m_dropTarget = new QWindowsOleDropTarget(window());
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index 933cd72a67..3ecd164c74 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -82,33 +82,28 @@ qtConfig(vulkan) {
HEADERS += $$PWD/qwindowsvulkaninstance.h
}
-!contains( DEFINES, QT_NO_CLIPBOARD ) {
+qtConfig(clipboard) {
SOURCES += $$PWD/qwindowsclipboard.cpp
HEADERS += $$PWD/qwindowsclipboard.h
-}
-
-# drag and drop on windows only works if a clipboard is available
-!contains( DEFINES, QT_NO_DRAGANDDROP ) {
- !win32:SOURCES += $$PWD/qwindowsdrag.cpp
- !win32:HEADERS += $$PWD/qwindowsdrag.h
- win32:!contains( DEFINES, QT_NO_CLIPBOARD ) {
+ # drag and drop on windows only works if a clipboard is available
+ qtConfig(draganddrop) {
HEADERS += $$PWD/qwindowsdrag.h
SOURCES += $$PWD/qwindowsdrag.cpp
}
}
-!contains( DEFINES, QT_NO_TABLETEVENT ) {
+qtConfig(tabletevent) {
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/wintab
HEADERS += $$PWD/qwindowstabletsupport.h
SOURCES += $$PWD/qwindowstabletsupport.cpp
}
-!contains( DEFINES, QT_NO_SESSIONMANAGER ) {
+qtConfig(sessionmanager) {
SOURCES += $$PWD/qwindowssessionmanager.cpp
HEADERS += $$PWD/qwindowssessionmanager.h
}
-!contains( DEFINES, QT_NO_IMAGEFORMAT_PNG ):RESOURCES += $$PWD/cursors.qrc
+qtConfig(imageformat_png):RESOURCES += $$PWD/cursors.qrc
RESOURCES += $$PWD/openglblacklists.qrc