Merge 5.12 into 5.12.3

Change-Id: I76905e3540585c3be221b89453c725828b05940b
bb10
Kari Oikarinen 2019-04-01 09:16:33 +03:00
commit 18e4cf2900
25 changed files with 411 additions and 186 deletions

View File

@ -17,8 +17,8 @@ os_directory = $$(INTEGRITY_DIR)
isEmpty(os_directory): \
error("This qmakespec requires $INTEGRITY_DIR to be set")
QMAKE_CC = cxintarm64 -U__ARM_NEON__ -U__ARM_NEON -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_CXX = cxintarm64 -U__ARM_NEON__ -U__ARM_NEON -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_LINK = $$QMAKE_CXX
QMAKE_AR = $$QMAKE_CXX -archive -o

View File

@ -22,4 +22,8 @@ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_LINK = $${CROSS_COMPILE}g++
QMAKE_LINK_C = $${CROSS_COMPILE}gcc
QMAKE_CFLAGS_LTCG = -flto
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
load(qt_config)

View File

@ -95,7 +95,9 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
if (project->isActiveConfig("debug_info")) {
if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
QString pdb_target = project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb";
const QFileInfo targetFileInfo = project->first("DESTDIR") + project->first("TARGET")
+ project->first("TARGET_EXT");
const QString pdb_target = targetFileInfo.completeBaseName() + ".pdb";
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute));
if(!ret.isEmpty())
@ -252,15 +254,16 @@ void NmakeMakefileGenerator::init()
project->values("PRECOMPILED_PCH_C") = ProStringList(precompPchC);
}
ProString tgt = project->first("DESTDIR")
+ project->first("TARGET") + project->first("TARGET_VERSION_EXT");
if(project->isActiveConfig("shared")) {
project->values("QMAKE_CLEAN").append(tgt + ".exp");
project->values("QMAKE_DISTCLEAN").append(tgt + ".lib");
const QFileInfo targetFileInfo = project->first("DESTDIR") + project->first("TARGET")
+ project->first("TARGET_EXT");
const ProString targetBase = targetFileInfo.path() + '/' + targetFileInfo.completeBaseName();
if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("shared")) {
project->values("QMAKE_CLEAN").append(targetBase + ".exp");
project->values("QMAKE_DISTCLEAN").append(targetBase + ".lib");
}
if (project->isActiveConfig("debug_info")) {
QString pdbfile;
QString distPdbFile = tgt + ".pdb";
QString distPdbFile = targetBase + ".pdb";
if (project->isActiveConfig("staticlib")) {
// For static libraries, the compiler's pdb file and the dist pdb file are the same.
pdbfile = distPdbFile;
@ -276,8 +279,8 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_DISTCLEAN").append(distPdbFile);
}
if (project->isActiveConfig("debug")) {
project->values("QMAKE_CLEAN").append(tgt + ".ilk");
project->values("QMAKE_CLEAN").append(tgt + ".idb");
project->values("QMAKE_CLEAN").append(targetBase + ".ilk");
project->values("QMAKE_CLEAN").append(targetBase + ".idb");
} else {
ProStringList &defines = project->values("DEFINES");
if (!defines.contains("NDEBUG"))

View File

@ -260,31 +260,25 @@ static int installFile(const QString &source, const QString &target, bool exe =
return 3;
}
QFileDevice::Permissions targetPermissions = QFileDevice::ReadOwner | QFileDevice::WriteOwner
| QFileDevice::ReadUser | QFileDevice::WriteUser
| QFileDevice::ReadGroup | QFileDevice::ReadOther;
if (exe) {
if (!targetFile.setPermissions(sourceFile.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeUser |
QFileDevice::ExeGroup | QFileDevice::ExeOther)) {
fprintf(stderr, "Error setting execute permissions on %s: %s\n",
qPrintable(target), qPrintable(targetFile.errorString()));
return 3;
}
targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser |
QFileDevice::ExeGroup | QFileDevice::ExeOther;
}
if (!targetFile.setPermissions(targetPermissions)) {
fprintf(stderr, "Error setting permissions on %s: %s\n",
qPrintable(target), qPrintable(targetFile.errorString()));
return 3;
}
// Copy file times
QString error;
#ifdef Q_OS_WIN
const QFile::Permissions permissions = targetFile.permissions();
const bool readOnly = !(permissions & QFile::WriteUser);
if (readOnly)
targetFile.setPermissions(permissions | QFile::WriteUser);
#endif
if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) {
fprintf(stderr, "%s", qPrintable(error));
return 3;
}
#ifdef Q_OS_WIN
if (readOnly)
targetFile.setPermissions(permissions);
#endif
return 0;
}

View File

