qtbase tests: Fix some warnings
- Fix warnings about QAtomicPointer/Int usage - Fix some gcc 4.6 warnings about assigned/unused variables Change-Id: Ib4dbf9110f0dad93ad48e97278310f05fad3a82a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
parent
ed5583048e
commit
e8b4c49efd
@ -301,14 +301,14 @@ void tst_QAnimationGroup::setParentAutoAdd()
|
|||||||
|
|
||||||
void tst_QAnimationGroup::beginNestedGroup()
|
void tst_QAnimationGroup::beginNestedGroup()
|
||||||
{
|
{
|
||||||
QAnimationGroup *subGroup;
|
|
||||||
QAnimationGroup *parent = new QParallelAnimationGroup();
|
QAnimationGroup *parent = new QParallelAnimationGroup();
|
||||||
|
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
if (i & 1)
|
if (i & 1) {
|
||||||
subGroup = new QParallelAnimationGroup(parent);
|
new QParallelAnimationGroup(parent);
|
||||||
else
|
} else {
|
||||||
subGroup = new QSequentialAnimationGroup(parent);
|
new QSequentialAnimationGroup(parent);
|
||||||
|
}
|
||||||
|
|
||||||
QCOMPARE(parent->animationCount(), 1);
|
QCOMPARE(parent->animationCount(), 1);
|
||||||
QAnimationGroup *child = static_cast<QAnimationGroup *>(parent->animationAt(0));
|
QAnimationGroup *child = static_cast<QAnimationGroup *>(parent->animationAt(0));
|
||||||
|
@ -95,7 +95,6 @@ void tst_QFuture::resultStore()
|
|||||||
|
|
||||||
{
|
{
|
||||||
ResultStore<int> store;
|
ResultStore<int> store;
|
||||||
ResultIteratorBase it = store.begin();
|
|
||||||
QVERIFY(store.begin() == store.end());
|
QVERIFY(store.begin() == store.end());
|
||||||
QVERIFY(store.resultAt(0) == store.end());
|
QVERIFY(store.resultAt(0) == store.end());
|
||||||
QVERIFY(store.resultAt(1) == store.end());
|
QVERIFY(store.resultAt(1) == store.end());
|
||||||
|
@ -233,7 +233,8 @@ public:
|
|||||||
|
|
||||||
bool shouldThrottleThread()
|
bool shouldThrottleThread()
|
||||||
{
|
{
|
||||||
return (iterations > 100 && iterations < 200);
|
const int load = iterations.load();
|
||||||
|
return (load > 100 && load < 200);
|
||||||
}
|
}
|
||||||
bool throttling;
|
bool throttling;
|
||||||
};
|
};
|
||||||
|
@ -1285,6 +1285,7 @@ void tst_QtConcurrentMap::mappedReduced()
|
|||||||
|
|
||||||
// test Q_DECLARE_OPERATORS_FOR_FLAGS
|
// test Q_DECLARE_OPERATORS_FOR_FLAGS
|
||||||
QtConcurrent::ReduceOptions opt = (QtConcurrent::UnorderedReduce | QtConcurrent::SequentialReduce);
|
QtConcurrent::ReduceOptions opt = (QtConcurrent::UnorderedReduce | QtConcurrent::SequentialReduce);
|
||||||
|
QVERIFY(opt);
|
||||||
|
|
||||||
// functor-functor
|
// functor-functor
|
||||||
{
|
{
|
||||||
|
@ -88,7 +88,6 @@ void tst_QtConcurrentResultStore::iterators()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
ResultStore<int> store;
|
ResultStore<int> store;
|
||||||
ResultIteratorBase it = store.begin();
|
|
||||||
QVERIFY(store.begin() == store.end());
|
QVERIFY(store.begin() == store.end());
|
||||||
QVERIFY(store.resultAt(0) == store.end());
|
QVERIFY(store.resultAt(0) == store.end());
|
||||||
QVERIFY(store.resultAt(1) == store.end());
|
QVERIFY(store.resultAt(1) == store.end());
|
||||||
|
@ -1023,12 +1023,12 @@ void tst_QMetaObjectBuilder::removeNotifySignal()
|
|||||||
{
|
{
|
||||||
QMetaObjectBuilder builder;
|
QMetaObjectBuilder builder;
|
||||||
|
|
||||||
QMetaMethodBuilder method1 = builder.addSignal("foo(const QString&, int)");
|
builder.addSignal("foo(const QString&, int)");
|
||||||
QMetaMethodBuilder method2 = builder.addSignal("bar(QString)");
|
QMetaMethodBuilder method = builder.addSignal("bar(QString)");
|
||||||
|
|
||||||
// Setup property
|
// Setup property
|
||||||
QMetaPropertyBuilder prop = builder.addProperty("prop", "const QString &");
|
QMetaPropertyBuilder prop = builder.addProperty("prop", "const QString &");
|
||||||
prop.setNotifySignal(method2);
|
prop.setNotifySignal(method);
|
||||||
QVERIFY(prop.hasNotifySignal());
|
QVERIFY(prop.hasNotifySignal());
|
||||||
QCOMPARE(prop.notifySignal().index(), 1);
|
QCOMPARE(prop.notifySignal().index(), 1);
|
||||||
|
|
||||||
|
@ -129,10 +129,8 @@ void tst_QSocketNotifier::unexpectedDisconnection()
|
|||||||
|
|
||||||
NATIVESOCKETENGINE readEnd1;
|
NATIVESOCKETENGINE readEnd1;
|
||||||
readEnd1.initialize(QAbstractSocket::TcpSocket);
|
readEnd1.initialize(QAbstractSocket::TcpSocket);
|
||||||
bool b = readEnd1.connectToHost(server.serverAddress(), server.serverPort());
|
readEnd1.connectToHost(server.serverAddress(), server.serverPort());
|
||||||
QVERIFY(readEnd1.waitForWrite());
|
QVERIFY(readEnd1.waitForWrite());
|
||||||
// while (!b && readEnd1.state() != QAbstractSocket::ConnectedState)
|
|
||||||
// b = readEnd1.connectToHost(server.serverAddress(), server.serverPort());
|
|
||||||
QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState);
|
QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState);
|
||||||
QVERIFY(server.waitForNewConnection());
|
QVERIFY(server.waitForNewConnection());
|
||||||
QTcpSocket *writeEnd1 = server.nextPendingConnection();
|
QTcpSocket *writeEnd1 = server.nextPendingConnection();
|
||||||
@ -140,10 +138,8 @@ void tst_QSocketNotifier::unexpectedDisconnection()
|
|||||||
|
|
||||||
NATIVESOCKETENGINE readEnd2;
|
NATIVESOCKETENGINE readEnd2;
|
||||||
readEnd2.initialize(QAbstractSocket::TcpSocket);
|
readEnd2.initialize(QAbstractSocket::TcpSocket);
|
||||||
b = readEnd2.connectToHost(server.serverAddress(), server.serverPort());
|
readEnd2.connectToHost(server.serverAddress(), server.serverPort());
|
||||||
QVERIFY(readEnd2.waitForWrite());
|
QVERIFY(readEnd2.waitForWrite());
|
||||||
// while (!b)
|
|
||||||
// b = readEnd2.connectToHost(server.serverAddress(), server.serverPort());
|
|
||||||
QVERIFY(readEnd2.state() == QAbstractSocket::ConnectedState);
|
QVERIFY(readEnd2.state() == QAbstractSocket::ConnectedState);
|
||||||
QVERIFY(server.waitForNewConnection());
|
QVERIFY(server.waitForNewConnection());
|
||||||
QTcpSocket *writeEnd2 = server.nextPendingConnection();
|
QTcpSocket *writeEnd2 = server.nextPendingConnection();
|
||||||
|
@ -430,7 +430,6 @@ public:
|
|||||||
|
|
||||||
m_timer.stop();
|
m_timer.stop();
|
||||||
|
|
||||||
QTime now = QTime::currentTime();
|
|
||||||
int elapsed = m_startedTime.elapsed();
|
int elapsed = m_startedTime.elapsed();
|
||||||
|
|
||||||
if (elapsed < m_interval / 2) {
|
if (elapsed < m_interval / 2) {
|
||||||
|
@ -576,28 +576,28 @@ public:
|
|||||||
quint64 i = 0;
|
quint64 i = 0;
|
||||||
while (t.elapsed() < one_minute) {
|
while (t.elapsed() < one_minute) {
|
||||||
i++;
|
i++;
|
||||||
uint nb = (i * 9 + lockCount * 13) % threadCount;
|
uint nb = (i * 9 + lockCount.load() * 13) % threadCount;
|
||||||
QMutexLocker locker(&mutex[nb]);
|
QMutexLocker locker(&mutex[nb]);
|
||||||
if (sentinel[nb]) errorCount.ref();
|
if (sentinel[nb].load()) errorCount.ref();
|
||||||
if (sentinel[nb].fetchAndAddRelaxed(5)) errorCount.ref();
|
if (sentinel[nb].fetchAndAddRelaxed(5)) errorCount.ref();
|
||||||
if (!sentinel[nb].testAndSetRelaxed(5, 0)) errorCount.ref();
|
if (!sentinel[nb].testAndSetRelaxed(5, 0)) errorCount.ref();
|
||||||
if (sentinel[nb]) errorCount.ref();
|
if (sentinel[nb].load()) errorCount.ref();
|
||||||
lockCount.ref();
|
lockCount.ref();
|
||||||
nb = (nb * 17 + i * 5 + lockCount * 3) % threadCount;
|
nb = (nb * 17 + i * 5 + lockCount.load() * 3) % threadCount;
|
||||||
if (mutex[nb].tryLock()) {
|
if (mutex[nb].tryLock()) {
|
||||||
if (sentinel[nb]) errorCount.ref();
|
if (sentinel[nb].load()) errorCount.ref();
|
||||||
if (sentinel[nb].fetchAndAddRelaxed(16)) errorCount.ref();
|
if (sentinel[nb].fetchAndAddRelaxed(16)) errorCount.ref();
|
||||||
if (!sentinel[nb].testAndSetRelaxed(16, 0)) errorCount.ref();
|
if (!sentinel[nb].testAndSetRelaxed(16, 0)) errorCount.ref();
|
||||||
if (sentinel[nb]) errorCount.ref();
|
if (sentinel[nb].load()) errorCount.ref();
|
||||||
lockCount.ref();
|
lockCount.ref();
|
||||||
mutex[nb].unlock();
|
mutex[nb].unlock();
|
||||||
}
|
}
|
||||||
nb = (nb * 15 + i * 47 + lockCount * 31) % threadCount;
|
nb = (nb * 15 + i * 47 + lockCount.load() * 31) % threadCount;
|
||||||
if (mutex[nb].tryLock(2)) {
|
if (mutex[nb].tryLock(2)) {
|
||||||
if (sentinel[nb]) errorCount.ref();
|
if (sentinel[nb].load()) errorCount.ref();
|
||||||
if (sentinel[nb].fetchAndAddRelaxed(53)) errorCount.ref();
|
if (sentinel[nb].fetchAndAddRelaxed(53)) errorCount.ref();
|
||||||
if (!sentinel[nb].testAndSetRelaxed(53, 0)) errorCount.ref();
|
if (!sentinel[nb].testAndSetRelaxed(53, 0)) errorCount.ref();
|
||||||
if (sentinel[nb]) errorCount.ref();
|
if (sentinel[nb].load()) errorCount.ref();
|
||||||
lockCount.ref();
|
lockCount.ref();
|
||||||
mutex[nb].unlock();
|
mutex[nb].unlock();
|
||||||
}
|
}
|
||||||
|
@ -4541,17 +4541,16 @@ void tst_QString::nanAndInf()
|
|||||||
QVERIFY(ok);
|
QVERIFY(ok);
|
||||||
QVERIFY(d == -INFINITY);
|
QVERIFY(d == -INFINITY);
|
||||||
|
|
||||||
long l;
|
QString("INF").toLong(&ok);
|
||||||
l = QString("INF").toLong(&ok);
|
|
||||||
QVERIFY(!ok);
|
QVERIFY(!ok);
|
||||||
|
|
||||||
l = QString("INF").toLong(&ok, 36);
|
QString("INF").toLong(&ok, 36);
|
||||||
QVERIFY(ok);
|
QVERIFY(ok);
|
||||||
|
|
||||||
l = QString("INF0").toLong(&ok, 36);
|
QString("INF0").toLong(&ok, 36);
|
||||||
QVERIFY(ok);
|
QVERIFY(ok);
|
||||||
|
|
||||||
l = QString("0INF0").toLong(&ok, 36);
|
QString("0INF0").toLong(&ok, 36);
|
||||||
QVERIFY(ok);
|
QVERIFY(ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1107,7 +1107,7 @@ class VirtualObject: public QDBusVirtualObject
|
|||||||
public:
|
public:
|
||||||
VirtualObject() :success(true) {}
|
VirtualObject() :success(true) {}
|
||||||
|
|
||||||
QString introspect(const QString &path) const
|
QString introspect(const QString & /* path */) const
|
||||||
{
|
{
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@ -211,8 +211,8 @@ tst_QDBusThreading::tst_QDBusThreading()
|
|||||||
|
|
||||||
void tst_QDBusThreading::joinThreads()
|
void tst_QDBusThreading::joinThreads()
|
||||||
{
|
{
|
||||||
threadJoin.acquire(threadJoinCount);
|
threadJoin.acquire(threadJoinCount.load());
|
||||||
threadJoinCount = 0;
|
threadJoinCount.store(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tst_QDBusThreading::waitForSignal(QObject *obj, const char *signal, int delay)
|
bool tst_QDBusThreading::waitForSignal(QObject *obj, const char *signal, int delay)
|
||||||
|
@ -718,7 +718,7 @@ void tst_QImageReader::sizeBeforeFormat()
|
|||||||
|
|
||||||
{
|
{
|
||||||
QImageReader reader(prefix + fileName);
|
QImageReader reader(prefix + fileName);
|
||||||
QSize size = reader.size();
|
reader.size();
|
||||||
formatB = reader.format();
|
formatB = reader.format();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -891,8 +891,8 @@ void tst_QShortcut::ambiguousItems()
|
|||||||
pb1.show(); // Must be show for QShortcutMap::correctSubWindow to trigger
|
pb1.show(); // Must be show for QShortcutMap::correctSubWindow to trigger
|
||||||
pb2.show();
|
pb2.show();
|
||||||
|
|
||||||
QShortcut *cut1 = setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, "M");
|
setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, "M");
|
||||||
QShortcut *cut2 = setupShortcut(&pb1, "shortcut2-pb2", TriggerSlot2, "M");
|
setupShortcut(&pb1, "shortcut2-pb2", TriggerSlot2, "M");
|
||||||
|
|
||||||
currentResult = NoResult;
|
currentResult = NoResult;
|
||||||
sendKeyEvents( Qt::Key_M, 'm' );
|
sendKeyEvents( Qt::Key_M, 'm' );
|
||||||
@ -910,7 +910,6 @@ void tst_QShortcut::ambiguousItems()
|
|||||||
QCOMPARE( ambigResult, Slot1Triggered );
|
QCOMPARE( ambigResult, Slot1Triggered );
|
||||||
|
|
||||||
clearAllShortcuts();
|
clearAllShortcuts();
|
||||||
cut1 = 0; cut2 = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -933,8 +932,8 @@ void tst_QShortcut::unicodeCompare()
|
|||||||
|
|
||||||
QKeySequence ks1("Ctrl+M"); // Unicode
|
QKeySequence ks1("Ctrl+M"); // Unicode
|
||||||
QKeySequence ks2(Qt::CTRL+Qt::Key_M); // non-Unicode
|
QKeySequence ks2(Qt::CTRL+Qt::Key_M); // non-Unicode
|
||||||
QShortcut *cut1 = setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, ks1);
|
setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, ks1);
|
||||||
QShortcut *cut2 = setupShortcut(&pb1, "shortcut2-pb2", TriggerSlot2, ks2);
|
setupShortcut(&pb1, "shortcut2-pb2", TriggerSlot2, ks2);
|
||||||
|
|
||||||
currentResult = NoResult;
|
currentResult = NoResult;
|
||||||
sendKeyEvents( Qt::CTRL+Qt::Key_M, 0 );
|
sendKeyEvents( Qt::CTRL+Qt::Key_M, 0 );
|
||||||
@ -945,7 +944,6 @@ void tst_QShortcut::unicodeCompare()
|
|||||||
QVERIFY( !(ks1 != ks2) );
|
QVERIFY( !(ks1 != ks2) );
|
||||||
|
|
||||||
clearAllShortcuts();
|
clearAllShortcuts();
|
||||||
cut1 = 0; cut2 = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@ -3274,7 +3274,6 @@ void tst_QTextDocumentFragment::html_hrMargins()
|
|||||||
|
|
||||||
cursor.movePosition(QTextCursor::NextBlock);
|
cursor.movePosition(QTextCursor::NextBlock);
|
||||||
block = cursor.block();
|
block = cursor.block();
|
||||||
QTextBlock hr = block;
|
|
||||||
QVERIFY(qMax(first.blockFormat().bottomMargin(), block.blockFormat().topMargin()) > 0);
|
QVERIFY(qMax(first.blockFormat().bottomMargin(), block.blockFormat().topMargin()) > 0);
|
||||||
|
|
||||||
cursor.movePosition(QTextCursor::NextBlock);
|
cursor.movePosition(QTextCursor::NextBlock);
|
||||||
|
@ -1188,7 +1188,7 @@ void tst_QTextLayout::capitalization_allUpperCase()
|
|||||||
font.setCapitalization(QFont::AllUppercase);
|
font.setCapitalization(QFont::AllUppercase);
|
||||||
QTextLayout layout("Test", font);
|
QTextLayout layout("Test", font);
|
||||||
layout.beginLayout();
|
layout.beginLayout();
|
||||||
QTextLine line = layout.createLine();
|
layout.createLine();
|
||||||
layout.endLayout();
|
layout.endLayout();
|
||||||
|
|
||||||
QTextEngine *engine = layout.engine();
|
QTextEngine *engine = layout.engine();
|
||||||
@ -1203,7 +1203,7 @@ void tst_QTextLayout::capitalization_allLowerCase()
|
|||||||
font.setCapitalization(QFont::AllLowercase);
|
font.setCapitalization(QFont::AllLowercase);
|
||||||
QTextLayout layout("Test", font);
|
QTextLayout layout("Test", font);
|
||||||
layout.beginLayout();
|
layout.beginLayout();
|
||||||
QTextLine line = layout.createLine();
|
layout.createLine();
|
||||||
layout.endLayout();
|
layout.endLayout();
|
||||||
|
|
||||||
QTextEngine *engine = layout.engine();
|
QTextEngine *engine = layout.engine();
|
||||||
@ -1218,7 +1218,7 @@ void tst_QTextLayout::capitalization_smallCaps()
|
|||||||
font.setCapitalization(QFont::SmallCaps);
|
font.setCapitalization(QFont::SmallCaps);
|
||||||
QTextLayout layout("Test", font);
|
QTextLayout layout("Test", font);
|
||||||
layout.beginLayout();
|
layout.beginLayout();
|
||||||
QTextLine line = layout.createLine();
|
layout.createLine();
|
||||||
layout.endLayout();
|
layout.endLayout();
|
||||||
|
|
||||||
QTextEngine *engine = layout.engine();
|
QTextEngine *engine = layout.engine();
|
||||||
@ -1234,7 +1234,7 @@ void tst_QTextLayout::capitalization_capitalize()
|
|||||||
font.setCapitalization(QFont::Capitalize);
|
font.setCapitalization(QFont::Capitalize);
|
||||||
QTextLayout layout("hello\tworld", font);
|
QTextLayout layout("hello\tworld", font);
|
||||||
layout.beginLayout();
|
layout.beginLayout();
|
||||||
QTextLine line = layout.createLine();
|
layout.createLine();
|
||||||
layout.endLayout();
|
layout.endLayout();
|
||||||
|
|
||||||
QTextEngine *engine = layout.engine();
|
QTextEngine *engine = layout.engine();
|
||||||
|
@ -2283,11 +2283,10 @@ int CacheFoo::counter = 0;
|
|||||||
void tst_Collections::cache()
|
void tst_Collections::cache()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
CacheFoo* cf;
|
|
||||||
QCache<int, CacheFoo> cache(120);
|
QCache<int, CacheFoo> cache(120);
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 30; i++) {
|
for (i = 0; i < 30; i++) {
|
||||||
cf = cache.object(10);
|
cache.object(10);
|
||||||
cache.insert(i, new CacheFoo(i), i);
|
cache.insert(i, new CacheFoo(i), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3009,6 +3008,7 @@ void instantiateContainer()
|
|||||||
|
|
||||||
constIt = constContainer.end();
|
constIt = constContainer.end();
|
||||||
container.constEnd();
|
container.constEnd();
|
||||||
|
Q_UNUSED(constIt)
|
||||||
#endif
|
#endif
|
||||||
container.clear();
|
container.clear();
|
||||||
container.contains(value);
|
container.contains(value);
|
||||||
@ -3032,6 +3032,7 @@ void instantiateMutableIterationContainer()
|
|||||||
typename ContainerType::iterator it;
|
typename ContainerType::iterator it;
|
||||||
it = container.begin();
|
it = container.begin();
|
||||||
it = container.end();
|
it = container.end();
|
||||||
|
Q_UNUSED(it)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// QSet lacks count(T).
|
// QSet lacks count(T).
|
||||||
|
@ -82,7 +82,7 @@ bool v8test_externalteardown()
|
|||||||
Persistent<Context> context = Context::New();
|
Persistent<Context> context = Context::New();
|
||||||
Context::Scope context_scope(context);
|
Context::Scope context_scope(context);
|
||||||
|
|
||||||
Local<String> str = String::NewExternal(new MyStringResource);
|
String::NewExternal(new MyStringResource);
|
||||||
|
|
||||||
Local<FunctionTemplate> ft = FunctionTemplate::New();
|
Local<FunctionTemplate> ft = FunctionTemplate::New();
|
||||||
ft->InstanceTemplate()->SetHasExternalResource(true);
|
ft->InstanceTemplate()->SetHasExternalResource(true);
|
||||||
|
@ -517,11 +517,9 @@ void tst_QFiledialog::completer()
|
|||||||
if (!fullPath.endsWith(QLatin1Char('/')))
|
if (!fullPath.endsWith(QLatin1Char('/')))
|
||||||
fullPath.append(QLatin1Char('/'));
|
fullPath.append(QLatin1Char('/'));
|
||||||
fullPath.append(input);
|
fullPath.append(input);
|
||||||
bool inputStartsWithRootPath = false;
|
|
||||||
if (input.startsWith(QDir::rootPath())) {
|
if (input.startsWith(QDir::rootPath())) {
|
||||||
fullPath = input;
|
fullPath = input;
|
||||||
input.clear();
|
input.clear();
|
||||||
inputStartsWithRootPath = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QFileInfo fi(fullPath);
|
QFileInfo fi(fullPath);
|
||||||
|
@ -522,6 +522,7 @@ void tst_QMessageBox::testSymbols()
|
|||||||
button = QMessageBox::Default;
|
button = QMessageBox::Default;
|
||||||
button = QMessageBox::Escape;
|
button = QMessageBox::Escape;
|
||||||
button = QMessageBox::FlagMask;
|
button = QMessageBox::FlagMask;
|
||||||
|
QVERIFY(button);
|
||||||
|
|
||||||
const QString text = QStringLiteral("Foo");
|
const QString text = QStringLiteral("Foo");
|
||||||
mb1.setText(text);
|
mb1.setText(text);
|
||||||
|
@ -578,7 +578,6 @@ void tst_QGraphicsProxyWidget::eventFilter()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QEvent::Resize: {
|
case QEvent::Resize: {
|
||||||
QSize oldSize = widget->size();
|
|
||||||
QSize newSize = QSize(100, 100);
|
QSize newSize = QSize(100, 100);
|
||||||
if (fromObject) {
|
if (fromObject) {
|
||||||
widget->resize(newSize);
|
widget->resize(newSize);
|
||||||
@ -590,7 +589,6 @@ void tst_QGraphicsProxyWidget::eventFilter()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QEvent::Move: {
|
case QEvent::Move: {
|
||||||
QPoint oldPoint = widget->pos();
|
|
||||||
QPoint newPoint = QPoint(100, 100);
|
QPoint newPoint = QPoint(100, 100);
|
||||||
if (fromObject) {
|
if (fromObject) {
|
||||||
widget->move(newPoint);
|
widget->move(newPoint);
|
||||||
@ -2651,26 +2649,25 @@ void tst_QGraphicsProxyWidget::childPos_data()
|
|||||||
QTest::addColumn<bool>("moveCombo");
|
QTest::addColumn<bool>("moveCombo");
|
||||||
QTest::addColumn<QPoint>("comboPos");
|
QTest::addColumn<QPoint>("comboPos");
|
||||||
QTest::addColumn<QPointF>("proxyPos");
|
QTest::addColumn<QPointF>("proxyPos");
|
||||||
QTest::addColumn<QPointF>("menuPos");
|
|
||||||
|
|
||||||
QTest::newRow("0") << true << QPoint() << QPointF() << QPointF();
|
QTest::newRow("0") << true << QPoint() << QPointF();
|
||||||
QTest::newRow("1") << true << QPoint(10, 0) << QPointF(10, 0) << QPointF();
|
QTest::newRow("1") << true << QPoint(10, 0) << QPointF(10, 0);
|
||||||
QTest::newRow("2") << true << QPoint(100, 0) << QPointF(100, 0) << QPointF();
|
QTest::newRow("2") << true << QPoint(100, 0) << QPointF(100, 0);
|
||||||
QTest::newRow("3") << true << QPoint(1000, 0) << QPointF(1000, 0) << QPointF();
|
QTest::newRow("3") << true << QPoint(1000, 0) << QPointF(1000, 0);
|
||||||
QTest::newRow("4") << true << QPoint(10000, 0) << QPointF(10000, 0) << QPointF();
|
QTest::newRow("4") << true << QPoint(10000, 0) << QPointF(10000, 0);
|
||||||
QTest::newRow("5") << true << QPoint(-10000, 0) << QPointF(-10000, 0) << QPointF();
|
QTest::newRow("5") << true << QPoint(-10000, 0) << QPointF(-10000, 0);
|
||||||
QTest::newRow("6") << true << QPoint(-1000, 0) << QPointF(-1000, 0) << QPointF();
|
QTest::newRow("6") << true << QPoint(-1000, 0) << QPointF(-1000, 0);
|
||||||
QTest::newRow("7") << true << QPoint(-100, 0) << QPointF(-100, 0) << QPointF();
|
QTest::newRow("7") << true << QPoint(-100, 0) << QPointF(-100, 0);
|
||||||
QTest::newRow("8") << true << QPoint(-10, 0) << QPointF(-10, 0) << QPointF();
|
QTest::newRow("8") << true << QPoint(-10, 0) << QPointF(-10, 0);
|
||||||
QTest::newRow("0-") << false << QPoint() << QPointF() << QPointF();
|
QTest::newRow("0-") << false << QPoint() << QPointF();
|
||||||
QTest::newRow("1-") << false << QPoint(10, 0) << QPointF(10, 0) << QPointF();
|
QTest::newRow("1-") << false << QPoint(10, 0) << QPointF(10, 0);
|
||||||
QTest::newRow("2-") << false << QPoint(100, 0) << QPointF(100, 0) << QPointF();
|
QTest::newRow("2-") << false << QPoint(100, 0) << QPointF(100, 0);
|
||||||
QTest::newRow("3-") << false << QPoint(1000, 0) << QPointF(1000, 0) << QPointF();
|
QTest::newRow("3-") << false << QPoint(1000, 0) << QPointF(1000, 0);
|
||||||
QTest::newRow("4-") << false << QPoint(10000, 0) << QPointF(10000, 0) << QPointF();
|
QTest::newRow("4-") << false << QPoint(10000, 0) << QPointF(10000, 0);
|
||||||
QTest::newRow("5-") << false << QPoint(-10000, 0) << QPointF(-10000, 0) << QPointF();
|
QTest::newRow("5-") << false << QPoint(-10000, 0) << QPointF(-10000, 0);
|
||||||
QTest::newRow("6-") << false << QPoint(-1000, 0) << QPointF(-1000, 0) << QPointF();
|
QTest::newRow("6-") << false << QPoint(-1000, 0) << QPointF(-1000, 0);
|
||||||
QTest::newRow("7-") << false << QPoint(-100, 0) << QPointF(-100, 0) << QPointF();
|
QTest::newRow("7-") << false << QPoint(-100, 0) << QPointF(-100, 0);
|
||||||
QTest::newRow("8-") << false << QPoint(-10, 0) << QPointF(-10, 0) << QPointF();
|
QTest::newRow("8-") << false << QPoint(-10, 0) << QPointF(-10, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QGraphicsProxyWidget::childPos()
|
void tst_QGraphicsProxyWidget::childPos()
|
||||||
@ -2681,7 +2678,6 @@ void tst_QGraphicsProxyWidget::childPos()
|
|||||||
QFETCH(bool, moveCombo);
|
QFETCH(bool, moveCombo);
|
||||||
QFETCH(QPoint, comboPos);
|
QFETCH(QPoint, comboPos);
|
||||||
QFETCH(QPointF, proxyPos);
|
QFETCH(QPointF, proxyPos);
|
||||||
QFETCH(QPointF, menuPos);
|
|
||||||
|
|
||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
|
|
||||||
|
@ -1369,7 +1369,6 @@ void tst_QGraphicsView::itemsInRect()
|
|||||||
view.setSceneRect(-10000, -10000, 20000, 20000);
|
view.setSceneRect(-10000, -10000, 20000, 20000);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QPoint centerPoint = view.viewport()->rect().center();
|
|
||||||
QRect leftRect = view.mapFromScene(-30, -10, 20, 20).boundingRect();
|
QRect leftRect = view.mapFromScene(-30, -10, 20, 20).boundingRect();
|
||||||
QRect rightRect = view.mapFromScene(30, -10, 20, 20).boundingRect();
|
QRect rightRect = view.mapFromScene(30, -10, 20, 20).boundingRect();
|
||||||
|
|
||||||
@ -1490,7 +1489,6 @@ void tst_QGraphicsView::itemsInPoly()
|
|||||||
view.setSceneRect(-10000, -10000, 20000, 20000);
|
view.setSceneRect(-10000, -10000, 20000, 20000);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QPoint centerPoint = view.viewport()->rect().center();
|
|
||||||
QPolygon leftPoly = view.mapFromScene(QRectF(-30, -10, 20, 20));
|
QPolygon leftPoly = view.mapFromScene(QRectF(-30, -10, 20, 20));
|
||||||
QPolygon rightPoly = view.mapFromScene(QRectF(30, -10, 20, 20));
|
QPolygon rightPoly = view.mapFromScene(QRectF(30, -10, 20, 20));
|
||||||
|
|
||||||
@ -1534,7 +1532,6 @@ void tst_QGraphicsView::itemsInPath()
|
|||||||
view.setSceneRect(-10000, -10000, 20000, 20000);
|
view.setSceneRect(-10000, -10000, 20000, 20000);
|
||||||
view.show();
|
view.show();
|
||||||
|
|
||||||
QPoint centerPoint = view.viewport()->rect().center();
|
|
||||||
QPainterPath leftPath;
|
QPainterPath leftPath;
|
||||||
leftPath.addEllipse(QRect(view.mapFromScene(-30, -10), QSize(20, 20)));
|
leftPath.addEllipse(QRect(view.mapFromScene(-30, -10), QSize(20, 20)));
|
||||||
|
|
||||||
@ -1794,7 +1791,6 @@ void tst_QGraphicsView::mapToScenePath()
|
|||||||
view.translate(10, 10);
|
view.translate(10, 10);
|
||||||
view.setFixedSize(300, 300);
|
view.setFixedSize(300, 300);
|
||||||
view.show();
|
view.show();
|
||||||
QPoint center = view.viewport()->rect().center();
|
|
||||||
QRect rect(QPoint(10, 0), QSize(10, 10));
|
QRect rect(QPoint(10, 0), QSize(10, 10));
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
|
@ -169,7 +169,7 @@ void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data()
|
|||||||
|
|
||||||
QStringList strings3; strings3 << "One" << "Two" << "Three" << "Four" << "Five";
|
QStringList strings3; strings3 << "One" << "Two" << "Three" << "Four" << "Five";
|
||||||
QStringList aboutto3; aboutto3 << "One" << "Two" << "Three" << "Four" << "Five";
|
QStringList aboutto3; aboutto3 << "One" << "Two" << "Three" << "Four" << "Five";
|
||||||
QStringList res3; res3 ;
|
QStringList res3;
|
||||||
QTest::newRow( "data3" ) << strings3 << 0 << 5 << aboutto3 << res3;
|
QTest::newRow( "data3" ) << strings3 << 0 << 5 << aboutto3 << res3;
|
||||||
|
|
||||||
/* Not sure if this is a valid test */
|
/* Not sure if this is a valid test */
|
||||||
|
@ -3280,8 +3280,6 @@ void tst_QTreeWidget::taskQTBUG2844_visualItemRect()
|
|||||||
tree.setColumnCount(3);
|
tree.setColumnCount(3);
|
||||||
QTreeWidgetItem item(&tree);
|
QTreeWidgetItem item(&tree);
|
||||||
|
|
||||||
QRect itemRect = tree.visualItemRect(&item);
|
|
||||||
|
|
||||||
QRect rectCol0 = tree.visualRect(tree.indexFromItem(&item, 0));
|
QRect rectCol0 = tree.visualRect(tree.indexFromItem(&item, 0));
|
||||||
QRect rectCol1 = tree.visualRect(tree.indexFromItem(&item, 1));
|
QRect rectCol1 = tree.visualRect(tree.indexFromItem(&item, 1));
|
||||||
QRect rectCol2 = tree.visualRect(tree.indexFromItem(&item, 2));
|
QRect rectCol2 = tree.visualRect(tree.indexFromItem(&item, 2));
|
||||||
|
@ -5015,8 +5015,6 @@ void tst_QWidget::moveChild()
|
|||||||
parent.setGeometry(60, 60, 150, 150);
|
parent.setGeometry(60, 60, 150, 150);
|
||||||
#endif
|
#endif
|
||||||
child.setGeometry(25, 25, 50, 50);
|
child.setGeometry(25, 25, 50, 50);
|
||||||
QPoint childOffset = child.mapToGlobal(QPoint());
|
|
||||||
|
|
||||||
parent.show();
|
parent.show();
|
||||||
QTest::qWaitForWindowShown(&parent);
|
QTest::qWaitForWindowShown(&parent);
|
||||||
QTest::qWait(30);
|
QTest::qWait(30);
|
||||||
@ -6970,9 +6968,6 @@ void tst_QWidget::render_worldTransform()
|
|||||||
painter.translate(105, 5);
|
painter.translate(105, 5);
|
||||||
painter.rotate(90);
|
painter.rotate(90);
|
||||||
|
|
||||||
const QTransform worldTransform = painter.worldTransform();
|
|
||||||
const QTransform deviceTransform = painter.deviceTransform();
|
|
||||||
|
|
||||||
// Render widgets onto image.
|
// Render widgets onto image.
|
||||||
widget.render(&painter);
|
widget.render(&painter);
|
||||||
#ifdef RENDER_DEBUG
|
#ifdef RENDER_DEBUG
|
||||||
@ -7100,7 +7095,6 @@ void tst_QWidget::repaintWhenChildDeleted()
|
|||||||
w.r = QRegion();
|
w.r = QRegion();
|
||||||
|
|
||||||
{
|
{
|
||||||
const QPoint tlwOffset = w.geometry().topLeft();
|
|
||||||
ColorWidget child(&w, Qt::blue);
|
ColorWidget child(&w, Qt::blue);
|
||||||
child.setGeometry(10, 10, 10, 10);
|
child.setGeometry(10, 10, 10, 10);
|
||||||
child.show();
|
child.show();
|
||||||
|
@ -180,7 +180,6 @@ void tst_QCalendarWidget::buttonClickCheck()
|
|||||||
object.setGeometry(0,0,size.width(), size.height());
|
object.setGeometry(0,0,size.width(), size.height());
|
||||||
object.show();
|
object.show();
|
||||||
|
|
||||||
QRect rect = object.geometry();
|
|
||||||
QDate selectedDate(2005, 1, 1);
|
QDate selectedDate(2005, 1, 1);
|
||||||
//click on the month buttons
|
//click on the month buttons
|
||||||
int month = object.monthShown();
|
int month = object.monthShown();
|
||||||
|
@ -294,7 +294,6 @@ void tst_QMainWindow::iconSize()
|
|||||||
|
|
||||||
// the default is determined by the style
|
// the default is determined by the style
|
||||||
const int metric = mw.style()->pixelMetric(QStyle::PM_ToolBarIconSize);
|
const int metric = mw.style()->pixelMetric(QStyle::PM_ToolBarIconSize);
|
||||||
const QSize defaultIconSize = QSize(metric, metric);
|
|
||||||
const QSize smallIconSize = QSize(metric / 2, metric / 2);
|
const QSize smallIconSize = QSize(metric / 2, metric / 2);
|
||||||
const QSize largeIconSize = QSize(metric * 2, metric * 2);
|
const QSize largeIconSize = QSize(metric * 2, metric * 2);
|
||||||
|
|
||||||
|
@ -2026,9 +2026,6 @@ void tst_QTextEdit::fullWidthSelection2()
|
|||||||
widget.setExtraSelections(selections);
|
widget.setExtraSelections(selections);
|
||||||
|
|
||||||
compareWidgetAndImage(widget, "fullWidthSelection/nowrap_long.png");
|
compareWidgetAndImage(widget, "fullWidthSelection/nowrap_long.png");
|
||||||
|
|
||||||
QTextLine line = widget.document()->begin().layout()->lineAt(0);
|
|
||||||
// qDebug() << line.width();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imageFileName)
|
void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imageFileName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user