Use QList instead of QVector in gui tests
Task-number: QTBUG-84469 Change-Id: Ia86f39597de418dde6cd9ae3170ef919bd27416a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
8cd3ec4ee4
commit
d1612610e6
@ -986,7 +986,7 @@ void tst_QImage::convertToFormat()
|
||||
|
||||
void tst_QImage::convertToFormatWithColorTable()
|
||||
{
|
||||
QVector<QRgb> colors(2);
|
||||
QList<QRgb> colors(2);
|
||||
colors[0] = 0xFF000000;
|
||||
colors[1] = 0xFFFFFFFF;
|
||||
for (int format = QImage::Format_RGB32; format < QImage::Format_Alpha8; ++format) {
|
||||
@ -1129,7 +1129,7 @@ void tst_QImage::rotate_data()
|
||||
QTest::addColumn<QImage::Format>("format");
|
||||
QTest::addColumn<int>("degrees");
|
||||
|
||||
QVector<int> degrees;
|
||||
QList<int> degrees;
|
||||
degrees << 0 << 90 << 180 << 270;
|
||||
|
||||
foreach (int d, degrees) {
|
||||
@ -1481,7 +1481,7 @@ void tst_QImage::convertToFormatPreserveText()
|
||||
QCOMPARE(imgResult1.text(), result);
|
||||
QCOMPARE(imgResult1.textKeys(), listResult);
|
||||
|
||||
QVector<QRgb> colorTable(4);
|
||||
QList<QRgb> colorTable(4);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
colorTable[i] = QRgb(42);
|
||||
QImage imgResult2 = img.convertToFormat(QImage::Format_MonoLSB,
|
||||
@ -2187,7 +2187,7 @@ void tst_QImage::compareIndexed()
|
||||
{
|
||||
QImage img(256, 1, QImage::Format_Indexed8);
|
||||
|
||||
QVector<QRgb> colorTable(256);
|
||||
QList<QRgb> colorTable(256);
|
||||
for (int i = 0; i < 256; ++i)
|
||||
colorTable[i] = qRgb(i, i, i);
|
||||
img.setColorTable(colorTable);
|
||||
@ -2197,7 +2197,7 @@ void tst_QImage::compareIndexed()
|
||||
}
|
||||
|
||||
QImage imgInverted(256, 1, QImage::Format_Indexed8);
|
||||
QVector<QRgb> invertedColorTable(256);
|
||||
QList<QRgb> invertedColorTable(256);
|
||||
for (int i = 0; i < 256; ++i)
|
||||
invertedColorTable[255-i] = qRgb(i, i, i);
|
||||
imgInverted.setColorTable(invertedColorTable);
|
||||
@ -2290,7 +2290,7 @@ void tst_QImage::fillColor()
|
||||
QImage image(1, 1, format);
|
||||
|
||||
if (image.depth() == 8) {
|
||||
QVector<QRgb> table;
|
||||
QList<QRgb> table;
|
||||
table << 0xff000000;
|
||||
table << 0xffffffff;
|
||||
table << 0xffff0000;
|
||||
@ -2401,7 +2401,7 @@ void tst_QImage::rgbSwapped()
|
||||
QImage image(100, 1, format);
|
||||
image.fill(0);
|
||||
|
||||
QVector<QColor> testColor(image.width());
|
||||
QList<QColor> testColor(image.width());
|
||||
|
||||
for (int i = 0; i < image.width(); ++i)
|
||||
testColor[i] = QColor(i, 10 + i, 20 + i * 2, 30 + i);
|
||||
@ -2569,7 +2569,7 @@ void tst_QImage::inplaceRgbSwapped()
|
||||
QImage image(64, 1, format);
|
||||
image.fill(0);
|
||||
|
||||
QVector<QRgb> testColor(image.width());
|
||||
QList<QRgb> testColor(image.width());
|
||||
for (int i = 0; i < image.width(); ++i)
|
||||
testColor[i] = qRgb(i * 2, i * 3, 255 - i * 4);
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
typedef QMap<QString, QString> QStringMap;
|
||||
typedef QVector<int> QIntList;
|
||||
typedef QList<int> QIntList;
|
||||
Q_DECLARE_METATYPE(QImageWriter::ImageWriterError)
|
||||
Q_DECLARE_METATYPE(QImage::Format)
|
||||
|
||||
|
@ -138,10 +138,10 @@ private slots:
|
||||
private:
|
||||
QStandardItemModel *m_model = nullptr;
|
||||
QPersistentModelIndex persistent;
|
||||
QVector<QModelIndex> rcParent = QVector<QModelIndex>(8);
|
||||
QVector<int> rcFirst = QVector<int>(8, 0);
|
||||
QVector<int> rcLast = QVector<int>(8, 0);
|
||||
QVector<int> currentRoles;
|
||||
QList<QModelIndex> rcParent = QList<QModelIndex>(8);
|
||||
QList<int> rcFirst = QList<int>(8, 0);
|
||||
QList<int> rcLast = QList<int>(8, 0);
|
||||
QList<int> currentRoles;
|
||||
|
||||
//return true if models have the same structure, and all child have the same text
|
||||
static bool compareModels(QStandardItemModel *model1, QStandardItemModel *model2);
|
||||
@ -193,9 +193,8 @@ void tst_QStandardItemModel::init()
|
||||
connect(m_model, &QStandardItemModel::columnsRemoved,
|
||||
this, &tst_QStandardItemModel::columnsRemoved);
|
||||
|
||||
connect(m_model, &QAbstractItemModel::dataChanged,
|
||||
this, [this](const QModelIndex &, const QModelIndex &, const QVector<int> &roles)
|
||||
{
|
||||
connect(m_model, &QAbstractItemModel::dataChanged, this,
|
||||
[this](const QModelIndex &, const QModelIndex &, const QList<int> &roles) {
|
||||
currentRoles = roles;
|
||||
});
|
||||
|
||||
@ -723,17 +722,17 @@ void tst_QStandardItemModel::data()
|
||||
currentRoles.clear();
|
||||
// bad args
|
||||
m_model->setData(QModelIndex(), "bla", Qt::DisplayRole);
|
||||
QCOMPARE(currentRoles, QVector<int>{});
|
||||
QCOMPARE(currentRoles, QList<int> {});
|
||||
|
||||
QIcon icon;
|
||||
for (int r = 0; r < m_model->rowCount(); ++r) {
|
||||
for (int c = 0; c < m_model->columnCount(); ++c) {
|
||||
m_model->setData(m_model->index(r,c), "initialitem", Qt::DisplayRole);
|
||||
QCOMPARE(currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole}));
|
||||
QCOMPARE(currentRoles, QList<int>({ Qt::DisplayRole, Qt::EditRole }));
|
||||
m_model->setData(m_model->index(r,c), "tooltip", Qt::ToolTipRole);
|
||||
QCOMPARE(currentRoles, QVector<int>{Qt::ToolTipRole});
|
||||
QCOMPARE(currentRoles, QList<int> { Qt::ToolTipRole });
|
||||
m_model->setData(m_model->index(r,c), icon, Qt::DecorationRole);
|
||||
QCOMPARE(currentRoles, QVector<int>{Qt::DecorationRole});
|
||||
QCOMPARE(currentRoles, QList<int> { Qt::DecorationRole });
|
||||
}
|
||||
}
|
||||
|
||||
@ -750,7 +749,7 @@ void tst_QStandardItemModel::clearItemData()
|
||||
{
|
||||
currentRoles.clear();
|
||||
QVERIFY(!m_model->clearItemData(QModelIndex()));
|
||||
QCOMPARE(currentRoles, QVector<int>{});
|
||||
QCOMPARE(currentRoles, QList<int> {});
|
||||
const QModelIndex idx = m_model->index(0, 0);
|
||||
const QMap<int, QVariant> oldData = m_model->itemData(idx);
|
||||
m_model->setData(idx, QLatin1String("initialitem"), Qt::DisplayRole);
|
||||
@ -762,7 +761,7 @@ void tst_QStandardItemModel::clearItemData()
|
||||
QCOMPARE(idx.data(Qt::ToolTipRole), QVariant());
|
||||
QCOMPARE(idx.data(Qt::DisplayRole), QVariant());
|
||||
QCOMPARE(idx.data(Qt::EditRole), QVariant());
|
||||
QCOMPARE(currentRoles, QVector<int>{});
|
||||
QCOMPARE(currentRoles, QList<int> {});
|
||||
m_model->setItemData(idx, oldData);
|
||||
currentRoles.clear();
|
||||
}
|
||||
@ -1561,8 +1560,8 @@ void tst_QStandardItemModel::removeRowsAndColumns()
|
||||
for (int r = 0; r < row_list.count(); r++) \
|
||||
QCOMPARE(model.item(r,c)->text() , row_list[r] + QLatin1Char('x') + col_list[c]);
|
||||
|
||||
QVector<QString> row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',').toVector();
|
||||
QVector<QString> col_list = row_list;
|
||||
QStringList row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',');
|
||||
QStringList col_list = row_list;
|
||||
QStandardItemModel model;
|
||||
for (int c = 0; c < col_list.count(); c++)
|
||||
for (int r = 0; r < row_list.count(); r++)
|
||||
@ -1608,8 +1607,8 @@ void tst_QStandardItemModel::defaultItemRoles()
|
||||
|
||||
void tst_QStandardItemModel::itemRoleNames()
|
||||
{
|
||||
QVector<QString> row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',').toVector();
|
||||
QVector<QString> col_list = row_list;
|
||||
QStringList row_list = QString("1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20").split(',');
|
||||
QStringList col_list = row_list;
|
||||
QStandardItemModel model;
|
||||
for (int c = 0; c < col_list.count(); c++)
|
||||
for (int r = 0; r < row_list.count(); r++)
|
||||
|
@ -52,7 +52,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
QVector<QKeyEvent*> keyEvents;
|
||||
QList<QKeyEvent *> keyEvents;
|
||||
};
|
||||
|
||||
class tst_QKeyEvent : public QObject
|
||||
@ -98,7 +98,7 @@ void tst_QKeyEvent::basicEventDelivery()
|
||||
}
|
||||
}
|
||||
|
||||
static bool orderByModifier(const QVector<int> &v1, const QVector<int> &v2)
|
||||
static bool orderByModifier(const QList<int> &v1, const QList<int> &v2)
|
||||
{
|
||||
if (v1.size() != v2.size())
|
||||
return v1.size() < v2.size();
|
||||
@ -146,12 +146,12 @@ void tst_QKeyEvent::modifiers_data()
|
||||
{ Qt::Key_Meta, Qt::MetaModifier },
|
||||
};
|
||||
|
||||
QVector<QVector<int>> modifierCombinations;
|
||||
QList<QList<int>> modifierCombinations;
|
||||
|
||||
// Generate powerset (minus the empty set) of possible modifier combinations
|
||||
static const int kNumModifiers = sizeof(modifiers) / sizeof(Modifier);
|
||||
for (quint64 bitmask = 1; bitmask < (1 << kNumModifiers) ; ++bitmask) {
|
||||
QVector<int> modifierCombination;
|
||||
QList<int> modifierCombination;
|
||||
for (quint64 modifier = 0; modifier < kNumModifiers; ++modifier) {
|
||||
if (bitmask & (quint64(1) << modifier))
|
||||
modifierCombination.append(modifier);
|
||||
@ -162,7 +162,7 @@ void tst_QKeyEvent::modifiers_data()
|
||||
std::sort(modifierCombinations.begin(), modifierCombinations.end(), orderByModifier);
|
||||
|
||||
QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
|
||||
foreach (const QVector<int> combination, modifierCombinations) {
|
||||
foreach (const QList<int> combination, modifierCombinations) {
|
||||
int keys[4] = {};
|
||||
Qt::KeyboardModifiers mods;
|
||||
for (int i = 0; i < combination.size(); ++i) {
|
||||
|
@ -56,8 +56,8 @@ void tst_QPixelFormat::testOperators()
|
||||
|
||||
void tst_QPixelFormat::testQVectorOfFormats()
|
||||
{
|
||||
QVector<QPixelFormat> reallocedVector;
|
||||
QVector<QPixelFormat> reservedVector;
|
||||
QList<QPixelFormat> reallocedVector;
|
||||
QList<QPixelFormat> reservedVector;
|
||||
reservedVector.reserve(QImage::NImageFormats);
|
||||
for (int i = 0; i < QImage::NImageFormats; i++) {
|
||||
if (i == 0 || i == 2) // skip invalid and monolsb
|
||||
|
@ -625,7 +625,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
|
||||
rawTouchPoint.setState(Qt::TouchPointPressed);
|
||||
rawTouchPoint.setScreenPos(screenPos);
|
||||
rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.position(), screenGeometry));
|
||||
QVector<QPointF> rawPosList;
|
||||
QList<QPointF> rawPosList;
|
||||
rawPosList << QPointF(12, 34) << QPointF(56, 78);
|
||||
rawTouchPoint.setRawScreenPositions(rawPosList);
|
||||
const ulong timestamp = 1234;
|
||||
@ -977,7 +977,7 @@ void tst_QTouchEvent::touchOnMultipleTouchscreens()
|
||||
QPointF delta(10, 10);
|
||||
QRectF screenGeometry = touchWidget.screen()->geometry();
|
||||
|
||||
QVector<QTouchEvent::TouchPoint> rawTouchPoints(3);
|
||||
QList<QTouchEvent::TouchPoint> rawTouchPoints(3);
|
||||
rawTouchPoints[0].setId(1);
|
||||
rawTouchPoints[1].setId(10);
|
||||
rawTouchPoints[2].setId(11);
|
||||
@ -1361,7 +1361,7 @@ void tst_QTouchEvent::basicRawEventTranslationOfIds()
|
||||
QPointF delta(10, 10);
|
||||
QRectF screenGeometry = touchWidget.screen()->geometry();
|
||||
|
||||
QVector<QPointF> rawPosList;
|
||||
QList<QPointF> rawPosList;
|
||||
rawPosList << QPointF(12, 34) << QPointF(56, 78);
|
||||
|
||||
QList<QTouchEvent::TouchPoint> rawTouchPoints;
|
||||
|
@ -343,12 +343,12 @@ public:
|
||||
return m_surfaceventType;
|
||||
}
|
||||
|
||||
QVector<QPoint> m_framePositionsOnMove;
|
||||
QList<QPoint> m_framePositionsOnMove;
|
||||
Qt::WindowStates lastReceivedWindowState;
|
||||
|
||||
private:
|
||||
QHash<QEvent::Type, int> m_received;
|
||||
QVector<QEvent::Type> m_order;
|
||||
QList<QEvent::Type> m_order;
|
||||
QRegion m_exposeRegion;
|
||||
QPlatformSurfaceEvent::SurfaceEventType m_surfaceventType;
|
||||
};
|
||||
|
@ -1764,7 +1764,7 @@ void tst_QPainter::setEqualClipRegionAndPath_data()
|
||||
QTest::newRow("simple rect") << QSize(100, 100)
|
||||
<< QRegion(QRect(5, 5, 10, 10));
|
||||
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
QRegion region;
|
||||
|
||||
rects << QRect(5, 5, 10, 10) << QRect(20, 20, 10, 10);
|
||||
@ -2065,7 +2065,7 @@ void tst_QPainter::clippedLines_data()
|
||||
QPen pen2(QColor(223, 223, 0, 223));
|
||||
pen2.setWidth(2);
|
||||
|
||||
QVector<QLineF> lines;
|
||||
QList<QLineF> lines;
|
||||
lines << QLineF(15, 15, 65, 65)
|
||||
<< QLineF(14, 14, 66, 66)
|
||||
<< QLineF(16, 16, 64, 64)
|
||||
@ -3239,7 +3239,7 @@ bool verifyOutlineFillConsistency(const QImage &img, QRgb outside, QRgb inside,
|
||||
QQueue<QPoint> discovered;
|
||||
discovered.enqueue(QPoint(x, y));
|
||||
|
||||
QVector<bool> visited(img.width() * img.height());
|
||||
QList<bool> visited(img.width() * img.height());
|
||||
visited.fill(false);
|
||||
|
||||
while (!discovered.isEmpty()) {
|
||||
@ -4023,7 +4023,7 @@ void tst_QPainter::inactivePainter()
|
||||
QPainter p;
|
||||
QPainterPath path;
|
||||
QRegion region(QRect(20, 20, 60, 40));
|
||||
QPolygonF polygon(QVector<QPointF>() << QPointF(0, 0) << QPointF(12, 0) << QPointF(8, 6));
|
||||
QPolygonF polygon(QList<QPointF>() << QPointF(0, 0) << QPointF(12, 0) << QPointF(8, 6));
|
||||
path.addPolygon(polygon);
|
||||
|
||||
p.save();
|
||||
@ -4666,7 +4666,7 @@ void tst_QPainter::QTBUG17053_zeroDashPattern()
|
||||
|
||||
QImage original = image;
|
||||
|
||||
QVector<qreal> pattern;
|
||||
QList<qreal> pattern;
|
||||
pattern << qreal(0) << qreal(0);
|
||||
|
||||
QPainter p(&image);
|
||||
@ -4788,7 +4788,7 @@ void tst_QPainter::QTBUG25153_drawLine()
|
||||
{
|
||||
QImage image(2, 2, QImage::Format_RGB32);
|
||||
|
||||
QVector<Qt::PenCapStyle> styles;
|
||||
QList<Qt::PenCapStyle> styles;
|
||||
styles << Qt::FlatCap << Qt::SquareCap << Qt::RoundCap;
|
||||
|
||||
foreach (Qt::PenCapStyle style, styles) {
|
||||
@ -5045,17 +5045,23 @@ void tst_QPainter::drawTextNoHinting()
|
||||
|
||||
void tst_QPainter::drawPolyline_data()
|
||||
{
|
||||
QTest::addColumn< QVector<QPointF> >("points");
|
||||
QTest::addColumn<QList<QPointF>>("points");
|
||||
|
||||
QTest::newRow("basic") << (QVector<QPointF>() << QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20));
|
||||
QTest::newRow("clipped") << (QVector<QPointF>() << QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2) << QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579
|
||||
QTest::newRow("shortsegment") << (QVector<QPointF>() << QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99) << QPoint(21, 104)); // QTBUG-42398
|
||||
QTest::newRow("edge") << (QVector<QPointF>() << QPointF(4.5, 121.6) << QPointF(9.4, 150.9) << QPointF(14.2, 184.8) << QPointF(19.1, 130.4));
|
||||
QTest::newRow("basic") << (QList<QPointF>()
|
||||
<< QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20));
|
||||
QTest::newRow("clipped") << (QList<QPointF>()
|
||||
<< QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2)
|
||||
<< QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579
|
||||
QTest::newRow("shortsegment") << (QList<QPointF>()
|
||||
<< QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99)
|
||||
<< QPoint(21, 104)); // QTBUG-42398
|
||||
QTest::newRow("edge") << (QList<QPointF>() << QPointF(4.5, 121.6) << QPointF(9.4, 150.9)
|
||||
<< QPointF(14.2, 184.8) << QPointF(19.1, 130.4));
|
||||
}
|
||||
|
||||
void tst_QPainter::drawPolyline()
|
||||
{
|
||||
QFETCH(QVector<QPointF>, points);
|
||||
QFETCH(QList<QPointF>, points);
|
||||
QImage images[2];
|
||||
|
||||
for (int r = 0; r < 2; r++) {
|
||||
|
@ -1345,7 +1345,7 @@ void tst_QPainterPath::translate()
|
||||
shape -= QRect(225, 175, 50, 50);
|
||||
QPainterPath complexPath;
|
||||
complexPath.addRegion(shape);
|
||||
QVector<QPointF> untranslatedElements;
|
||||
QList<QPointF> untranslatedElements;
|
||||
for (int i = 0; i < complexPath.elementCount(); ++i)
|
||||
untranslatedElements.append(QPointF(complexPath.elementAt(i)));
|
||||
|
||||
|
@ -154,8 +154,9 @@ void tst_QPolygon::makeEllipse()
|
||||
|
||||
void tst_QPolygon::swap()
|
||||
{
|
||||
QPolygon p1(QVector<QPoint>() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10));
|
||||
QPolygon p2(QVector<QPoint>() << QPoint(0,0) << QPoint( 0,10) << QPoint( 10,10) << QPoint(10,0));
|
||||
QPolygon p1(QList<QPoint>() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10));
|
||||
QPolygon p2(QList<QPoint>() << QPoint(0, 0) << QPoint(0, 10) << QPoint(10, 10)
|
||||
<< QPoint(10, 0));
|
||||
p1.swap(p2);
|
||||
QCOMPARE(p1.count(),4);
|
||||
QCOMPARE(p2.count(),3);
|
||||
@ -169,23 +170,27 @@ void tst_QPolygon::intersections_data()
|
||||
|
||||
QTest::newRow("empty intersects nothing")
|
||||
<< QPolygon()
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10))
|
||||
<< QPolygon(QList<QPoint>() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10))
|
||||
<< false;
|
||||
QTest::newRow("identical triangles")
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10))
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10))
|
||||
<< QPolygon(QList<QPoint>() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10))
|
||||
<< QPolygon(QList<QPoint>() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10))
|
||||
<< true;
|
||||
QTest::newRow("not intersecting")
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(0,0) << QPoint(10,10) << QPoint(-10,10))
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(0,20) << QPoint(10,12) << QPoint(-10,12))
|
||||
<< QPolygon(QList<QPoint>() << QPoint(0, 0) << QPoint(10, 10) << QPoint(-10, 10))
|
||||
<< QPolygon(QList<QPoint>() << QPoint(0, 20) << QPoint(10, 12) << QPoint(-10, 12))
|
||||
<< false;
|
||||
QTest::newRow("clean intersection of squares")
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(0,0) << QPoint(0,10) << QPoint(10,10) << QPoint(10,0))
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(5,5) << QPoint(5,15) << QPoint(15,15) << QPoint(15,5))
|
||||
<< QPolygon(QList<QPoint>()
|
||||
<< QPoint(0, 0) << QPoint(0, 10) << QPoint(10, 10) << QPoint(10, 0))
|
||||
<< QPolygon(QList<QPoint>()
|
||||
<< QPoint(5, 5) << QPoint(5, 15) << QPoint(15, 15) << QPoint(15, 5))
|
||||
<< true;
|
||||
QTest::newRow("clean contains of squares")
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(0,0) << QPoint(0,10) << QPoint(10,10) << QPoint(10,0))
|
||||
<< QPolygon(QVector<QPoint>() << QPoint(5,5) << QPoint(5,8) << QPoint(8,8) << QPoint(8,5))
|
||||
<< QPolygon(QList<QPoint>()
|
||||
<< QPoint(0, 0) << QPoint(0, 10) << QPoint(10, 10) << QPoint(10, 0))
|
||||
<< QPolygon(QList<QPoint>()
|
||||
<< QPoint(5, 5) << QPoint(5, 8) << QPoint(8, 8) << QPoint(8, 5))
|
||||
<< true;
|
||||
}
|
||||
|
||||
|
@ -298,25 +298,24 @@ void tst_QRegion::emptyPolygonRegion_data()
|
||||
QTest::addColumn<QPolygon>("pa");
|
||||
QTest::addColumn<bool>("isEmpty");
|
||||
QTest::addColumn<int>("numRects");
|
||||
QTest::addColumn<QVector<QRect> >("rects");
|
||||
QTest::addColumn<QList<QRect>>("rects");
|
||||
|
||||
QPolygon pa;
|
||||
|
||||
|
||||
QTest::newRow("no points") << pa << true << 0 << QVector<QRect>();
|
||||
QTest::newRow("no points") << pa << true << 0 << QList<QRect>();
|
||||
pa = QPolygon() << QPoint(10,10);
|
||||
QTest::newRow("one point") << pa << true << 0 << QVector<QRect>();
|
||||
QTest::newRow("one point") << pa << true << 0 << QList<QRect>();
|
||||
pa = QPolygon() << QPoint(10,10) << QPoint(10,20);
|
||||
QTest::newRow("two points, horizontal") << pa << true << 0 << QVector<QRect>();
|
||||
QTest::newRow("two points, horizontal") << pa << true << 0 << QList<QRect>();
|
||||
|
||||
pa = QPolygon() << QPoint(10,10) << QPoint(20,10);
|
||||
QTest::newRow("two points, vertical") << pa << true << 0 << QVector<QRect>();
|
||||
QTest::newRow("two points, vertical") << pa << true << 0 << QList<QRect>();
|
||||
|
||||
pa = QPolygon() << QPoint(10,10) << QPoint(20,20);
|
||||
QTest::newRow("two points, diagonal") << pa << true << 0 << QVector<QRect>();
|
||||
QTest::newRow("two points, diagonal") << pa << true << 0 << QList<QRect>();
|
||||
|
||||
pa = QPolygon() << QPoint(10,10) << QPoint(15,15) << QPoint(10,15) << QPoint(10, 10) ;
|
||||
QVector<QRect> v;
|
||||
QList<QRect> v;
|
||||
v << QRect(10,11,1, 1) << QRect(10,12,2,1) << QRect(10,13,3,1) << QRect(10,14,4,1);
|
||||
QTest::newRow("triangle") << pa << false << 4 << v;
|
||||
|
||||
@ -334,7 +333,7 @@ void tst_QRegion::emptyPolygonRegion()
|
||||
QRegion r(pa);
|
||||
QTEST(r.isEmpty(), "isEmpty");
|
||||
QTEST(int(std::distance(r.begin(), r.end())), "numRects");
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
std::copy(r.begin(), r.end(), std::back_inserter(rects));
|
||||
QTEST(rects.size(), "numRects");
|
||||
QTEST(rects, "rects");
|
||||
@ -504,7 +503,7 @@ void tst_QRegion::operator_plus_data()
|
||||
<< QRegion(QRect(10, 10, 10, 10));
|
||||
|
||||
QRegion expected;
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10);
|
||||
expected.setRects(rects.constData(), rects.size());
|
||||
QTest::newRow("non overlapping") << QRegion(10, 10, 10, 10)
|
||||
@ -650,7 +649,7 @@ void tst_QRegion::operator_minus_data()
|
||||
<< QRegion(QRect(10, 10, 10, 10));
|
||||
|
||||
QRegion dest;
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10);
|
||||
dest.setRects(rects.constData(), rects.size());
|
||||
QTest::newRow("simple 1") << dest
|
||||
@ -705,7 +704,7 @@ void tst_QRegion::operator_intersect_data()
|
||||
<< QRegion();
|
||||
|
||||
QRegion dest;
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10);
|
||||
dest.setRects(rects.constData(), rects.size());
|
||||
QTest::newRow("simple 1") << dest
|
||||
@ -787,7 +786,7 @@ void tst_QRegion::operator_xor_data()
|
||||
<< QRegion(QRect(10, 10, 10, 10));
|
||||
|
||||
QRegion dest;
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10);
|
||||
dest.setRects(rects.constData(), rects.size());
|
||||
QTest::newRow("simple 1") << dest
|
||||
@ -838,7 +837,7 @@ void tst_QRegion::rectCount_data()
|
||||
QTest::newRow("rect") << QRegion(10, 10, 10, 10) << 1;
|
||||
|
||||
QRegion dest;
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
rects << QRect(10, 10, 10, 10) << QRect(22, 10, 10, 10);
|
||||
dest.setRects(rects.constData(), rects.size());
|
||||
|
||||
@ -859,7 +858,7 @@ void tst_QRegion::isEmpty_data()
|
||||
|
||||
QTest::newRow("QRegion") << QRegion();
|
||||
|
||||
QVector<QRect> rects;
|
||||
QList<QRect> rects;
|
||||
rects << QRect(0, 0, 10, 10) << QRect(15, 0, 10, 10);
|
||||
QRegion r1;
|
||||
r1.setRects(rects.constData(), rects.size());
|
||||
@ -918,40 +917,38 @@ void tst_QRegion::regionFromPath()
|
||||
void tst_QRegion::scaleRegions_data()
|
||||
{
|
||||
QTest::addColumn<qreal>("scale");
|
||||
QTest::addColumn<QVector<QRect>>("inputRects");
|
||||
QTest::addColumn<QVector<QRect>>("expectedRects");
|
||||
QTest::addColumn<QList<QRect>>("inputRects");
|
||||
QTest::addColumn<QList<QRect>>("expectedRects");
|
||||
|
||||
QTest::newRow("1.0 single") << 1.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20) };
|
||||
QTest::newRow("1.0 single") << 1.0 << QList<QRect> { QRect(10, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(10, 10, 20, 20) };
|
||||
QTest::newRow("1.0 multi") << 1.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) };
|
||||
QTest::newRow("2.0 single") << 2.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(20, 20, 40, 40) };
|
||||
<< QList<QRect> { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) };
|
||||
QTest::newRow("2.0 single") << 2.0 << QList<QRect> { QRect(10, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(20, 20, 40, 40) };
|
||||
QTest::newRow("2.0 multi") << 2.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(20, 20, 40, 40), QRect(80, 20, 40, 40) };
|
||||
QTest::newRow("-1.0 single") << -1.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(-30, -30, 20, 20) };
|
||||
<< QList<QRect> { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(20, 20, 40, 40), QRect(80, 20, 40, 40) };
|
||||
QTest::newRow("-1.0 single") << -1.0 << QList<QRect> { QRect(10, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(-30, -30, 20, 20) };
|
||||
QTest::newRow("-1.0 multi") << -1.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(-60, -30, 20, 20), QRect(-30, -30, 20, 20) };
|
||||
QTest::newRow("-2.0 single") << -2.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(-60, -60, 40, 40) };
|
||||
<< QList<QRect> { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(-60, -30, 20, 20),
|
||||
QRect(-30, -30, 20, 20) };
|
||||
QTest::newRow("-2.0 single") << -2.0 << QList<QRect> { QRect(10, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(-60, -60, 40, 40) };
|
||||
QTest::newRow("-2.0 multi") << -2.0
|
||||
<< QVector<QRect>{ QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QVector<QRect>{ QRect(-120, -60, 40, 40), QRect(-60, -60, 40, 40) };
|
||||
<< QList<QRect> { QRect(10, 10, 20, 20), QRect(40, 10, 20, 20) }
|
||||
<< QList<QRect> { QRect(-120, -60, 40, 40),
|
||||
QRect(-60, -60, 40, 40) };
|
||||
}
|
||||
|
||||
void tst_QRegion::scaleRegions()
|
||||
{
|
||||
QFETCH(qreal, scale);
|
||||
QFETCH(QVector<QRect>, inputRects);
|
||||
QFETCH(QVector<QRect>, expectedRects);
|
||||
QFETCH(QList<QRect>, inputRects);
|
||||
QFETCH(QList<QRect>, expectedRects);
|
||||
|
||||
QRegion region;
|
||||
region.setRects(inputRects.constData(), inputRects.size());
|
||||
|
@ -834,7 +834,7 @@ void tst_QOpenGL::fboMRT()
|
||||
|
||||
{
|
||||
// 3 color attachments, different sizes, same internal format, no depth/stencil.
|
||||
QVector<QSize> sizes;
|
||||
QList<QSize> sizes;
|
||||
sizes << QSize(128, 128) << QSize(192, 128) << QSize(432, 123);
|
||||
QOpenGLFramebufferObject fbo(sizes[0]);
|
||||
fbo.addColorAttachment(sizes[1]);
|
||||
@ -882,7 +882,7 @@ void tst_QOpenGL::fboMRT()
|
||||
|
||||
{
|
||||
// 2 color attachments, same size, same internal format, depth/stencil.
|
||||
QVector<QSize> sizes;
|
||||
QList<QSize> sizes;
|
||||
sizes.fill(QSize(128, 128), 2);
|
||||
QOpenGLFramebufferObject fbo(sizes[0], QOpenGLFramebufferObject::CombinedDepthStencil);
|
||||
fbo.addColorAttachment(sizes[1]);
|
||||
@ -922,11 +922,11 @@ void tst_QOpenGL::fboMRT_differentFormats()
|
||||
QSKIP("RGB10_A2 not supported on this platform");
|
||||
|
||||
// 3 color attachments, same size, different internal format, depth/stencil.
|
||||
QVector<QSize> sizes;
|
||||
QList<QSize> sizes;
|
||||
sizes.fill(QSize(128, 128), 3);
|
||||
QOpenGLFramebufferObjectFormat format;
|
||||
format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
|
||||
QVector<GLenum> internalFormats;
|
||||
QList<GLenum> internalFormats;
|
||||
internalFormats << GL_RGBA8 << GL_RGB10_A2 << GL_RGB5_A1;
|
||||
format.setInternalTextureFormat(internalFormats[0]);
|
||||
QOpenGLFramebufferObject fbo(sizes[0], format);
|
||||
|
@ -249,7 +249,7 @@ void tst_QOpenGlConfig::testBugList()
|
||||
expectedFeatures << "feature1";
|
||||
|
||||
// adapter info
|
||||
QVersionNumber driverVersion(QVector<int>() << 9 << 18 << 13 << 4460);
|
||||
QVersionNumber driverVersion(QList<int>() << 9 << 18 << 13 << 4460);
|
||||
QOpenGLConfig::Gpu gpu = QOpenGLConfig::Gpu::fromDevice(0x10DE, 0x0DE9, driverVersion, QByteArrayLiteral("Unknown"));
|
||||
|
||||
QSet<QString> actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"),
|
||||
|
@ -197,7 +197,7 @@ void tst_QVulkan::vulkanWindow()
|
||||
w.hide();
|
||||
waitForUnexposed(&w);
|
||||
w.setVulkanInstance(&inst);
|
||||
QVector<VkPhysicalDeviceProperties> pdevs = w.availablePhysicalDevices();
|
||||
QList<VkPhysicalDeviceProperties> pdevs = w.availablePhysicalDevices();
|
||||
if (pdevs.isEmpty())
|
||||
QSKIP("No Vulkan physical devices; skip");
|
||||
w.show();
|
||||
|
@ -266,7 +266,7 @@ void tst_QShader::mslResourceMapping()
|
||||
QVERIFY(s.isValid());
|
||||
QCOMPARE(QShaderPrivate::get(&s)->qsbVersion, 2);
|
||||
|
||||
const QVector<QShaderKey> availableShaders = s.availableShaders();
|
||||
const QList<QShaderKey> availableShaders = s.availableShaders();
|
||||
QCOMPARE(availableShaders.count(), 7);
|
||||
QVERIFY(availableShaders.contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
|
||||
QVERIFY(availableShaders.contains(QShaderKey(QShader::MslShader, QShaderVersion(12))));
|
||||
@ -298,7 +298,7 @@ void tst_QShader::loadV3()
|
||||
QVERIFY(s.isValid());
|
||||
QCOMPARE(QShaderPrivate::get(&s)->qsbVersion, 3);
|
||||
|
||||
const QVector<QShaderKey> availableShaders = s.availableShaders();
|
||||
const QList<QShaderKey> availableShaders = s.availableShaders();
|
||||
QCOMPARE(availableShaders.count(), 7);
|
||||
QVERIFY(availableShaders.contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
|
||||
QVERIFY(availableShaders.contains(QShaderKey(QShader::MslShader, QShaderVersion(12))));
|
||||
@ -461,7 +461,7 @@ void tst_QShader::loadV4()
|
||||
QVERIFY(s.isValid());
|
||||
QCOMPARE(QShaderPrivate::get(&s)->qsbVersion, 4);
|
||||
|
||||
const QVector<QShaderKey> availableShaders = s.availableShaders();
|
||||
const QList<QShaderKey> availableShaders = s.availableShaders();
|
||||
QCOMPARE(availableShaders.count(), 7);
|
||||
QVERIFY(availableShaders.contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
|
||||
QVERIFY(availableShaders.contains(QShaderKey(QShader::MslShader, QShaderVersion(12))));
|
||||
|
@ -148,7 +148,7 @@ static const char *tokenName(QCss::TokenType t)
|
||||
return "";
|
||||
}
|
||||
|
||||
static void debug(const QVector<QCss::Symbol> &symbols, int index = -1)
|
||||
static void debug(const QList<QCss::Symbol> &symbols, int index = -1)
|
||||
{
|
||||
qDebug() << "all symbols:";
|
||||
for (int i = 0; i < symbols.count(); ++i)
|
||||
@ -166,7 +166,7 @@ void tst_QCssParser::scanner()
|
||||
|
||||
QFile inputFile(input);
|
||||
QVERIFY(inputFile.open(QIODevice::ReadOnly|QIODevice::Text));
|
||||
QVector<QCss::Symbol> symbols;
|
||||
QList<QCss::Symbol> symbols;
|
||||
QCss::Scanner::scan(QCss::Scanner::preprocess(QString::fromUtf8(inputFile.readAll())), &symbols);
|
||||
|
||||
QVERIFY(symbols.count() > 1);
|
||||
@ -343,9 +343,9 @@ void tst_QCssParser::expr_data()
|
||||
{
|
||||
QTest::addColumn<bool>("parseSuccess");
|
||||
QTest::addColumn<QString>("css");
|
||||
QTest::addColumn<QVector<QCss::Value> >("expectedValues");
|
||||
QTest::addColumn<QList<QCss::Value>>("expectedValues");
|
||||
|
||||
QVector<QCss::Value> values;
|
||||
QList<QCss::Value> values;
|
||||
QCss::Value val;
|
||||
|
||||
QCss::Value comma;
|
||||
@ -368,10 +368,10 @@ void tst_QCssParser::expr()
|
||||
{
|
||||
QFETCH(bool, parseSuccess);
|
||||
QFETCH(QString, css);
|
||||
QFETCH(QVector<QCss::Value>, expectedValues);
|
||||
QFETCH(QList<QCss::Value>, expectedValues);
|
||||
|
||||
QCss::Parser parser(css);
|
||||
QVector<QCss::Value> values;
|
||||
QList<QCss::Value> values;
|
||||
QVERIFY(parser.testExpr());
|
||||
QCOMPARE(parser.parseExpr(&values), parseSuccess);
|
||||
if (parseSuccess) {
|
||||
@ -983,8 +983,8 @@ void tst_QCssParser::marginValue()
|
||||
QDomElement e = doc.documentElement().firstChildElement();
|
||||
QCss::StyleSelector::NodePtr n;
|
||||
n.ptr = &e;
|
||||
QVector<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QVector<QCss::Declaration> decls = rules.at(0).declarations;
|
||||
QList<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QList<QCss::Declaration> decls = rules.at(0).declarations;
|
||||
QCss::ValueExtractor v(decls);
|
||||
|
||||
{
|
||||
@ -1162,7 +1162,7 @@ void tst_QCssParser::styleSelector()
|
||||
QVERIFY(!e.isNull());
|
||||
QCss::StyleSelector::NodePtr n;
|
||||
n.ptr = &e;
|
||||
QVector<QCss::Declaration> decls = testSelector.declarationsForNode(n);
|
||||
QList<QCss::Declaration> decls = testSelector.declarationsForNode(n);
|
||||
|
||||
if (match) {
|
||||
QCOMPARE(decls.count(), 1);
|
||||
@ -1258,7 +1258,7 @@ void tst_QCssParser::specificitySort()
|
||||
QDomElement e = doc.documentElement().firstChildElement();
|
||||
QCss::StyleSelector::NodePtr n;
|
||||
n.ptr = &e;
|
||||
QVector<QCss::Declaration> decls = testSelector.declarationsForNode(n);
|
||||
QList<QCss::Declaration> decls = testSelector.declarationsForNode(n);
|
||||
|
||||
QCOMPARE(decls.count(), 2);
|
||||
|
||||
@ -1340,9 +1340,9 @@ void tst_QCssParser::rulesForNode()
|
||||
QDomElement e = doc.documentElement().firstChildElement();
|
||||
QCss::StyleSelector::NodePtr n;
|
||||
n.ptr = &e;
|
||||
QVector<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QList<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
|
||||
QVector<QCss::Declaration> decls;
|
||||
QList<QCss::Declaration> decls;
|
||||
for (int i = 0; i < rules.count(); i++) {
|
||||
const QCss::Selector &selector = rules.at(i).selectors.at(0);
|
||||
quint64 negated = 0;
|
||||
@ -1398,8 +1398,8 @@ void tst_QCssParser::shorthandBackgroundProperty()
|
||||
QDomElement e = doc.documentElement().firstChildElement();
|
||||
QCss::StyleSelector::NodePtr n;
|
||||
n.ptr = &e;
|
||||
QVector<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QVector<QCss::Declaration> decls = rules.at(0).declarations;
|
||||
QList<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QList<QCss::Declaration> decls = rules.at(0).declarations;
|
||||
QCss::ValueExtractor v(decls);
|
||||
|
||||
QBrush brush;
|
||||
@ -1477,8 +1477,8 @@ void tst_QCssParser::pseudoElement()
|
||||
QDomElement e = doc.documentElement().firstChildElement();
|
||||
QCss::StyleSelector::NodePtr n;
|
||||
n.ptr = &e;
|
||||
QVector<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QVector<QCss::Declaration> decls;
|
||||
QList<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QList<QCss::Declaration> decls;
|
||||
for (int i = 0; i < rules.count(); i++) {
|
||||
const QCss::Selector& selector = rules.at(i).selectors.at(0);
|
||||
if (pseudoElement.compare(selector.pseudoElement(), Qt::CaseInsensitive) != 0)
|
||||
@ -1564,8 +1564,8 @@ void tst_QCssParser::gradient()
|
||||
QDomElement e = doc.documentElement().firstChildElement();
|
||||
QCss::StyleSelector::NodePtr n;
|
||||
n.ptr = &e;
|
||||
QVector<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QVector<QCss::Declaration> decls = rules.at(0).declarations;
|
||||
QList<QCss::StyleRule> rules = testSelector.styleRulesForNode(n);
|
||||
QList<QCss::Declaration> decls = rules.at(0).declarations;
|
||||
QCss::ValueExtractor ve(decls);
|
||||
QBrush fg, sfg;
|
||||
QBrush sbg, abg;
|
||||
@ -1624,7 +1624,7 @@ void tst_QCssParser::extractFontFamily()
|
||||
QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ?
|
||||
sheet.styleRules.at(0) : *sheet.nameIndex.begin();
|
||||
|
||||
const QVector<QCss::Declaration> decls = rule.declarations;
|
||||
const QList<QCss::Declaration> decls = rule.declarations;
|
||||
QVERIFY(!decls.isEmpty());
|
||||
QCss::ValueExtractor extractor(decls);
|
||||
|
||||
@ -1681,7 +1681,7 @@ void tst_QCssParser::extractBorder()
|
||||
QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count(), 1);
|
||||
QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ?
|
||||
sheet.styleRules.at(0) : *sheet.nameIndex.begin();
|
||||
const QVector<QCss::Declaration> decls = rule.declarations;
|
||||
const QList<QCss::Declaration> decls = rule.declarations;
|
||||
QVERIFY(!decls.isEmpty());
|
||||
QCss::ValueExtractor extractor(decls);
|
||||
|
||||
@ -1711,7 +1711,7 @@ void tst_QCssParser::noTextDecoration()
|
||||
QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count(), 1);
|
||||
QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ?
|
||||
sheet.styleRules.at(0) : *sheet.nameIndex.begin();
|
||||
const QVector<QCss::Declaration> decls = rule.declarations;
|
||||
const QList<QCss::Declaration> decls = rule.declarations;
|
||||
QVERIFY(!decls.isEmpty());
|
||||
QCss::ValueExtractor extractor(decls);
|
||||
|
||||
@ -1736,7 +1736,7 @@ void tst_QCssParser::quotedAndUnquotedIdentifiers()
|
||||
QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count(), 1);
|
||||
QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ?
|
||||
sheet.styleRules.at(0) : *sheet.nameIndex.begin();
|
||||
const QVector<QCss::Declaration> decls = rule.declarations;
|
||||
const QList<QCss::Declaration> decls = rule.declarations;
|
||||
QCOMPARE(decls.size(), 2);
|
||||
|
||||
QCOMPARE(decls.at(0).d->values.first().type, QCss::Value::String);
|
||||
|
@ -110,8 +110,8 @@ static QGlyphRun make_dummy_indexes()
|
||||
{
|
||||
QGlyphRun glyphs;
|
||||
|
||||
QVector<quint32> glyphIndexes;
|
||||
QVector<QPointF> positions;
|
||||
QList<quint32> glyphIndexes;
|
||||
QList<QPointF> positions;
|
||||
QFont font;
|
||||
font.setPointSize(18);
|
||||
|
||||
@ -135,8 +135,8 @@ void tst_QGlyphRun::copyConstructor()
|
||||
QGlyphRun glyphs;
|
||||
|
||||
{
|
||||
QVector<quint32> glyphIndexes;
|
||||
QVector<QPointF> positions;
|
||||
QList<quint32> glyphIndexes;
|
||||
QList<QPointF> positions;
|
||||
QFont font;
|
||||
font.setPointSize(18);
|
||||
|
||||
@ -183,7 +183,7 @@ void tst_QGlyphRun::equalsOperator_data()
|
||||
{
|
||||
QGlyphRun busted(two);
|
||||
|
||||
QVector<QPointF> positions = busted.positions();
|
||||
QList<QPointF> positions = busted.positions();
|
||||
positions[2] += QPointF(1, 1);
|
||||
busted.setPositions(positions);
|
||||
|
||||
@ -204,7 +204,7 @@ void tst_QGlyphRun::equalsOperator_data()
|
||||
{
|
||||
QGlyphRun busted(two);
|
||||
|
||||
QVector<quint32> glyphIndexes = busted.glyphIndexes();
|
||||
QList<quint32> glyphIndexes = busted.glyphIndexes();
|
||||
glyphIndexes[2] += 1;
|
||||
busted.setGlyphIndexes(glyphIndexes);
|
||||
|
||||
@ -228,14 +228,14 @@ void tst_QGlyphRun::isEmpty()
|
||||
QGlyphRun glyphs;
|
||||
QVERIFY(glyphs.isEmpty());
|
||||
|
||||
glyphs.setGlyphIndexes(QVector<quint32>() << 1 << 2 << 3);
|
||||
glyphs.setGlyphIndexes(QList<quint32>() << 1 << 2 << 3);
|
||||
QVERIFY(!glyphs.isEmpty());
|
||||
|
||||
glyphs.clear();
|
||||
QVERIFY(glyphs.isEmpty());
|
||||
|
||||
QVector<quint32> glyphIndexes = QVector<quint32>() << 1 << 2 << 3;
|
||||
QVector<QPointF> positions = QVector<QPointF>() << QPointF(0, 0) << QPointF(0, 0) << QPointF(0, 0);
|
||||
QList<quint32> glyphIndexes = QList<quint32>() << 1 << 2 << 3;
|
||||
QList<QPointF> positions = QList<QPointF>() << QPointF(0, 0) << QPointF(0, 0) << QPointF(0, 0);
|
||||
glyphs.setRawData(glyphIndexes.constData(), positions.constData(), glyphIndexes.size());
|
||||
QVERIFY(!glyphs.isEmpty());
|
||||
}
|
||||
@ -309,8 +309,8 @@ void tst_QGlyphRun::setRawData()
|
||||
{
|
||||
QGlyphRun glyphRun;
|
||||
glyphRun.setRawFont(QRawFont::fromFont(m_testFont));
|
||||
glyphRun.setGlyphIndexes(QVector<quint32>() << 2 << 2 << 2);
|
||||
glyphRun.setPositions(QVector<QPointF>() << QPointF(2, 3) << QPointF(20, 3) << QPointF(10, 20));
|
||||
glyphRun.setGlyphIndexes(QList<quint32>() << 2 << 2 << 2);
|
||||
glyphRun.setPositions(QList<QPointF>() << QPointF(2, 3) << QPointF(20, 3) << QPointF(10, 20));
|
||||
|
||||
QPixmap baseline(100, 50);
|
||||
baseline.fill(Qt::white);
|
||||
@ -357,17 +357,17 @@ void tst_QGlyphRun::setRawData()
|
||||
|
||||
void tst_QGlyphRun::setRawDataAndGetAsVector()
|
||||
{
|
||||
QVector<quint32> glyphIndexArray;
|
||||
QList<quint32> glyphIndexArray;
|
||||
glyphIndexArray << 3 << 2 << 1 << 4;
|
||||
|
||||
QVector<QPointF> glyphPositionArray;
|
||||
QList<QPointF> glyphPositionArray;
|
||||
glyphPositionArray << QPointF(1, 2) << QPointF(3, 4) << QPointF(5, 6) << QPointF(7, 8);
|
||||
|
||||
QGlyphRun glyphRun;
|
||||
glyphRun.setRawData(glyphIndexArray.constData(), glyphPositionArray.constData(), 4);
|
||||
|
||||
QVector<quint32> glyphIndexes = glyphRun.glyphIndexes();
|
||||
QVector<QPointF> glyphPositions = glyphRun.positions();
|
||||
QList<quint32> glyphIndexes = glyphRun.glyphIndexes();
|
||||
QList<QPointF> glyphPositions = glyphRun.positions();
|
||||
|
||||
QCOMPARE(glyphIndexes.size(), 4);
|
||||
QCOMPARE(glyphPositions.size(), 4);
|
||||
@ -384,10 +384,10 @@ void tst_QGlyphRun::setRawDataAndGetAsVector()
|
||||
|
||||
void tst_QGlyphRun::drawNonExistentGlyphs()
|
||||
{
|
||||
QVector<quint32> glyphIndexes;
|
||||
QList<quint32> glyphIndexes;
|
||||
glyphIndexes.append(4);
|
||||
|
||||
QVector<QPointF> glyphPositions;
|
||||
QList<QPointF> glyphPositions;
|
||||
glyphPositions.append(QPointF(0, 0));
|
||||
|
||||
QGlyphRun glyphs;
|
||||
@ -495,17 +495,17 @@ void tst_QGlyphRun::detach()
|
||||
{
|
||||
QGlyphRun glyphs;
|
||||
|
||||
glyphs.setGlyphIndexes(QVector<quint32>() << 1 << 2 << 3);
|
||||
glyphs.setGlyphIndexes(QList<quint32>() << 1 << 2 << 3);
|
||||
|
||||
QGlyphRun otherGlyphs;
|
||||
otherGlyphs = glyphs;
|
||||
|
||||
QCOMPARE(otherGlyphs.glyphIndexes(), glyphs.glyphIndexes());
|
||||
|
||||
otherGlyphs.setGlyphIndexes(QVector<quint32>() << 4 << 5 << 6);
|
||||
otherGlyphs.setGlyphIndexes(QList<quint32>() << 4 << 5 << 6);
|
||||
|
||||
QCOMPARE(otherGlyphs.glyphIndexes(), QVector<quint32>() << 4 << 5 << 6);
|
||||
QCOMPARE(glyphs.glyphIndexes(), QVector<quint32>() << 1 << 2 << 3);
|
||||
QCOMPARE(otherGlyphs.glyphIndexes(), QList<quint32>() << 4 << 5 << 6);
|
||||
QCOMPARE(glyphs.glyphIndexes(), QList<quint32>() << 1 << 2 << 3);
|
||||
}
|
||||
|
||||
void tst_QGlyphRun::drawRightToLeft()
|
||||
@ -559,8 +559,8 @@ void tst_QGlyphRun::boundingRect()
|
||||
|
||||
QRawFont rawFont(QRawFont::fromFont(QFont()));
|
||||
QVERIFY(rawFont.isValid());
|
||||
QVector<quint32> glyphIndexes = rawFont.glyphIndexesForString(s);
|
||||
QVector<QPointF> positions = rawFont.advancesForGlyphIndexes(glyphIndexes);
|
||||
QList<quint32> glyphIndexes = rawFont.glyphIndexesForString(s);
|
||||
QList<QPointF> positions = rawFont.advancesForGlyphIndexes(glyphIndexes);
|
||||
QCOMPARE(glyphIndexes.size(), s.size());
|
||||
QCOMPARE(positions.size(), glyphIndexes.size());
|
||||
|
||||
|
@ -285,8 +285,8 @@ void tst_QRawFont::glyphIndices()
|
||||
QRawFont font(testFont, 10);
|
||||
QVERIFY(font.isValid());
|
||||
|
||||
QVector<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("Foobar"));
|
||||
QVector<quint32> expectedGlyphIndices;
|
||||
QList<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("Foobar"));
|
||||
QList<quint32> expectedGlyphIndices;
|
||||
expectedGlyphIndices << 44 << 83 << 83 << 70 << 69 << 86;
|
||||
|
||||
QCOMPARE(glyphIndices, expectedGlyphIndices);
|
||||
@ -330,11 +330,11 @@ void tst_QRawFont::advances()
|
||||
QRawFontPrivate *font_d = QRawFontPrivate::get(font);
|
||||
QVERIFY(font_d->fontEngine != 0);
|
||||
|
||||
QVector<quint32> glyphIndices;
|
||||
QList<quint32> glyphIndices;
|
||||
glyphIndices << 44 << 83 << 83 << 70 << 69 << 86; // "Foobar"
|
||||
|
||||
bool supportsSubPixelPositions = font_d->fontEngine->supportsSubPixelPositions();
|
||||
QVector<QPointF> advances = font.advancesForGlyphIndexes(glyphIndices);
|
||||
QList<QPointF> advances = font.advancesForGlyphIndexes(glyphIndices);
|
||||
|
||||
bool mayDiffer = font_d->fontEngine->type() == QFontEngine::Freetype
|
||||
&& (hintingPreference == QFont::PreferFullHinting
|
||||
@ -358,7 +358,7 @@ void tst_QRawFont::advances()
|
||||
QVERIFY(qFuzzyIsNull(advances.at(i).y()));
|
||||
}
|
||||
|
||||
advances = font.advancesForGlyphIndexes(QVector<quint32>());
|
||||
advances = font.advancesForGlyphIndexes(QList<quint32>());
|
||||
QVERIFY(advances.isEmpty());
|
||||
|
||||
int numGlyphs = glyphIndices.size();
|
||||
@ -415,7 +415,7 @@ void tst_QRawFont::textLayout()
|
||||
QCOMPARE(rawFont.familyName(), familyName);
|
||||
QCOMPARE(rawFont.pixelSize(), 18.0);
|
||||
|
||||
QVector<quint32> expectedGlyphIndices;
|
||||
QList<quint32> expectedGlyphIndices;
|
||||
expectedGlyphIndices << 44 << 83 << 83 << 70 << 69 << 86;
|
||||
|
||||
QCOMPARE(glyphs.glyphIndexes(), expectedGlyphIndices);
|
||||
@ -996,10 +996,10 @@ void tst_QRawFont::kernedAdvances()
|
||||
QRawFont font(testFont, pixelSize);
|
||||
QVERIFY(font.isValid());
|
||||
|
||||
QVector<quint32> glyphIndexes = font.glyphIndexesForString(QStringLiteral("__"));
|
||||
QList<quint32> glyphIndexes = font.glyphIndexesForString(QStringLiteral("__"));
|
||||
QCOMPARE(glyphIndexes.size(), 2);
|
||||
|
||||
QVector<QPointF> advances = font.advancesForGlyphIndexes(glyphIndexes, QRawFont::KernedAdvances);
|
||||
QList<QPointF> advances = font.advancesForGlyphIndexes(glyphIndexes, QRawFont::KernedAdvances);
|
||||
QCOMPARE(advances.size(), 2);
|
||||
|
||||
qreal expectedAdvanceWidth = pixelSize * underScoreAW / emSquareSize;
|
||||
|
@ -113,8 +113,10 @@ void tst_QSyntaxHighlighter::cleanup()
|
||||
class TestHighlighter : public QSyntaxHighlighter
|
||||
{
|
||||
public:
|
||||
inline TestHighlighter(const QVector<QTextLayout::FormatRange> &fmts, QTextDocument *parent)
|
||||
: QSyntaxHighlighter(parent), formats(fmts), highlighted(false), callCount(0) {}
|
||||
inline TestHighlighter(const QList<QTextLayout::FormatRange> &fmts, QTextDocument *parent)
|
||||
: QSyntaxHighlighter(parent), formats(fmts), highlighted(false), callCount(0)
|
||||
{
|
||||
}
|
||||
inline TestHighlighter(QObject *parent)
|
||||
: QSyntaxHighlighter(parent) {}
|
||||
inline TestHighlighter(QTextDocument *parent)
|
||||
@ -131,7 +133,7 @@ public:
|
||||
++callCount;
|
||||
}
|
||||
|
||||
QVector<QTextLayout::FormatRange> formats;
|
||||
QList<QTextLayout::FormatRange> formats;
|
||||
bool highlighted;
|
||||
int callCount;
|
||||
QString highlightedText;
|
||||
@ -139,7 +141,7 @@ public:
|
||||
|
||||
void tst_QSyntaxHighlighter::basic()
|
||||
{
|
||||
QVector<QTextLayout::FormatRange> formats;
|
||||
QList<QTextLayout::FormatRange> formats;
|
||||
QTextLayout::FormatRange range;
|
||||
range.start = 0;
|
||||
range.length = 2;
|
||||
@ -206,7 +208,7 @@ void tst_QSyntaxHighlighter::basicTwo()
|
||||
|
||||
void tst_QSyntaxHighlighter::removeFormatsOnDelete()
|
||||
{
|
||||
QVector<QTextLayout::FormatRange> formats;
|
||||
QList<QTextLayout::FormatRange> formats;
|
||||
QTextLayout::FormatRange range;
|
||||
range.start = 0;
|
||||
range.length = 9;
|
||||
@ -403,7 +405,7 @@ void tst_QSyntaxHighlighter::highlightToEndOfDocument2()
|
||||
|
||||
void tst_QSyntaxHighlighter::preservePreeditArea()
|
||||
{
|
||||
QVector<QTextLayout::FormatRange> formats;
|
||||
QList<QTextLayout::FormatRange> formats;
|
||||
QTextLayout::FormatRange range;
|
||||
range.start = 0;
|
||||
range.length = 8;
|
||||
@ -500,7 +502,7 @@ void tst_QSyntaxHighlighter::avoidUnnecessaryDelayedRehighlight()
|
||||
|
||||
void tst_QSyntaxHighlighter::noContentsChangedDuringHighlight()
|
||||
{
|
||||
QVector<QTextLayout::FormatRange> formats;
|
||||
QList<QTextLayout::FormatRange> formats;
|
||||
QTextLayout::FormatRange range;
|
||||
range.start = 0;
|
||||
range.length = 10;
|
||||
|
@ -1267,7 +1267,7 @@ void tst_QTextDocument::toHtml_data()
|
||||
CREATE_DOC_AND_CURSOR();
|
||||
|
||||
QTextTableFormat fmt;
|
||||
QVector<QTextLength> widths;
|
||||
QList<QTextLength> widths;
|
||||
widths.append(QTextLength());
|
||||
widths.append(QTextLength(QTextLength::PercentageLength, 30));
|
||||
widths.append(QTextLength(QTextLength::FixedLength, 40));
|
||||
@ -1540,7 +1540,7 @@ void tst_QTextDocument::toHtml_data()
|
||||
QTextTable *table = cursor.insertTable(2, 2);
|
||||
table->mergeCells(0, 0, 1, 2);
|
||||
QTextTableFormat fmt = table->format();
|
||||
QVector<QTextLength> widths;
|
||||
QList<QTextLength> widths;
|
||||
widths.append(QTextLength(QTextLength::FixedLength, 20));
|
||||
widths.append(QTextLength(QTextLength::FixedLength, 40));
|
||||
fmt.setColumnWidthConstraints(widths);
|
||||
|
@ -1175,7 +1175,7 @@ void tst_QTextDocumentFragment::copySubTable()
|
||||
QTextDocumentFragment frag;
|
||||
{
|
||||
QTextTableFormat fmt;
|
||||
QVector<QTextLength> constraints;
|
||||
QList<QTextLength> constraints;
|
||||
constraints << QTextLength(QTextLength::PercentageLength, 16);
|
||||
constraints << QTextLength(QTextLength::PercentageLength, 28);
|
||||
constraints << QTextLength(QTextLength::PercentageLength, 28);
|
||||
@ -2744,7 +2744,7 @@ void tst_QTextDocumentFragment::html_columnWidths()
|
||||
QCOMPARE(table->rows(), 2);
|
||||
QTextTableFormat fmt = table->format();
|
||||
|
||||
const QVector<QTextLength> columnWidths = fmt.columnWidthConstraints();
|
||||
const QList<QTextLength> columnWidths = fmt.columnWidthConstraints();
|
||||
QCOMPARE(columnWidths.count(), 2);
|
||||
QCOMPARE(columnWidths.at(0).type(), QTextLength::VariableLength);
|
||||
QCOMPARE(columnWidths.at(1).type(), QTextLength::PercentageLength);
|
||||
|
@ -155,7 +155,7 @@ void tst_QTextFormat::testUnderlinePropertyPrecedence()
|
||||
QCOMPARE(format.fontUnderline(), false);
|
||||
QCOMPARE(format.font().underline(), false);
|
||||
|
||||
// do it again, but reverse the ordering (we use a QVector internally, so test a LOT ;)
|
||||
// do it again, but reverse the ordering (we use a QList internally, so test a LOT ;)
|
||||
// create conflict. Should use the new property
|
||||
format.setProperty(QTextCharFormat::FontUnderline, false);
|
||||
format.setProperty(QTextCharFormat::TextUnderlineStyle, QTextCharFormat::SingleUnderline);
|
||||
@ -210,7 +210,7 @@ void tst_QTextFormat::resolveFont()
|
||||
fmt.setProperty(QTextFormat::FontItalic, true);
|
||||
QTextCursor(&doc).insertText("Test", fmt);
|
||||
|
||||
QVector<QTextFormat> formats = doc.allFormats();
|
||||
QList<QTextFormat> formats = doc.allFormats();
|
||||
QCOMPARE(formats.count(), 3);
|
||||
|
||||
QCOMPARE(formats.at(2).type(), int(QTextFormat::CharFormat));
|
||||
|
@ -117,7 +117,7 @@ static void prepareShapingTest(const QFont &font, const ShapeTable *shape_table)
|
||||
string.append(QChar(*u));
|
||||
testName.append(" 0x" + QByteArray::number(*u, 16));
|
||||
}
|
||||
QVector<ushort> glyphs;
|
||||
QList<ushort> glyphs;
|
||||
for (const ushort *g = s->glyphs; *g; ++g)
|
||||
glyphs.append(*g);
|
||||
|
||||
@ -129,7 +129,7 @@ static void doShapingTests()
|
||||
{
|
||||
QFETCH(QFont, font);
|
||||
QFETCH(QString, string);
|
||||
QFETCH(QVector<ushort>, glyphs);
|
||||
QFETCH(QList<ushort>, glyphs);
|
||||
|
||||
QVERIFY(!string.isEmpty());
|
||||
|
||||
@ -176,7 +176,7 @@ void tst_QTextScriptEngine::devanagari_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -283,7 +283,7 @@ void tst_QTextScriptEngine::bengali_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -521,7 +521,7 @@ void tst_QTextScriptEngine::gurmukhi_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -549,7 +549,7 @@ void tst_QTextScriptEngine::oriya_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -590,7 +590,7 @@ void tst_QTextScriptEngine::tamil_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -667,7 +667,7 @@ void tst_QTextScriptEngine::telugu_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -716,7 +716,7 @@ void tst_QTextScriptEngine::kannada_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -787,7 +787,7 @@ void tst_QTextScriptEngine::malayalam_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -868,7 +868,7 @@ void tst_QTextScriptEngine::sinhala_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -906,7 +906,7 @@ void tst_QTextScriptEngine::khmer_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -950,7 +950,7 @@ void tst_QTextScriptEngine::linearB_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -978,7 +978,7 @@ void tst_QTextScriptEngine::greek_data()
|
||||
{
|
||||
QTest::addColumn<QFont>("font");
|
||||
QTest::addColumn<QString>("string");
|
||||
QTest::addColumn<QVector<ushort> >("glyphs");
|
||||
QTest::addColumn<QList<ushort>>("glyphs");
|
||||
|
||||
if (!haveTestFonts)
|
||||
QSKIP("Test fonts are not available");
|
||||
@ -990,7 +990,7 @@ void tst_QTextScriptEngine::greek_data()
|
||||
QString string;
|
||||
string.append(QChar(uc));
|
||||
QByteArray testName = f.family().toLatin1() + ": 0x" + QByteArray::number(uc, 16);
|
||||
QTest::newRow(testName.constData()) << f << string << QVector<ushort>();
|
||||
QTest::newRow(testName.constData()) << f << string << QList<ushort>();
|
||||
}
|
||||
} else
|
||||
QSKIP("couldn't find DejaVu Sans");
|
||||
@ -1003,7 +1003,7 @@ void tst_QTextScriptEngine::greek_data()
|
||||
QString string;
|
||||
string.append(QChar(uc));
|
||||
QByteArray testName = f.family().toLatin1() + ": 0x" + QByteArray::number(uc, 16);
|
||||
QTest::newRow(testName.constData()) << f << string << QVector<ushort>();
|
||||
QTest::newRow(testName.constData()) << f << string << QList<ushort>();
|
||||
}
|
||||
|
||||
const ShapeTable shape_table [] = {
|
||||
|
@ -45,7 +45,7 @@ private slots:
|
||||
void tst_QZip::basicUnpack()
|
||||
{
|
||||
QZipReader zip(QFINDTESTDATA("/testdata/test.zip"), QIODevice::ReadOnly);
|
||||
QVector<QZipReader::FileInfo> files = zip.fileInfoList();
|
||||
QList<QZipReader::FileInfo> files = zip.fileInfoList();
|
||||
QCOMPARE(files.count(), 2);
|
||||
|
||||
QZipReader::FileInfo fi = files.at(0);
|
||||
@ -81,7 +81,7 @@ void tst_QZip::basicUnpack()
|
||||
void tst_QZip::symlinks()
|
||||
{
|
||||
QZipReader zip(QFINDTESTDATA("/testdata/symlink.zip"), QIODevice::ReadOnly);
|
||||
QVector<QZipReader::FileInfo> files = zip.fileInfoList();
|
||||
QList<QZipReader::FileInfo> files = zip.fileInfoList();
|
||||
QCOMPARE(files.count(), 2);
|
||||
|
||||
QZipReader::FileInfo fi = files.at(0);
|
||||
@ -104,7 +104,7 @@ void tst_QZip::symlinks()
|
||||
void tst_QZip::readTest()
|
||||
{
|
||||
QZipReader zip("foobar.zip", QIODevice::ReadOnly); // non existing file.
|
||||
QVector<QZipReader::FileInfo> files = zip.fileInfoList();
|
||||
QList<QZipReader::FileInfo> files = zip.fileInfoList();
|
||||
QCOMPARE(files.count(), 0);
|
||||
QByteArray b = zip.fileData("foobar");
|
||||
QCOMPARE(b.size(), 0);
|
||||
@ -123,7 +123,7 @@ void tst_QZip::createArchive()
|
||||
|
||||
QBuffer buffer2(&zipFile);
|
||||
QZipReader zip2(&buffer2);
|
||||
QVector<QZipReader::FileInfo> files = zip2.fileInfoList();
|
||||
QList<QZipReader::FileInfo> files = zip2.fileInfoList();
|
||||
QCOMPARE(files.count(), 1);
|
||||
QZipReader::FileInfo file = files.at(0);
|
||||
QCOMPARE(file.filePath, QString("My Filename"));
|
||||
|
@ -53,7 +53,8 @@ namespace
|
||||
return port;
|
||||
}
|
||||
|
||||
QShaderNode createNode(const QVector<QShaderNodePort> &ports, const QStringList &layers = QStringList())
|
||||
QShaderNode createNode(const QList<QShaderNodePort> &ports,
|
||||
const QStringList &layers = QStringList())
|
||||
{
|
||||
auto node = QShaderNode();
|
||||
node.setUuid(QUuid::createUuid());
|
||||
|
@ -41,7 +41,8 @@ namespace
|
||||
return port;
|
||||
}
|
||||
|
||||
QShaderNode createNode(const QVector<QShaderNodePort> &ports, const QStringList &layers = QStringList())
|
||||
QShaderNode createNode(const QList<QShaderNodePort> &ports,
|
||||
const QStringList &layers = QStringList())
|
||||
{
|
||||
auto node = QShaderNode();
|
||||
node.setUuid(QUuid::createUuid());
|
||||
@ -65,8 +66,8 @@ namespace
|
||||
}
|
||||
|
||||
QShaderGraph::Statement createStatement(const QShaderNode &node,
|
||||
const QVector<int> &inputs = QVector<int>(),
|
||||
const QVector<int> &outputs = QVector<int>())
|
||||
const QList<int> &inputs = QList<int>(),
|
||||
const QList<int> &outputs = QList<int>())
|
||||
{
|
||||
auto statement = QShaderGraph::Statement();
|
||||
statement.node = node;
|
||||
@ -80,7 +81,8 @@ namespace
|
||||
qDebug() << prefix << statement.inputs << statement.uuid().toString() << statement.outputs;
|
||||
}
|
||||
|
||||
void dumpStatementsIfNeeded(const QVector<QShaderGraph::Statement> &statements, const QVector<QShaderGraph::Statement> &expected)
|
||||
void dumpStatementsIfNeeded(const QList<QShaderGraph::Statement> &statements,
|
||||
const QList<QShaderGraph::Statement> &expected)
|
||||
{
|
||||
if (statements != expected) {
|
||||
for (int i = 0; i < qMax(statements.size(), expected.size()); i++) {
|
||||
@ -464,13 +466,11 @@ void tst_QShaderGraph::shouldSerializeGraphForCodeGeneration()
|
||||
const auto statements = graph.createStatements();
|
||||
|
||||
// THEN
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
<< createStatement(input2, {}, {1})
|
||||
<< createStatement(input1, {}, {0})
|
||||
const auto expected = QList<QShaderGraph::Statement>()
|
||||
<< createStatement(input2, {}, { 1 }) << createStatement(input1, {}, { 0 })
|
||||
<< createStatement(function2, { 0, 1 }, { 3 })
|
||||
<< createStatement(function1, { 0 }, { 2 })
|
||||
<< createStatement(function3, {2, 3}, {4, 5})
|
||||
<< createStatement(output2, {5}, {})
|
||||
<< createStatement(function3, { 2, 3 }, { 4, 5 }) << createStatement(output2, { 5 }, {})
|
||||
<< createStatement(output1, { 4 }, {});
|
||||
dumpStatementsIfNeeded(statements, expected);
|
||||
QCOMPARE(statements, expected);
|
||||
@ -517,8 +517,7 @@ void tst_QShaderGraph::shouldHandleUnboundPortsDuringGraphSerialization()
|
||||
|
||||
// THEN
|
||||
// Note that no statement has any unbound input
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
<< createStatement(input, {}, {0});
|
||||
const auto expected = QList<QShaderGraph::Statement>() << createStatement(input, {}, { 0 });
|
||||
dumpStatementsIfNeeded(statements, expected);
|
||||
QCOMPARE(statements, expected);
|
||||
}
|
||||
@ -566,7 +565,7 @@ void tst_QShaderGraph::shouldSurviveCyclesDuringGraphSerialization()
|
||||
|
||||
// THEN
|
||||
// The cycle is ignored
|
||||
const auto expected = QVector<QShaderGraph::Statement>();
|
||||
const auto expected = QList<QShaderGraph::Statement>();
|
||||
dumpStatementsIfNeeded(statements, expected);
|
||||
QCOMPARE(statements, expected);
|
||||
}
|
||||
@ -641,13 +640,11 @@ void tst_QShaderGraph::shouldDealWithEdgesJumpingOverLayers()
|
||||
const auto statements = graph.createStatements();
|
||||
|
||||
// THEN
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
<< createStatement(texCoord, {}, {2})
|
||||
<< createStatement(texture, {}, {1})
|
||||
const auto expected = QList<QShaderGraph::Statement>()
|
||||
<< createStatement(texCoord, {}, { 2 }) << createStatement(texture, {}, { 1 })
|
||||
<< createStatement(lightIntensity, {}, { 3 })
|
||||
<< createStatement(sampleTexture, { 1, 2 }, { 5 })
|
||||
<< createStatement(worldPosition, {}, {0})
|
||||
<< createStatement(exposure, {}, {4})
|
||||
<< createStatement(worldPosition, {}, { 0 }) << createStatement(exposure, {}, { 4 })
|
||||
<< createStatement(lightFunction, { 5, 0, 3 }, { 6 })
|
||||
<< createStatement(exposureFunction, { 6, 4 }, { 7 })
|
||||
<< createStatement(fragColor, { 7 }, {});
|
||||
@ -716,7 +713,7 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers(
|
||||
const auto statements = graph.createStatements({"diffuseUniform", "normalUniform"});
|
||||
|
||||
// THEN
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
const auto expected = QList<QShaderGraph::Statement>()
|
||||
<< createStatement(normalUniform, {}, { 1 })
|
||||
<< createStatement(diffuseUniform, {}, { 0 })
|
||||
<< createStatement(lightFunction, { 0, 1 }, { 2 })
|
||||
@ -730,7 +727,7 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers(
|
||||
const auto statements = graph.createStatements({"diffuseUniform", "normalTexture"});
|
||||
|
||||
// THEN
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
const auto expected = QList<QShaderGraph::Statement>()
|
||||
<< createStatement(texCoord, {}, { 0 })
|
||||
<< createStatement(normalTexture, { 0 }, { 2 })
|
||||
<< createStatement(diffuseUniform, {}, { 1 })
|
||||
@ -745,9 +742,8 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers(
|
||||
const auto statements = graph.createStatements({"diffuseTexture", "normalUniform"});
|
||||
|
||||
// THEN
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
<< createStatement(texCoord, {}, {0})
|
||||
<< createStatement(normalUniform, {}, {2})
|
||||
const auto expected = QList<QShaderGraph::Statement>()
|
||||
<< createStatement(texCoord, {}, { 0 }) << createStatement(normalUniform, {}, { 2 })
|
||||
<< createStatement(diffuseTexture, { 0 }, { 1 })
|
||||
<< createStatement(lightFunction, { 1, 2 }, { 3 })
|
||||
<< createStatement(fragColor, { 3 }, {});
|
||||
@ -760,7 +756,7 @@ void tst_QShaderGraph::shouldGenerateDifferentStatementsDependingOnActiveLayers(
|
||||
const auto statements = graph.createStatements({"diffuseTexture", "normalTexture"});
|
||||
|
||||
// THEN
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
const auto expected = QList<QShaderGraph::Statement>()
|
||||
<< createStatement(texCoord, {}, { 0 })
|
||||
<< createStatement(normalTexture, { 0 }, { 2 })
|
||||
<< createStatement(diffuseTexture, { 0 }, { 1 })
|
||||
@ -806,9 +802,8 @@ void tst_QShaderGraph::shouldDealWithBranchesWithoutOutput()
|
||||
|
||||
// THEN
|
||||
// Note that no edge leads to the unbound input
|
||||
const auto expected = QVector<QShaderGraph::Statement>()
|
||||
<< createStatement(input, {}, {0})
|
||||
<< createStatement(function, {0}, {1})
|
||||
const auto expected = QList<QShaderGraph::Statement>()
|
||||
<< createStatement(input, {}, { 0 }) << createStatement(function, { 0 }, { 1 })
|
||||
<< createStatement(output, { 1 }, {})
|
||||
<< createStatement(danglingFunction, { 0 }, { 2 });
|
||||
dumpStatementsIfNeeded(statements, expected);
|
||||
|
@ -67,7 +67,8 @@ namespace
|
||||
return port;
|
||||
}
|
||||
|
||||
QShaderNode createNode(const QVector<QShaderNodePort> &ports, const QStringList &layers = QStringList())
|
||||
QShaderNode createNode(const QList<QShaderNodePort> &ports,
|
||||
const QStringList &layers = QStringList())
|
||||
{
|
||||
auto node = QShaderNode();
|
||||
node.setUuid(QUuid::createUuid());
|
||||
@ -216,7 +217,8 @@ namespace
|
||||
qDebug() << prefix << statement.inputs << statement.uuid().toString() << statement.outputs;
|
||||
}
|
||||
|
||||
void dumpStatementsIfNeeded(const QVector<QShaderGraph::Statement> &statements, const QVector<QShaderGraph::Statement> &expected)
|
||||
void dumpStatementsIfNeeded(const QList<QShaderGraph::Statement> &statements,
|
||||
const QList<QShaderGraph::Statement> &expected)
|
||||
{
|
||||
if (statements != expected) {
|
||||
for (int i = 0; i < qMax(statements.size(), expected.size()); i++) {
|
||||
|
@ -71,7 +71,7 @@ namespace
|
||||
return port;
|
||||
}
|
||||
|
||||
QShaderNode createNode(const QVector<QShaderNodePort> &ports)
|
||||
QShaderNode createNode(const QList<QShaderNodePort> &ports)
|
||||
{
|
||||
auto node = QShaderNode();
|
||||
for (const auto &port : ports)
|
||||
|
Loading…
Reference in New Issue
Block a user