Fix test compilation issues with QtLite configuration

Now developer build tests compile, but some are not working.
Functional fix will come later via separate tasks.

Task-number: QTBUG-122999
Change-Id: I70487b46c1b32ba4279cb02a4978e4f55ac0d310
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Jari Helaakoski 2024-04-24 13:39:38 +03:00
parent 7feaf9d41e
commit 30cc8a28de
43 changed files with 311 additions and 60 deletions

View File

@ -893,7 +893,7 @@ qt_feature("jpeg" PRIVATE
CONDITION QT_FEATURE_imageformatplugin
DISABLE INPUT_libjpeg STREQUAL 'no'
)
qt_feature_definition("jpeg" "QT_NO_IMAGEFORMAT_JPEG" NEGATE)
qt_feature_definition("jpeg" "QT_NO_IMAGEFORMAT_JPEG" NEGATE VALUE "1")
qt_feature("system-jpeg" PRIVATE
LABEL " Using system libjpeg"
CONDITION QT_FEATURE_jpeg AND JPEG_FOUND

View File

@ -78,7 +78,9 @@ static constexpr struct : QMetaTypeModuleHelper
// either two nullptrs from canConvert, or two valid pointers
Q_ASSERT(onlyCheck || (bool(from) && bool(to)));
#if QT_CONFIG(shortcut)
using Int = int;
#endif
switch (makePair(toTypeId, fromTypeId)) {
QMETATYPE_CONVERTER(QByteArray, QColor,
result = source.name(source.alpha() != 255 ?

View File

@ -1396,7 +1396,9 @@ void QTextEngine::shapeText(int item) const
QFontEngine *fontEngine = this->fontEngine(si, &si.ascent, &si.descent, &si.leading);
#if QT_CONFIG(harfbuzz)
bool kerningEnabled;
#endif
bool letterSpacingIsAbsolute;
bool shapingEnabled = false;
QHash<QFont::Tag, quint32> features;
@ -1405,8 +1407,8 @@ void QTextEngine::shapeText(int item) const
if (useRawFont) {
QTextCharFormat f = format(&si);
QFont font = f.font();
kerningEnabled = font.kerning();
# if QT_CONFIG(harfbuzz)
kerningEnabled = font.kerning();
shapingEnabled = QFontEngine::scriptRequiresOpenType(QChar::Script(si.analysis.script))
|| (font.styleStrategy() & QFont::PreferNoShaping) == 0;
# endif
@ -1418,8 +1420,8 @@ void QTextEngine::shapeText(int item) const
#endif
{
QFont font = this->font(si);
kerningEnabled = font.d->kerning;
#if QT_CONFIG(harfbuzz)
kerningEnabled = font.d->kerning;
shapingEnabled = QFontEngine::scriptRequiresOpenType(QChar::Script(si.analysis.script))
|| (font.d->request.styleStrategy & QFont::PreferNoShaping) == 0;
#endif

View File

@ -4,15 +4,17 @@
add_subdirectory(qstringlistmodel)
if(TARGET Qt::Gui)
add_subdirectory(qabstractitemmodel)
add_subdirectory(qabstractproxymodel)
add_subdirectory(qconcatenatetablesproxymodel)
add_subdirectory(qidentityproxymodel)
if(QT_FEATURE_proxymodel)
add_subdirectory(qabstractproxymodel)
add_subdirectory(qconcatenatetablesproxymodel)
add_subdirectory(qidentityproxymodel)
add_subdirectory(qsortfilterproxymodel_recursive)
add_subdirectory(qsortfilterproxymodel_regularexpression)
add_subdirectory(qtransposeproxymodel)
endif()
add_subdirectory(qitemselectionmodel)
add_subdirectory(qsortfilterproxymodel_recursive)
add_subdirectory(qsortfilterproxymodel_regularexpression)
add_subdirectory(qtransposeproxymodel)
endif()
if(TARGET Qt::Widgets)
if(TARGET Qt::Widgets AND QT_FEATURE_proxymodel)
add_subdirectory(qsortfilterproxymodel)
endif()
if(TARGET Qt::Sql AND TARGET Qt::Widgets)

View File

@ -6,7 +6,9 @@
#include <QtTest/private/qcomparisontesthelper_p.h>
#include <QtCore/QCoreApplication>
#if QT_CONFIG(sortfilterproxymodel)
#include <QtCore/QSortFilterProxyModel>
#endif
#include <QtCore/QStringListModel>
#include <QtGui/QStandardItemModel>
@ -80,9 +82,11 @@ private slots:
void testMoveWithinOwnRange_data();
void testMoveWithinOwnRange();
#if QT_CONFIG(sortfilterproxymodel)
void testMoveThroughProxy();
void testReset();
#endif
void testDataChanged();
@ -1239,6 +1243,7 @@ void tst_QAbstractItemModel::testMoveSameParentUp()
}
}
#if QT_CONFIG(sortfilterproxymodel)
void tst_QAbstractItemModel::testMoveThroughProxy()
{
QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this);
@ -1257,6 +1262,7 @@ void tst_QAbstractItemModel::testMoveThroughProxy()
moveCommand->setDestRow(0);
moveCommand->doCommand();
}
#endif
void tst_QAbstractItemModel::testMoveToGrandParent_data()
{
@ -1804,6 +1810,7 @@ void tst_QAbstractItemModel::testMoveWithinOwnRange()
QCOMPARE(afterSpy.size(), 0);
}
#if QT_CONFIG(proxymodel)
class ListenerObject : public QObject
{
Q_OBJECT
@ -1822,7 +1829,7 @@ private:
QList<QPersistentModelIndex> m_persistentIndexes;
QModelIndexList m_nonPersistentIndexes;
};
#endif
class ModelWithCustomRole : public QStringListModel
{
@ -1836,6 +1843,7 @@ public:
}
};
#if QT_CONFIG(proxymodel)
ListenerObject::ListenerObject(QAbstractProxyModel *parent)
: QObject(parent), m_model(parent)
{
@ -1876,7 +1884,9 @@ void ListenerObject::slotReset()
QVERIFY(!idx.isValid());
}
}
#endif
#if QT_CONFIG(sortfilterproxymodel)
void tst_QAbstractItemModel::testReset()
{
QSignalSpy beforeResetSpy(m_model, &DynamicTreeModel::modelAboutToBeReset);
@ -1931,6 +1941,7 @@ void tst_QAbstractItemModel::testReset()
// After being reset the proxy must be queried again.
QCOMPARE(nullProxy->roleNames().value(Qt::UserRole + 1), QByteArray());
}
#endif
class CustomRoleModel : public QStringListModel
{

View File

@ -57,8 +57,10 @@ private slots:
void merge();
void isRowSelected();
void childrenDeselectionSignal();
#if QT_CONFIG(proxymodel)
void layoutChangedWithAllSelected1();
void layoutChangedWithAllSelected2();
#endif
void layoutChangedTreeSelection();
void deselectRemovedMiddleRange();
void setModel();
@ -75,7 +77,9 @@ private slots:
void QTBUG48402();
void QTBUG58851_data();
#if QT_CONFIG(proxymodel)
void QTBUG58851();
#endif
void QTBUG18001_data();
void QTBUG18001();
@ -2260,6 +2264,7 @@ void tst_QItemSelectionModel::childrenDeselectionSignal()
QVERIFY(selectionModel.selection().contains(sel2));
}
#if QT_CONFIG(proxymodel)
void tst_QItemSelectionModel::layoutChangedWithAllSelected1()
{
QStringListModel model( QStringList() << "foo" << "bar" << "foo2");
@ -2338,6 +2343,7 @@ void tst_QItemSelectionModel::layoutChangedWithAllSelected2()
for (const auto &index : indexList)
QVERIFY(selection.isSelected(index));
}
#endif
// This test is a regression test for QTBUG-2804.
void tst_QItemSelectionModel::layoutChangedTreeSelection()
@ -2752,6 +2758,7 @@ void tst_QItemSelectionModel::QTBUG58851_data()
<< IntPair(2, 3));
}
#if QT_CONFIG(proxymodel)
void tst_QItemSelectionModel::QTBUG58851()
{
using IntPair = std::pair<int, int>;
@ -2796,6 +2803,7 @@ void tst_QItemSelectionModel::QTBUG58851()
QVERIFY(selections.isSelected(i));
}
}
#endif
void tst_QItemSelectionModel::QTBUG18001_data()
{

View File

@ -3,11 +3,15 @@
#include <QTest>
#include <QSignalSpy>
#if QT_CONFIG(sortfilterproxymodel)
#include <QSortFilterProxyModel>
#endif
#include <qobject.h>
#include <qmetaobject.h>
#if QT_CONFIG(proxymodel)
#include <qabstractproxymodel.h>
#endif
#include <private/qmetaobject_p.h>
Q_DECLARE_METATYPE(const QMetaObject *)
@ -1906,6 +1910,7 @@ void tst_QMetaObject::invokeBlockingQueuedPointer()
void tst_QMetaObject::qtMetaObjectInheritance()
{
QVERIFY(!QObject::staticMetaObject.superClass());
#if QT_CONFIG(sortfilterproxymodel)
QCOMPARE(QSortFilterProxyModel::staticMetaObject.indexOfEnumerator("Qt::CaseSensitivity"), -1);
QCOMPARE(QSortFilterProxyModel::staticMetaObject.indexOfEnumerator("CaseSensitivity"), -1);
int indexOfSortCaseSensitivity = QSortFilterProxyModel::staticMetaObject.indexOfProperty("sortCaseSensitivity");
@ -1913,6 +1918,7 @@ void tst_QMetaObject::qtMetaObjectInheritance()
QMetaProperty sortCaseSensitivity = QSortFilterProxyModel::staticMetaObject.property(indexOfSortCaseSensitivity);
QVERIFY(sortCaseSensitivity.isValid());
QCOMPARE(sortCaseSensitivity.enumerator().name(), "CaseSensitivity");
#endif
}
struct MyType
@ -2515,7 +2521,9 @@ void tst_QMetaObject::metaType()
{
QCOMPARE(QObject::staticMetaObject.metaType(), QMetaType::fromType<QObject>());
QCOMPARE(MyGadget::staticMetaObject.metaType(), QMetaType::fromType<MyGadget>());
#if QT_CONFIG(proxymodel)
QCOMPARE(QAbstractProxyModel::staticMetaObject.metaType(), QMetaType::fromType<QAbstractProxyModel>());
#endif
auto qtNameSpaceMetaType = Qt::staticMetaObject.metaType();
QVERIFY2(!qtNameSpaceMetaType.isValid(), qtNameSpaceMetaType.name());
}

View File

@ -3,7 +3,9 @@
add_subdirectory(json)
add_subdirectory(qcborstreamreader)
add_subdirectory(qcborstreamwriter)
if(QT_FEATURE_cborstreamwriter)
add_subdirectory(qcborstreamwriter)
endif()
if(NOT WASM)
add_subdirectory(qcborvalue)
endif()

View File

@ -7,7 +7,9 @@
#include <QBuffer>
#include <QCborStreamReader>
#if QT_CONFIG(cborstreamwriter)
#include <QCborStreamWriter>
#endif
#include <QDateTime>
#include <QtEndian>
#include <QTimeZone>
@ -86,9 +88,11 @@ private slots:
void comparisonMap();
void toCbor_data();
#if QT_CONFIG(cborstreamwriter)
void toCbor();
void toCborStreamWriter_data() { toCbor_data(); }
void toCborStreamWriter();
#endif
void fromCbor_data();
void fromCbor();
void fromCborStreamReaderByteArray_data() { fromCbor_data(); }
@ -2311,6 +2315,7 @@ void tst_QCborValue::toCbor_data()
QTest::newRow("UseInteger:-2^65") << QCborValue(-2 * 18446744073709551616.0) << raw("\xfb\xc4\0\0\0""\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
}
#if QT_CONFIG(cborstreamwriter)
void tst_QCborValue::toCbor()
{
QFETCH(QCborValue, v);
@ -2350,6 +2355,7 @@ void tst_QCborValue::toCborStreamWriter()
QCOMPARE(buffer.pos(), result.size());
QCOMPARE(output, result);
}
#endif
void tst_QCborValue::fromCbor_data()
{
@ -2667,12 +2673,14 @@ void tst_QCborValue::extendedTypeValidation()
QCOMPARE(error.offset, data.size());
QT_TEST_EQUALITY_OPS(decoded, expected, true);
#if QT_CONFIG(cborstreamwriter)
QByteArray encoded = decoded.toCbor();
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// behavior change, see qdatetime.cpp:fromIsoTimeString
QEXPECT_FAIL("DateTime:Null-at-19", "QDateTime parsing fixed, but only in 6.0", Abort);
#endif
QCOMPARE(encoded, data);
#endif
}
void tst_QCborValue::hugeDeviceValidation_data()
@ -3000,7 +3008,9 @@ template <typename ValueRef> static void cborValueRef_template()
else
QCOMPARE(ref.toVariant(), v.toVariant());
QCOMPARE(ref.toJsonValue(), v.toJsonValue());
#if QT_CONFIG(cborstreamwriter)
QCOMPARE(ref.toCbor(), v.toCbor());
#endif
QCOMPARE(ref.toDiagnosticNotation(), v.toDiagnosticNotation());
}
@ -3160,6 +3170,7 @@ void tst_QCborValue::datastreamSerialization_data()
void tst_QCborValue::datastreamSerialization()
{
#if QT_CONFIG(cborstreamwriter)
QFETCH(QCborValue, v);
QByteArray buffer;
{
@ -3187,6 +3198,7 @@ void tst_QCborValue::datastreamSerialization()
load >> output;
QCOMPARE(output, map);
}
#endif
}
void tst_QCborValue::streamVariantSerialization()

