diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-03 16:36:38 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-05 08:16:56 +0000 |
commit | 73c062d60509a4bda0d1fad2dee3f9be70108bfb (patch) | |
tree | 5caf67cfad329395e1568326a7af3582ce88b2de /src/plugins/platforms/windows | |
parent | 798e0064e9be78f8320ff25a9af50d1b5e5badb1 (diff) |
Windows QPA: Remove dead code as detected by Clang.
Task-number: QTBUG-50804
Change-Id: Id87ca4ac98eb17b1e743a10080554da38d609588
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows')
12 files changed, 6 insertions, 97 deletions
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp index 1071a2e038..8b0be5d916 100644 --- a/src/plugins/platforms/windows/qwindowsclipboard.cpp +++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp @@ -51,9 +51,6 @@ QT_BEGIN_NAMESPACE -static const char formatTextPlainC[] = "text/plain"; -static const char formatTextHtmlC[] = "text/html"; - /*! \class QWindowsClipboard \brief Clipboard implementation. diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 4934b6c6e4..6ff6875c49 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -89,20 +89,6 @@ Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility") int QWindowsContext::verbose = 0; -// Get verbosity of components from "foo:2,bar:3" -static inline int componentVerbose(const char *v, const char *keyWord) -{ - if (const char *k = strstr(v, keyWord)) { - k += qstrlen(keyWord); - if (*k == ':') { - ++k; - if (isdigit(*k)) - return *k - '0'; - } - } - return 0; -} - #if !defined(LANG_SYRIAC) # define LANG_SYRIAC 0x5a #endif diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp index c769eb04a4..b9e893c650 100644 --- a/src/plugins/platforms/windows/qwindowscursor.cpp +++ b/src/plugins/platforms/windows/qwindowscursor.cpp @@ -246,9 +246,10 @@ static QSize systemCursorSize(const QPlatformScreen *screen = Q_NULLPTR) return primaryScreenCursorSize; } +#if defined (Q_OS_WINCE) || defined (QT_NO_IMAGEFORMAT_PNG) + static inline QSize standardCursorSize() { return QSize(32, 32); } -#if defined (Q_OS_WINCE) || defined (QT_NO_IMAGEFORMAT_PNG) // Create pixmap cursors from data and scale the image if the cursor size is // higher than the standard 32. Note that bitmap cursors as produced by // createBitmapCursor() only work for standard sizes (32,48,64...), which does diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 4abeb4c1ce..aeb4f903db 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1584,11 +1584,6 @@ QWindowsNativeFileDialogBase *QWindowsNativeFileDialogBase::create(QFileDialogOp return result; } -static inline bool isQQuickWindow(const QWindow *w = 0) -{ - return w && w->inherits("QQuickWindow"); -} - /*! \class QWindowsFileDialogHelper \brief Helper for native Windows file dialogs diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp index 65a9763be6..20517bc5a9 100644 --- a/src/plugins/platforms/windows/qwindowseglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp @@ -342,8 +342,8 @@ bool QWindowsLibGLESv2::init() return glBindTexture && glCreateShader && glClearDepthf; } -QWindowsEGLStaticContext::QWindowsEGLStaticContext(EGLDisplay display, int version) - : m_display(display), m_version(version) +QWindowsEGLStaticContext::QWindowsEGLStaticContext(EGLDisplay display) + : m_display(display) { } @@ -410,7 +410,7 @@ QWindowsEGLStaticContext *QWindowsEGLStaticContext::create(QWindowsOpenGLTester: } qCDebug(lcQpaGl) << __FUNCTION__ << "Created EGL display" << display << 'v' <<major << '.' << minor; - return new QWindowsEGLStaticContext(display, (major << 8) | minor); + return new QWindowsEGLStaticContext(display); } QWindowsEGLStaticContext::~QWindowsEGLStaticContext() diff --git a/src/plugins/platforms/windows/qwindowseglcontext.h b/src/plugins/platforms/windows/qwindowseglcontext.h index 7a74a2c76f..6945939941 100644 --- a/src/plugins/platforms/windows/qwindowseglcontext.h +++ b/src/plugins/platforms/windows/qwindowseglcontext.h @@ -270,10 +270,9 @@ public: static QWindowsLibGLESv2 libGLESv2; private: - QWindowsEGLStaticContext(EGLDisplay display, int version); + explicit QWindowsEGLStaticContext(EGLDisplay display); const EGLDisplay m_display; - const int m_version; //! majorVersion<<8 + minorVersion }; class QWindowsEGLContext : public QWindowsOpenGLContext diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index bf62052ee5..05e2b0ca03 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -103,17 +103,6 @@ static void resolveGetCharWidthI() ptrGetCharWidthI = (PtrGetCharWidthI)QSystemLibrary::resolve(QStringLiteral("gdi32"), "GetCharWidthI"); } -static inline quint32 getUInt(unsigned char *p) -{ - quint32 val; - val = *p++ << 24; - val |= *p++ << 16; - val |= *p++ << 8; - val |= *p; - - return val; -} - static inline quint16 getUShort(unsigned char *p) { quint16 val; @@ -265,7 +254,6 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name, m_logfont(lf), ttf(0), hasOutline(0), - lw(0), cmap(0), cmapSize(0), lbearing(SHRT_MIN), diff --git a/src/plugins/platforms/windows/qwindowsfontengine.h b/src/plugins/platforms/windows/qwindowsfontengine.h index 5317368455..47891a2830 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.h +++ b/src/plugins/platforms/windows/qwindowsfontengine.h @@ -144,7 +144,6 @@ private: uint hasUnreliableOutline : 1; uint cffTable : 1; TEXTMETRIC tm; - int lw; const unsigned char *cmap; int cmapSize; QByteArray cmapTable; diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index c5dff60114..b7e7867404 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -614,10 +614,6 @@ static inline int asciiToKeycode(char a, int state) return a & 0xff; } -static inline bool isModifierKey(int code) -{ - return (code >= Qt::Key_Shift) && (code <= Qt::Key_ScrollLock); -} // Key translation -----------------------------------------------------------------------[ end ]--- diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 02696c87cd..bfcf96ebe7 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -77,22 +77,6 @@ static inline QDpi monitorDPI(HMONITOR hMonitor) #endif // !Q_OS_WINCE -static inline QSizeF deviceSizeMM(const QSize &pixels, const QDpi &dpi) -{ - const qreal inchToMM = 25.4; - const qreal h = qreal(pixels.width()) / qreal(dpi.first) * inchToMM; - const qreal v = qreal(pixels.height()) / qreal(dpi.second) * inchToMM; - return QSizeF(h, v); -} - -static inline QDpi deviceDPI(const QSize &pixels, const QSizeF &physicalSizeMM) -{ - const qreal inchToMM = 25.4; - const qreal h = qreal(pixels.width()) / (qreal(physicalSizeMM.width()) / inchToMM); - const qreal v = qreal(pixels.height()) / (qreal(physicalSizeMM.height()) / inchToMM); - return QDpi(h, v); -} - typedef QList<QWindowsScreenData> WindowsScreenDataList; static bool monitorData(HMONITOR hMonitor, QWindowsScreenData *data) diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index cc367ff801..5bbe923fe7 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -78,11 +78,6 @@ QT_BEGIN_NAMESPACE -static inline COLORREF qColorToCOLORREF(const QColor &color) -{ - return RGB(color.red(), color.green(), color.blue()); -} - static inline QColor COLORREFToQColor(COLORREF cr) { return QColor(GetRValue(cr), GetGValue(cr), GetBValue(cr)); @@ -99,30 +94,6 @@ static inline QTextStream& operator<<(QTextStream &str, const QColor &c) return str; } -static inline void paletteRoleToString(const QPalette &palette, - const QPalette::ColorRole role, - QTextStream &str) -{ - str << "Role: "; - str.setFieldWidth(2); - str.setPadChar(QLatin1Char('0')); - str << role; - str.setFieldWidth(0); - str << " Active: " << palette.color(QPalette::Active, role) - << " Disabled: " << palette.color(QPalette::Disabled, role) - << " Inactive: " << palette.color(QPalette::Inactive, role) - << '\n'; -} - -static inline QString paletteToString(const QPalette &palette) -{ - QString result; - QTextStream str(&result); - for (int r = 0; r < QPalette::NColorRoles; ++r) - paletteRoleToString(palette, static_cast<QPalette::ColorRole>(r), str); - return result; -} - static inline bool booleanSystemParametersInfo(UINT what, bool defaultValue) { BOOL result; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 7f45b4817a..82d67e36f5 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -248,13 +248,6 @@ static QWindow::Visibility windowVisibility_sys(HWND hwnd) return QWindow::Windowed; } -static inline QSize clientSize(HWND hwnd) -{ - RECT rect = { 0, 0, 0, 0 }; - GetClientRect(hwnd, &rect); // Always returns point 0,0, thus unusable for geometry. - return qSizeOfRect(rect); -} - static inline bool windowIsOpenGL(const QWindow *w) { switch (w->surfaceType()) { |