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 <lars.knoll@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2016-03-08 13:25:23 +01:00
parent c8c3893f37
commit bf537516a9
28 changed files with 41 additions and 344 deletions

View File

@ -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

View File

@ -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();

View File

@ -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)

View File

@ -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 <QtCore/qt_windows.h>
# include <QtCore/QLibraryInfo>
# if defined(Q_OS_WINPHONE)
# include <Objbase.h>
# endif
#endif // Q_OS_WIN && !Q_OS_WINCE
#endif // Q_OS_WIN
#include <ctype.h>
@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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);
}
{

View File

@ -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/*

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -13,10 +13,6 @@ win32 {
}
}
wince* {
DEPLOYMENT += rsc reg_resource
}
!winrt: TEST_HELPER_INSTALLS = \
../copier/copier \
../paster/paster

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -40,7 +40,7 @@
#if defined(Q_OS_QNX)
#include <QOpenGLContext>
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
# include <QtCore/qt_windows.h>
#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<HWND>(window->winId()));
#else
Q_UNIMPLEMENTED();

View File

@ -39,9 +39,7 @@
#include <qimage.h>
#include <qthread.h>
#include <limits.h>
#if !defined(Q_OS_WINCE)
#include <math.h>
#endif
#include <qpaintengine.h>
#ifndef QT_NO_WIDGETS
#include <qdesktopwidget.h>

View File

@ -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

View File

@ -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

View File

@ -27,9 +27,6 @@
****************************************************************************/
#include <QtTest/QtTest>
#include <QtXml/QtXml>
#if defined(Q_OS_WINCE)
#include <QtGui/QFontDatabase>
#endif
#include <QtGui/QFontInfo>
#include <QtGui/QFontMetrics>
@ -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<QString>("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());

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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());