View File

@ -143,9 +143,11 @@ private slots:
void stream_QJsonObject();
void stream_QJsonValue();
#if QT_CONFIG(cborstreamwriter)
void stream_QCborArray();
void stream_QCborMap();
void stream_QCborValue();
#endif
void setVersion_data();
void setVersion();
@ -2326,6 +2328,7 @@ void tst_QDataStream::stream_QJsonValue()
}
}
#if QT_CONFIG(cborstreamwriter)
void tst_QDataStream::stream_QCborArray()
{
QByteArray buffer;
@ -2361,6 +2364,7 @@ void tst_QDataStream::stream_QCborValue()
load >> valueLoad;
QCOMPARE(valueLoad, valueSave);
}
#endif
void tst_QDataStream::setVersion_data()
{
@ -3254,11 +3258,13 @@ void tst_QDataStream::streamRealDataTypes()
// Generate QPicture from pixmap.
QPixmap pm(open_xpm);
QVERIFY(!pm.isNull());
#ifndef QT_NO_PICTURE
QPicture picture;
picture.setBoundingRect(QRect(QPoint(0, 0), pm.size()));
QPainter painter(&picture);
painter.drawPixmap(0, 0, pm);
painter.end();
#endif
// Generate path
QPainterPath path;
@ -3296,7 +3302,9 @@ void tst_QDataStream::streamRealDataTypes()
stream << QPointF(3, 5) << QRectF(-1, -2, 3, 4) << (QPolygonF() << QPointF(0, 0) << QPointF(1, 2));
stream << QTransform().rotate(90).scale(2, 2).asAffineMatrix();
stream << path;
#ifndef QT_NO_PICTURE
stream << picture;
#endif
stream << QTextLength(QTextLength::VariableLength, 1.5);
stream << color;
stream << radialBrush << conicalBrush;
@ -3310,7 +3318,9 @@ void tst_QDataStream::streamRealDataTypes()
QPolygonF polygon {{3, 4}, {5, 6}};
QTransform transform;
QPainterPath p = otherPath;
#ifndef QT_NO_PICTURE
QPicture pict;
#endif
QTextLength textLength(QTextLength::FixedLength, 2.5);
QColor col(128, 128, 127);
QBrush rGrad(Qt::CrossPattern);
@ -3363,6 +3373,7 @@ void tst_QDataStream::streamRealDataTypes()
QCOMPARE(transform, QTransform().rotate(90).scale(2, 2));
stream >> p;
QCOMPARE(p, path);
#ifndef QT_NO_PICTURE
if (i == 1) {
stream >> pict;
@ -3376,6 +3387,7 @@ void tst_QDataStream::streamRealDataTypes()
QCOMPARE(pictA, pictB);
}
#endif
stream >> textLength;
QCOMPARE(textLength, QTextLength(QTextLength::VariableLength, 1.5));
stream >> col;

View File

@ -8,4 +8,6 @@ if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
endif()
add_subdirectory(test)
add_subdirectory(syslocaleapp)
if(QT_FEATURE_jalalicalendar)
add_subdirectory(syslocaleapp)
endif()

View File

@ -17,11 +17,20 @@ if(QT_FEATURE_thread)
add_subdirectory(qatomicint)
add_subdirectory(qatomicinteger)
add_subdirectory(qatomicpointer)
add_subdirectory(qresultstore)
if(QT_FEATURE_concurrent AND NOT INTEGRITY)
add_subdirectory(qfuture)
if(QT_FEATURE_future)
if(QT_FEATURE_concurrent AND NOT INTEGRITY)
add_subdirectory(qfuture)
endif()
add_subdirectory(qresultstore)
add_subdirectory(qfuturesynchronizer)
if(NOT INTEGRITY)
add_subdirectory(qpromise)
endif()
# QTBUG-87431
if(TARGET Qt::Concurrent AND NOT INTEGRITY)
add_subdirectory(qfuturewatcher)
endif()
endif()
add_subdirectory(qfuturesynchronizer)
add_subdirectory(qmutex)
add_subdirectory(qmutexlocker)
add_subdirectory(qreadlocker)
@ -36,12 +45,5 @@ if(QT_FEATURE_thread)
add_subdirectory(qthreadstorage)
add_subdirectory(qwaitcondition)
add_subdirectory(qwritelocker)
if(NOT INTEGRITY)
add_subdirectory(qpromise)
endif()
endif()
# QTBUG-87431
if(TARGET Qt::Concurrent AND NOT INTEGRITY)
add_subdirectory(qfuturewatcher)
endif()

View File

@ -4,6 +4,8 @@
add_subdirectory(qcalendar)
add_subdirectory(qdate)
add_subdirectory(qdatetime)
add_subdirectory(qdatetimeparser)
if(QT_FEATURE_datetimeparser)
add_subdirectory(qdatetimeparser)
endif()
add_subdirectory(qtime)
add_subdirectory(qtimezone)

View File

@ -1179,7 +1179,7 @@ void tst_QDate::operator_insert_extract()
QCOMPARE(deserialised, date);
}
#if QT_CONFIG(datetimeparser)
#if QT_CONFIG(datestring)
void tst_QDate::fromStringDateFormat_data()
{
QTest::addColumn<QString>("dateStr");
@ -1303,6 +1303,7 @@ void tst_QDate::fromStringDateFormat()
QCOMPARE(QDate::fromString(dateStr, dateFormat), expectedDate);
}
# if QT_CONFIG(datetimeparser)
void tst_QDate::fromStringFormat_data()
{
QTest::addColumn<QString>("string");
@ -1490,7 +1491,6 @@ void tst_QDate::fromStringFormat()
}
#endif // datetimeparser
#if QT_CONFIG(datestring)
void tst_QDate::toStringFormat_data()
{
QTest::addColumn<QDate>("t");

View File

@ -21,7 +21,7 @@ private Q_SLOTS:
void deterministicSeed();
void reseeding();
void quality();
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && QT_DEPRECATED_SINCE(6,6)
void compatibilityApi();
void deterministicSeed_compat();
#endif
@ -157,7 +157,7 @@ void tst_QHashSeed::quality()
"seedsToMinus1 = " + QByteArray::number(seedsToMinus1));
}
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && QT_DEPRECATED_SINCE(6,6)
QT_WARNING_DISABLE_DEPRECATED
void tst_QHashSeed::compatibilityApi()
{

View File

@ -12,8 +12,12 @@ add_subdirectory(qpixmap)
add_subdirectory(qimage)
add_subdirectory(qimageiohandler)
add_subdirectory(qimagewriter)
add_subdirectory(qmovie)
add_subdirectory(qpicture)
if(QT_FEATURE_movie)
add_subdirectory(qmovie)
endif()
if(QT_FEATURE_picture)
add_subdirectory(qpicture)
endif()
add_subdirectory(qiconhighdpi)
if(QT_FEATURE_private_tests)
add_subdirectory(qpixmapcache)

View File

@ -3863,10 +3863,12 @@ void tst_QImage::metadataPassthrough()
QCOMPARE(alphaMask.dotsPerMeterY(), a.dotsPerMeterY());
QCOMPARE(alphaMask.devicePixelRatio(), a.devicePixelRatio());
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
QImage heuristicMask = a.createHeuristicMask();
QCOMPARE(heuristicMask.dotsPerMeterX(), a.dotsPerMeterX());
QCOMPARE(heuristicMask.dotsPerMeterY(), a.dotsPerMeterY());
QCOMPARE(heuristicMask.devicePixelRatio(), a.devicePixelRatio());
#endif
QImage maskFromColor = a.createMaskFromColor(qRgb(0, 0, 0));
QCOMPARE(maskFromColor.dotsPerMeterX(), a.dotsPerMeterX());

View File

@ -1176,8 +1176,10 @@ void tst_QPixmap::dprPassthrough()
pm.convertFromImage(img);
QCOMPARE(pm.devicePixelRatio(), dpr);
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
QBitmap heuristicMask = src.createHeuristicMask();
QCOMPARE(heuristicMask.devicePixelRatio(), dpr);
#endif
QBitmap maskFromColor = src.createMaskFromColor(Qt::white);
QCOMPARE(maskFromColor.devicePixelRatio(), dpr);

View File

@ -112,13 +112,17 @@ void tst_QStandardItem::getSetData()
item.setToolTip(toolTip);
QCOMPARE(item.toolTip(), toolTip);
#ifndef QT_NO_STATUSTIP
QString statusTip = QLatin1String("statusTip ") + iS;
item.setStatusTip(statusTip);
QCOMPARE(item.statusTip(), statusTip);
#endif
#if QT_CONFIG(whatsthis)
QString whatsThis = QLatin1String("whatsThis ") + iS;
item.setWhatsThis(whatsThis);
QCOMPARE(item.whatsThis(), whatsThis);
#endif
QSize sizeHint(64*i, 48*i);
item.setSizeHint(sizeHint);
@ -157,8 +161,12 @@ void tst_QStandardItem::getSetData()
QCOMPARE(item.text(), text);
QCOMPARE(item.icon(), icon);
QCOMPARE(item.toolTip(), toolTip);
#ifndef QT_NO_STATUSTIP
QCOMPARE(item.statusTip(), statusTip);
#endif
#if QT_CONFIG(whatsthis)
QCOMPARE(item.whatsThis(), whatsThis);
#endif
QCOMPARE(item.sizeHint(), sizeHint);
QCOMPARE(item.font(), font);
QCOMPARE(item.textAlignment(), textAlignment);
@ -171,8 +179,12 @@ void tst_QStandardItem::getSetData()
QCOMPARE(qvariant_cast<QString>(item.data(Qt::DisplayRole)), text);
QCOMPARE(qvariant_cast<QIcon>(item.data(Qt::DecorationRole)), icon);
QCOMPARE(qvariant_cast<QString>(item.data(Qt::ToolTipRole)), toolTip);
#ifndef QT_NO_STATUSTIP
QCOMPARE(qvariant_cast<QString>(item.data(Qt::StatusTipRole)), statusTip);
#endif
#if QT_CONFIG(whatsthis)
QCOMPARE(qvariant_cast<QString>(item.data(Qt::WhatsThisRole)), whatsThis);
#endif
QCOMPARE(qvariant_cast<QSize>(item.data(Qt::SizeHintRole)), sizeHint);
QCOMPARE(qvariant_cast<QFont>(item.data(Qt::FontRole)), font);
QCOMPARE(qvariant_cast<int>(item.data(Qt::TextAlignmentRole)), int(textAlignment));
@ -844,7 +856,9 @@ void tst_QStandardItem::streamItem()
item.setText(QLatin1String("text"));
item.setToolTip(QLatin1String("toolTip"));
item.setStatusTip(QLatin1String("statusTip"));
#if QT_CONFIG(whatsthis)
item.setWhatsThis(QLatin1String("whatsThis"));
#endif
item.setSizeHint(QSize(64, 48));
item.setFont(QFont());
item.setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
@ -866,7 +880,9 @@ void tst_QStandardItem::streamItem()
QCOMPARE(streamedItem.text(), item.text());
QCOMPARE(streamedItem.toolTip(), item.toolTip());
QCOMPARE(streamedItem.statusTip(), item.statusTip());
#if QT_CONFIG(whatsthis)
QCOMPARE(streamedItem.whatsThis(), item.whatsThis());
#endif
QCOMPARE(streamedItem.sizeHint(), item.sizeHint());
QCOMPARE(streamedItem.font(), item.font());
QCOMPARE(streamedItem.textAlignment(), item.textAlignment());
@ -905,7 +921,9 @@ void tst_QStandardItem::clone()
item.setText(QLatin1String("text"));
item.setToolTip(QLatin1String("toolTip"));
item.setStatusTip(QLatin1String("statusTip"));
#if QT_CONFIG(whatsthis)
item.setWhatsThis(QLatin1String("whatsThis"));
#endif
item.setSizeHint(QSize(64, 48));
item.setFont(QFont());
item.setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
@ -920,7 +938,9 @@ void tst_QStandardItem::clone()
QCOMPARE(clone->text(), item.text());
QCOMPARE(clone->toolTip(), item.toolTip());
QCOMPARE(clone->statusTip(), item.statusTip());
#if QT_CONFIG(whatsthis)
QCOMPARE(clone->whatsThis(), item.whatsThis());
#endif
QCOMPARE(clone->sizeHint(), item.sizeHint());
QCOMPARE(clone->font(), item.font());
QCOMPARE(clone->textAlignment(), item.textAlignment());

View File

@ -6,7 +6,52 @@
#include <QtGui/qguiapplication.h>
#include <QtGui/qevent.h>
#if QT_CONFIG(future)
#include <QtCore/private/qfutureinterface_p.h>
#endif
#if QT_CONFIG(future)
#define X_QFutureCallOutEvent(X) X(QFutureCallOutEvent, ())
#else
#define X_QFutureCallOutEvent(X)
#endif
#if QT_CONFIG(wheelevent)
#define X_QWheelEvent(X) X(QWheelEvent, ({}, {}, {}, {}, {}, {}, {}, {}))
#else
#define X_QWheelEvent(X)
#endif
#if QT_CONFIG(tabletevent)
#define X_QTabletEvent(X) X(QTabletEvent, (QEvent::None, QPointingDevice::primaryPointingDevice(), {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}))
#else
#define X_QTabletEvent(X)
#endif
#if QT_CONFIG(gestures)
#define X_QNativeGestureEvent(X) X(QNativeGestureEvent, ({}, QPointingDevice::primaryPointingDevice(), 0, {}, {}, {}, {}, {}))
#else
#define X_QNativeGestureEvent(X)
#endif
#if QT_CONFIG(whatsthis)
#define X_QWhatsThisClickedEvent(X) X(QWhatsThisClickedEvent, ({}))
#else
#define X_QWhatsThisClickedEvent(X)
#endif
#if QT_CONFIG(action)
#define X_QActionEvent(X) X(QActionEvent, (0, nullptr))
#else
#define X_QActionEvent(X)
#endif
#if QT_CONFIG(shortcut)
#define X_QShortcutEvent(X) X(QShortcutEvent, ({}, 0))
#else
#define X_QShortcutEvent(X)
#endif
#define FOR_EACH_CORE_EVENT(X) \
/* qcoreevent.h */ \
@ -15,7 +60,7 @@
X(QChildEvent, (QEvent::ChildAdded, nullptr)) \
X(QDynamicPropertyChangeEvent, ("size")) \
/* qfutureinterface_p.h */ \
X(QFutureCallOutEvent, ()) \
X_QFutureCallOutEvent(X) \
/* end */
#define FOR_EACH_GUI_EVENT(X) \
@ -27,9 +72,9 @@
X(QEnterEvent, ({}, {}, {})) \
X(QMouseEvent, (QEvent::None, {}, {}, {}, {}, {}, {}, {}, QPointingDevice::primaryPointingDevice())) \
X(QHoverEvent, (QEvent::None, {}, {}, QPointF{})) \
X(QWheelEvent, ({}, {}, {}, {}, {}, {}, {}, {})) \
X(QTabletEvent, (QEvent::None, QPointingDevice::primaryPointingDevice(), {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {})) \
X(QNativeGestureEvent, ({}, QPointingDevice::primaryPointingDevice(), 0, {}, {}, {}, {}, {})) \
X_QWheelEvent(X) \
X_QTabletEvent(X) \
X_QNativeGestureEvent(X) \
X(QKeyEvent, (QEvent::None, 0, {})) \
X(QFocusEvent, (QEvent::None)) \
X(QPaintEvent, (QRect{0, 0, 100, 100})) \
@ -50,11 +95,11 @@
X(QDragLeaveEvent, ()) \
X(QHelpEvent, ({}, {}, {})) \
X(QStatusTipEvent, ({})) \
X(QWhatsThisClickedEvent, ({})) \
X(QActionEvent, (0, nullptr)) \
X_QWhatsThisClickedEvent(X) \
X_QActionEvent(X) \
X(QFileOpenEvent, (QString{})) \
X(QToolBarChangeEvent, (false)) \
X(QShortcutEvent, ({}, 0)) \
X_QShortcutEvent(X) \
X(QWindowStateChangeEvent, ({})) \
X(QTouchEvent, (QEvent::None)) \
X(QScrollPrepareEvent, ({})) \

View File

@ -11,7 +11,9 @@ add_subdirectory(qstatictext)
add_subdirectory(qsyntaxhighlighter)
add_subdirectory(qtextblock)
add_subdirectory(qtextcursor)
add_subdirectory(qtextdocumentfragment)
if(QT_FEATURE_texthtmlparser)
add_subdirectory(qtextdocumentfragment)
endif()
add_subdirectory(qtextdocumentlayout)
add_subdirectory(qtextformat)
add_subdirectory(qtextimagehandler)

View File

@ -22,9 +22,11 @@ public:
private slots:
void getSetCheck();
void maximumBlockCount();
#ifndef QT_NO_TEXTHTMLPARSER
void anchorAt();
void imageAt();
void formatAt();
#endif
};
tst_QAbstractTextDocumentLayout::tst_QAbstractTextDocumentLayout()
@ -119,6 +121,7 @@ void tst_QAbstractTextDocumentLayout::maximumBlockCount()
QCOMPARE(layout.blockCount, 10);
}
#ifndef QT_NO_TEXTHTMLPARSER
void tst_QAbstractTextDocumentLayout::anchorAt()
{
QTextDocument doc;
@ -204,6 +207,7 @@ void tst_QAbstractTextDocumentLayout::formatAt()
QVERIFY(!format.toCharFormat().fontItalic());
QVERIFY(!format.isImageFormat());
}
#endif
QTEST_MAIN(tst_QAbstractTextDocumentLayout)
#include "tst_qabstracttextdocumentlayout.moc"

