summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp28
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h2
2 files changed, 13 insertions, 17 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
index f3b390b4d6..750233c94f 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
@@ -131,7 +131,7 @@ HRESULT QWinRTInputContext::handleVisibilityChange(IInputPane *pane)
return S_OK;
}
-#ifdef Q_OS_WINPHONE
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
static HRESULT getInputPane(ComPtr<IInputPane2> *inputPane2)
{
@@ -160,13 +160,11 @@ static HRESULT getInputPane(ComPtr<IInputPane2> *inputPane2)
void QWinRTInputContext::showInputPanel()
{
- ComPtr<IInputPane2> inputPane;
- HRESULT hr = getInputPane(&inputPane);
- if (FAILED(hr))
- return;
-
- QEventDispatcherWinRT::runOnXamlThread([&inputPane]() {
- HRESULT hr;
+ QEventDispatcherWinRT::runOnXamlThread([&]() {
+ ComPtr<IInputPane2> inputPane;
+ HRESULT hr = getInputPane(&inputPane);
+ if (FAILED(hr))
+ return hr;
boolean success;
hr = inputPane->TryShow(&success);
if (FAILED(hr) || !success)
@@ -177,13 +175,11 @@ void QWinRTInputContext::showInputPanel()
void QWinRTInputContext::hideInputPanel()
{
- ComPtr<IInputPane2> inputPane;
- HRESULT hr = getInputPane(&inputPane);
- if (FAILED(hr))
- return;
-
- QEventDispatcherWinRT::runOnXamlThread([&inputPane]() {
- HRESULT hr;
+ QEventDispatcherWinRT::runOnXamlThread([&]() {
+ ComPtr<IInputPane2> inputPane;
+ HRESULT hr = getInputPane(&inputPane);
+ if (FAILED(hr))
+ return hr;
boolean success;
hr = inputPane->TryHide(&success);
if (FAILED(hr) || !success)
@@ -192,6 +188,6 @@ void QWinRTInputContext::hideInputPanel()
});
}
-#endif // Q_OS_WINPHONE
+#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.h b/src/plugins/platforms/winrt/qwinrtinputcontext.h
index cc3bce435f..6f88ff46e6 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.h
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.h
@@ -68,7 +68,7 @@ public:
bool isInputPanelVisible() const;
-#ifdef Q_OS_WINPHONE
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
void showInputPanel();
void hideInputPanel();
#endif