From bf537516a93ae9297a90a6369a3f613ded0dc84c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 8 Mar 2016 13:25:23 +0100 Subject: [PATCH] QtGui: Remove Windows CE. Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, and tests. Task-number: QTBUG-51673 Change-Id: I55f61845c3b54027c467a5c59c122e7d16955358 Reviewed-by: Lars Knoll --- src/gui/image/qpixmap_win.cpp | 170 ------------------ src/gui/image/qpnghandler.cpp | 28 +-- src/gui/image/qxpmhandler.cpp | 2 +- src/gui/kernel/qguiapplication.cpp | 10 +- src/gui/painting/qdrawhelper.cpp | 8 +- .../image/qicoimageformat/qicoimageformat.pro | 9 - tests/auto/gui/image/qicon/tst_qicon.cpp | 8 - tests/auto/gui/image/qimage/tst_qimage.cpp | 8 - .../image/qimagewriter/tst_qimagewriter.cpp | 6 - tests/auto/gui/image/qpixmap/qpixmap.pro | 4 +- tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 33 ++-- tests/auto/gui/kernel/kernel.pro | 2 +- .../kernel/noqteventloop/noqteventloop.pro | 2 +- .../gui/kernel/qclipboard/copier/main.cpp | 2 - .../gui/kernel/qclipboard/paster/main.cpp | 4 - .../auto/gui/kernel/qclipboard/test/test.pro | 4 - .../gui/kernel/qclipboard/tst_qclipboard.cpp | 4 - .../kernel/qkeysequence/tst_qkeysequence.cpp | 4 +- tests/auto/gui/kernel/qwindow/qwindow.pro | 2 +- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 4 +- .../gui/painting/qpainter/tst_qpainter.cpp | 2 - .../gui/painting/qwmatrix/tst_qwmatrix.cpp | 2 +- tests/auto/gui/text/qcssparser/qcssparser.pro | 8 - .../gui/text/qcssparser/tst_qcssparser.cpp | 34 +--- .../gui/text/qfontdatabase/qfontdatabase.pro | 6 - tests/auto/gui/text/qglyphrun/qglyphrun.pro | 11 +- tests/auto/gui/text/qzip/qzip.pro | 6 - .../qdesktopservices/tst_qdesktopservices.cpp | 2 +- 28 files changed, 41 insertions(+), 344 deletions(-) diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp index 7f20586156..92f6964783 100644 --- a/src/gui/image/qpixmap_win.cpp +++ b/src/gui/image/qpixmap_win.cpp @@ -48,84 +48,6 @@ QT_BEGIN_NAMESPACE -#ifdef Q_OS_WINCE -#define GetDIBits(a,b,c,d,e,f,g) qt_wince_GetDIBits(a,b,c,d,e,f,g) -int qt_wince_GetDIBits(HDC /*hdc*/ , HBITMAP hSourceBitmap, uint, uint, LPVOID lpvBits, LPBITMAPINFO, uint) -{ - if (!lpvBits) { - qWarning("::GetDIBits(), lpvBits NULL"); - return 0; - } - BITMAP bm; - GetObject(hSourceBitmap, sizeof(BITMAP), &bm); - bm.bmHeight = qAbs(bm.bmHeight); - - HBITMAP hTargetBitmap; - void *pixels; - - BITMAPINFO dibInfo; - memset(&dibInfo, 0, sizeof(dibInfo)); - dibInfo.bmiHeader.biBitCount = 32; - dibInfo.bmiHeader.biClrImportant = 0; - dibInfo.bmiHeader.biClrUsed = 0; - dibInfo.bmiHeader.biCompression = BI_RGB;; - dibInfo.bmiHeader.biHeight = -bm.bmHeight; - dibInfo.bmiHeader.biWidth = bm.bmWidth; - dibInfo.bmiHeader.biPlanes = 1; - dibInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - dibInfo.bmiHeader.biSizeImage = bm.bmWidth * bm.bmHeight * 4; - - HDC displayDC = GetDC(NULL); - if (!displayDC) { - qWarning("::GetDIBits(), failed to GetDC"); - return 0; - } - - int ret = bm.bmHeight; - - hTargetBitmap = CreateDIBSection(displayDC, (const BITMAPINFO*) &dibInfo, DIB_RGB_COLORS, - (void**)&pixels, NULL, 0); - if (!hTargetBitmap) { - qWarning("::GetDIBits(), failed to CreateDIBSection"); - return 0; - } - - HDC hdcSrc = CreateCompatibleDC(displayDC); - HDC hdcDst = CreateCompatibleDC(displayDC); - - if (!(hdcDst && hdcSrc)) { - qWarning("::GetDIBits(), failed to CreateCompatibleDC"); - ret = 0; - } - - HBITMAP hOldBitmap1 = (HBITMAP) SelectObject(hdcSrc, hSourceBitmap); - HBITMAP hOldBitmap2 = (HBITMAP) SelectObject(hdcDst, hTargetBitmap); - - if (!(hOldBitmap1 && hOldBitmap2)) { - qWarning("::GetDIBits(), failed to SelectObject for bitmaps"); - ret = 0; - } - - if (!BitBlt(hdcDst, 0, 0, bm.bmWidth, bm.bmHeight, hdcSrc, 0, 0, SRCCOPY)) { - qWarning("::GetDIBits(), BitBlt failed"); - ret = 0; - } - - SelectObject(hdcSrc, hOldBitmap1); - SelectObject(hdcDst, hOldBitmap2); - - DeleteDC(hdcSrc); - DeleteDC(hdcDst); - - ReleaseDC(NULL, displayDC); - - memcpy(lpvBits, pixels, dibInfo.bmiHeader.biSizeImage); - - DeleteObject(hTargetBitmap); - return ret; -} -#endif - static inline void initBitMapInfoHeader(int width, int height, bool topToBottom, BITMAPINFOHEADER *bih) { memset(bih, 0, sizeof(BITMAPINFOHEADER)); @@ -325,8 +247,6 @@ Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p) return hIcon; } -#ifndef Q_OS_WINCE - Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h) { QImage image(w, h, QImage::Format_ARGB32_Premultiplied); @@ -415,95 +335,5 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon) DeleteDC(hdc); return QPixmap::fromImage(image); } -#else //ifndef Q_OS_WINCE -Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon) -{ - HDC screenDevice = GetDC(0); - HDC hdc = CreateCompatibleDC(screenDevice); - ReleaseDC(0, screenDevice); - - ICONINFO iconinfo; - bool result = GetIconInfo(icon, &iconinfo); - if (!result) - qWarning("QPixmap::fromWinHICON(), failed to GetIconInfo()"); - - int w = 0; - int h = 0; - if (!iconinfo.xHotspot || !iconinfo.yHotspot) { - // We could not retrieve the icon size via GetIconInfo, - // so we try again using the icon bitmap. - BITMAP bm; - int result = GetObject(iconinfo.hbmColor, sizeof(BITMAP), &bm); - if (!result) result = GetObject(iconinfo.hbmMask, sizeof(BITMAP), &bm); - if (!result) { - qWarning("QPixmap::fromWinHICON(), failed to retrieve icon size"); - return QPixmap(); - } - w = bm.bmWidth; - h = bm.bmHeight; - } else { - // x and y Hotspot describes the icon center - w = iconinfo.xHotspot * 2; - h = iconinfo.yHotspot * 2; - } - const DWORD dwImageSize = w * h * 4; - - BITMAPINFO bmi; - memset(&bmi, 0, sizeof(bmi)); - bmi.bmiHeader.biSize = sizeof(BITMAPINFO); - bmi.bmiHeader.biWidth = w; - bmi.bmiHeader.biHeight = -h; - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = 32; - bmi.bmiHeader.biCompression = BI_RGB; - bmi.bmiHeader.biSizeImage = dwImageSize; - - uchar* bits; - - HBITMAP winBitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**) &bits, 0, 0); - if (winBitmap ) - memset(bits, 0xff, dwImageSize); - if (!winBitmap) { - qWarning("QPixmap::fromWinHICON(), failed to CreateDIBSection()"); - return QPixmap(); - } - - HGDIOBJ oldhdc = (HBITMAP)SelectObject(hdc, winBitmap); - if (!DrawIconEx( hdc, 0, 0, icon, w, h, 0, 0, DI_NORMAL)) - qWarning("QPixmap::fromWinHICON(), failed to DrawIcon()"); - - uint mask = 0xff000000; - // Create image and copy data into image. - QImage image(w, h, QImage::Format_ARGB32); - - if (!image.isNull()) { // failed to alloc? - int bytes_per_line = w * sizeof(QRgb); - for (int y=0; y < h; ++y) { - QRgb *dest = (QRgb *) image.scanLine(y); - const QRgb *src = (const QRgb *) (bits + y * bytes_per_line); - for (int x=0; x < w; ++x) { - dest[x] = src[x]; - } - } - } - if (!DrawIconEx( hdc, 0, 0, icon, w, h, 0, 0, DI_MASK)) - qWarning("QPixmap::fromWinHICON(), failed to DrawIcon()"); - if (!image.isNull()) { // failed to alloc? - int bytes_per_line = w * sizeof(QRgb); - for (int y=0; y < h; ++y) { - QRgb *dest = (QRgb *) image.scanLine(y); - const QRgb *src = (const QRgb *) (bits + y * bytes_per_line); - for (int x=0; x < w; ++x) { - if (!src[x]) - dest[x] = dest[x] | mask; - } - } - } - SelectObject(hdc, oldhdc); //restore state - DeleteObject(winBitmap); - DeleteDC(hdc); - return QPixmap::fromImage(image); -} -#endif //ifndef Q_OS_WINCE QT_END_NAMESPACE diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index c84f429e46..7fbb498bbb 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -75,20 +75,8 @@ # endif #endif -#ifdef Q_OS_WINCE -#define CALLBACK_CALL_TYPE __cdecl -#else -#define CALLBACK_CALL_TYPE -#endif - QT_BEGIN_NAMESPACE -#if defined(Q_OS_WINCE) && defined(STANDARDSHELL_UI_MODEL) -# define Q_INTERNAL_WIN_NO_THROW __declspec(nothrow) -#else -# define Q_INTERNAL_WIN_NO_THROW -#endif - // avoid going through QImage::scanLine() which calls detach #define FAST_SCAN_LINE(data, bpl, y) (data + (y) * bpl) @@ -190,7 +178,7 @@ private: extern "C" { static -void CALLBACK_CALL_TYPE iod_read_fn(png_structp png_ptr, png_bytep data, png_size_t length) +void iod_read_fn(png_structp png_ptr, png_bytep data, png_size_t length) { QPngHandlerPrivate *d = (QPngHandlerPrivate *)png_get_io_ptr(png_ptr); QIODevice *in = d->q->device(); @@ -215,7 +203,7 @@ void CALLBACK_CALL_TYPE iod_read_fn(png_structp png_ptr, png_bytep data, png_siz static -void CALLBACK_CALL_TYPE qpiw_write_fn(png_structp png_ptr, png_bytep data, png_size_t length) +void qpiw_write_fn(png_structp png_ptr, png_bytep data, png_size_t length) { QPNGImageWriter* qpiw = (QPNGImageWriter*)png_get_io_ptr(png_ptr); QIODevice* out = qpiw->device(); @@ -229,7 +217,7 @@ void CALLBACK_CALL_TYPE qpiw_write_fn(png_structp png_ptr, png_bytep data, png_s static -void CALLBACK_CALL_TYPE qpiw_flush_fn(png_structp /* png_ptr */) +void qpiw_flush_fn(png_structp /* png_ptr */) { } @@ -487,7 +475,7 @@ static void read_image_scaled(QImage *outImage, png_structp png_ptr, png_infop i } extern "C" { -static void CALLBACK_CALL_TYPE qt_png_warning(png_structp /*png_ptr*/, png_const_charp message) +static void qt_png_warning(png_structp /*png_ptr*/, png_const_charp message) { qWarning("libpng warning: %s", message); } @@ -495,7 +483,7 @@ static void CALLBACK_CALL_TYPE qt_png_warning(png_structp /*png_ptr*/, png_const } -void Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngTexts(png_info *info) +void QPngHandlerPrivate::readPngTexts(png_info *info) { png_textp text_ptr; int num_text=0; @@ -522,7 +510,7 @@ void Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngTexts(png_info *info) } -bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngHeader() +bool QPngHandlerPrivate::readPngHeader() { state = Error; png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); @@ -566,7 +554,7 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngHeader() return true; } -bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage) +bool QPngHandlerPrivate::readPngImage(QImage *outImage) { if (state == Error) return false; @@ -810,7 +798,7 @@ bool QPNGImageWriter::writeImage(const QImage& image, int off_x, int off_y) return writeImage(image, -1, QString(), off_x, off_y); } -bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, volatile int quality_in, const QString &description, +bool QPNGImageWriter::writeImage(const QImage& image, volatile int quality_in, const QString &description, int off_x_in, int off_y_in) { QPoint offset = image.offset(); diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 5ae8e893cb..5c8ff84929 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -845,7 +845,7 @@ static bool read_xpm_header( if (!read_xpm_string(buf, device, source, index, state)) return false; -#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(Q_OS_WINCE) +#ifdef Q_CC_MSVC if (sscanf_s(buf, "%d %d %d %d", w, h, ncols, cpp) < 4) #else if (sscanf(buf, "%d %d %d %d", w, h, ncols, cpp) < 4) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 31b30c6e5a..0639b5bbc5 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -104,13 +104,13 @@ #if defined(Q_OS_MAC) # include "private/qcore_mac_p.h" -#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#elif defined(Q_OS_WIN) # include # include # if defined(Q_OS_WINPHONE) # include # endif -#endif // Q_OS_WIN && !Q_OS_WINCE +#endif // Q_OS_WIN #include @@ -1102,12 +1102,12 @@ static void init_platform(const QString &pluginArgument, const QString &platform keys.join(QStringLiteral(", "))); } fatalMessage += QStringLiteral("Reinstalling the application may fix this problem."); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) // Windows: Display message box unless it is a console application // or debug build showing an assert box. if (!QLibraryInfo::isDebugBuild() && !GetConsoleWindow()) MessageBox(0, (LPCTSTR)fatalMessage.utf16(), (LPCTSTR)(QCoreApplication::applicationName().utf16()), MB_OK | MB_ICONERROR); -#endif // Q_OS_WIN && !Q_OS_WINCE && !Q_OS_WINRT +#endif // Q_OS_WIN && !Q_OS_WINRT qFatal("%s", qPrintable(fatalMessage)); return; } @@ -1310,7 +1310,7 @@ void QGuiApplicationPrivate::init() #ifndef QT_NO_SESSIONMANAGER QString session_id; QString session_key; -# if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +# if defined(Q_OS_WIN) wchar_t guidstr[40]; GUID guid; CoCreateGuid(&guid); diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 29c3ba3480..ae6d373f0e 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5758,7 +5758,7 @@ static inline void rgbBlendPixel(quint32 *dst, int coverage, int sr, int sg, int *dst = qRgb(nr, ng, nb); } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) Q_GUI_EXPORT bool qt_needs_a8_gamma_correction = false; static inline void grayBlendPixel(quint32 *dst, int coverage, int sr, int sg, int sb, const uint *gamma, const uchar *invgamma) @@ -5795,7 +5795,7 @@ static void qt_alphamapblit_uint32(QRasterBuffer *rasterBuffer, const quint32 c = color; const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint32); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables(); if (!tables) return; @@ -5822,7 +5822,7 @@ static void qt_alphamapblit_uint32(QRasterBuffer *rasterBuffer, } else if (coverage == 255) { dest[i] = c; } else { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel && qAlpha(dest[i]) == 255) { grayBlendPixel(dest+i, coverage, sr, sg, sb, gamma, invgamma); @@ -5863,7 +5863,7 @@ static void qt_alphamapblit_uint32(QRasterBuffer *rasterBuffer, } else if (coverage == 255) { dest[xp] = c; } else { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && doGrayBlendPixel && qAlpha(dest[xp]) == 255) { grayBlendPixel(dest+xp, coverage, sr, sg, sb, gamma, invgamma); diff --git a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro index 485472c70c..46bfb2a586 100644 --- a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro +++ b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro @@ -3,14 +3,5 @@ TARGET = tst_qicoimageformat SOURCES+= tst_qicoimageformat.cpp QT += testlib -wince { - CONFIG(debug, debug|release):{ - addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll - } else { - addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll - } - addPlugins.path = imageformats - DEPLOYMENT += addPlugins -} TESTDATA += icons/* android:RESOURCES+=qicoimageformat.qrc diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 3c4610a892..b728d095d7 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -393,7 +393,6 @@ void tst_QIcon::addFile() icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-save-32.png"), QSize(), QIcon::Selected); icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-save-128.png"), QSize(), QIcon::Selected); -#ifndef Q_OS_WINCE QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() == QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); QVERIFY(icon.pixmap(32, QIcon::Normal).toImage() == @@ -406,13 +405,6 @@ void tst_QIcon::addFile() QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-save-32.png")).toImage()); QVERIFY(icon.pixmap(128, QIcon::Selected).toImage() == QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-save-128.png")).toImage()); -#else - // WinCE only includes the 16x16 images for size reasons - QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() == - QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); - QVERIFY(icon.pixmap(16, QIcon::Selected).toImage() == - QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-save-16.png")).toImage()); -#endif } static bool sizeLess(const QSize &a, const QSize &b) diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index d8fb39f77f..dd10ba2e82 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -289,17 +289,13 @@ void tst_QImage::swap() void tst_QImage::create() { bool cr = true; -#if !defined(Q_OS_WINCE) QT_TRY { -#endif //QImage image(7000000, 7000000, 8, 256, QImage::IgnoreEndian); QImage image(7000000, 7000000, QImage::Format_Indexed8); image.setColorCount(256); cr = !image.isNull(); -#if !defined(Q_OS_WINCE) } QT_CATCH (...) { } -#endif QVERIFY( !cr ); } @@ -1784,11 +1780,7 @@ void tst_QImage::smoothScale4() void tst_QImage::smoothScaleBig() { -#if defined(Q_OS_WINCE) - int bigValue = 2000; -#else int bigValue = 200000; -#endif QImage tall(4, bigValue, QImage::Format_ARGB32); tall.fill(0x0); diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index c12c8a9cf4..f48fab4f0a 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -508,9 +508,6 @@ void tst_QImageWriter::saveToTemporaryFile() QVERIFY(writer.write(image)); else qWarning() << file.errorString(); -#if defined(Q_OS_WINCE) - file.reset(); -#endif QCOMPARE(QImage(writer.fileName()), image); } { @@ -529,9 +526,6 @@ void tst_QImageWriter::saveToTemporaryFile() QVERIFY2(file.open(), qPrintable(file.errorString())); QImageWriter writer(&file, "PNG"); QVERIFY(writer.write(image)); -#if defined(Q_OS_WINCE) - file.reset(); -#endif QCOMPARE(QImage(writer.fileName()), image); } { diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro index 5a4656998a..e6a020af1a 100644 --- a/tests/auto/gui/image/qpixmap/qpixmap.pro +++ b/tests/auto/gui/image/qpixmap/qpixmap.pro @@ -5,9 +5,7 @@ QT += core-private gui-private testlib qtHaveModule(widgets): QT += widgets widgets-private SOURCES += tst_qpixmap.cpp -!wince:!winrt { - win32:LIBS += -lgdi32 -luser32 -} +win32:!winrt:LIBS += -lgdi32 -luser32 RESOURCES += qpixmap.qrc TESTDATA += convertFromImage/* convertFromToHICON/* loadFromData/* images/* diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 6adfe05fb0..79d3a57d73 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -442,22 +442,16 @@ void tst_QPixmap::fill_data() QTest::newRow(("syscolor_" + QByteArray::number(color)).constData()) << uint(color) << true << false; -#if defined (Q_OS_WINCE) - QPixmap pixmap(1,1); - if (QApplication::desktop()->grab().depth() >= 24) { -#else - QPixmap pixmap(1, 1); { -#endif - QTest::newRow("alpha_7f_red") << 0x7fff0000u << false << false; - QTest::newRow("alpha_3f_blue") << 0x3f0000ffu << false << false; - QTest::newRow("alpha_b7_green") << 0xbf00ff00u << false << false; - QTest::newRow("alpha_7f_white") << 0x7fffffffu << false << false; - QTest::newRow("alpha_3f_white") << 0x3fffffffu << false << false; - QTest::newRow("alpha_b7_white") << 0xb7ffffffu << false << false; - QTest::newRow("alpha_7f_black") << 0x7f000000u << false << false; - QTest::newRow("alpha_3f_black") << 0x3f000000u << false << false; - QTest::newRow("alpha_b7_black") << 0xbf000000u << false << false; - } + QPixmap pixmap(1, 1); + QTest::newRow("alpha_7f_red") << 0x7fff0000u << false << false; + QTest::newRow("alpha_3f_blue") << 0x3f0000ffu << false << false; + QTest::newRow("alpha_b7_green") << 0xbf00ff00u << false << false; + QTest::newRow("alpha_7f_white") << 0x7fffffffu << false << false; + QTest::newRow("alpha_3f_white") << 0x3fffffffu << false << false; + QTest::newRow("alpha_b7_white") << 0xb7ffffffu << false << false; + QTest::newRow("alpha_7f_black") << 0x7f000000u << false << false; + QTest::newRow("alpha_3f_black") << 0x3f000000u << false << false; + QTest::newRow("alpha_b7_black") << 0xbf000000u << false << false; QTest::newRow("bitmap_color0") << uint(Qt::color0) << true << true; QTest::newRow("bitmap_color1") << uint(Qt::color1) << true << true; @@ -891,9 +885,6 @@ void tst_QPixmap::fromWinHBITMAP() HGDIOBJ old_brush = SelectObject(bitmap_dc, CreateSolidBrush(RGB(red, green, blue))); Rectangle(bitmap_dc, 0, 0, 100, 100); -#ifdef Q_OS_WINCE //the device context has to be deleted before QPixmap::fromWinHBITMAP() - DeleteDC(bitmap_dc); -#endif QPixmap pixmap = qt_pixmapFromWinHBITMAP(bitmap); QCOMPARE(pixmap.width(), 100); QCOMPARE(pixmap.height(), 100); @@ -906,9 +897,7 @@ void tst_QPixmap::fromWinHBITMAP() DeleteObject(SelectObject(bitmap_dc, old_brush)); DeleteObject(SelectObject(bitmap_dc, bitmap)); -#ifndef Q_OS_WINCE DeleteDC(bitmap_dc); -#endif ReleaseDC(0, display_dc); } @@ -1010,7 +999,6 @@ void tst_QPixmap::fromWinHICON_data() void tst_QPixmap::fromWinHICON() { -#ifndef Q_OS_WINCE QFETCH(int, width); QFETCH(int, height); QFETCH(QString, image); @@ -1028,7 +1016,6 @@ void tst_QPixmap::fromWinHICON() // between QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied, or elsewhere QVERIFY(compareImages(imageFromHICON, imageFromFile)); -#endif // Q_OS_WINCE } #endif // Q_OS_WIN && !Q_OS_WINRT diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro index 5000e1a926..317d8c1ff9 100644 --- a/tests/auto/gui/kernel/kernel.pro +++ b/tests/auto/gui/kernel/kernel.pro @@ -25,7 +25,7 @@ SUBDIRS=\ qopenglwindow \ qrasterwindow -win32:!wince:!winrt:qtHaveModule(network): SUBDIRS += noqteventloop +win32:!winrt:qtHaveModule(network): SUBDIRS += noqteventloop !qtHaveModule(widgets): SUBDIRS -= \ qmouseevent_modal \ diff --git a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro index a42b359f29..5e4875d1e7 100644 --- a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro +++ b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro @@ -5,4 +5,4 @@ QT += core-private network gui-private testlib SOURCES += tst_noqteventloop.cpp -contains(QT_CONFIG,dynamicgl):win32:!wince*:!winrt: LIBS += -luser32 +contains(QT_CONFIG,dynamicgl):win32:!winrt: LIBS += -luser32 diff --git a/tests/auto/gui/kernel/qclipboard/copier/main.cpp b/tests/auto/gui/kernel/qclipboard/copier/main.cpp index 22f2aa3bb8..32e91a9939 100644 --- a/tests/auto/gui/kernel/qclipboard/copier/main.cpp +++ b/tests/auto/gui/kernel/qclipboard/copier/main.cpp @@ -33,11 +33,9 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); QString paste = QStringLiteral("testString.!"); -#ifndef Q_OS_WINCE const QStringList arguments = app.arguments(); if (arguments.size() > 1) paste = arguments.at(1); -#endif #ifndef QT_NO_CLIPBOARD QGuiApplication::clipboard()->setText(paste); #endif diff --git a/tests/auto/gui/kernel/qclipboard/paster/main.cpp b/tests/auto/gui/kernel/qclipboard/paster/main.cpp index c96d903fb7..7fca8af1cb 100644 --- a/tests/auto/gui/kernel/qclipboard/paster/main.cpp +++ b/tests/auto/gui/kernel/qclipboard/paster/main.cpp @@ -66,13 +66,9 @@ int main(int argc, char **argv) return 0; } -#ifndef Q_OS_WINCE QString expected; if (parser.isSet(textOption)) expected = parser.value(textOption); -#else // !Q_OS_WINCE - const QString expected = QStringLiteral("testString.!"); -#endif // Q_OS_WINCE if (!expected.isEmpty()) { #ifndef QT_NO_CLIPBOARD const QString actual = QGuiApplication::clipboard()->text(); diff --git a/tests/auto/gui/kernel/qclipboard/test/test.pro b/tests/auto/gui/kernel/qclipboard/test/test.pro index 40bf9c8d8e..59b77b11ba 100644 --- a/tests/auto/gui/kernel/qclipboard/test/test.pro +++ b/tests/auto/gui/kernel/qclipboard/test/test.pro @@ -13,10 +13,6 @@ win32 { } } -wince* { - DEPLOYMENT += rsc reg_resource -} - !winrt: TEST_HELPER_INSTALLS = \ ../copier/copier \ ../paster/paster diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index 6bad45fefe..bfa15744c2 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -313,10 +313,6 @@ void tst_QClipboard::setMimeData() QMimeData *mimeData = new QMimeData; const QString TestName(QLatin1String("tst_QClipboard::setMimeData() mimeData")); mimeData->setObjectName(TestName); -#if defined(Q_OS_WINCE) - // need to set text on CE - mimeData->setText(QLatin1String("Qt/CE foo")); -#endif QGuiApplication::clipboard()->setMimeData(mimeData); QCOMPARE(QGuiApplication::clipboard()->mimeData(), (const QMimeData *)mimeData); diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index 0d0b6ae81e..6394a956bd 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -725,7 +725,7 @@ void tst_QKeySequence::listFromString() void tst_QKeySequence::translated_data() { -#if defined (Q_OS_MAC) || defined (Q_OS_WINCE) +#if defined (Q_OS_DARWIN) QSKIP("Test not applicable"); #endif @@ -756,7 +756,7 @@ void tst_QKeySequence::translated_data() void tst_QKeySequence::translated() { -#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE) +#if !defined (Q_OS_DARWIN) QFETCH(QString, transKey); QFETCH(QString, compKey); diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro index 08e1b1d3a0..f975e00ffa 100644 --- a/tests/auto/gui/kernel/qwindow/qwindow.pro +++ b/tests/auto/gui/kernel/qwindow/qwindow.pro @@ -5,4 +5,4 @@ QT += core-private gui-private testlib SOURCES += tst_qwindow.cpp -contains(QT_CONFIG,dynamicgl):win32:!wince:!winrt: LIBS += -luser32 +contains(QT_CONFIG,dynamicgl):win32:!winrt: LIBS += -luser32 diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 892dc0899f..1756dab70a 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -40,7 +40,7 @@ #if defined(Q_OS_QNX) #include -#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT) # include #endif @@ -2079,7 +2079,7 @@ void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109() static bool isNativeWindowVisible(const QWindow *window) { -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) return IsWindowVisible(reinterpret_cast(window->winId())); #else Q_UNIMPLEMENTED(); diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 8a97a9261f..d2cc7ce072 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -39,9 +39,7 @@ #include #include #include -#if !defined(Q_OS_WINCE) #include -#endif #include #ifndef QT_NO_WIDGETS #include diff --git a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp index e05d7dd022..a79526c434 100644 --- a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp +++ b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp @@ -114,7 +114,7 @@ void tst_QWMatrix::mapping_data() << QRect( 0, 0, 30, 40 ) << QPolygon( QRect( -300, -400, 300, 400 ) ); -#if (defined(Q_OS_WIN) || defined(Q_OS_WINCE)) && !defined(M_PI) +#if defined(Q_OS_WIN) && !defined(M_PI) #define M_PI 3.14159265897932384626433832795f #endif diff --git a/tests/auto/gui/text/qcssparser/qcssparser.pro b/tests/auto/gui/text/qcssparser/qcssparser.pro index 88d1fcfd2d..b92859d4fb 100644 --- a/tests/auto/gui/text/qcssparser/qcssparser.pro +++ b/tests/auto/gui/text/qcssparser/qcssparser.pro @@ -6,14 +6,6 @@ QT += xml gui-private testlib requires(contains(QT_CONFIG,private_tests)) DEFINES += SRCDIR=\\\"$$PWD\\\" -wince* { - addFiles.files = testdata - addFiles.path = . - timesFont.files = C:/Windows/Fonts/times.ttf - timesFont.path = . - DEPLOYMENT += addFiles timesFont -} - android { RESOURCES += \ testdata.qrc diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index 847d6e2e2f..51e9bf646a 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -27,9 +27,6 @@ ****************************************************************************/ #include #include -#if defined(Q_OS_WINCE) -#include -#endif #include #include @@ -39,10 +36,6 @@ class tst_QCssParser : public QObject { Q_OBJECT -public slots: - void initTestCase(); - void cleanupTestCase(); - private slots: void scanner_data(); void scanner(); @@ -85,33 +78,8 @@ private slots: void extractBorder(); void noTextDecoration(); void quotedAndUnquotedIdentifiers(); - -private: -#if defined(Q_OS_WINCE) - int m_timesFontId; -#endif }; -void tst_QCssParser::initTestCase() -{ -#if defined(Q_OS_WINCE) - QFontDatabase fontDB; - m_timesFontId = -1; - if (!fontDB.families().contains("Times New Roman")) { - m_timesFontId = QFontDatabase::addApplicationFont("times.ttf"); - QVERIFY(m_timesFontId != -1); - } -#endif -} - -void tst_QCssParser::cleanupTestCase() -{ -#if defined(Q_OS_WINCE) - if (m_timesFontId != -1) - QFontDatabase::removeApplicationFont(m_timesFontId); -#endif -} - void tst_QCssParser::scanner_data() { QTest::addColumn("input"); @@ -119,7 +87,7 @@ void tst_QCssParser::scanner_data() #if defined(Q_OS_ANDROID) QDir d(":/"); -#elif !defined(Q_OS_IRIX) && !defined(Q_OS_WINCE) +#elif !defined(Q_OS_IRIX) QDir d(SRCDIR); #else QDir d(QDir::current()); diff --git a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro index 5dba2fc06a..0aff8a3ac8 100644 --- a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro @@ -3,12 +3,6 @@ TARGET = tst_qfontdatabase SOURCES += tst_qfontdatabase.cpp QT += testlib core-private gui-private -wince* { - additionalFiles.files = FreeMono.ttf - additionalFiles.path = . - DEPLOYMENT += additionalFiles -} - android { RESOURCES += testdata.qrc } diff --git a/tests/auto/gui/text/qglyphrun/qglyphrun.pro b/tests/auto/gui/text/qglyphrun/qglyphrun.pro index 3abca8ce89..c08019a561 100644 --- a/tests/auto/gui/text/qglyphrun/qglyphrun.pro +++ b/tests/auto/gui/text/qglyphrun/qglyphrun.pro @@ -6,12 +6,5 @@ SOURCES += \ tst_qglyphrun.cpp -wince* { - additionalFiles.files = test.ttf - additionalFiles.path = ../../../shared/resources/ - DEPLOYMENT += additionalFiles -} else { - RESOURCES += \ - testdata.qrc -} - +RESOURCES += \ + testdata.qrc diff --git a/tests/auto/gui/text/qzip/qzip.pro b/tests/auto/gui/text/qzip/qzip.pro index ebcd6ec022..eb3de04da6 100644 --- a/tests/auto/gui/text/qzip/qzip.pro +++ b/tests/auto/gui/text/qzip/qzip.pro @@ -3,12 +3,6 @@ TARGET = tst_qzip QT += gui-private testlib SOURCES += tst_qzip.cpp -wince* { - addFiles.files = testdata - addFiles.path = . - DEPLOYMENT += addFiles -} - android { RESOURCES += \ testdata.qrc diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp index 58164f1fa1..f57ed12ed3 100644 --- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp +++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp @@ -46,7 +46,7 @@ void tst_qdesktopservices::openUrl() { // At the bare minimum check that they return false for invalid url's QCOMPARE(QDesktopServices::openUrl(QUrl()), false); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_OS_WIN) // this test is only valid on windows on other systems it might mean open a new document in the application handling .file const QRegularExpression messagePattern("ShellExecute 'file://invalid\\.file' failed \\(error \\d+\\)\\."); QVERIFY(messagePattern.isValid());