View File

@ -39,7 +39,9 @@ private slots:
void navigation7();
void navigation8();
void navigation9();
#ifndef QT_NO_TEXTHTMLPARSER
void navigation10();
#endif
void movePositionEndOfLine();
void insertBlock();
void insertWithBlockSeparator1();
@ -431,6 +433,7 @@ void tst_QTextCursor::navigation9()
QCOMPARE(cursor.position(), 15);
}
#ifndef QT_NO_TEXTHTMLPARSER
void tst_QTextCursor::navigation10()
{
doc->setHtml("<html><p>just a simple paragraph.</p>"
@ -542,6 +545,7 @@ void tst_QTextCursor::navigation10()
QVERIFY(ok);
QCOMPARE(cursor.position(), 1); // a
}
#endif
void tst_QTextCursor::insertBlock()
{

View File

@ -24,18 +24,24 @@ private slots:
void cleanupTestCase();
void defaultPageSizeHandling();
void idealWidth();
#ifndef QT_NO_TEXTHTMLPARSER
void lineSeparatorFollowingTable();
#endif
#ifndef QT_NO_WIDGETS
void wrapAtWordBoundaryOrAnywhere();
#endif
void inlineImage();
#ifndef QT_NO_TEXTHTMLPARSER
void clippedTableCell();
#endif
void floatingTablePageBreak();
void imageAtRightAlignedTab();
void blockVisibility();
#ifndef QT_NO_TEXTHTMLPARSER
void testHitTest();
void largeImage();
#endif
private:
QTextDocument *doc;
@ -99,6 +105,7 @@ void tst_QTextDocumentLayout::idealWidth()
QVERIFY(doc->idealWidth() > 0);
}
#ifndef QT_NO_TEXTHTMLPARSER
// none of the QTextLine items in the document should intersect with the margin rect
void tst_QTextDocumentLayout::lineSeparatorFollowingTable()
{
@ -145,6 +152,7 @@ void tst_QTextDocumentLayout::lineSeparatorFollowingTable()
}
}
}
#endif
#ifndef QT_NO_WIDGETS
void tst_QTextDocumentLayout::wrapAtWordBoundaryOrAnywhere()
@ -184,6 +192,7 @@ void tst_QTextDocumentLayout::inlineImage()
QCOMPARE(doc->pageCount(), 1);
}
#ifndef QT_NO_TEXTHTMLPARSER
void tst_QTextDocumentLayout::clippedTableCell()
{
const char *html =
@ -224,6 +233,7 @@ void tst_QTextDocumentLayout::clippedTableCell()
expected.save("expected.png");
QCOMPARE(img, expected);
}
#endif
void tst_QTextDocumentLayout::floatingTablePageBreak()
{
@ -323,6 +333,7 @@ void tst_QTextDocumentLayout::blockVisibility()
QCOMPARE(doc->size(), halfSize);
}
#ifndef QT_NO_TEXTHTMLPARSER
void tst_QTextDocumentLayout::largeImage()
{
auto img = QImage(400, 500, QImage::Format_ARGB32_Premultiplied);
@ -416,6 +427,7 @@ void tst_QTextDocumentLayout::testHitTest()
QVERIFY(positionY - topMargin <= y);
}
}
#endif
QTEST_MAIN(tst_QTextDocumentLayout)
#include "tst_qtextdocumentlayout.moc"