@ -61,7 +61,7 @@ public:
/*!
\class QSignalMapper
\inmodule QtCore
\obsolete
\obsolete The recommended solution is connecting the signal to a lambda.
\brief The QSignalMapper class bundles signals from identifiable senders.
\ingroup objectmodel

View File

@ -52,65 +52,41 @@ Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, cons
const quint32 *const end = dst + len;
// align dst on 64 bits
const int offsetToAlignOn8Bytes = (reinterpret_cast<quintptr>(dst) >> 2) & 0x1;
for (int i = 0; i < offsetToAlignOn8Bytes; ++i) {
// align dst on 128 bits
const int offsetToAlignOn16Bytes = (reinterpret_cast<quintptr>(dst) >> 2) & 0x3;
for (int i = 0; i < offsetToAlignOn16Bytes; ++i) {
*dst++ = qRgb(src[0], src[1], src[2]);
src += 3;
}
if ((len - offsetToAlignOn8Bytes) >= 8) {
const quint32 *const simdEnd = end - 7;
#if !defined(Q_PROCESSOR_ARM_64)
register uint8x8_t fullVector asm ("d3") = vdup_n_u8(0xff);
do {
if ((len - offsetToAlignOn16Bytes) >= 16) {
const quint32 *const simdEnd = end - 15;
uint8x16x4_t dstVector;
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
asm volatile (
"vld3.8 { d4, d5, d6 }, [%[SRC]] !\n\t"
"vst4.8 { d3, d4, d5, d6 }, [%[DST],:64] !\n\t"
: [DST]"+r" (dst), [SRC]"+r" (src)
: "w"(fullVector)
: "memory", "d4", "d5", "d6"
);
dstVector.val[0] = vdupq_n_u8(0xff);
#else
asm volatile (
"vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t"
"vswp d0, d2\n\t"
"vst4.8 { d0, d1, d2, d3 }, [%[DST],:64] !\n\t"
: [DST]"+r" (dst), [SRC]"+r" (src)
: "w"(fullVector)
: "memory", "d0", "d1", "d2"
);
dstVector.val[3] = vdupq_n_u8(0xff);
#endif
} while (dst < simdEnd);
#else
register uint8x8_t fullVector asm ("v3") = vdup_n_u8(0xff);
do {
uint8x16x3_t srcVector = vld3q_u8(src);
src += 3 * 16;
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
asm volatile (
"ld3 { v4.8b, v5.8b, v6.8b }, [%[SRC]], #24 \n\t"
"st4 { v3.8b, v4.8b, v5.8b, v6.8b }, [%[DST]], #32 \n\t"
: [DST]"+r" (dst), [SRC]"+r" (src)
: "w"(fullVector)
: "memory", "v4", "v5", "v6"
);
dstVector.val[1] = srcVector.val[0];
dstVector.val[2] = srcVector.val[1];
dstVector.val[3] = srcVector.val[2];
#else
asm volatile (
"ld3 { v0.8b, v1.8b, v2.8b }, [%[SRC]], #24 \n\t"
"mov v4.8b, v2.8b\n\t"
"mov v2.8b, v0.8b\n\t"
"mov v0.8b, v4.8b\n\t"
"st4 { v0.8b, v1.8b, v2.8b, v3.8b }, [%[DST]], #32 \n\t"
: [DST]"+r" (dst), [SRC]"+r" (src)
: "w"(fullVector)
: "memory", "v0", "v1", "v2", "v4"
);
dstVector.val[0] = srcVector.val[2];
dstVector.val[1] = srcVector.val[1];
dstVector.val[2] = srcVector.val[0];
#endif
vst4q_u8(reinterpret_cast<uint8_t*>(dst), dstVector);
dst += 16;
} while (dst < simdEnd);
#endif
}
while (dst != end) {
int i = 0;
int length = end - dst;
SIMD_EPILOGUE(i, length, 15) {
*dst++ = qRgb(src[0], src[1], src[2]);
src += 3;
}

View File

@ -131,9 +131,11 @@ ARCH_HASWELL_SOURCES += painting/qdrawhelper_avx2.cpp
NEON_SOURCES += painting/qdrawhelper_neon.cpp painting/qimagescale_neon.cpp
NEON_HEADERS += painting/qdrawhelper_neon_p.h
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
!uikit:!win32:contains(QT_ARCH, "arm"): CONFIG += no_clang_integrated_as
!uikit:!win32:!contains(QT_ARCH, "arm64"): DEFINES += ENABLE_PIXMAN_DRAWHELPERS
!uikit:!win32:!integrity:!contains(QT_ARCH, "arm64") {
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
DEFINES += ENABLE_PIXMAN_DRAWHELPERS
}
MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h

View File

@ -50,7 +50,18 @@ QT_BEGIN_NAMESPACE
void qt_memfill32(quint32 *dest, quint32 value, int count)
{
const int epilogueSize = count % 16;
#if !defined(Q_PROCESSOR_ARM_64)
#if defined(Q_CC_GHS) || defined(Q_CC_MSVC)
// inline assembler free version:
if (count >= 16) {
quint32 *const neonEnd = dest + count - epilogueSize;
const uint32x4_t valueVector1 = vdupq_n_u32(value);
const uint32x4x4_t valueVector4 = { valueVector1, valueVector1, valueVector1, valueVector1 };
do {
vst4q_u32(dest, valueVector4);
dest += 16;
} while (dest != neonEnd);
}
#elif !defined(Q_PROCESSOR_ARM_64)
if (count >= 16) {
quint32 *const neonEnd = dest + count - epilogueSize;
register uint32x4_t valueVector1 asm ("q0") = vdupq_n_u32(value);
@ -84,20 +95,20 @@ void qt_memfill32(quint32 *dest, quint32 value, int count)
switch (epilogueSize)
{
case 15: *dest++ = value;
case 14: *dest++ = value;
case 13: *dest++ = value;
case 12: *dest++ = value;
case 11: *dest++ = value;
case 10: *dest++ = value;
case 9: *dest++ = value;
case 8: *dest++ = value;
case 7: *dest++ = value;
case 6: *dest++ = value;
case 5: *dest++ = value;
case 4: *dest++ = value;
case 3: *dest++ = value;
case 2: *dest++ = value;
case 15: *dest++ = value; Q_FALLTHROUGH();
case 14: *dest++ = value; Q_FALLTHROUGH();
case 13: *dest++ = value; Q_FALLTHROUGH();
case 12: *dest++ = value; Q_FALLTHROUGH();
case 11: *dest++ = value; Q_FALLTHROUGH();
case 10: *dest++ = value; Q_FALLTHROUGH();
case 9: *dest++ = value; Q_FALLTHROUGH();
case 8: *dest++ = value; Q_FALLTHROUGH();
case 7: *dest++ = value; Q_FALLTHROUGH();
case 6: *dest++ = value; Q_FALLTHROUGH();
case 5: *dest++ = value; Q_FALLTHROUGH();
case 4: *dest++ = value; Q_FALLTHROUGH();
case 3: *dest++ = value; Q_FALLTHROUGH();
case 2: *dest++ = value; Q_FALLTHROUGH();
case 1: *dest++ = value;
}
}

View File

@ -446,6 +446,11 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
d_ptr->blitter->setRedBlueSwizzle(false);
}
// There is no way to tell if the OpenGL-rendered content is premultiplied or not.
// For compatibility, assume that it is not, and use normal alpha blend always.
if (d_ptr->premultiplied)
funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
// Textures for renderToTexture widgets that have WA_AlwaysStackOnTop set.
for (int i = 0; i < textures->count(); ++i) {
if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop))

View File

@ -1754,7 +1754,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si,
#ifdef Q_OS_DARWIN
if (actualFontEngine->type() == QFontEngine::Mac) {
if (actualFontEngine->fontDef.stretch != 100) {
if (actualFontEngine->fontDef.stretch != 100 && actualFontEngine->fontDef.stretch != QFont::AnyStretch) {
QFixed stretch = QFixed(int(actualFontEngine->fontDef.stretch)) / QFixed(100);
for (uint i = 0; i < num_glyphs; ++i)
g.advances[i] *= stretch;

View File

@ -198,7 +198,7 @@ QHttp2ProtocolHandler::QHttp2ProtocolHandler(QHttpNetworkConnectionChannel *chan
}
}
if (!channel->ssl) {
if (!channel->ssl && m_connection->connectionType() != QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
// We upgraded from HTTP/1.1 to HTTP/2. channel->request was already sent
// as HTTP/1.1 request. The response with status code 101 triggered
// protocol switch and now we are waiting for the real response, sent

View File

@ -491,9 +491,11 @@ void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextIt
struct ConvertPathInfo
{
ConvertPathInfo(QPainterPath *newPath, const QPointF &newPos) : path(newPath), pos(newPos) {}
ConvertPathInfo(QPainterPath *newPath, const QPointF &newPos, qreal newStretch = 1.0) :
path(newPath), pos(newPos), stretch(newStretch) {}
QPainterPath *path;
QPointF pos;
qreal stretch;
};
static void convertCGPathToQPainterPath(void *info, const CGPathElement *element)
@ -501,25 +503,25 @@ static void convertCGPathToQPainterPath(void *info, const CGPathElement *element
ConvertPathInfo *myInfo = static_cast<ConvertPathInfo *>(info);
switch(element->type) {
case kCGPathElementMoveToPoint:
myInfo->path->moveTo(element->points[0].x + myInfo->pos.x(),
myInfo->path->moveTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y());
break;
case kCGPathElementAddLineToPoint:
myInfo->path->lineTo(element->points[0].x + myInfo->pos.x(),
myInfo->path->lineTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y());
break;
case kCGPathElementAddQuadCurveToPoint:
myInfo->path->quadTo(element->points[0].x + myInfo->pos.x(),
myInfo->path->quadTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y(),
element->points[1].x + myInfo->pos.x(),
(element->points[1].x * myInfo->stretch) + myInfo->pos.x(),
element->points[1].y + myInfo->pos.y());
break;
case kCGPathElementAddCurveToPoint:
myInfo->path->cubicTo(element->points[0].x + myInfo->pos.x(),
myInfo->path->cubicTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y(),
element->points[1].x + myInfo->pos.x(),
(element->points[1].x * myInfo->stretch) + myInfo->pos.x(),
element->points[1].y + myInfo->pos.y(),
element->points[2].x + myInfo->pos.x(),
(element->points[2].x * myInfo->stretch) + myInfo->pos.x(),
element->points[2].y + myInfo->pos.y());
break;
case kCGPathElementCloseSubpath:
@ -543,9 +545,10 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
if (synthesisFlags & QFontEngine::SynthesizedItalic)
cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0));
qreal stretch = fontDef.stretch ? qreal(fontDef.stretch) / 100 : 1.0;
for (int i = 0; i < nGlyphs; ++i) {
QCFType<CGPathRef> cgpath = CTFontCreatePathForGlyph(ctfont, glyphs[i], &cgMatrix);
ConvertPathInfo info(path, positions[i].toPointF());
ConvertPathInfo info(path, positions[i].toPointF(), stretch);
CGPathApply(cgpath, &info, convertCGPathToQPainterPath);
}
}

View File

@ -702,8 +702,8 @@ static inline double qt_fixed_to_double(const FIXED &p) {
return ((p.value << 16) + p.fract) / 65536.0;
}
static inline QPointF qt_to_qpointf(const POINTFX &pt, qreal scale) {
return QPointF(qt_fixed_to_double(pt.x) * scale, -qt_fixed_to_double(pt.y) * scale);
static inline QPointF qt_to_qpointf(const POINTFX &pt, qreal scale, qreal stretch) {
return QPointF(qt_fixed_to_double(pt.x) * scale * stretch, -qt_fixed_to_double(pt.y) * scale);
}
#ifndef GGO_UNHINTED
@ -711,7 +711,8 @@ static inline QPointF qt_to_qpointf(const POINTFX &pt, qreal scale) {
#endif
static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
QPainterPath *path, bool ttf, glyph_metrics_t *metric = 0, qreal scale = 1)
QPainterPath *path, bool ttf, glyph_metrics_t *metric = 0,
qreal scale = 1.0, qreal stretch = 1.0)
{
MAT2 mat;
mat.eM11.value = mat.eM22.value = 1;
@ -761,7 +762,7 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
while (headerOffset < bufferSize) {
const TTPOLYGONHEADER *ttph = reinterpret_cast<const TTPOLYGONHEADER *>(dataBuffer + headerOffset);
QPointF lastPoint(qt_to_qpointf(ttph->pfxStart, scale));
QPointF lastPoint(qt_to_qpointf(ttph->pfxStart, scale, stretch));
path->moveTo(lastPoint + oset);
offset += sizeof(TTPOLYGONHEADER);
while (offset < headerOffset + ttph->cb) {
@ -769,7 +770,7 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
switch (curve->wType) {
case TT_PRIM_LINE: {
for (int i=0; i<curve->cpfx; ++i) {
QPointF p = qt_to_qpointf(curve->apfx[i], scale) + oset;
QPointF p = qt_to_qpointf(curve->apfx[i], scale, stretch) + oset;
path->lineTo(p);
}
break;
@ -779,8 +780,8 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
QPointF prev(elm.x, elm.y);
QPointF endPoint;
for (int i=0; i<curve->cpfx - 1; ++i) {
QPointF p1 = qt_to_qpointf(curve->apfx[i], scale) + oset;
QPointF p2 = qt_to_qpointf(curve->apfx[i+1], scale) + oset;
QPointF p1 = qt_to_qpointf(curve->apfx[i], scale, stretch) + oset;
QPointF p2 = qt_to_qpointf(curve->apfx[i+1], scale, stretch) + oset;
if (i < curve->cpfx - 2) {
endPoint = QPointF((p1.x() + p2.x()) / 2, (p1.y() + p2.y()) / 2);
} else {
@ -795,9 +796,9 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
}
case TT_PRIM_CSPLINE: {
for (int i=0; i<curve->cpfx; ) {
QPointF p2 = qt_to_qpointf(curve->apfx[i++], scale) + oset;
QPointF p3 = qt_to_qpointf(curve->apfx[i++], scale) + oset;
QPointF p4 = qt_to_qpointf(curve->apfx[i++], scale) + oset;
QPointF p2 = qt_to_qpointf(curve->apfx[i++], scale, stretch) + oset;
QPointF p3 = qt_to_qpointf(curve->apfx[i++], scale, stretch) + oset;
QPointF p4 = qt_to_qpointf(curve->apfx[i++], scale, stretch) + oset;
path->cubicTo(p2, p3, p4);
}
break;
@ -829,9 +830,11 @@ void QWindowsFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions
HDC hdc = m_fontEngineData->hdc;
HGDIOBJ oldfont = SelectObject(hdc, hf);
qreal scale = qreal(fontDef.pixelSize) / unitsPerEm;
qreal stretch = fontDef.stretch ? qreal(fontDef.stretch) / 100 : 1.0;
for(int i = 0; i < nglyphs; ++i) {
if (!addGlyphToPath(glyphs[i], positions[i], hdc, path, ttf, /*metric*/0,
qreal(fontDef.pixelSize) / unitsPerEm)) {
scale, stretch)) {
// Some windows fonts, like "Modern", are vector stroke
// fonts, which are reported as TMPF_VECTOR but do not
// support GetGlyphOutline, and thus we set this bit so

View File

@ -85,7 +85,7 @@ QTsLibMouseHandler::QTsLibMouseHandler(const QString &key,
if (fd >= 0) {
qCDebug(qLcTsLib) << "tslib device is" << device;
m_notify = new QSocketNotifier(fd, QSocketNotifier::Read, this);
connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData()));
connect(m_notify, &QSocketNotifier::activated, this, &QTsLibMouseHandler::readMouseData);
} else {
qErrnoWarning(errno, "tslib: Cannot open input device %s", device.constData());
}
@ -129,7 +129,9 @@ void QTsLibMouseHandler::readMouseData()
}
QPoint pos(x, y);
QWindowSystemInterface::handleMouseEvent(0, pos, pos, pressed ? Qt::LeftButton : Qt::NoButton);
QWindowSystemInterface::handleMouseEvent(nullptr, pos, pos,
pressed ? Qt::LeftButton : Qt::NoButton,
Qt::NoButton, QEvent::None);
m_x = x;
m_y = y;

