summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/winrt/qwinrtclipboard.cpp14
-rw-r--r--src/plugins/platforms/winrt/qwinrtclipboard.h4
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp143
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.h5
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.cpp8
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.cpp17
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp18
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.cpp98
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp2
-rw-r--r--src/plugins/platforms/winrt/winrt.pro2
10 files changed, 9 insertions, 302 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtclipboard.cpp b/src/plugins/platforms/winrt/qwinrtclipboard.cpp
index 0a38b3df34..117cb515df 100644
--- a/src/plugins/platforms/winrt/qwinrtclipboard.cpp
+++ b/src/plugins/platforms/winrt/qwinrtclipboard.cpp
@@ -61,7 +61,6 @@ QT_BEGIN_NAMESPACE
QWinRTClipboard::QWinRTClipboard()
: m_mimeData(Q_NULLPTR)
{
-#ifndef Q_OS_WINPHONE
QEventDispatcherWinRT::runOnXamlThread([this]() {
HRESULT hr;
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_ApplicationModel_DataTransfer_Clipboard).Get(),
@@ -74,7 +73,6 @@ QWinRTClipboard::QWinRTClipboard()
return hr;
});
-#endif // !Q_OS_WINPHONE
}
QMimeData *QWinRTClipboard::mimeData(QClipboard::Mode mode)
@@ -82,7 +80,6 @@ QMimeData *QWinRTClipboard::mimeData(QClipboard::Mode mode)
if (!supportsMode(mode))
return nullptr;
-#ifndef Q_OS_WINPHONE
ComPtr<IDataPackageView> view;
HRESULT hr;
hr = m_nativeClipBoard->GetContent(&view);
@@ -114,9 +111,6 @@ QMimeData *QWinRTClipboard::mimeData(QClipboard::Mode mode)
m_mimeData->setText(text);
return m_mimeData;
-#else // Q_OS_WINPHONE
- return QPlatformClipboard::mimeData(mode);
-#endif // Q_OS_WINPHONE
}
// Inspired by QWindowsMimeText::convertFromMime
@@ -153,7 +147,6 @@ void QWinRTClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
if (!supportsMode(mode))
return;
-#ifndef Q_OS_WINPHONE
const bool newData = !m_mimeData || m_mimeData != data;
if (newData) {
if (m_mimeData)
@@ -178,18 +171,11 @@ void QWinRTClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
return S_OK;
});
RETURN_VOID_IF_FAILED("Could not set clipboard text.");
-#else // Q_OS_WINPHONE
- QPlatformClipboard::setMimeData(data, mode);
-#endif // Q_OS_WINPHONE
}
bool QWinRTClipboard::supportsMode(QClipboard::Mode mode) const
{
-#ifndef Q_OS_WINPHONE
return mode == QClipboard::Clipboard;
-#else
- return QPlatformClipboard::supportsMode(mode);
-#endif
}
HRESULT QWinRTClipboard::onContentChanged(IInspectable *, IInspectable *)
diff --git a/src/plugins/platforms/winrt/qwinrtclipboard.h b/src/plugins/platforms/winrt/qwinrtclipboard.h
index 2e3e2b834d..899fcbe730 100644
--- a/src/plugins/platforms/winrt/qwinrtclipboard.h
+++ b/src/plugins/platforms/winrt/qwinrtclipboard.h
@@ -45,7 +45,6 @@
#include <wrl.h>
-#ifndef Q_OS_WINPHONE
namespace ABI {
namespace Windows {
namespace ApplicationModel {
@@ -55,7 +54,6 @@ namespace ABI {
}
}
}
-#endif // !Q_OS_WINPHONE
QT_BEGIN_NAMESPACE
@@ -70,9 +68,7 @@ public:
HRESULT onContentChanged(IInspectable *, IInspectable *);
private:
-#ifndef Q_OS_WINPHONE
Microsoft::WRL::ComPtr<ABI::Windows::ApplicationModel::DataTransfer::IClipboardStatics> m_nativeClipBoard;
-#endif
QMimeData *m_mimeData;
};
diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
index 417dbdc1db..62eacba89b 100644
--- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
@@ -61,11 +61,9 @@ using namespace ABI::Windows::Foundation::Collections;
using namespace ABI::Windows::Storage;
using namespace ABI::Windows::Storage::Pickers;
-#ifndef Q_OS_WINPHONE
typedef IAsyncOperationCompletedHandler<StorageFile *> SingleFileHandler;
typedef IAsyncOperationCompletedHandler<IVectorView<StorageFile *> *> MultipleFileHandler;
typedef IAsyncOperationCompletedHandler<StorageFolder *> SingleFolderHandler;
-#endif
QT_BEGIN_NAMESPACE
@@ -152,16 +150,6 @@ private:
QVector<HSTRING> impl;
};
-#ifdef Q_OS_WINPHONE
-class QActivationEvent : public QEvent
-{
-public:
- IInspectable *args() const {
- return reinterpret_cast<IInspectable *>(d);
- }
-};
-#endif
-
template<typename T>
static bool initializePicker(HSTRING runtimeId, T **picker, const QSharedPointer<QFileDialogOptions> &options)
{
@@ -225,23 +213,6 @@ static bool pickFiles(IFileOpenPicker *picker, QWinRTFileDialogHelper *helper, b
Q_ASSERT(picker);
Q_ASSERT(helper);
HRESULT hr;
-#ifdef Q_OS_WINPHONE
- hr = QEventDispatcherWinRT::runOnXamlThread([picker, singleFile]() {
- HRESULT hr;
- ComPtr<IFileOpenPicker2> picker2;
- hr = picker->QueryInterface(IID_PPV_ARGS(picker2.GetAddressOf()));
- RETURN_HR_IF_FAILED("Failed to cast file picker");
- if (singleFile)
- return picker2->PickSingleFileAndContinue();
- else
- return picker2->PickMultipleFilesAndContinue();
- });
- RETURN_FALSE_IF_FAILED("Failed to open file picker");
- QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
- Q_ASSERT(eventDispatcher);
- eventDispatcher->installEventFilter(helper);
- return true;
-#else
hr = QEventDispatcherWinRT::runOnXamlThread([picker, helper, singleFile]() {
HRESULT hr;
if (singleFile) {
@@ -260,7 +231,6 @@ static bool pickFiles(IFileOpenPicker *picker, QWinRTFileDialogHelper *helper, b
return S_OK;
});
return SUCCEEDED(hr);
-#endif
}
static bool pickFolder(IFolderPicker *picker, QWinRTFileDialogHelper *helper)
@@ -268,19 +238,6 @@ static bool pickFolder(IFolderPicker *picker, QWinRTFileDialogHelper *helper)
Q_ASSERT(picker);
Q_ASSERT(helper);
HRESULT hr;
-#ifdef Q_OS_WINPHONE
- hr = QEventDispatcherWinRT::runOnXamlThread([picker]() {
- HRESULT hr;
- ComPtr<IFolderPicker2> picker2;
- hr = picker->QueryInterface(IID_PPV_ARGS(picker2.GetAddressOf()));
- RETURN_HR_IF_FAILED("Failed to cast folder picker");
- return picker2->PickFolderAndContinue();
- });
- RETURN_FALSE_IF_FAILED("Failed to open folder picker");
- QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
- Q_ASSERT(eventDispatcher);
- eventDispatcher->installEventFilter(helper);
-#else
hr = QEventDispatcherWinRT::runOnXamlThread([picker, helper]() {
HRESULT hr;
ComPtr<IAsyncOperation<StorageFolder *>> op;
@@ -290,7 +247,6 @@ static bool pickFolder(IFolderPicker *picker, QWinRTFileDialogHelper *helper)
RETURN_HR_IF_FAILED("Failed to attach folder picker callback");
return S_OK;
});
-#endif
return SUCCEEDED(hr);
}
@@ -299,19 +255,6 @@ static bool pickSaveFile(IFileSavePicker *picker, QWinRTFileDialogHelper *helper
Q_ASSERT(picker);
Q_ASSERT(helper);
HRESULT hr;
-#ifdef Q_OS_WINPHONE
- hr = QEventDispatcherWinRT::runOnXamlThread([picker]() {
- HRESULT hr;
- ComPtr<IFileSavePicker2> picker2;
- hr = picker->QueryInterface(IID_PPV_ARGS(picker2.GetAddressOf()));
- RETURN_HR_IF_FAILED("Failed to cast save file picker");
- return picker2->PickSaveFileAndContinue();
- });
- RETURN_FALSE_IF_FAILED("Failed to open single file picker");
- QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
- Q_ASSERT(eventDispatcher);
- eventDispatcher->installEventFilter(helper);
-#else
hr = QEventDispatcherWinRT::runOnXamlThread([picker, helper]() {
HRESULT hr;
ComPtr<IAsyncOperation<StorageFile *>> op;
@@ -321,7 +264,6 @@ static bool pickSaveFile(IFileSavePicker *picker, QWinRTFileDialogHelper *helper
RETURN_HR_IF_FAILED("Failed to attach save file picker callback");
return S_OK;
});
-#endif
return SUCCEEDED(hr);
}
@@ -488,68 +430,6 @@ void QWinRTFileDialogHelper::hide()
d->shown = false;
}
-#ifdef Q_OS_WINPHONE
-bool QWinRTFileDialogHelper::eventFilter(QObject *, QEvent *e)
-{
- if (e->type() != QEvent::WinEventAct)
- return false;
-
- HRESULT hr;
- QActivationEvent *event = static_cast<QActivationEvent *>(e);
- ComPtr<IInspectable> inspectable = event->args();
- ComPtr<IActivatedEventArgs> arguments;
- hr = inspectable.As(&arguments);
- Q_ASSERT_SUCCEEDED(hr);
-
- ActivationKind activationKind;
- hr = arguments->get_Kind(&activationKind);
- Q_ASSERT_SUCCEEDED(hr);
-
- // Handle only File, Folder and Save file pick continuation here.
- if (activationKind != ActivationKind_PickFileContinuation
- && activationKind != ActivationKind_PickFolderContinuation
- && activationKind != ActivationKind_PickSaveFileContinuation) {
- return false;
- }
-
- QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher();
- Q_ASSERT(eventDispatcher);
- eventDispatcher->removeEventFilter(this);
- e->accept();
-
- if (activationKind == ActivationKind_PickFileContinuation) {
- ComPtr<IFileOpenPickerContinuationEventArgs> fileContinuationArgs;
- hr = arguments.As(&fileContinuationArgs);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IVectorView<StorageFile *>> files;
- hr = fileContinuationArgs->get_Files(&files);
- Q_ASSERT_SUCCEEDED(hr);
- hr = onFilesPicked(files.Get());
- Q_ASSERT_SUCCEEDED(hr);
- } else if (activationKind == ActivationKind_PickFolderContinuation) {
- ComPtr<IFolderPickerContinuationEventArgs> folderContinuationArgs;
- hr = arguments.As(&folderContinuationArgs);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IStorageFolder> folder;
- hr = folderContinuationArgs->get_Folder(&folder);
- Q_ASSERT_SUCCEEDED(hr);
- hr = onFolderPicked(folder.Get());
- Q_ASSERT_SUCCEEDED(hr);
- } else {
- ComPtr<IFileSavePickerContinuationEventArgs> saveFileContinuationArgs;
- hr = arguments.As(&saveFileContinuationArgs);
- Q_ASSERT_SUCCEEDED(hr);
- ComPtr<IStorageFile> file;
- hr = saveFileContinuationArgs->get_File(&file);
- Q_ASSERT_SUCCEEDED(hr);
- hr = onFilePicked(file.Get());
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- return true;
-}
-#endif
-
void QWinRTFileDialogHelper::setDirectory(const QUrl &directory)
{
Q_D(QWinRTFileDialogHelper);
@@ -586,7 +466,6 @@ QString QWinRTFileDialogHelper::selectedNameFilter() const
return d->selectedNameFilter;
}
-#ifndef Q_OS_WINPHONE
HRESULT QWinRTFileDialogHelper::onSingleFilePicked(IAsyncOperation<StorageFile *> *args, AsyncStatus status)
{
Q_D(QWinRTFileDialogHelper);
@@ -643,17 +522,9 @@ HRESULT QWinRTFileDialogHelper::onSingleFolderPicked(IAsyncOperation<StorageFold
Q_ASSERT_SUCCEEDED(hr);
return onFolderPicked(folder.Get());
}
-#endif //Q_OS_WINPHONE
HRESULT QWinRTFileDialogHelper::onFilesPicked(IVectorView<StorageFile *> *files)
{
-#ifdef Q_OS_WINPHONE
- Q_D(QWinRTFileDialogHelper);
- QEventLoopLocker locker(&d->loop);
- d->shown = false;
- d->selectedFiles.clear();
-#endif
-
HRESULT hr;
quint32 size;
hr = files->get_Size(&size);
@@ -676,13 +547,6 @@ HRESULT QWinRTFileDialogHelper::onFilesPicked(IVectorView<StorageFile *> *files)
HRESULT QWinRTFileDialogHelper::onFolderPicked(IStorageFolder *folder)
{
-#ifdef Q_OS_WINPHONE
- Q_D(QWinRTFileDialogHelper);
- QEventLoopLocker locker(&d->loop);
- d->shown = false;
- d->selectedFiles.clear();
-#endif
-
if (!folder) {
emit reject();
return S_OK;
@@ -695,13 +559,6 @@ HRESULT QWinRTFileDialogHelper::onFolderPicked(IStorageFolder *folder)
HRESULT QWinRTFileDialogHelper::onFilePicked(IStorageFile *file)
{
-#ifdef Q_OS_WINPHONE
- Q_D(QWinRTFileDialogHelper);
- QEventLoopLocker locker(&d->loop);
- d->shown = false;
- d->selectedFiles.clear();
-#endif
-
if (!file) {
emit reject();
return S_OK;
diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h
index 413dee7459..99239aad3a 100644
--- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h
+++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.h
@@ -75,9 +75,6 @@ public:
void exec() override;
bool show(Qt::WindowFlags, Qt::WindowModality, QWindow *) override;
void hide() override;
-#ifdef Q_OS_WINPHONE
- bool eventFilter(QObject *o, QEvent *e) override;
-#endif
bool defaultNameFilterDisables() const override { return false; }
void setDirectory(const QUrl &directory) override;
@@ -88,14 +85,12 @@ public:
void selectNameFilter(const QString &selectedNameFilter) override;
QString selectedNameFilter() const override;
-#ifndef Q_OS_WINPHONE
HRESULT onSingleFilePicked(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Storage::StorageFile *> *,
ABI::Windows::Foundation::AsyncStatus);
HRESULT onMultipleFilesPicked(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Foundation::Collections::IVectorView<ABI::Windows::Storage::StorageFile *> *> *,
ABI::Windows::Foundation::AsyncStatus);
HRESULT onSingleFolderPicked(ABI::Windows::Foundation::IAsyncOperation<ABI::Windows::Storage::StorageFolder *> *,
ABI::Windows::Foundation::AsyncStatus);
-#endif
private:
HRESULT onFilesPicked(ABI::Windows::Foundation::Collections::IVectorView<ABI::Windows::Storage::StorageFile *> *files);
diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.cpp b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
index 557c13cf63..dab2482ab3 100644
--- a/src/plugins/platforms/winrt/qwinrtfileengine.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
@@ -153,7 +153,6 @@ static HRESULT getDestinationFolder(const QString &fileName, const QString &newF
HRESULT hr;
ComPtr<IAsyncOperation<StorageFolder *>> op;
QFileInfo newFileInfo(newFileName);
-#ifndef Q_OS_WINPHONE
QFileInfo fileInfo(fileName);
if (fileInfo.dir() == newFileInfo.dir()) {
ComPtr<IStorageItem2> item;
@@ -161,12 +160,7 @@ static HRESULT getDestinationFolder(const QString &fileName, const QString &newF
Q_ASSERT_SUCCEEDED(hr);
hr = item->GetParentAsync(&op);
- } else
-#else
- Q_UNUSED(fileName);
- Q_UNUSED(file)
-#endif
- {
+ } else {
ComPtr<IStorageFolderStatics> folderFactory;
hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_StorageFolder).Get(),
IID_PPV_ARGS(&folderFactory));
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp
index ffc3bbf077..7a30c8d98b 100644
--- a/src/plugins/platforms/winrt/qwinrtintegration.cpp
+++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp
@@ -74,10 +74,8 @@
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
# include <windows.phone.ui.input.h>
-# if _MSC_VER >= 1900
-# include <windows.foundation.metadata.h>
- using namespace ABI::Windows::Foundation::Metadata;
-# endif
+# include <windows.foundation.metadata.h>
+ using namespace ABI::Windows::Foundation::Metadata;
#endif
@@ -153,7 +151,6 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
Q_ASSERT_SUCCEEDED(hr);
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-#if _MSC_VER >= 1900
d->hasHardwareButtons = false;
ComPtr<IApiInformationStatics> apiInformationStatics;
hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(),
@@ -163,9 +160,6 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
const HStringReference valueRef(L"Windows.Phone.UI.Input.HardwareButtons");
hr = apiInformationStatics->IsTypePresent(valueRef.Get(), &d->hasHardwareButtons);
}
-#else
- d->hasHardwareButtons = true;
-#endif // _MSC_VER >= 1900
if (d->hasHardwareButtons) {
hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(),
@@ -226,12 +220,11 @@ QWinRTIntegration::~QWinRTIntegration()
// Do not execute this on Windows Phone as the application is already
// shutting down and trying to unregister suspending/resume handler will
// cause exceptions and assert in debug mode
-#ifndef Q_OS_WINPHONE
for (QHash<CoreApplicationCallbackRemover, EventRegistrationToken>::const_iterator i = d->applicationTokens.begin(); i != d->applicationTokens.end(); ++i) {
hr = (d->application.Get()->*i.key())(i.value());
Q_ASSERT_SUCCEEDED(hr);
}
-#endif
+
destroyScreen(d->mainScreen);
Windows::Foundation::Uninitialize();
}
@@ -318,11 +311,7 @@ QPlatformClipboard *QWinRTIntegration::clipboard() const
#ifndef QT_NO_DRAGANDDROP
QPlatformDrag *QWinRTIntegration::drag() const
{
-#if _MSC_VER >= 1900
return QWinRTDrag::instance();
-#else
- return QPlatformIntegration::drag();
-#endif
}
#endif // QT_NO_DRAGANDDROP
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index f87ae9fd24..060f1839cf 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -562,7 +562,7 @@ QWinRTScreen::QWinRTScreen()
ComPtr<Xaml::IUIElement> uiElement;
hr = canvas.As(&uiElement);
Q_ASSERT_SUCCEEDED(hr);
-#if _MSC_VER >= 1900 && !defined(QT_NO_DRAGANDDROP)
+#ifndef QT_NO_DRAGANDDROP
QWinRTDrag::instance()->setUiElement(uiElement);
#endif
hr = window->put_Content(uiElement.Get());
@@ -833,7 +833,7 @@ void QWinRTScreen::addWindow(QWindow *window)
handleExpose();
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
-#if _MSC_VER >= 1900 && !defined(QT_NO_DRAGANDDROP)
+#ifndef QT_NO_DRAGANDDROP
QWinRTDrag::instance()->setDropTarget(window);
#endif
}
@@ -852,7 +852,7 @@ void QWinRTScreen::removeWindow(QWindow *window)
QWindowSystemInterface::handleWindowActivated(Q_NULLPTR, Qt::OtherFocusReason);
handleExpose();
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
-#if _MSC_VER >= 1900 && !defined(QT_NO_DRAGANDDROP)
+#ifndef QT_NO_DRAGANDDROP
if (wasTopWindow)
QWinRTDrag::instance()->setDropTarget(topWindow());
#endif
@@ -1221,11 +1221,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
properties->get_Pressure(&pressure);
boolean isPressed;
-#ifndef Q_OS_WINPHONE
pointerPoint->get_IsInContact(&isPressed);
-#else
- properties->get_IsLeftButtonPressed(&isPressed); // IsInContact not reliable on phone
-#endif
// Devices like the Hololens set a static pressure of 0.5 independent
// of the pressed state. In those cases we need to synthesize the
@@ -1356,16 +1352,10 @@ HRESULT QWinRTScreen::onDpiChanged(IDisplayInformation *, IInspectable *)
Q_D(QWinRTScreen);
HRESULT hr;
-#ifdef Q_OS_WINPHONE
- ComPtr<IDisplayInformation2> displayInformation;
- hr = d->displayInformation.As(&displayInformation);
- RETURN_OK_IF_FAILED("Failed to cast display information.");
- hr = displayInformation->get_RawPixelsPerViewPixel(&d->scaleFactor);
-#else
ResolutionScale resolutionScale;
hr = d->displayInformation->get_ResolutionScale(&resolutionScale);
d->scaleFactor = qreal(resolutionScale) / 100;
-#endif
+
qCDebug(lcQpaWindows) << __FUNCTION__ << "Scale Factor:" << d->scaleFactor;
RETURN_OK_IF_FAILED("Failed to get scale factor");
diff --git a/src/plugins/platforms/winrt/qwinrttheme.cpp b/src/plugins/platforms/winrt/qwinrttheme.cpp
index f84688f045..6b35bde83e 100644
--- a/src/plugins/platforms/winrt/qwinrttheme.cpp
+++ b/src/plugins/platforms/winrt/qwinrttheme.cpp
@@ -84,7 +84,6 @@ static inline QColor fromColor(const Color &color)
return QColor(color.R, color.G, color.B, color.A);
}
-#if _MSC_VER >= 1900
static bool uiColorSettings(const wchar_t *value, UIElementType type, Color *color)
{
static ComPtr<IApiInformationStatics> apiInformationStatics;
@@ -189,103 +188,6 @@ static void nativeColorSettings(QPalette &p)
p.setColor(QPalette::BrightText, fromColor(color));
}
-#else // _MSC_VER >= 1900
-
-static void nativeColorSettings(QPalette &p)
-{
- HRESULT hr;
- Color color;
-
-#ifdef Q_OS_WINPHONE
- hr = uiSettings()->UIElementColor(UIElementType_PopupBackground, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::ToolTipBase, fromColor(color));
- p.setColor(QPalette::AlternateBase, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_NonTextMedium, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Button, fromColor(color));
- hr = uiSettings()->UIElementColor(UIElementType_NonTextMediumHigh, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Midlight, fromColor(color));
- hr = uiSettings()->UIElementColor(UIElementType_NonTextHigh, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Light, fromColor(color));
- hr = uiSettings()->UIElementColor(UIElementType_NonTextMediumLow, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Mid, fromColor(color));
- hr = uiSettings()->UIElementColor(UIElementType_NonTextLow, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Dark, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_TextHigh, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::ButtonText, fromColor(color));
- p.setColor(QPalette::Text, fromColor(color));
- p.setColor(QPalette::WindowText, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_TextMedium, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::ToolTipText, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_AccentColor, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Highlight, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_PageBackground, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Window, fromColor(color));
- p.setColor(QPalette::Base, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_TextContrastWithHigh, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::BrightText, fromColor(color));
-#else
- hr = uiSettings()->UIElementColor(UIElementType_ActiveCaption, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::ToolTipBase, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_Background, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::AlternateBase, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_ButtonFace, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Button, fromColor(color));
- p.setColor(QPalette::Midlight, fromColor(color).lighter(110));
- p.setColor(QPalette::Light, fromColor(color).lighter(150));
- p.setColor(QPalette::Mid, fromColor(color).dark(130));
- p.setColor(QPalette::Dark, fromColor(color).dark(150));
-
- hr = uiSettings()->UIElementColor(UIElementType_ButtonText, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::ButtonText, fromColor(color));
- p.setColor(QPalette::Text, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_CaptionText, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::ToolTipText, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_Highlight, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Highlight, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_HighlightText, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::HighlightedText, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_Window, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::Window, fromColor(color));
- p.setColor(QPalette::Base, fromColor(color));
-
- hr = uiSettings()->UIElementColor(UIElementType_Hotlight, &color);
- Q_ASSERT_SUCCEEDED(hr);
- p.setColor(QPalette::BrightText, fromColor(color));
-#endif
-}
-#endif // _MSC_VER < 1900
-
QWinRTTheme::QWinRTTheme()
: d_ptr(new QWinRTThemePrivate)
{
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp
index 8f3b86ff3b..c40a1b8c45 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.cpp
+++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp
@@ -331,7 +331,6 @@ void QWinRTWindow::setWindowState(Qt::WindowState state)
if (d->state == state)
return;
-#if _MSC_VER >= 1900
if (state == Qt::WindowFullScreen) {
HRESULT hr;
boolean success;
@@ -378,7 +377,6 @@ void QWinRTWindow::setWindowState(Qt::WindowState state)
return;
}
}
-#endif // _MSC_VER >= 1900
if (state == Qt::WindowMinimized)
setUIElementVisibility(d->uiElement.Get(), false);
diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro
index be2f5ca7e2..35801fdacc 100644
--- a/src/plugins/platforms/winrt/winrt.pro
+++ b/src/plugins/platforms/winrt/winrt.pro
@@ -52,7 +52,7 @@ WINRT_SDK_VERSION_STRING = $$(UCRTVersion)
WINRT_SDK_VERSION = $$member($$list($$split(WINRT_SDK_VERSION_STRING, .)), 2)
lessThan(WINRT_SDK_VERSION, 14322): DEFINES += QT_WINRT_LIMITED_DRAGANDDROP
-*-msvc2013|contains(DEFINES, QT_NO_DRAGANDDROP) {
+contains(DEFINES, QT_NO_DRAGANDDROP) {
SOURCES -= qwinrtdrag.cpp
HEADERS -= qwinrtdrag.h
}