View File

@ -7,7 +7,9 @@
#include <qcoreapplication.h>
#include <qdebug.h>
#if QT_CONFIG(settings)
#include <qsettings.h>
#endif
#include <qtextformat.h>
#include <private/qtextformat_p.h>
#include <qtextdocument.h>
@ -27,7 +29,9 @@ Q_OBJECT
private slots:
void getSetCheck();
void defaultAlignment();
#if QT_CONFIG(settings)
void testQTextCharFormat() const;
#endif
void testUnderlinePropertyPrecedence();
void toFormat();
void resolveFont();
@ -47,6 +51,7 @@ private slots:
#endif
};
#if QT_CONFIG(settings)
/*! \internal
This (used to) trigger a crash in:
@ -61,6 +66,7 @@ void tst_QTextFormat::testQTextCharFormat() const
settings.value("test", test);
}
#endif
// Testing get/set functions
void tst_QTextFormat::getSetCheck()

View File

@ -18,7 +18,9 @@ private slots:
void cleanup();
void cleanupTestCase();
void loadAtNImages_data();
#ifndef QT_NO_TEXTHTMLPARSER
void loadAtNImages();
#endif
};
tst_QTextImageHandler::tst_QTextImageHandler()
@ -47,6 +49,7 @@ void tst_QTextImageHandler::loadAtNImages_data()
QTest::addRow("qrc_url") << "qrc:/data/image.png";
}
#ifndef QT_NO_TEXTHTMLPARSER
void tst_QTextImageHandler::loadAtNImages()
{
QFETCH(QString, imageFile);
@ -74,6 +77,7 @@ void tst_QTextImageHandler::loadAtNImages()
QCOMPARE(img.pixelColor(0, 0), expectedColor);
}
}
#endif
QTEST_MAIN(tst_QTextImageHandler)
#include "tst_qtextimagehandler.moc"

View File

@ -140,6 +140,7 @@ void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
QCOMPARE(list->count(), 28);
#ifndef QT_NO_TEXTHTMLPARSER
QString htmlExport = doc->toHtml();
QTextDocument importDoc;
importDoc.setHtml(htmlExport);
@ -152,6 +153,7 @@ void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
QCOMPARE(importCursor.currentList()->itemNumber(importCursor.block()), 27);
QCOMPARE(importCursor.currentList()->itemText(importCursor.block()), QLatin1String("\"ab#"));
QCOMPARE(importCursor.currentList()->format().indent(), 10);
#endif
}
void tst_QTextList::autoNumberingRTL()

View File

@ -1236,6 +1236,7 @@ void tst_QTextTable::checkBorderAttributes()
QFETCH(QBrush, leftBorderBrush);
QFETCH(QBrush, rightBorderBrush);
#ifndef QT_NO_TEXTHTMLPARSER
QTextDocument doc;
doc.setHtml(html);
QTextCursor cursor(doc.firstBlock());
@ -1261,6 +1262,7 @@ void tst_QTextTable::checkBorderAttributes()
QCOMPARE(cellFormat.brushProperty(QTextFormat::TableCellRightBorderBrush), rightBorderBrush);
}
}
#endif
}
void tst_QTextTable::checkTableBorderAttributes_data()
@ -1317,6 +1319,7 @@ void tst_QTextTable::checkTableBorderAttributes()
QFETCH(QTextFrameFormat::BorderStyle, tableBorderStyle);
QFETCH(QBrush, tableBorderBrush);
#ifndef QT_NO_TEXTHTMLPARSER
QTextDocument doc;
doc.setHtml(html);
QTextCursor cursor(doc.firstBlock());
@ -1327,6 +1330,7 @@ void tst_QTextTable::checkTableBorderAttributes()
QCOMPARE(currentTable->format().border(), tableBorderWidth);
QCOMPARE(currentTable->format().borderStyle(), tableBorderStyle);
QCOMPARE(currentTable->format().borderBrush(), tableBorderBrush);
#endif
}
#ifndef QT_NO_WIDGETS
@ -1385,6 +1389,7 @@ void tst_QTextTable::columnWidthWithImage()
QFETCH(QString, rightHtml);
QFETCH(QSize, imageSize);
#ifndef QT_NO_TEXTHTMLPARSER
QTextDocument doc;
doc.setHtml(tableTemplate.arg(leftHtml).arg(rightHtml));
QTextEdit textEdit;
@ -1404,6 +1409,7 @@ void tst_QTextTable::columnWidthWithImage()
const QRectF rightRect = currentTable->document()->documentLayout()->blockBoundingRect(block);
QCOMPARE(leftRect.size().toSize(), imageSize);
QVERIFY(rightRect.left() > leftRect.right());
#endif
}
#endif

View File

@ -1,10 +1,16 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qdesktopservices)
if(QT_FEATURE_desktopservices)
add_subdirectory(qdesktopservices)
endif()
add_subdirectory(qdoublevalidator)
add_subdirectory(qintvalidator)
add_subdirectory(qregularexpressionvalidator)
add_subdirectory(qtexturefilereader)
add_subdirectory(qundogroup)
add_subdirectory(qundostack)
if(QT_FEATURE_undogroup)
add_subdirectory(qundogroup)
endif()
if(QT_FEATURE_undocommand)
add_subdirectory(qundostack)
endif()

View File

@ -2,16 +2,22 @@
# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qhttpheaders)
add_subdirectory(qnetworkdiskcache)
if(QT_FEATURE_networkdiskcache)
add_subdirectory(qnetworkdiskcache)
endif()
add_subdirectory(qnetworkcookiejar)
add_subdirectory(qnetworkaccessmanager)
add_subdirectory(qnetworkcookie)
add_subdirectory(qnetworkrequest)
add_subdirectory(qnetworkrequestfactory)
add_subdirectory(qnetworkreply)
if(QT_FEATURE_localserver)
add_subdirectory(qnetworkreply)
endif()
add_subdirectory(qnetworkcachemetadata)
add_subdirectory(qabstractnetworkcache)
add_subdirectory(qrestaccessmanager)
if(QT_FEATURE_http)
add_subdirectory(qnetworkrequestfactory)
add_subdirectory(qrestaccessmanager)
endif()
if(QT_FEATURE_private_tests)
add_subdirectory(qhttp2connection)
add_subdirectory(qhttpheaderparser)

View File

@ -50,6 +50,7 @@ private:
};
#if QT_CONFIG(networkdiskcache)
class NetworkDiskCache : public QNetworkDiskCache
{
Q_OBJECT
@ -72,6 +73,7 @@ public:
QTemporaryDir tempDir;
bool gotData;
};
#endif
tst_QAbstractNetworkCache::tst_QAbstractNetworkCache()
@ -254,10 +256,12 @@ void tst_QAbstractNetworkCache::runTest()
QFETCH(bool, fetchFromCache);
QNetworkAccessManager manager;
#if QT_CONFIG(networkdiskcache)
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QCOMPARE(diskCache->gotData, false);
#endif
QUrl realUrl = url.contains("://") ? url : TESTFILE + url;
QNetworkRequest request(realUrl);
@ -266,7 +270,9 @@ void tst_QAbstractNetworkCache::runTest()
QNetworkReply *reply = manager.get(request);
QSignalSpy downloaded1(reply, SIGNAL(finished()));
QTRY_COMPARE(downloaded1.size(), 1);
#if QT_CONFIG(networkdiskcache)
QCOMPARE(diskCache->gotData, false);
#endif
QByteArray goodData = reply->readAll();
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, cacheLoadControl);
@ -293,7 +299,9 @@ void tst_QAbstractNetworkCache::runTest()
std::sort(rawHeaderList.begin(), rawHeaderList.end());
std::sort(rawHeaderList2.begin(), rawHeaderList2.end());
}
#if QT_CONFIG(networkdiskcache)
QCOMPARE(diskCache->gotData, fetchFromCache);
#endif
}
void tst_QAbstractNetworkCache::checkSynchronous()
@ -305,10 +313,12 @@ void tst_QAbstractNetworkCache::checkSynchronous()
QFETCH(bool, fetchFromCache);
QNetworkAccessManager manager;
#if QT_CONFIG(networkdiskcache)
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QCOMPARE(diskCache->gotData, false);
#endif
QUrl realUrl = url.contains("://") ? url : TESTFILE + url;
QNetworkRequest request(realUrl);
@ -320,7 +330,9 @@ void tst_QAbstractNetworkCache::checkSynchronous()
// prime the cache
QNetworkReply *reply = manager.get(request);
QVERIFY(reply->isFinished()); // synchronous
#if QT_CONFIG(networkdiskcache)
QCOMPARE(diskCache->gotData, false);
#endif
QByteArray goodData = reply->readAll();
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, cacheLoadControl);
@ -348,15 +360,19 @@ void tst_QAbstractNetworkCache::checkSynchronous()
std::sort(rawHeaderList.begin(), rawHeaderList.end());
std::sort(rawHeaderList2.begin(), rawHeaderList2.end());
}
#if QT_CONFIG(networkdiskcache)
QCOMPARE(diskCache->gotData, fetchFromCache);
#endif
}
void tst_QAbstractNetworkCache::deleteCache()
{
QNetworkAccessManager manager;
#if QT_CONFIG(networkdiskcache)
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
#endif
QString url = "httpcachetest_cachecontrol.cgi?max-age=1000";
QNetworkRequest request(QUrl(TESTFILE + url));

View File

@ -3,7 +3,9 @@
#include "httptestserver_p.h"
#if QT_CONFIG(http)
#include <QtNetwork/qhttpmultipart.h>
#endif
#include <QtNetwork/qrestaccessmanager.h>
#include <QtNetwork/qauthenticator.h>
#include <QtNetwork/qnetworkreply.h>
@ -33,7 +35,9 @@ private slots:
void initialization();
void destruction();
void callbacks();
#if QT_CONFIG(http)
void requests();
#endif
void reply();
void errors();
void body();
@ -90,6 +94,7 @@ void tst_QRestAccessManager::reply()
networkReply = nullptr; \
}
#if QT_CONFIG(http)
void tst_QRestAccessManager::requests()
{
// A basic test for each HTTP method against the local testserver.
@ -268,6 +273,7 @@ void tst_QRestAccessManager::requests()
//manager.sendCustomRequest(request, this, [](){}); // No verb && no data
//manager.sendCustomRequest(request, "FOOBAR", this, [](){}); // No verb || no data
}
#endif
void tst_QRestAccessManager::memberHandler(QRestReply &reply)
{

View File

@ -6,12 +6,16 @@ if(QT_FEATURE_dnslookup AND (QT_FEATURE_libresolv OR WIN32))
add_subdirectory(qdnslookup_appless)
endif()
if(QT_FEATURE_networkinterface)
add_subdirectory(qnetworkaddressentry)
add_subdirectory(qnetworkproxyfactory)
add_subdirectory(qnetworkinterface)
endif()
add_subdirectory(qnetworkproxy)
add_subdirectory(qnetworkdatagram)
add_subdirectory(qnetworkaddressentry)
if(QT_FEATURE_networkproxy)
add_subdirectory(qnetworkproxy)
endif()
if(QT_FEATURE_udpsocket)
add_subdirectory(qnetworkdatagram)
endif()
add_subdirectory(qhostaddress)
if(QT_FEATURE_private_tests AND NOT MACOS AND NOT INTEGRITY)
add_subdirectory(qhostinfo)

View File

@ -7,11 +7,14 @@ if(QT_FEATURE_private_tests)
add_subdirectory(qsocks5socketengine)
add_subdirectory(platformsocketengine)
endif()
add_subdirectory(qudpsocket)
if(QT_FEATURE_udpsocket)
add_subdirectory(qudpsocket)
endif()
add_subdirectory(qabstractsocket)
if(NOT ANDROID)
if(QT_FEATURE_localserver AND NOT ANDROID)
# QTBUG-87387
add_subdirectory(qlocalsocket)
# QTBUG-87388
add_subdirectory(qtcpserver)
endif()

View File

@ -119,6 +119,13 @@ protected:
QFETCH(bool, UIntCast); \
QFETCH(bool, ULongLongCast);
#if QT_CONFIG(shortcut)
#define QMETATYPE_QKEYSEQUENCE \
QCOMPARE(val.canConvert(QMetaType(QMetaType::QKeySequence)), KeySequenceCast);
#else
#define QMETATYPE_QKEYSEQUENCE
#endif
#define TST_QVARIANT_CANCONVERT_COMPARE_DATA \
QCOMPARE(val.canConvert(QMetaType(QMetaType::QBitArray)), BitArrayCast); \
QCOMPARE(val.canConvert(QMetaType(QMetaType::QBitmap)), BitmapCast); \
@ -135,7 +142,7 @@ protected:
QCOMPARE(val.canConvert(QMetaType(QMetaType::QImage)), ImageCast); \
QCOMPARE(val.canConvert(QMetaType(QMetaType::Int)), IntCast); \
QCOMPARE(val.canConvert(QMetaType(QMetaType::UnknownType)), InvalidCast); \
QCOMPARE(val.canConvert(QMetaType(QMetaType::QKeySequence)), KeySequenceCast); \
QMETATYPE_QKEYSEQUENCE \
QCOMPARE(val.canConvert(QMetaType(QMetaType::QVariantList)), ListCast); \
QCOMPARE(val.canConvert(QMetaType(QMetaType::LongLong)), LongLongCast); \
QCOMPARE(val.canConvert(QMetaType(QMetaType::QVariantMap)), MapCast); \

View File

@ -450,10 +450,12 @@ void PaintCommands::staticInit()
"^drawGlyphRun\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$",
"drawGlyphRun <x> <y> <text> - Will create glyph run using QTextLayout and draw this",
"drawGlyphRun 10 10 \"my text\"");
#ifndef QT_NO_TEXTHTMLPARSER
DECL_PAINTCOMMAND("drawTextDocument", command_drawTextDocument,
"^drawTextDocument\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$",
"drawTextDocument <x> <y> <html>",
"drawTextDocument 10 10 \"html\"");
#endif
DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap,
"^drawTiledPixmap\\s+([\\w.:\\/]*)"
"\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)"
@ -1404,6 +1406,7 @@ void PaintCommands::command_drawGlyphRun(QRegularExpressionMatch re)
m_painter->drawGlyphRun(QPointF(x, y), glyphRun);
}
#ifndef QT_NO_TEXTHTMLPARSER
void PaintCommands::command_drawTextDocument(QRegularExpressionMatch re)
{
if (!m_shouldDrawText)
@ -1425,6 +1428,7 @@ void PaintCommands::command_drawTextDocument(QRegularExpressionMatch re)
doc.drawContents(m_painter);
m_painter->restore();
}
#endif
/***************************************************************************************************/
void PaintCommands::command_fillRect(QRegularExpressionMatch re)

