Remove superfluous clang preprocessor check for cpp/winrt
The cpp/winrt configure test fails if clang is being used so there is no need to explicitly check for the compiler. Change-Id: Ifb2cb792cf3ea2d2ff09be6e47d741f09aec765f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
parent
d7ea07c8c1
commit
0988ad8521
@ -19,7 +19,7 @@
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
#if QT_CONFIG(cpp_winrt) && !defined(Q_CC_CLANG)
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
# include <winrt/base.h>
|
||||
// Workaround for Windows SDK bug.
|
||||
// See https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47
|
||||
@ -31,7 +31,7 @@ namespace winrt::impl
|
||||
# include <winrt/Windows.Foundation.h>
|
||||
# include <winrt/Windows.Foundation.Collections.h>
|
||||
# include <winrt/Windows.System.UserProfile.h>
|
||||
#endif // QT_CONFIG(cpp_winrt) && !defined(Q_CC_CLANG)
|
||||
#endif // QT_CONFIG(cpp_winrt)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -661,7 +661,7 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS
|
||||
QVariant QSystemLocalePrivate::uiLanguages()
|
||||
{
|
||||
QStringList result;
|
||||
#if QT_CONFIG(cpp_winrt) && !defined(Q_CC_CLANG)
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
using namespace winrt;
|
||||
using namespace Windows::System::UserProfile;
|
||||
auto languages = GlobalizationPreferences::Languages();
|
||||
@ -669,7 +669,7 @@ QVariant QSystemLocalePrivate::uiLanguages()
|
||||
result << QString::fromStdString(winrt::to_string(lang));
|
||||
if (!result.isEmpty())
|
||||
return result; // else just fall back to WIN32 API implementation
|
||||
#endif // QT_CONFIG(cpp_winrt) && !defined(Q_CC_CLANG)
|
||||
#endif // QT_CONFIG(cpp_winrt)
|
||||
// mingw and clang still have to use Win32 API
|
||||
unsigned long cnt = 0;
|
||||
QVarLengthArray<wchar_t, 64> buf(64);
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "qnetworklistmanagerevents.h"
|
||||
|
||||
#ifdef SUPPORTS_WINRT
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
#include <winrt/base.h>
|
||||
// Workaround for Windows SDK bug.
|
||||
// See https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47
|
||||
@ -14,7 +14,7 @@ namespace winrt::impl
|
||||
}
|
||||
|
||||
#include <winrt/Windows.Networking.Connectivity.h>
|
||||
#endif
|
||||
#endif // QT_CONFIG(cpp_winrt)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -99,7 +99,7 @@ bool QNetworkListManagerEvents::start()
|
||||
else
|
||||
emit connectivityChanged(connectivity);
|
||||
|
||||
#ifdef SUPPORTS_WINRT
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
using namespace winrt::Windows::Networking::Connectivity;
|
||||
// Register for changes in the network and store a token to unregister later:
|
||||
token = NetworkInformation::NetworkStatusChanged(
|
||||
@ -125,7 +125,7 @@ bool QNetworkListManagerEvents::stop()
|
||||
}
|
||||
cookie = 0;
|
||||
|
||||
#ifdef SUPPORTS_WINRT
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
using namespace winrt::Windows::Networking::Connectivity;
|
||||
// Pass the token we stored earlier to unregister:
|
||||
NetworkInformation::NetworkStatusChanged(token);
|
||||
@ -172,7 +172,7 @@ bool QNetworkListManagerEvents::checkBehindCaptivePortal()
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef SUPPORTS_WINRT
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
namespace {
|
||||
using namespace winrt::Windows::Networking::Connectivity;
|
||||
// NB: this isn't part of "network list manager", but sadly NLM doesn't have an
|
||||
@ -223,6 +223,6 @@ void QNetworkListManagerEvents::emitWinRTUpdates()
|
||||
emit transportMediumChanged(getTransportMedium(profile));
|
||||
emit isMeteredChanged(getMetered(profile));
|
||||
}
|
||||
#endif
|
||||
#endif // QT_CONFIG(cpp_winrt)
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -15,11 +15,7 @@
|
||||
#include <wrl/wrappers/corewrappers.h>
|
||||
#include <comdef.h>
|
||||
|
||||
#if QT_CONFIG(cpp_winrt) && !defined(Q_CC_CLANG)
|
||||
#define SUPPORTS_WINRT 1
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORTS_WINRT
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
#include <winrt/base.h>
|
||||
#endif
|
||||
|
||||
@ -69,7 +65,7 @@ private:
|
||||
ComPtr<INetworkListManager> networkListManager = nullptr;
|
||||
ComPtr<IConnectionPoint> connectionPoint = nullptr;
|
||||
|
||||
#ifdef SUPPORTS_WINRT
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
void emitWinRTUpdates();
|
||||
|
||||
winrt::event_token token;
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
{
|
||||
return QNetworkInformation::Features(QNetworkInformation::Feature::Reachability
|
||||
| QNetworkInformation::Feature::CaptivePortal
|
||||
#ifdef SUPPORTS_WINRT
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
| QNetworkInformation::Feature::TransportMedium
|
||||
#endif
|
||||
);
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#if QT_CONFIG(cpp_winrt) && !defined(Q_CC_CLANG)
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
# include <winrt/base.h>
|
||||
// Workaround for Windows SDK bug.
|
||||
// See https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47
|
||||
@ -56,8 +56,7 @@ namespace winrt::impl
|
||||
auto wait_for(Async const& async, Windows::Foundation::TimeSpan const& timeout);
|
||||
}
|
||||
# include <winrt/Windows.UI.ViewManagement.h>
|
||||
# define HAS_UISETTINGS 1
|
||||
#endif
|
||||
#endif // QT_CONFIG(cpp_winrt)
|
||||
|
||||
#if defined(__IImageList_INTERFACE_DEFINED__) && defined(__IID_DEFINED__)
|
||||
# define USE_IIMAGELIST
|
||||
@ -111,7 +110,7 @@ static inline QColor getSysColor(int index)
|
||||
return COLORREFToQColor(GetSysColor(index));
|
||||
}
|
||||
|
||||
#if defined(HAS_UISETTINGS)
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
static constexpr QColor getSysColor(winrt::Windows::UI::Color &&color)
|
||||
{
|
||||
return QColor(color.R, color.G, color.B, color.A);
|
||||
@ -261,7 +260,7 @@ static void populateLightSystemBasePalette(QPalette &result)
|
||||
QColor textColor = getSysColor(COLOR_WINDOWTEXT);
|
||||
QColor accent = getSysColor(COLOR_HIGHLIGHT);
|
||||
|
||||
#if defined(HAS_UISETTINGS)
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
if (QWindowsIntegration::instance()->darkModeHandling().testFlag(QWindowsApplication::DarkModeStyle)) {
|
||||
using namespace winrt::Windows::UI::ViewManagement;
|
||||
const auto settings = UISettings();
|
||||
@ -304,7 +303,7 @@ static void populateLightSystemBasePalette(QPalette &result)
|
||||
|
||||
static void populateDarkSystemBasePalette(QPalette &result)
|
||||
{
|
||||
#if defined(HAS_UISETTINGS)
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
using namespace winrt::Windows::UI::ViewManagement;
|
||||
const auto settings = UISettings();
|
||||
|
||||
@ -593,7 +592,7 @@ void QWindowsTheme::refreshPalettes()
|
||||
m_palettes[MenuPalette] = new QPalette(menuPalette(*m_palettes[SystemPalette], light));
|
||||
m_palettes[MenuBarPalette] = menuBarPalette(*m_palettes[MenuPalette], light);
|
||||
if (!light) {
|
||||
#if defined(HAS_UISETTINGS)
|
||||
#if QT_CONFIG(cpp_winrt)
|
||||
using namespace winrt::Windows::UI::ViewManagement;
|
||||
const auto settings = UISettings();
|
||||
const QColor accent = getSysColor(settings.GetColorValue(UIColorType::Accent));
|
||||
|
Loading…
x
Reference in New Issue
Block a user