View File

@ -158,10 +158,13 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
pal.setColor(QPalette::Inactive, QPalette::WindowText, qc);
pal.setColor(QPalette::Active, QPalette::HighlightedText, qc);
pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
pal.setColor(QPalette::Active, QPalette::ButtonText, qc);
pal.setColor(QPalette::Inactive, QPalette::ButtonText, qc);
qc = qt_mac_toQColor(mac_widget_colors[i].inactive);
pal.setColor(QPalette::Disabled, QPalette::Text, qc);
pal.setColor(QPalette::Disabled, QPalette::WindowText, qc);
pal.setColor(QPalette::Disabled, QPalette::HighlightedText, qc);
pal.setColor(QPalette::Disabled, QPalette::ButtonText, qc);
}
if (mac_widget_colors[i].paletteRole == QPlatformTheme::MenuPalette
|| mac_widget_colors[i].paletteRole == QPlatformTheme::MenuBarPalette) {

View File

@ -2,7 +2,7 @@
defineTest(qtConfLibrary_psqlConfig) {
pg_config = $$config.input.psql_config
isEmpty(pg_config): \
isEmpty(pg_config):!cross_compile: \
pg_config = $$qtConfFindInPath("pg_config")
!win32:!isEmpty(pg_config) {
qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
@ -33,7 +33,7 @@ defineTest(qtConfLibrary_psqlEnv) {
defineTest(qtConfLibrary_mysqlConfig) {
mysql_config = $$config.input.mysql_config
isEmpty(mysql_config): \
isEmpty(mysql_config):!cross_compile: \
mysql_config = $$qtConfFindInPath("mysql_config")
!isEmpty(mysql_config) {
qtRunLoggedCommand("$$mysql_config --version", version)|return(false)

View File

@ -356,15 +356,44 @@ static const qreal titleBarButtonSpacing = 8;
// active: window is active
// selected: tab is selected
// hovered: tab is hovered
static const QColor tabBarTabBackgroundActive(190, 190, 190);
static const QColor tabBarTabBackgroundActiveHovered(178, 178, 178);
static const QColor tabBarTabBackgroundActiveSelected(211, 211, 211);
static const QColor tabBarTabBackground(227, 227, 227);
static const QColor tabBarTabBackgroundSelected(246, 246, 246);
static const QColor tabBarTabLineActive(160, 160, 160);
static const QColor tabBarTabLineActiveHovered(150, 150, 150);
static const QColor tabBarTabLine(210, 210, 210);
static const QColor tabBarTabLineSelected(189, 189, 189);
bool isDarkMode() { return qt_mac_applicationIsInDarkMode(); }
static const QColor lightTabBarTabBackgroundActive(190, 190, 190);
static const QColor darkTabBarTabBackgroundActive(38, 38, 38);
static const QColor tabBarTabBackgroundActive() { return isDarkMode() ? darkTabBarTabBackgroundActive : lightTabBarTabBackgroundActive; }
static const QColor lightTabBarTabBackgroundActiveHovered(178, 178, 178);
static const QColor darkTabBarTabBackgroundActiveHovered(32, 32, 32);
static const QColor tabBarTabBackgroundActiveHovered() { return isDarkMode() ? darkTabBarTabBackgroundActiveHovered : lightTabBarTabBackgroundActiveHovered; }
static const QColor lightTabBarTabBackgroundActiveSelected(211, 211, 211);
static const QColor darkTabBarTabBackgroundActiveSelected(52, 52, 52);
static const QColor tabBarTabBackgroundActiveSelected() { return isDarkMode() ? darkTabBarTabBackgroundActiveSelected : lightTabBarTabBackgroundActiveSelected; }
static const QColor lightTabBarTabBackground(227, 227, 227);
static const QColor darkTabBarTabBackground(38, 38, 38);
static const QColor tabBarTabBackground() { return isDarkMode() ? darkTabBarTabBackground : lightTabBarTabBackground; }
static const QColor lightTabBarTabBackgroundSelected(246, 246, 246);
static const QColor darkTabBarTabBackgroundSelected(52, 52, 52);
static const QColor tabBarTabBackgroundSelected() { return isDarkMode() ? darkTabBarTabBackgroundSelected : lightTabBarTabBackgroundSelected; }
static const QColor lightTabBarTabLineActive(160, 160, 160);
static const QColor darkTabBarTabLineActive(90, 90, 90);
static const QColor tabBarTabLineActive() { return isDarkMode() ? darkTabBarTabLineActive : lightTabBarTabLineActive; }
static const QColor lightTabBarTabLineActiveHovered(150, 150, 150);
static const QColor darkTabBarTabLineActiveHovered(90, 90, 90);
static const QColor tabBarTabLineActiveHovered() { return isDarkMode() ? darkTabBarTabLineActiveHovered : lightTabBarTabLineActiveHovered; }
static const QColor lightTabBarTabLine(210, 210, 210);
static const QColor darkTabBarTabLine(90, 90, 90);
static const QColor tabBarTabLine() { return isDarkMode() ? darkTabBarTabLine : lightTabBarTabLine; }
static const QColor lightTabBarTabLineSelected(189, 189, 189);
static const QColor darkTabBarTabLineSelected(90, 90, 90);
static const QColor tabBarTabLineSelected() { return isDarkMode() ? darkTabBarTabLineSelected : lightTabBarTabLineSelected; }
static const QColor tabBarCloseButtonBackgroundHovered(162, 162, 162);
static const QColor tabBarCloseButtonBackgroundPressed(153, 153, 153);
static const QColor tabBarCloseButtonBackgroundSelectedHovered(192, 192, 192);
@ -561,7 +590,7 @@ void drawTabShape(QPainter *p, const QStyleOptionTab *tabOpt, bool isUnified, in
const bool active = (tabOpt->state & QStyle::State_Active);
const bool selected = (tabOpt->state & QStyle::State_Selected);
const QRect bodyRect(1, 1, width - 2, height - 2);
const QRect bodyRect(1, 2, width - 2, height - 3);
const QRect topLineRect(1, 0, width - 2, 1);
const QRect bottomLineRect(1, height - 1, width - 2, 1);
if (selected) {
@ -572,27 +601,27 @@ void drawTabShape(QPainter *p, const QStyleOptionTab *tabOpt, bool isUnified, in
p->fillRect(tabRect, QColor(Qt::transparent));
p->restore();
} else if (active) {
p->fillRect(bodyRect, tabBarTabBackgroundActiveSelected);
p->fillRect(bodyRect, tabBarTabBackgroundActiveSelected());
// top line
p->fillRect(topLineRect, tabBarTabLineSelected);
p->fillRect(topLineRect, tabBarTabLineSelected());
} else {
p->fillRect(bodyRect, tabBarTabBackgroundSelected);
p->fillRect(bodyRect, tabBarTabBackgroundSelected());
}
} else {
// when the mouse is over non selected tabs they get a new color
const bool hover = (tabOpt->state & QStyle::State_MouseOver);
if (hover) {
// fill body
p->fillRect(bodyRect, tabBarTabBackgroundActiveHovered);
p->fillRect(bodyRect, tabBarTabBackgroundActiveHovered());
// bottom line
p->fillRect(bottomLineRect, tabBarTabLineActiveHovered);
p->fillRect(bottomLineRect, isDarkMode() ? QColor(Qt::black) : tabBarTabLineActiveHovered());
}
}
// separator lines between tabs
const QRect leftLineRect(0, 1, 1, height - 2);
const QRect rightLineRect(width - 1, 1, 1, height - 2);
const QColor separatorLineColor = active ? tabBarTabLineActive : tabBarTabLine;
const QColor separatorLineColor = active ? tabBarTabLineActive() : tabBarTabLine();
p->fillRect(leftLineRect, separatorLineColor);
p->fillRect(rightLineRect, separatorLineColor);
}
@ -612,17 +641,20 @@ void drawTabBase(QPainter *p, const QStyleOptionTabBarBase *tbb, const QWidget *
// fill body
const QRect bodyRect(0, 1, width, height - 1);
const QColor bodyColor = active ? tabBarTabBackgroundActive : tabBarTabBackground;
const QColor bodyColor = active ? tabBarTabBackgroundActive() : tabBarTabBackground();
p->fillRect(bodyRect, bodyColor);
// top line
const QRect topLineRect(0, 0, width, 1);
const QColor topLineColor = active ? tabBarTabLineActive : tabBarTabLine;
const QColor topLineColor = active ? tabBarTabLineActive() : tabBarTabLine();
p->fillRect(topLineRect, topLineColor);
// bottom line
const QRect bottomLineRect(0, height - 1, width, 1);
const QColor bottomLineColor = active ? tabBarTabLineActive : tabBarTabLine;
bool isDocument = false;
if (const QTabBar *tabBar = qobject_cast<const QTabBar*>(w))
isDocument = tabBar->documentMode();
const QColor bottomLineColor = isDocument && isDarkMode() ? QColor(Qt::black) : active ? tabBarTabLineActive() : tabBarTabLine();
p->fillRect(bottomLineRect, bottomLineColor);
}
#endif
@ -1124,6 +1156,66 @@ static QStyleHelper::WidgetSizePolicy qt_aqua_guess_size(const QWidget *widg, QS
}
#endif
static NSColor *qt_convertColorForContext(CGContextRef context, NSColor *color)
{
Q_ASSERT(color);
Q_ASSERT(context);
CGColorSpaceRef targetCGColorSpace = CGBitmapContextGetColorSpace(context);
NSColorSpace *targetNSColorSpace = [[NSColorSpace alloc] initWithCGColorSpace:targetCGColorSpace];
NSColor *adjusted = [color colorUsingColorSpace:targetNSColorSpace];
[targetNSColorSpace release];
return adjusted;
}
static NSColor *qt_colorForContext(CGContextRef context, const CGFloat (&rgba)[4])
{
Q_ASSERT(context);
auto colorSpace = CGBitmapContextGetColorSpace(context);
if (!colorSpace)
return nil;
return qt_convertColorForContext(context, [NSColor colorWithSRGBRed:rgba[0] green:rgba[1] blue:rgba[2] alpha:rgba[3]]);
}
static void qt_drawDisclosureButton(CGContextRef context, NSInteger state, bool selected, CGRect rect)
{
Q_ASSERT(context);
static const CGFloat gray[] = {0.55, 0.55, 0.55, 0.97};
static const CGFloat white[] = {1.0, 1.0, 1.0, 0.9};
NSColor *fillColor = qt_colorForContext(context, selected ? white : gray);
[fillColor setFill];
if (state == NSOffState) {
static NSBezierPath *triangle = [[NSBezierPath alloc] init];
[triangle removeAllPoints];
// In off state, a disclosure button is an equilateral triangle
// ('pointing' to the right) with a bound rect that can be described
// as NSMakeRect(0, 0, 8, 9). Inside the 'rect' it's translated by
// (2, 4).
[triangle moveToPoint:NSMakePoint(rect.origin.x + 2, rect.origin.y + 4)];
[triangle lineToPoint:NSMakePoint(rect.origin.x + 2, rect.origin.y + 4 + 9)];
[triangle lineToPoint:NSMakePoint(rect.origin.x + 2 + 8, rect.origin.y + 4 + 4.5)];
[triangle closePath];
[triangle fill];
} else {
static NSBezierPath *openTriangle = [[NSBezierPath alloc] init];
[openTriangle removeAllPoints];
// In 'on' state, the button is an equilateral triangle (looking down)
// with the bounding rect NSMakeRect(0, 0, 9, 8). Inside the 'rect'
// it's translated by (1, 4).
[openTriangle moveToPoint:NSMakePoint(rect.origin.x + 1, rect.origin.y + 4 + 8)];
[openTriangle lineToPoint:NSMakePoint(rect.origin.x + 1 + 9, rect.origin.y + 4 + 8)];
[openTriangle lineToPoint:NSMakePoint(rect.origin.x + 1 + 4.5, rect.origin.y + 4)];
[openTriangle closePath];
[openTriangle fill];
}
}
void QMacStylePrivate::drawFocusRing(QPainter *p, const QRectF &targetRect, int hMargin, int vMargin, const CocoaControl &cw) const
{
QPainterPath focusRingPath;
@ -3209,8 +3301,15 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
CGContextScaleCTM(cg, 1, -1);
CGContextTranslateCTM(cg, -rect.origin.x, -rect.origin.y);
[triangleCell drawBezelWithFrame:NSRectFromCGRect(rect) inView:[triangleCell controlView]];
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave && !qt_mac_applicationIsInDarkMode()) {
// When the real system theme is one of the 'Dark' themes, and an application forces the 'Aqua' theme,
// under some conditions (see QTBUG-74515 for more details) NSButtonCell seems to select the 'Dark'
// code path and is becoming transparent, thus 'invisible' on the white background. To workaround this,
// we draw the disclose triangle manually:
qt_drawDisclosureButton(cg, triangleCell.state, (opt->state & State_Selected) && viewHasFocus, rect);
} else {
[triangleCell drawBezelWithFrame:NSRectFromCGRect(rect) inView:[triangleCell controlView]];
}
d->restoreNSGraphicsContext(cg);
break; }
@ -3542,7 +3641,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (tbstyle == Qt::ToolButtonTextOnly
|| (tbstyle != Qt::ToolButtonTextOnly && !down)) {
QPen pen = p->pen();
QColor light = down ? Qt::black : Qt::white;
QColor light = down || isDarkMode() ? Qt::black : Qt::white;
light.setAlphaF(0.375f);
p->setPen(light);
p->drawText(cr.adjusted(0, 1, 0, 1), alignment, tb->text);
@ -3964,6 +4063,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (!tabBar->tabTextColor(tabBar->currentIndex()).isValid())
myTab.palette.setColor(QPalette::WindowText, Qt::white);
if (myTab.documentMode && isDarkMode()) {
bool active = (myTab.state & State_Selected) && (myTab.state & State_Active);
myTab.palette.setColor(QPalette::WindowText, active ? Qt::white : Qt::gray);
}
int heightOffset = 0;
if (verticalTabs) {
heightOffset = -1;
@ -4450,16 +4554,17 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
p->fillRect(opt->rect, linearGrad);
p->save();
QRect toolbarRect = isDarkMode ? opt->rect.adjusted(0, 0, 0, 1) : opt->rect;
if (opt->state & State_Horizontal) {
p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientBegin.lighter(114));
p->drawLine(opt->rect.topLeft(), opt->rect.topRight());
p->drawLine(toolbarRect.topLeft(), toolbarRect.topRight());
p->setPen(isDarkMode ? darkModeSeparatorLine :mainWindowGradientEnd.darker(114));
p->drawLine(opt->rect.bottomLeft(), opt->rect.bottomRight());
p->drawLine(toolbarRect.bottomLeft(), toolbarRect.bottomRight());
} else {
p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientBegin.lighter(114));
p->drawLine(opt->rect.topLeft(), opt->rect.bottomLeft());
p->drawLine(toolbarRect.topLeft(), toolbarRect.bottomLeft());
p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientEnd.darker(114));
p->drawLine(opt->rect.topRight(), opt->rect.bottomRight());
p->drawLine(toolbarRect.topRight(), toolbarRect.bottomRight());
}
p->restore();

View File

@ -83,56 +83,56 @@ void QAppleTestLogger::leaveTestFunction()
testFunctionActivity.leave();
}
typedef QPair<QtMsgType, const char *> IncidentClassification;
static IncidentClassification incidentTypeToClassification(QAbstractTestLogger::IncidentTypes type)
struct MessageData
{
switch (type) {
case QAbstractTestLogger::Pass:
return IncidentClassification(QtInfoMsg, "pass");
case QAbstractTestLogger::XFail:
return IncidentClassification(QtInfoMsg, "xfail");
case QAbstractTestLogger::Fail:
return IncidentClassification(QtCriticalMsg, "fail");
case QAbstractTestLogger::XPass:
return IncidentClassification(QtInfoMsg, "xpass");
case QAbstractTestLogger::BlacklistedPass:
return IncidentClassification(QtWarningMsg, "bpass");
case QAbstractTestLogger::BlacklistedFail:
return IncidentClassification(QtInfoMsg, "bfail");
case QAbstractTestLogger::BlacklistedXPass:
return IncidentClassification(QtWarningMsg, "bxpass");
case QAbstractTestLogger::BlacklistedXFail:
return IncidentClassification(QtInfoMsg, "bxfail");
QtMsgType messageType = QtFatalMsg;
const char *categorySuffix = nullptr;
void generateCategory(QTestCharBuffer *category)
{
if (categorySuffix)
QTest::qt_asprintf(category, "qt.test.%s", categorySuffix);
else
QTest::qt_asprintf(category, "qt.test");
}
return IncidentClassification(QtFatalMsg, nullptr);
}
};
void QAppleTestLogger::addIncident(IncidentTypes type, const char *description,
const char *file, int line)
{
IncidentClassification incidentClassification = incidentTypeToClassification(type);
MessageData messageData = [=]() {
switch (type) {
case QAbstractTestLogger::Pass:
return MessageData{QtInfoMsg, "pass"};
case QAbstractTestLogger::XFail:
return MessageData{QtInfoMsg, "xfail"};
case QAbstractTestLogger::Fail:
return MessageData{QtCriticalMsg, "fail"};
case QAbstractTestLogger::XPass:
return MessageData{QtInfoMsg, "xpass"};
case QAbstractTestLogger::BlacklistedPass:
return MessageData{QtWarningMsg, "bpass"};
case QAbstractTestLogger::BlacklistedFail:
return MessageData{QtInfoMsg, "bfail"};
case QAbstractTestLogger::BlacklistedXPass:
return MessageData{QtWarningMsg, "bxpass"};
case QAbstractTestLogger::BlacklistedXFail:
return MessageData{QtInfoMsg, "bxfail"};
}
Q_UNREACHABLE();
}();
QTestCharBuffer category;
QTest::qt_asprintf(&category, "qt.test.%s", incidentClassification.second);
messageData.generateCategory(&category);
QMessageLogContext context(file, line, /* function = */ nullptr, category.data());
QTestCharBuffer subsystemBuffer;
// It would be nice to have the data tag as part of the subsystem too, but that
// will for some tests results in hundreds of thousands of log objects being
// created, so we limit the subsystem to test functions, which we can hope
// are reasonably limited.
generateTestIdentifier(&subsystemBuffer, TestObject | TestFunction);
QString subsystem = QString::fromLatin1(subsystemBuffer.data());
// We still want the full identifier as part of the message though
QTestCharBuffer testIdentifier;
generateTestIdentifier(&testIdentifier);
QString message = QString::fromLatin1(testIdentifier.data());
QString message = testIdentifier();
if (qstrlen(description))
message += QLatin1Char('\n') % QString::fromLatin1(description);
AppleUnifiedLogger::messageHandler(incidentClassification.first, context, message, subsystem);
AppleUnifiedLogger::messageHandler(messageData.messageType, context, message, subsystem());
}
void QAppleTestLogger::addMessage(QtMsgType type, const QMessageLogContext &context, const QString &message)
@ -140,6 +140,62 @@ void QAppleTestLogger::addMessage(QtMsgType type, const QMessageLogContext &cont
AppleUnifiedLogger::messageHandler(type, context, message);
}
void QAppleTestLogger::addMessage(MessageTypes type, const QString &message, const char *file, int line)
{
MessageData messageData = [=]() {
switch (type) {
case QAbstractTestLogger::Warn:
case QAbstractTestLogger::QWarning:
return MessageData{QtWarningMsg, nullptr};
case QAbstractTestLogger::QDebug:
return MessageData{QtDebugMsg, nullptr};
case QAbstractTestLogger::QSystem:
return MessageData{QtWarningMsg, "system"};
case QAbstractTestLogger::QFatal:
return MessageData{QtFatalMsg, nullptr};
case QAbstractTestLogger::Skip:
return MessageData{QtInfoMsg, "skip"};
case QAbstractTestLogger::Info:
case QAbstractTestLogger::QInfo:
return MessageData{QtInfoMsg, nullptr};
}
Q_UNREACHABLE();
}();
QTestCharBuffer category;
messageData.generateCategory(&category);
QMessageLogContext context(file, line, /* function = */ nullptr, category.data());
QString msg = message;
if (type == Skip) {
if (!message.isNull())
msg.prepend(testIdentifier() + QLatin1Char('\n'));
else
msg = testIdentifier();
}
AppleUnifiedLogger::messageHandler(messageData.messageType, context, msg, subsystem());
}
QString QAppleTestLogger::subsystem() const
{
QTestCharBuffer buffer;
// It would be nice to have the data tag as part of the subsystem too, but that
// will for some tests result in hundreds of thousands of log objects being
// created, so we limit the subsystem to test functions, which we can hope
// are reasonably limited.
generateTestIdentifier(&buffer, TestObject | TestFunction);
return QString::fromLatin1(buffer.data());
}
QString QAppleTestLogger::testIdentifier() const
{
QTestCharBuffer buffer;
generateTestIdentifier(&buffer);
return QString::fromLatin1(buffer.data());
}
#endif // QT_USE_APPLE_UNIFIED_LOGGING
QT_END_NAMESPACE

View File

@ -73,11 +73,14 @@ public:
void addMessage(QtMsgType, const QMessageLogContext &,
const QString &) override;
void addMessage(MessageTypes type, const QString &message,
const char *file = 0, int line = 0) override
{ Q_UNUSED(type); Q_UNUSED(message); Q_UNUSED(file); Q_UNUSED(line); Q_UNREACHABLE(); }
const char *file = 0, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override
{ Q_UNUSED(result); }
private:
QString subsystem() const;
QString testIdentifier() const;
};
#endif

View File

@ -4,3 +4,5 @@
windows ci
[blockingLookup:a-plus-aaaa]
windows ci
[reverseLookup:google-public-dns-a.google.com]
ci

View File

@ -31,7 +31,7 @@
#include <QProcess>
#include <QDir>
static QString targetName( BuildType buildMode, const QString& target, const QString& version )
QString TestCompiler::targetName(BuildType buildMode, const QString& target, const QString& version)
{
Q_UNUSED(version);
QString targetName = target;
@ -257,7 +257,8 @@ bool TestCompiler::qmakeProject( const QString &workDir, const QString &proName
return runCommand(qmakeCmd_, QStringList() << "-project" << "-o" << projectFile << "DESTDIR=./");
}
bool TestCompiler::qmake( const QString &workDir, const QString &proName, const QString &buildDir )
bool TestCompiler::qmake(const QString &workDir, const QString &proName, const QString &buildDir,
const QStringList &additionalArguments)
{
QDir D;
D.setCurrent( workDir );
@ -274,7 +275,8 @@ bool TestCompiler::qmake( const QString &workDir, const QString &proName, const
makeFile += "Makefile";
// Now start qmake and generate the makefile
return runCommand(qmakeCmd_, QStringList(qmakeArgs_) << projectFile << "-o" << makeFile);
return runCommand(qmakeCmd_, QStringList(qmakeArgs_) << projectFile << "-o" << makeFile
<< additionalArguments);
}
bool TestCompiler::make( const QString &workPath, const QString &target, bool expectFail )

View File

@ -49,6 +49,8 @@ public:
void resetEnvironment();
void addToEnvironment( QString varAssignment );
static QString targetName(BuildType buildMode, const QString& target, const QString& version);
// executes a make clean in the specified workPath
bool makeClean( const QString &workPath );
// executes a make dist clean in the specified workPath
@ -56,7 +58,8 @@ public:
// executes a qmake -project on the specified workDir
bool qmakeProject( const QString &workDir, const QString &proName );
// executes a qmake on proName in the specified workDir, output goes to buildDir or workDir if it's null
bool qmake( const QString &workDir, const QString &proName, const QString &buildDir = QString() );
bool qmake(const QString &workDir, const QString &proName, const QString &buildDir = QString(),
const QStringList &additionalArguments = QStringList());
// executes a make in the specified workPath, with an optional target (eg. install)
bool make( const QString &workPath, const QString &target = QString(), bool expectFail = false );
// checks if the executable exists in destDir

View File

@ -5,3 +5,8 @@ SOURCES = test_file.cpp \
RESOURCES = test.qrc
TARGET = "simple app"
DESTDIR = "dest dir"
target.path = $$OUT_PWD/dist
INSTALLS += target
!build_pass:msvc:CONFIG(debug, debug|release):message("check for pdb, please")

View File

@ -58,6 +58,7 @@ private slots:
void simple_app();
void simple_app_shadowbuild();
void simple_app_shadowbuild2();
void simple_app_versioned();
void simple_lib();
void simple_dll();
void subdirs();
@ -173,10 +174,15 @@ void tst_qmake::simple_app()
{
QString workDir = base_path + "/testdata/simple_app";
QString destDir = workDir + "/dest dir";
QString installDir = workDir + "/dist";
QVERIFY( test_compiler.qmake( workDir, "simple_app" ));
QVERIFY( test_compiler.qmake( workDir, "simple_app", QString() ));
QVERIFY( test_compiler.make( workDir ));
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" ));
QVERIFY(test_compiler.make(workDir, "install"));
QVERIFY(test_compiler.exists(installDir, "simple app", Exe, "1.0.0"));
QVERIFY( test_compiler.makeClean( workDir ));
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.makeDistClean( workDir ));
@ -216,6 +222,40 @@ void tst_qmake::simple_app_shadowbuild2()
QVERIFY( test_compiler.removeMakefile( buildDir ) );
}
void tst_qmake::simple_app_versioned()
{
QString workDir = base_path + "/testdata/simple_app";
QString buildDir = base_path + "/testdata/simple_app_versioned_build";
QString destDir = buildDir + "/dest dir";
QString installDir = buildDir + "/dist";
QString version = "4.5.6";
QVERIFY(test_compiler.qmake(workDir, "simple_app", buildDir, QStringList{ "VERSION=" + version }));
QString qmakeOutput = test_compiler.commandOutput();
QVERIFY(test_compiler.make(buildDir));
QVERIFY(test_compiler.exists(destDir, "simple app", Exe, version));
QString pdbFilePath;
bool checkPdb = qmakeOutput.contains("Project MESSAGE: check for pdb, please");
if (checkPdb) {
QString targetBase = QFileInfo(TestCompiler::targetName(Exe, "simple app", version))
.completeBaseName();
pdbFilePath = destDir + '/' + targetBase + ".pdb";
QVERIFY2(QFile::exists(pdbFilePath), qPrintable(pdbFilePath));
QVERIFY(test_compiler.make(buildDir, "install"));
QString installedPdbFilePath = installDir + '/' + targetBase + ".pdb";
QVERIFY2(QFile::exists(installedPdbFilePath), qPrintable(installedPdbFilePath));
}
QVERIFY(test_compiler.makeClean(buildDir));
QVERIFY(test_compiler.exists(destDir, "simple app", Exe, version));
QVERIFY(test_compiler.makeDistClean(buildDir));
QVERIFY(!test_compiler.exists(destDir, "simple app", Exe, version));
if (checkPdb)
QVERIFY(!QFile::exists(pdbFilePath));
QVERIFY(test_compiler.removeMakefile(buildDir));
}
void tst_qmake::simple_dll()
{
QString workDir = base_path + "/testdata/simple_dll";

View File

@ -0,0 +1,3 @@
# QTBUG-74760
[sorting]
opensuse-42.3