View File

@ -179,7 +179,9 @@ private:
void command_drawText(QRegularExpressionMatch re);
void command_drawStaticText(QRegularExpressionMatch re);
void command_drawGlyphRun(QRegularExpressionMatch re);
#ifndef QT_NO_TEXTHTMLPARSER
void command_drawTextDocument(QRegularExpressionMatch re);
#endif
void command_drawTiledPixmap(QRegularExpressionMatch re);
void command_fillRect(QRegularExpressionMatch re);
void command_fillRectF(QRegularExpressionMatch re);

View File

@ -4,7 +4,9 @@
add_subdirectory(io)
add_subdirectory(itemmodels)
add_subdirectory(json)
add_subdirectory(mimetypes)
if(QT_FEATURE_mimetype)
add_subdirectory(mimetypes)
endif()
add_subdirectory(kernel)
add_subdirectory(text)
add_subdirectory(thread)

View File

@ -1 +1,4 @@
add_subdirectory(qsortfilterproxymodel)
if(QT_FEATURE_proxymodel)
add_subdirectory(qsortfilterproxymodel)
endif()

View File

@ -1,7 +1,9 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qfuture)
if(QT_FEATURE_future)
add_subdirectory(qfuture)
endif()
add_subdirectory(qmutex)
add_subdirectory(qreadwritelock)
add_subdirectory(qthreadstorage)

View File

@ -25,7 +25,9 @@ public:
private slots:
void loadHtml_data();
#ifndef QT_NO_TEXTHTMLPARSER
void loadHtml();
#endif
void shaping_data();
void shaping();
@ -47,9 +49,11 @@ private slots:
void paintLayoutToPixmap();
void paintLayoutToPixmap_painterFill();
#ifndef QT_NO_TEXTHTMLPARSER
void document();
void paintDocToPixmap();
void paintDocToPixmap_painterFill();
#endif
private:
QSize setupTextLayout(QTextLayout *layout, bool wrap = true, int wrapWidth = 100);
@ -76,6 +80,7 @@ void tst_QText::loadHtml_data()
+ parag;
}
#ifndef QT_NO_TEXTHTMLPARSER
void tst_QText::loadHtml()
{
QFETCH(QString, source);
@ -84,6 +89,7 @@ void tst_QText::loadHtml()
doc.setHtml(source);
}
}
#endif
void tst_QText::shaping_data()
{
@ -371,6 +377,7 @@ void tst_QText::paintLayoutToPixmap_painterFill()
}
}
#ifndef QT_NO_TEXTHTMLPARSER
void tst_QText::document()
{
QTextDocument *doc = new QTextDocument;
@ -413,6 +420,7 @@ void tst_QText::paintDocToPixmap_painterFill()
doc->drawContents(&p);
}
}
#endif
QTEST_MAIN(tst_QText)

View File

@ -4,8 +4,10 @@
add_subdirectory(qfile_vs_qnetworkaccessmanager)
add_subdirectory(qhttpheaders)
add_subdirectory(qnetworkreply)
add_subdirectory(qnetworkreply_from_cache)
add_subdirectory(qnetworkdiskcache)
if(QT_FEATURE_networkdiskcache)
add_subdirectory(qnetworkreply_from_cache)
add_subdirectory(qnetworkdiskcache)
endif()
if(QT_FEATURE_private_tests)
add_subdirectory(qdecompresshelper)
endif()

View File

@ -1,6 +1,8 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qlocalsocket)
add_subdirectory(qtcpserver)
add_subdirectory(qudpsocket)
if(QT_FEATURE_localserver)
add_subdirectory(qlocalsocket)
add_subdirectory(qtcpserver)
add_subdirectory(qudpsocket)
endif()