diff options
Diffstat (limited to 'tests')
277 files changed, 9095 insertions, 2671 deletions
diff --git a/tests/auto/corelib/global/qglobal/qglobal.pro b/tests/auto/corelib/global/qglobal/qglobal.pro index a40cb9a288..b105769430 100644 --- a/tests/auto/corelib/global/qglobal/qglobal.pro +++ b/tests/auto/corelib/global/qglobal/qglobal.pro @@ -2,3 +2,4 @@ CONFIG += testcase TARGET = tst_qglobal QT = core testlib SOURCES = tst_qglobal.cpp qglobal.c +contains(QT_CONFIG, c++1z): CONFIG += c++1z diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index 78b954f373..56da047147 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -126,6 +126,46 @@ void tst_QGlobal::for_each() QCOMPARE(i, counter++); } QCOMPARE(counter, list.count()); + + // Should also work with an existing variable + int local; + counter = 0; + foreach (local, list) { + QCOMPARE(local, counter++); + } + QCOMPARE(counter, list.count()); + QCOMPARE(local, counter - 1); + + // Test the macro does not mess if/else conditions + counter = 0; + if (true) + foreach (int i, list) + QCOMPARE(i, counter++); + else + QFAIL("If/Else mismatch"); + QCOMPARE(counter, list.count()); + + counter = 0; + if (false) + foreach (int i, list) + if (i) QFAIL("If/Else mismatch"); + else QFAIL("If/Else mismatch"); + else + foreach (int i, list) + if (false) { } + else QCOMPARE(i, counter++); + QCOMPARE(counter, list.count()); + + // break and continue + counter = 0; + foreach (int i, list) { + if (i == 0) + continue; + QCOMPARE(i, (counter++) + 1); + if (i == 3) + break; + } + QCOMPARE(counter, 3); } void tst_QGlobal::qassert() diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 017eebe153..3e29475636 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -95,6 +95,38 @@ inline bool qIsLikelyToBeNfs(const QString &path) #endif } +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) +# ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE // MinGW +# define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE (0x2) +# endif + +static DWORD createSymbolicLink(const QString &symLinkName, const QString &target, + QString *errorMessage) +{ + DWORD result = ERROR_SUCCESS; + const QString nativeSymLinkName = QDir::toNativeSeparators(symLinkName); + const QString nativeTarget = QDir::toNativeSeparators(target); + DWORD flags = 0; + if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 14972)) + flags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; + if (QFileInfo(target).isDir()) + flags |= SYMBOLIC_LINK_FLAG_DIRECTORY; + if (CreateSymbolicLink(reinterpret_cast<const wchar_t*>(nativeSymLinkName.utf16()), + reinterpret_cast<const wchar_t*>(nativeTarget.utf16()), flags) == FALSE) { + result = GetLastError(); + QTextStream(errorMessage) << "CreateSymbolicLink(" << nativeSymLinkName << ", " + << nativeTarget << ", 0x" << hex << flags << dec << ") failed with error " << result + << ": " << qt_error_string(int(result)); + } + return result; +} + +static QByteArray msgInsufficientPrivileges(const QString &errorMessage) +{ + return "Insufficient privileges (" + errorMessage.toLocal8Bit() + ')'; +} +#endif // Q_OS_WIN && !Q_OS_WINRT + static QString seedAndTemplate() { QString base; @@ -704,19 +736,14 @@ void tst_QFileInfo::canonicalFilePath() #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) { - // CreateSymbolicLink can return TRUE & still fail to create the link, - // the error code in that case is ERROR_PRIVILEGE_NOT_HELD (1314) - SetLastError(0); + QString errorMessage; const QString linkTarget = QStringLiteral("res"); - BOOL ret = CreateSymbolicLink((wchar_t*)linkTarget.utf16(), (wchar_t*)m_resourcesDir.utf16(), 1); - DWORD dwErr = GetLastError(); - if (!ret) - QSKIP("Symbolic links aren't supported by FS"); + const DWORD dwErr = createSymbolicLink(linkTarget, m_resourcesDir, &errorMessage); + if (dwErr == ERROR_PRIVILEGE_NOT_HELD) + QSKIP(msgInsufficientPrivileges(errorMessage)); + QVERIFY2(dwErr == ERROR_SUCCESS, qPrintable(errorMessage)); QString currentPath = QDir::currentPath(); - bool is_res_Current = QDir::setCurrent(linkTarget); - if (!is_res_Current && dwErr == 1314) - QSKIP("Not enough privilages to create Symbolic links"); - QCOMPARE(is_res_Current, true); + QVERIFY(QDir::setCurrent(linkTarget)); const QString actualCanonicalPath = QFileInfo("file1").canonicalFilePath(); QVERIFY(QDir::setCurrent(currentPath)); QCOMPARE(actualCanonicalPath, m_resourcesDir + QStringLiteral("/file1")); @@ -1455,8 +1482,24 @@ void tst_QFileInfo::refresh() } #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) + +struct NtfsTestResource { + + enum Type { None, SymLink, Junction }; + + explicit NtfsTestResource(Type tp = None, const QString &s = QString(), const QString &t = QString()) + : source(s), target(t), type(tp) {} + + QString source; + QString target; + Type type; +}; + +Q_DECLARE_METATYPE(NtfsTestResource) + void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data() { + QTest::addColumn<NtfsTestResource>("resource"); QTest::addColumn<QString>("path"); QTest::addColumn<bool>("isSymLink"); QTest::addColumn<QString>("linkTarget"); @@ -1479,32 +1522,20 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data() QString fileInSymlink(absSymlink); fileInSymlink.append("\\file"); QFile file(fileInTarget); - file.open(QIODevice::ReadWrite); + QVERIFY2(file.open(QIODevice::ReadWrite), qPrintable(file.errorString())); file.close(); - DWORD err = ERROR_SUCCESS ; - if (!pwd.exists("abs_symlink")) - if (!CreateSymbolicLink((wchar_t*)absSymlink.utf16(),(wchar_t*)absTarget.utf16(),0x1)) - err = GetLastError(); - if (err == ERROR_SUCCESS && !pwd.exists(relSymlink)) - if (!CreateSymbolicLink((wchar_t*)relSymlink.utf16(),(wchar_t*)relTarget.utf16(),0x1)) - err = GetLastError(); - if (err != ERROR_SUCCESS) { - wchar_t errstr[0x100]; - DWORD count = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, - 0, err, 0, errstr, 0x100, 0); - QString error(QString::fromWCharArray(errstr, count)); - qWarning() << error; - //we need at least one data set for the test not to assert fail when skipping _data function - QDir target("target"); - QTest::newRow("dummy") << target.path() << false << "" << target.canonicalPath(); - QSKIP("link not supported by FS or insufficient privilege"); - } QVERIFY2(file.exists(), msgDoesNotExist(file.fileName()).constData()); - QTest::newRow("absolute dir symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath(); - QTest::newRow("relative dir symlink") << relSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath(); - QTest::newRow("file in symlink dir") << fileInSymlink << false << "" << target.canonicalPath().append("/file"); + QTest::newRow("absolute dir symlink") + << NtfsTestResource(NtfsTestResource::SymLink, absSymlink, absTarget) + << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath(); + QTest::newRow("relative dir symlink") + << NtfsTestResource(NtfsTestResource::SymLink, relSymlink, relTarget) + << relSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath(); + QTest::newRow("file in symlink dir") + << NtfsTestResource() + << fileInSymlink << false << "" << target.canonicalPath().append("/file"); } { //File symlinks @@ -1517,33 +1548,41 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data() QString relSymlink = "rel_symlink.cpp"; QString relToRelTarget = QDir::toNativeSeparators(relativeDir.relativeFilePath(target.absoluteFilePath())); QString relToRelSymlink = "relative/rel_symlink"; - QVERIFY(pwd.exists("abs_symlink.cpp") || CreateSymbolicLink((wchar_t*)absSymlink.utf16(),(wchar_t*)absTarget.utf16(),0x0)); - QVERIFY(pwd.exists(relSymlink) || CreateSymbolicLink((wchar_t*)relSymlink.utf16(),(wchar_t*)relTarget.utf16(),0x0)); - QVERIFY(pwd.exists(relToRelSymlink) || CreateSymbolicLink((wchar_t*)relToRelSymlink.utf16(), (wchar_t*)relToRelTarget.utf16(),0x0)); - QTest::newRow("absolute file symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); - QTest::newRow("relative file symlink") << relSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); - QTest::newRow("relative to relative file symlink") << relToRelSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); + + QTest::newRow("absolute file symlink") + << NtfsTestResource(NtfsTestResource::SymLink, absSymlink, absTarget) + << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); + QTest::newRow("relative file symlink") + << NtfsTestResource(NtfsTestResource::SymLink, relSymlink, relTarget) + << relSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); + QTest::newRow("relative to relative file symlink") + << NtfsTestResource(NtfsTestResource::SymLink, relToRelSymlink, relToRelTarget) + << relToRelSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalFilePath(); } //Junctions QString target = "target"; QString junction = "junction_pwd"; - FileSystem::createNtfsJunction(target, junction); QFileInfo targetInfo(target); - QTest::newRow("junction_pwd") << junction << false << QString() << QString(); + QTest::newRow("junction_pwd") + << NtfsTestResource(NtfsTestResource::Junction, junction, target) + << junction << false << QString() << QString(); QFileInfo fileInJunction(targetInfo.absoluteFilePath().append("/file")); QFile file(fileInJunction.absoluteFilePath()); - file.open(QIODevice::ReadWrite); + QVERIFY2(file.open(QIODevice::ReadWrite), qPrintable(file.errorString())); file.close(); QVERIFY2(file.exists(), msgDoesNotExist(file.fileName()).constData()); - QTest::newRow("file in junction") << fileInJunction.absoluteFilePath() << false << "" << fileInJunction.canonicalFilePath(); + QTest::newRow("file in junction") + << NtfsTestResource() + << fileInJunction.absoluteFilePath() << false << QString() << fileInJunction.canonicalFilePath(); target = QDir::rootPath(); junction = "junction_root"; - FileSystem::createNtfsJunction(target, junction); targetInfo.setFile(target); - QTest::newRow("junction_root") << junction << false << QString() << QString(); + QTest::newRow("junction_root") + << NtfsTestResource(NtfsTestResource::Junction, junction, target) + << junction << false << QString() << QString(); //Mountpoint wchar_t buffer[MAX_PATH]; @@ -1552,17 +1591,38 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data() QString rootVolume = QString::fromWCharArray(buffer); junction = "mountpoint"; rootVolume.replace("\\\\?\\","\\??\\"); - FileSystem::createNtfsJunction(rootVolume, junction); - QTest::newRow("mountpoint") << junction << false << QString() << QString(); + QTest::newRow("mountpoint") + << NtfsTestResource(NtfsTestResource::Junction, junction, rootVolume) + << junction << false << QString() << QString(); } void tst_QFileInfo::ntfsJunctionPointsAndSymlinks() { + QFETCH(NtfsTestResource, resource); QFETCH(QString, path); QFETCH(bool, isSymLink); QFETCH(QString, linkTarget); QFETCH(QString, canonicalFilePath); + QString errorMessage; + DWORD creationResult = ERROR_SUCCESS; + switch (resource.type) { + case NtfsTestResource::None: + break; + case NtfsTestResource::SymLink: + creationResult = createSymbolicLink(resource.source, resource.target, &errorMessage); + break; + case NtfsTestResource::Junction: + creationResult = FileSystem::createNtfsJunction(resource.target, resource.source, &errorMessage); + if (creationResult == ERROR_NOT_SUPPORTED) // Special value indicating non-NTFS drive + QSKIP(qPrintable(errorMessage)); + break; + } + + if (creationResult == ERROR_PRIVILEGE_NOT_HELD) + QSKIP(msgInsufficientPrivileges(errorMessage)); + QVERIFY2(creationResult == ERROR_SUCCESS, qPrintable(errorMessage)); + QFileInfo fi(path); const bool actualIsSymLink = fi.isSymLink(); const QString actualSymLinkTarget = isSymLink ? fi.symLinkTarget() : QString(); diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp index d839141091..25d392b37e 100644 --- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp +++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp @@ -233,6 +233,14 @@ void tst_QUrlQuery::constructing() query += qMakePair(QString("prosent"), QString("%")); copy.setQueryItems(query); QVERIFY(!copy.isEmpty()); + + QUrlQuery fromList = { + {QString("type"), QString("login")}, + {QString("name"), QString::fromUtf8("åge nissemannsen")}, + {QString("ole&du"), QString::fromUtf8("anne+jørgen=sant")}, + {QString("prosent"), QString("%")} + }; + QCOMPARE(fromList, copy); } void tst_QUrlQuery::addRemove() diff --git a/tests/auto/corelib/itemmodels/itemmodels.pro b/tests/auto/corelib/itemmodels/itemmodels.pro index cca350ad43..ffbda6ec40 100644 --- a/tests/auto/corelib/itemmodels/itemmodels.pro +++ b/tests/auto/corelib/itemmodels/itemmodels.pro @@ -5,9 +5,11 @@ SUBDIRS = qstringlistmodel qtHaveModule(gui): SUBDIRS += \ qabstractitemmodel \ qabstractproxymodel \ + qconcatenatetablesproxymodel \ qidentityproxymodel \ qitemselectionmodel \ qsortfilterproxymodel_recursive \ + qtransposeproxymodel \ qtHaveModule(widgets) { SUBDIRS += \ diff --git a/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/qconcatenatetablesproxymodel.pro b/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/qconcatenatetablesproxymodel.pro new file mode 100644 index 0000000000..ee4ea28b5b --- /dev/null +++ b/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/qconcatenatetablesproxymodel.pro @@ -0,0 +1,5 @@ +CONFIG += testcase +TARGET = tst_qconcatenatetablesproxymodel +QT = core gui testlib + +SOURCES = tst_qconcatenatetablesproxymodel.cpp diff --git a/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/tst_qconcatenatetablesproxymodel.cpp b/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/tst_qconcatenatetablesproxymodel.cpp new file mode 100644 index 0000000000..40617c1f7d --- /dev/null +++ b/tests/auto/corelib/itemmodels/qconcatenatetablesproxymodel/tst_qconcatenatetablesproxymodel.cpp @@ -0,0 +1,823 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QSignalSpy> +#include <QSortFilterProxyModel> +#include <QTest> +#include <QStandardItemModel> +#include <QIdentityProxyModel> +#include <QItemSelectionModel> +#include <QMimeData> +#include <QStringListModel> +#include <QAbstractItemModelTester> + +#include <qconcatenatetablesproxymodel.h> + +Q_DECLARE_METATYPE(QModelIndex) + +// Extracts a full row from a model as a string +// Works best if every cell contains only one character +static QString extractRowTexts(QAbstractItemModel *model, int row, const QModelIndex &parent = QModelIndex()) +{ + QString result; + const int colCount = model->columnCount(); + for (int col = 0; col < colCount; ++col) { + const QString txt = model->index(row, col, parent).data().toString(); + result += txt.isEmpty() ? QStringLiteral(" ") : txt; + } + return result; +} + +// Extracts a full column from a model as a string +// Works best if every cell contains only one character +static QString extractColumnTexts(QAbstractItemModel *model, int column, const QModelIndex &parent = QModelIndex()) +{ + QString result; + const int rowCount = model->rowCount(); + for (int row = 0; row < rowCount; ++row) { + const QString txt = model->index(row, column, parent).data().toString(); + result += txt.isEmpty() ? QStringLiteral(" ") : txt; + } + return result; +} + +static QString rowSpyToText(const QSignalSpy &spy) +{ + if (!spy.isValid()) + return QStringLiteral("THE SIGNALSPY IS INVALID!"); + QString str; + for (int i = 0; i < spy.count(); ++i) { + str += spy.at(i).at(1).toString() + QLatin1Char(',') + spy.at(i).at(2).toString(); + if (i + 1 < spy.count()) + str += QLatin1Char(';'); + } + return str; +} + +class tst_QConcatenateTablesProxyModel : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void init(); + void shouldAggregateTwoModelsCorrectly(); + void shouldAggregateThenRemoveTwoEmptyModelsCorrectly(); + void shouldAggregateTwoEmptyModelsWhichThenGetFilled(); + void shouldHandleDataChanged(); + void shouldHandleSetData(); + void shouldHandleSetItemData(); + void shouldHandleRowInsertionAndRemoval(); + void shouldAggregateAnotherModelThenRemoveModels(); + void shouldUseSmallestColumnCount(); + void shouldIncreaseColumnCountWhenRemovingFirstModel(); + void shouldHandleColumnInsertionAndRemoval(); + void shouldPropagateLayoutChanged(); + void shouldReactToModelReset(); + void shouldUpdateColumnsOnModelReset(); + void shouldPropagateDropOnItem_data(); + void shouldPropagateDropOnItem(); + void shouldPropagateDropBetweenItems(); + void shouldPropagateDropBetweenItemsAtModelBoundary(); + void shouldPropagateDropAfterLastRow_data(); + void shouldPropagateDropAfterLastRow(); + +private: + QStandardItemModel mod; + QStandardItemModel mod2; + QStandardItemModel mod3; +}; + +void tst_QConcatenateTablesProxyModel::init() +{ + // Prepare some source models to use later on + mod.clear(); + mod.appendRow({ new QStandardItem(QStringLiteral("A")), new QStandardItem(QStringLiteral("B")), new QStandardItem(QStringLiteral("C")) }); + mod.setHorizontalHeaderLabels(QStringList() << QStringLiteral("H1") << QStringLiteral("H2") << QStringLiteral("H3")); + mod.setVerticalHeaderLabels(QStringList() << QStringLiteral("One")); + + mod2.clear(); + mod2.appendRow({ new QStandardItem(QStringLiteral("D")), new QStandardItem(QStringLiteral("E")), new QStandardItem(QStringLiteral("F")) }); + mod2.setHorizontalHeaderLabels(QStringList() << QStringLiteral("H1") << QStringLiteral("H2") << QStringLiteral("H3")); + mod2.setVerticalHeaderLabels(QStringList() << QStringLiteral("Two")); + + mod3.clear(); + mod3.appendRow({ new QStandardItem(QStringLiteral("1")), new QStandardItem(QStringLiteral("2")), new QStandardItem(QStringLiteral("3")) }); + mod3.appendRow({ new QStandardItem(QStringLiteral("4")), new QStandardItem(QStringLiteral("5")), new QStandardItem(QStringLiteral("6")) }); +} + +void tst_QConcatenateTablesProxyModel::shouldAggregateTwoModelsCorrectly() +{ + // Given a combining proxy + QConcatenateTablesProxyModel pm; + + // When adding two source models + pm.addSourceModel(&mod); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + + // Then the proxy should show 2 rows + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + + // ... and correct headers + QCOMPARE(pm.headerData(0, Qt::Horizontal).toString(), QStringLiteral("H1")); + QCOMPARE(pm.headerData(1, Qt::Horizontal).toString(), QStringLiteral("H2")); + QCOMPARE(pm.headerData(2, Qt::Horizontal).toString(), QStringLiteral("H3")); + QCOMPARE(pm.headerData(0, Qt::Vertical).toString(), QStringLiteral("One")); + QCOMPARE(pm.headerData(1, Qt::Vertical).toString(), QStringLiteral("Two")); + + QVERIFY(!pm.canFetchMore(QModelIndex())); +} + +void tst_QConcatenateTablesProxyModel::shouldAggregateThenRemoveTwoEmptyModelsCorrectly() +{ + // Given a combining proxy + QConcatenateTablesProxyModel pm; + + // When adding two empty models + QSignalSpy rowATBISpy(&pm, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int))); + QSignalSpy rowInsertedSpy(&pm, SIGNAL(rowsInserted(QModelIndex,int,int))); + QSignalSpy rowATBRSpy(&pm, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy rowRemovedSpy(&pm, SIGNAL(rowsRemoved(QModelIndex,int,int))); + QIdentityProxyModel i1, i2; + pm.addSourceModel(&i1); + pm.addSourceModel(&i2); + + // Then the proxy should still be empty (and no signals emitted) + QCOMPARE(pm.rowCount(), 0); + QCOMPARE(pm.columnCount(), 0); + QCOMPARE(rowATBISpy.count(), 0); + QCOMPARE(rowInsertedSpy.count(), 0); + + // When removing the empty models + pm.removeSourceModel(&i1); + pm.removeSourceModel(&i2); + + // Then the proxy should still be empty (and no signals emitted) + QCOMPARE(pm.rowCount(), 0); + QCOMPARE(pm.columnCount(), 0); + QCOMPARE(rowATBRSpy.count(), 0); + QCOMPARE(rowRemovedSpy.count(), 0); +} + +void tst_QConcatenateTablesProxyModel::shouldAggregateTwoEmptyModelsWhichThenGetFilled() +{ + // Given a combining proxy with two empty models + QConcatenateTablesProxyModel pm; + QIdentityProxyModel i1, i2; + pm.addSourceModel(&i1); + pm.addSourceModel(&i2); + + // When filling them afterwards + i1.setSourceModel(&mod); + i2.setSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + + // Then the proxy should show 2 rows + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(pm.columnCount(), 3); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + + // ... and correct headers + QCOMPARE(pm.headerData(0, Qt::Horizontal).toString(), QStringLiteral("H1")); + QCOMPARE(pm.headerData(1, Qt::Horizontal).toString(), QStringLiteral("H2")); + QCOMPARE(pm.headerData(2, Qt::Horizontal).toString(), QStringLiteral("H3")); + QCOMPARE(pm.headerData(0, Qt::Vertical).toString(), QStringLiteral("One")); + QCOMPARE(pm.headerData(1, Qt::Vertical).toString(), QStringLiteral("Two")); + + QVERIFY(!pm.canFetchMore(QModelIndex())); +} + +void tst_QConcatenateTablesProxyModel::shouldHandleDataChanged() +{ + // Given two models combined + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + QSignalSpy dataChangedSpy(&pm, SIGNAL(dataChanged(QModelIndex,QModelIndex))); + + // When a cell in a source model changes + mod.item(0, 0)->setData("a", Qt::EditRole); + + // Then the change should be notified to the proxy + QCOMPARE(dataChangedSpy.count(), 1); + QCOMPARE(dataChangedSpy.at(0).at(0).toModelIndex(), pm.index(0, 0)); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("aBC")); + + // Same test with the other model + mod2.item(0, 2)->setData("f", Qt::EditRole); + + QCOMPARE(dataChangedSpy.count(), 2); + QCOMPARE(dataChangedSpy.at(1).at(0).toModelIndex(), pm.index(1, 2)); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEf")); +} + +void tst_QConcatenateTablesProxyModel::shouldHandleSetData() +{ + // Given two models combined + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + QSignalSpy dataChangedSpy(&pm, SIGNAL(dataChanged(QModelIndex,QModelIndex))); + + // When changing a cell using setData + pm.setData(pm.index(0, 0), "a"); + + // Then the change should be notified to the proxy + QCOMPARE(dataChangedSpy.count(), 1); + QCOMPARE(dataChangedSpy.at(0).at(0).toModelIndex(), pm.index(0, 0)); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("aBC")); + + // Same test with the other model + pm.setData(pm.index(1, 2), "f"); + + QCOMPARE(dataChangedSpy.count(), 2); + QCOMPARE(dataChangedSpy.at(1).at(0).toModelIndex(), pm.index(1, 2)); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEf")); +} + +void tst_QConcatenateTablesProxyModel::shouldHandleSetItemData() +{ + // Given two models combined + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + QSignalSpy dataChangedSpy(&pm, SIGNAL(dataChanged(QModelIndex,QModelIndex))); + + // When changing a cell using setData + pm.setItemData(pm.index(0, 0), QMap<int, QVariant>{ std::make_pair<int, QVariant>(Qt::DisplayRole, QStringLiteral("X")), + std::make_pair<int, QVariant>(Qt::UserRole, 88) }); + + // Then the change should be notified to the proxy + QCOMPARE(dataChangedSpy.count(), 1); + QCOMPARE(dataChangedSpy.at(0).at(0).toModelIndex(), pm.index(0, 0)); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("XBC")); + QCOMPARE(pm.index(0, 0).data(Qt::UserRole).toInt(), 88); + + // Same test with the other model + pm.setItemData(pm.index(1, 2), QMap<int, QVariant>{ std::make_pair<int, QVariant>(Qt::DisplayRole, QStringLiteral("Y")), + std::make_pair<int, QVariant>(Qt::UserRole, 89) }); + + QCOMPARE(dataChangedSpy.count(), 2); + QCOMPARE(dataChangedSpy.at(1).at(0).toModelIndex(), pm.index(1, 2)); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEY")); + QCOMPARE(pm.index(1, 2).data(Qt::UserRole).toInt(), 89); +} + +void tst_QConcatenateTablesProxyModel::shouldHandleRowInsertionAndRemoval() +{ + // Given two models combined + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + QSignalSpy rowATBISpy(&pm, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int))); + QSignalSpy rowInsertedSpy(&pm, SIGNAL(rowsInserted(QModelIndex,int,int))); + + // When a source model inserts a new row + QList<QStandardItem *> row; + row.append(new QStandardItem(QStringLiteral("1"))); + row.append(new QStandardItem(QStringLiteral("2"))); + row.append(new QStandardItem(QStringLiteral("3"))); + mod2.insertRow(0, row); + + // Then the proxy should notify its users and show changes + QCOMPARE(rowSpyToText(rowATBISpy), QStringLiteral("1,1")); + QCOMPARE(rowSpyToText(rowInsertedSpy), QStringLiteral("1,1")); + QCOMPARE(pm.rowCount(), 3); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("DEF")); + + // When removing that row + QSignalSpy rowATBRSpy(&pm, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy rowRemovedSpy(&pm, SIGNAL(rowsRemoved(QModelIndex,int,int))); + mod2.removeRow(0); + + // Then the proxy should notify its users and show changes + QCOMPARE(rowATBRSpy.count(), 1); + QCOMPARE(rowATBRSpy.at(0).at(1).toInt(), 1); + QCOMPARE(rowATBRSpy.at(0).at(2).toInt(), 1); + QCOMPARE(rowRemovedSpy.count(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(1).toInt(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(2).toInt(), 1); + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + + // When removing the last row from mod2 + rowATBRSpy.clear(); + rowRemovedSpy.clear(); + mod2.removeRow(0); + + // Then the proxy should notify its users and show changes + QCOMPARE(rowATBRSpy.count(), 1); + QCOMPARE(rowATBRSpy.at(0).at(1).toInt(), 1); + QCOMPARE(rowATBRSpy.at(0).at(2).toInt(), 1); + QCOMPARE(rowRemovedSpy.count(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(1).toInt(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(2).toInt(), 1); + QCOMPARE(pm.rowCount(), 1); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); +} + +void tst_QConcatenateTablesProxyModel::shouldAggregateAnotherModelThenRemoveModels() +{ + // Given two models combined, and a third model + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + + QSignalSpy rowATBISpy(&pm, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int))); + QSignalSpy rowInsertedSpy(&pm, SIGNAL(rowsInserted(QModelIndex,int,int))); + + // When adding the new source model + pm.addSourceModel(&mod3); + + // Then the proxy should notify its users about the two rows inserted + QCOMPARE(rowSpyToText(rowATBISpy), QStringLiteral("2,3")); + QCOMPARE(rowSpyToText(rowInsertedSpy), QStringLiteral("2,3")); + QCOMPARE(pm.rowCount(), 4); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 3), QStringLiteral("456")); + + // When removing that source model again + QSignalSpy rowATBRSpy(&pm, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy rowRemovedSpy(&pm, SIGNAL(rowsRemoved(QModelIndex,int,int))); + pm.removeSourceModel(&mod3); + + // Then the proxy should notify its users about the row removed + QCOMPARE(rowATBRSpy.count(), 1); + QCOMPARE(rowATBRSpy.at(0).at(1).toInt(), 2); + QCOMPARE(rowATBRSpy.at(0).at(2).toInt(), 3); + QCOMPARE(rowRemovedSpy.count(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(1).toInt(), 2); + QCOMPARE(rowRemovedSpy.at(0).at(2).toInt(), 3); + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + + // When removing model 2 + rowATBRSpy.clear(); + rowRemovedSpy.clear(); + pm.removeSourceModel(&mod2); + QCOMPARE(rowATBRSpy.count(), 1); + QCOMPARE(rowATBRSpy.at(0).at(1).toInt(), 1); + QCOMPARE(rowATBRSpy.at(0).at(2).toInt(), 1); + QCOMPARE(rowRemovedSpy.count(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(1).toInt(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(2).toInt(), 1); + QCOMPARE(pm.rowCount(), 1); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + + // When removing model 1 + rowATBRSpy.clear(); + rowRemovedSpy.clear(); + pm.removeSourceModel(&mod); + QCOMPARE(rowATBRSpy.count(), 1); + QCOMPARE(rowATBRSpy.at(0).at(1).toInt(), 0); + QCOMPARE(rowATBRSpy.at(0).at(2).toInt(), 0); + QCOMPARE(rowRemovedSpy.count(), 1); + QCOMPARE(rowRemovedSpy.at(0).at(1).toInt(), 0); + QCOMPARE(rowRemovedSpy.at(0).at(2).toInt(), 0); + QCOMPARE(pm.rowCount(), 0); +} + +void tst_QConcatenateTablesProxyModel::shouldUseSmallestColumnCount() +{ + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + pm.addSourceModel(&mod2); + mod2.setColumnCount(1); + pm.addSourceModel(&mod3); + QAbstractItemModelTester modelTest(&pm, this); + + QCOMPARE(pm.rowCount(), 4); + QCOMPARE(pm.columnCount(), 1); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("A")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("D")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("1")); + QCOMPARE(extractRowTexts(&pm, 3), QStringLiteral("4")); + + const QModelIndex indexA = pm.mapFromSource(mod.index(0, 0)); + QVERIFY(indexA.isValid()); + QCOMPARE(indexA, pm.index(0, 0)); + + const QModelIndex indexB = pm.mapFromSource(mod.index(0, 1)); + QVERIFY(!indexB.isValid()); + + const QModelIndex indexD = pm.mapFromSource(mod2.index(0, 0)); + QVERIFY(indexD.isValid()); + QCOMPARE(indexD, pm.index(1, 0)); +} + +void tst_QConcatenateTablesProxyModel::shouldIncreaseColumnCountWhenRemovingFirstModel() +{ + // Given a model with 2 columns and one with 3 columns + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + QAbstractItemModelTester modelTest(&pm, this); + mod.setColumnCount(2); + pm.addSourceModel(&mod2); + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(pm.columnCount(), 2); + + QSignalSpy colATBISpy(&pm, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int))); + QSignalSpy colInsertedSpy(&pm, SIGNAL(columnsInserted(QModelIndex,int,int))); + QSignalSpy rowATBRSpy(&pm, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy rowRemovedSpy(&pm, SIGNAL(rowsRemoved(QModelIndex,int,int))); + + // When removing the first source model + pm.removeSourceModel(&mod); + + // Then the proxy should notify its users about the row removed, and the column added + QCOMPARE(pm.rowCount(), 1); + QCOMPARE(pm.columnCount(), 3); + QCOMPARE(rowSpyToText(rowATBRSpy), QStringLiteral("0,0")); + QCOMPARE(rowSpyToText(rowRemovedSpy), QStringLiteral("0,0")); + QCOMPARE(rowSpyToText(colATBISpy), QStringLiteral("2,2")); + QCOMPARE(rowSpyToText(colInsertedSpy), QStringLiteral("2,2")); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("DEF")); +} + +void tst_QConcatenateTablesProxyModel::shouldHandleColumnInsertionAndRemoval() +{ + // Given two models combined, one with 2 columns and one with 3 + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + QAbstractItemModelTester modelTest(&pm, this); + mod.setColumnCount(2); + pm.addSourceModel(&mod2); + QSignalSpy colATBISpy(&pm, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int))); + QSignalSpy colInsertedSpy(&pm, SIGNAL(columnsInserted(QModelIndex,int,int))); + QSignalSpy colATBRSpy(&pm, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy colRemovedSpy(&pm, SIGNAL(columnsRemoved(QModelIndex,int,int))); + + // When the first source model inserts a new column + QCOMPARE(mod.columnCount(), 2); + mod.setColumnCount(3); + + // Then the proxy should notify its users and show changes + QCOMPARE(rowSpyToText(colATBISpy), QStringLiteral("2,2")); + QCOMPARE(rowSpyToText(colInsertedSpy), QStringLiteral("2,2")); + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(pm.columnCount(), 3); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("AB ")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + + // And when removing two columns + mod.setColumnCount(1); + + // Then the proxy should notify its users and show changes + QCOMPARE(rowSpyToText(colATBRSpy), QStringLiteral("1,2")); + QCOMPARE(rowSpyToText(colRemovedSpy), QStringLiteral("1,2")); + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(pm.columnCount(), 1); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("A")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("D")); +} + +void tst_QConcatenateTablesProxyModel::shouldPropagateLayoutChanged() +{ + // Given two source models, the second one being a QSFPM + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + QAbstractItemModelTester modelTest(&pm, this); + + QSortFilterProxyModel qsfpm; + qsfpm.setSourceModel(&mod3); + pm.addSourceModel(&qsfpm); + + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("456")); + + // And a selection (row 1) + QItemSelectionModel selection(&pm); + selection.select(pm.index(1, 0), QItemSelectionModel::Select | QItemSelectionModel::Rows); + const QModelIndexList lst = selection.selectedIndexes(); + QCOMPARE(lst.count(), 3); + for (int col = 0; col < lst.count(); ++col) { + QCOMPARE(lst.at(col).row(), 1); + QCOMPARE(lst.at(col).column(), col); + } + + QSignalSpy layoutATBCSpy(&pm, SIGNAL(layoutAboutToBeChanged())); + QSignalSpy layoutChangedSpy(&pm, SIGNAL(layoutChanged())); + + // When changing the sorting in the QSFPM + qsfpm.sort(0, Qt::DescendingOrder); + + // Then the proxy should emit the layoutChanged signals, and show re-sorted data + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("123")); + QCOMPARE(layoutATBCSpy.count(), 1); + QCOMPARE(layoutChangedSpy.count(), 1); + + // And the selection should be updated accordingly (it became row 2) + const QModelIndexList lstAfter = selection.selectedIndexes(); + QCOMPARE(lstAfter.count(), 3); + for (int col = 0; col < lstAfter.count(); ++col) { + QCOMPARE(lstAfter.at(col).row(), 2); + QCOMPARE(lstAfter.at(col).column(), col); + } +} + +void tst_QConcatenateTablesProxyModel::shouldReactToModelReset() +{ + // Given two source models, the second one being a QSFPM + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod); + QAbstractItemModelTester modelTest(&pm, this); + + QSortFilterProxyModel qsfpm; + qsfpm.setSourceModel(&mod3); + pm.addSourceModel(&qsfpm); + + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("456")); + QSignalSpy rowATBRSpy(&pm, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy rowRemovedSpy(&pm, SIGNAL(rowsRemoved(QModelIndex,int,int))); + QSignalSpy rowATBISpy(&pm, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int))); + QSignalSpy rowInsertedSpy(&pm, SIGNAL(rowsInserted(QModelIndex,int,int))); + QSignalSpy colATBRSpy(&pm, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy colRemovedSpy(&pm, SIGNAL(columnsRemoved(QModelIndex,int,int))); + QSignalSpy modelATBResetSpy(&pm, SIGNAL(modelAboutToBeReset())); + QSignalSpy modelResetSpy(&pm, SIGNAL(modelReset())); + + // When changing the source model of the QSFPM + qsfpm.setSourceModel(&mod2); + + // Then the proxy should emit the reset signals, and show the new data + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("ABC")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + QCOMPARE(rowATBRSpy.count(), 0); + QCOMPARE(rowRemovedSpy.count(), 0); + QCOMPARE(rowATBISpy.count(), 0); + QCOMPARE(rowInsertedSpy.count(), 0); + QCOMPARE(colATBRSpy.count(), 0); + QCOMPARE(colRemovedSpy.count(), 0); + QCOMPARE(modelATBResetSpy.count(), 1); + QCOMPARE(modelResetSpy.count(), 1); +} + +void tst_QConcatenateTablesProxyModel::shouldUpdateColumnsOnModelReset() +{ + // Given two source models, the first one being a QSFPM + QConcatenateTablesProxyModel pm; + + QSortFilterProxyModel qsfpm; + qsfpm.setSourceModel(&mod3); + pm.addSourceModel(&qsfpm); + pm.addSourceModel(&mod); + QAbstractItemModelTester modelTest(&pm, this); + + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("ABC")); + + // ... and a model with only 2 columns + QStandardItemModel mod2Columns; + mod2Columns.appendRow({ new QStandardItem(QStringLiteral("W")), new QStandardItem(QStringLiteral("X")) }); + + QSignalSpy rowATBRSpy(&pm, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy rowRemovedSpy(&pm, SIGNAL(rowsRemoved(QModelIndex,int,int))); + QSignalSpy rowATBISpy(&pm, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int))); + QSignalSpy rowInsertedSpy(&pm, SIGNAL(rowsInserted(QModelIndex,int,int))); + QSignalSpy colATBRSpy(&pm, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int))); + QSignalSpy colRemovedSpy(&pm, SIGNAL(columnsRemoved(QModelIndex,int,int))); + QSignalSpy modelATBResetSpy(&pm, SIGNAL(modelAboutToBeReset())); + QSignalSpy modelResetSpy(&pm, SIGNAL(modelReset())); + + // When changing the source model of the QSFPM + qsfpm.setSourceModel(&mod2Columns); + + // Then the proxy should reset, and show the new data + QCOMPARE(modelATBResetSpy.count(), 1); + QCOMPARE(modelResetSpy.count(), 1); + QCOMPARE(rowATBRSpy.count(), 0); + QCOMPARE(rowRemovedSpy.count(), 0); + QCOMPARE(rowATBISpy.count(), 0); + QCOMPARE(rowInsertedSpy.count(), 0); + QCOMPARE(colATBRSpy.count(), 0); + QCOMPARE(colRemovedSpy.count(), 0); + + QCOMPARE(pm.rowCount(), 2); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("WX")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("AB")); +} + +void tst_QConcatenateTablesProxyModel::shouldPropagateDropOnItem_data() +{ + QTest::addColumn<int>("sourceRow"); + QTest::addColumn<int>("destRow"); + QTest::addColumn<QString>("expectedResult"); + + QTest::newRow("0-3") << 0 << 3 << QStringLiteral("ABCA"); + QTest::newRow("1-2") << 1 << 2 << QStringLiteral("ABBD"); + QTest::newRow("2-1") << 2 << 1 << QStringLiteral("ACCD"); + QTest::newRow("3-0") << 3 << 0 << QStringLiteral("DBCD"); + +} + +void tst_QConcatenateTablesProxyModel::shouldPropagateDropOnItem() +{ + // Given two source models who handle drops + + // Note: QStandardItemModel handles drop onto items by inserting child rows, + // which is good for QTreeView but not for QTableView or QConcatenateTablesProxyModel. + // So we use QStringListModel here instead. + QConcatenateTablesProxyModel pm; + QStringListModel model1({QStringLiteral("A"), QStringLiteral("B")}); + QStringListModel model2({QStringLiteral("C"), QStringLiteral("D")}); + pm.addSourceModel(&model1); + pm.addSourceModel(&model2); + QAbstractItemModelTester modelTest(&pm, this); + QCOMPARE(extractColumnTexts(&pm, 0), QStringLiteral("ABCD")); + + // When dragging one item + QFETCH(int, sourceRow); + QMimeData* mimeData = pm.mimeData({pm.index(sourceRow, 0)}); + QVERIFY(mimeData); + + // and dropping onto another item + QFETCH(int, destRow); + QVERIFY(pm.canDropMimeData(mimeData, Qt::CopyAction, -1, -1, pm.index(destRow, 0))); + QVERIFY(pm.dropMimeData(mimeData, Qt::CopyAction, -1, -1, pm.index(destRow, 0))); + delete mimeData; + + // Then the result should be as expected + QFETCH(QString, expectedResult); + QCOMPARE(extractColumnTexts(&pm, 0), expectedResult); +} + +void tst_QConcatenateTablesProxyModel::shouldPropagateDropBetweenItems() +{ + // Given two models combined + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod3); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + QCOMPARE(pm.rowCount(), 3); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("DEF")); + + // When dragging the last row + QModelIndexList indexes; + indexes.reserve(pm.columnCount()); + for (int col = 0; col < pm.columnCount(); ++col) { + indexes.append(pm.index(2, col)); + } + QMimeData* mimeData = pm.mimeData(indexes); + QVERIFY(mimeData); + + // and dropping it before row 1 + const int destRow = 1; + QVERIFY(pm.canDropMimeData(mimeData, Qt::CopyAction, destRow, 0, QModelIndex())); + QVERIFY(pm.dropMimeData(mimeData, Qt::CopyAction, destRow, 0, QModelIndex())); + delete mimeData; + + // Then a new row should be inserted + QCOMPARE(pm.rowCount(), 4); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("DEF")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 3), QStringLiteral("DEF")); +} + +void tst_QConcatenateTablesProxyModel::shouldPropagateDropBetweenItemsAtModelBoundary() +{ + // Given two models combined + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod3); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + QCOMPARE(pm.rowCount(), 3); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("DEF")); + + // When dragging the first row + QModelIndexList indexes; + indexes.reserve(pm.columnCount()); + for (int col = 0; col < pm.columnCount(); ++col) { + indexes.append(pm.index(0, col)); + } + QMimeData* mimeData = pm.mimeData(indexes); + QVERIFY(mimeData); + + // and dropping it before row 2 + const int destRow = 2; + QVERIFY(pm.canDropMimeData(mimeData, Qt::CopyAction, destRow, 0, QModelIndex())); + QVERIFY(pm.dropMimeData(mimeData, Qt::CopyAction, destRow, 0, QModelIndex())); + delete mimeData; + + // Then a new row should be inserted + QCOMPARE(pm.rowCount(), 4); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 3), QStringLiteral("DEF")); + + // and it should be part of the second model + QCOMPARE(mod2.rowCount(), 2); +} + +void tst_QConcatenateTablesProxyModel::shouldPropagateDropAfterLastRow_data() +{ + QTest::addColumn<int>("destRow"); + + // Dropping after the last row is documented to be done with destRow == -1. + QTest::newRow("-1") << -1; + // However, sometimes QTreeView calls dropMimeData with destRow == rowCount... + // Not sure if that's a bug or not, but let's support it in the model, just in case. + QTest::newRow("3") << 3; +} + +void tst_QConcatenateTablesProxyModel::shouldPropagateDropAfterLastRow() +{ + QFETCH(int, destRow); + + // Given two models combined + QConcatenateTablesProxyModel pm; + pm.addSourceModel(&mod3); + pm.addSourceModel(&mod2); + QAbstractItemModelTester modelTest(&pm, this); + QCOMPARE(pm.rowCount(), 3); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("DEF")); + + // When dragging the second row + QModelIndexList indexes; + indexes.reserve(pm.columnCount()); + for (int col = 0; col < pm.columnCount(); ++col) { + indexes.append(pm.index(1, col)); + } + QMimeData* mimeData = pm.mimeData(indexes); + QVERIFY(mimeData); + + // and dropping it after the last row + QVERIFY(pm.canDropMimeData(mimeData, Qt::CopyAction, destRow, 0, QModelIndex())); + QVERIFY(pm.dropMimeData(mimeData, Qt::CopyAction, destRow, 0, QModelIndex())); + delete mimeData; + + // Then a new row should be inserted at the end + QCOMPARE(pm.rowCount(), 4); + QCOMPARE(extractRowTexts(&pm, 0), QStringLiteral("123")); + QCOMPARE(extractRowTexts(&pm, 1), QStringLiteral("456")); + QCOMPARE(extractRowTexts(&pm, 2), QStringLiteral("DEF")); + QCOMPARE(extractRowTexts(&pm, 3), QStringLiteral("456")); + +} + +QTEST_GUILESS_MAIN(tst_QConcatenateTablesProxyModel) + +#include "tst_qconcatenatetablesproxymodel.moc" diff --git a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp index 6ea7a38137..dbc7173028 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp +++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp @@ -251,7 +251,7 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) QString val = xval + QString::number(y) + QString::number(i); QModelIndex index = model->index(x, y, parent); model->setData(index, val); - model->setData(index, blue, Qt::TextColorRole); + model->setData(index, blue, Qt::ForegroundRole); } } */ @@ -276,7 +276,7 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) QString val = xval + QString::number(y) + QString::number(i); QModelIndex index = realModel->index(x, y, parent); realModel->setData(index, val); - realModel->setData(index, blue, Qt::TextColorRole); + realModel->setData(index, blue, Qt::ForegroundRole); } } */ diff --git a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp index 7cd220e684..da13b9f33f 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp +++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp @@ -576,12 +576,12 @@ void tst_QItemModel::data() alignment == Qt::AlignJustify); } - QVariant colorVariant = currentModel->data(currentModel->index(0,0), Qt::BackgroundColorRole); + QVariant colorVariant = currentModel->data(currentModel->index(0,0), Qt::BackgroundRole); if (colorVariant.isValid()) { QVERIFY(colorVariant.canConvert<QColor>()); } - colorVariant = currentModel->data(currentModel->index(0,0), Qt::TextColorRole); + colorVariant = currentModel->data(currentModel->index(0,0), Qt::ForegroundRole); if (colorVariant.isValid()) { QVERIFY(colorVariant.canConvert<QColor>()); } diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp index 9a54c0a70d..16e5170a47 100644 --- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp +++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp @@ -82,8 +82,116 @@ private slots: void setData_emits_both_roles(); void supportedDragDropActions(); + + void moveRows_data(); + void moveRows(); + void moveRowsInvalid_data(); + void moveRowsInvalid(); + + void itemData(); + void setItemData(); }; +void tst_QStringListModel::moveRowsInvalid_data() +{ + QTest::addColumn<QStringListModel*>("baseModel"); + QTest::addColumn<QModelIndex>("startParent"); + QTest::addColumn<int>("startRow"); + QTest::addColumn<int>("count"); + QTest::addColumn<QModelIndex>("destinationParent"); + QTest::addColumn<int>("destination"); + + QStringListModel* tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("destination_equal_source") << tempModel << QModelIndex() << 0 << 1 << QModelIndex() << 1; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("count_equal_0") << tempModel << QModelIndex() << 0 << 0 << QModelIndex() << 2; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("move_child") << tempModel << tempModel->index(0, 0) << 0 << 1 << QModelIndex() << 2; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("move_to_child") << tempModel << QModelIndex() << 0 << 1 << tempModel->index(0, 0) << 2; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("negative_count") << tempModel << QModelIndex() << 0 << -1 << QModelIndex() << 2; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("negative_source_row") << tempModel << QModelIndex() << -1 << 1 << QModelIndex() << 2; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("negative_destination_row") << tempModel << QModelIndex() << 0 << 1 << QModelIndex() << -1; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("source_row_equal_rowCount") << tempModel << QModelIndex() << tempModel->rowCount() << 1 << QModelIndex() << 1; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("destination_row_greater_rowCount") << tempModel << QModelIndex() << 0 << 1 << QModelIndex() << tempModel->rowCount() + 1; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("move_row_within_source_range") << tempModel << QModelIndex() << 0 << 3 << QModelIndex() << 2; + tempModel = new QStringListModel(QStringList{"A", "B", "C", "D", "E", "F"}, this); + QTest::addRow("destination_row_before_0") << tempModel << QModelIndex() << 1 << 1 << QModelIndex() << 0; +} + +void tst_QStringListModel::moveRowsInvalid() +{ + QFETCH(QStringListModel* const, baseModel); + QFETCH(const QModelIndex, startParent); + QFETCH(const int, startRow); + QFETCH(const int, count); + QFETCH(const QModelIndex, destinationParent); + QFETCH(const int, destination); + + QSignalSpy rowMovedSpy(baseModel, &QAbstractItemModel::rowsMoved); + QSignalSpy rowAboutMovedSpy(baseModel, &QAbstractItemModel::rowsAboutToBeMoved); + QVERIFY(rowMovedSpy.isValid()); + QVERIFY(rowAboutMovedSpy.isValid()); + QVERIFY(!baseModel->moveRows(startParent, startRow, count, destinationParent, destination)); + QCOMPARE(rowMovedSpy.size(), 0); + QCOMPARE(rowAboutMovedSpy.size(), 0); + delete baseModel; +} + +void tst_QStringListModel::moveRows_data() +{ + QTest::addColumn<int>("startRow"); + QTest::addColumn<int>("count"); + QTest::addColumn<int>("destination"); + QTest::addColumn<QStringList>("expected"); + + QTest::newRow("1_Item_from_top_to_middle") << 0 << 1 << 3 << QStringList{"B", "C", "A", "D", "E", "F"}; + QTest::newRow("1_Item_from_top_to_bottom") << 0 << 1 << 6 << QStringList{"B", "C", "D", "E", "F", "A"}; + QTest::newRow("1_Item_from_middle_to_top") << 2 << 1 << 1 << QStringList{"C", "A", "B", "D", "E", "F"}; + QTest::newRow("1_Item_from_bottom_to_middle") << 5 << 1 << 3 << QStringList{"A", "B", "F", "C", "D", "E"}; + QTest::newRow("1_Item_from_bottom to_top") << 5 << 1 << 1 << QStringList{"F", "A", "B", "C", "D", "E"}; + QTest::newRow("1_Item_from_middle_to_bottom") << 2 << 1 << 6 << QStringList{"A", "B", "D", "E", "F", "C"}; + QTest::newRow("1_Item_from_middle_to_middle_before") << 2 << 1 << 1 << QStringList{"C", "A", "B", "D", "E", "F"}; + QTest::newRow("1_Item_from_middle_to_middle_after") << 2 << 1 << 4 << QStringList{"A", "B", "D", "C", "E", "F"}; + + QTest::newRow("2_Items_from_top_to_middle") << 0 << 2 << 3 << QStringList{"C", "A", "B", "D", "E", "F"}; + QTest::newRow("2_Items_from_top_to_bottom") << 0 << 2 << 6 << QStringList{"C", "D", "E", "F", "A", "B"}; + QTest::newRow("2_Items_from_middle_to_top") << 2 << 2 << 1 << QStringList{"C", "D", "A", "B", "E", "F"}; + QTest::newRow("2_Items_from_bottom_to_middle") << 4 << 2 << 3 << QStringList{"A", "B", "E", "F", "C", "D"}; + QTest::newRow("2_Items_from_bottom_to_top") << 4 << 2 << 1 << QStringList{"E", "F", "A", "B", "C", "D"}; + QTest::newRow("2_Items_from_middle_to_bottom") << 2 << 2 << 6 << QStringList{"A", "B", "E", "F", "C", "D"}; + QTest::newRow("2_Items_from_middle_to_middle_before") << 3 << 2 << 2 << QStringList{"A", "D", "E", "B", "C", "F"}; + QTest::newRow("2_Items_from_middle_to_middle_after") << 1 << 2 << 5 << QStringList{"A", "D", "E", "B", "C", "F"}; +} + +void tst_QStringListModel::moveRows() +{ + QFETCH(const int, startRow); + QFETCH(const int, count); + QFETCH(const int, destination); + QFETCH(const QStringList, expected); + QStringListModel baseModel(QStringList{"A", "B", "C", "D", "E", "F"}); + QSignalSpy rowMovedSpy(&baseModel, &QAbstractItemModel::rowsMoved); + QSignalSpy rowAboutMovedSpy(&baseModel, &QAbstractItemModel::rowsAboutToBeMoved); + QVERIFY(baseModel.moveRows(QModelIndex(), startRow, count, QModelIndex(), destination)); + QCOMPARE(baseModel.stringList(), expected); + QCOMPARE(rowMovedSpy.size(), 1); + QCOMPARE(rowAboutMovedSpy.size(), 1); + for (const QList<QVariant> &signalArgs : {rowMovedSpy.first(), rowAboutMovedSpy.first()}){ + QVERIFY(!signalArgs.at(0).value<QModelIndex>().isValid()); + QCOMPARE(signalArgs.at(1).toInt(), startRow); + QCOMPARE(signalArgs.at(2).toInt(), startRow + count - 1); + QVERIFY(!signalArgs.at(3).value<QModelIndex>().isValid()); + QCOMPARE(signalArgs.at(4).toInt(), destination); + } +} + void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data() { QTest::addColumn<QStringList>("input"); @@ -246,6 +354,74 @@ void tst_QStringListModel::setData_emits_both_roles() expected); } +void tst_QStringListModel::itemData() +{ + QStringListModel testModel{ QStringList { + QStringLiteral("One"), + QStringLiteral("Two"), + QStringLiteral("Three"), + QStringLiteral("Four"), + QStringLiteral("Five") + }}; + QMap<int, QVariant> compareMap; + QCOMPARE(testModel.itemData(QModelIndex()), compareMap); + compareMap.insert(Qt::DisplayRole, QStringLiteral("Two")); + compareMap.insert(Qt::EditRole, QStringLiteral("Two")); + QCOMPARE(testModel.itemData(testModel.index(1, 0)), compareMap); +} + +void tst_QStringListModel::setItemData() +{ + QStringListModel testModel{ QStringList { + QStringLiteral("One"), + QStringLiteral("Two"), + QStringLiteral("Three"), + QStringLiteral("Four"), + QStringLiteral("Five") + }}; + QSignalSpy dataChangedSpy(&testModel, &QAbstractItemModel::dataChanged); + QModelIndex changeIndex = testModel.index(1, 0); + const QVector<int> changeRoles{Qt::DisplayRole, Qt::EditRole}; + const QString changedString("Changed"); + QMap<int, QVariant> newItemData{std::make_pair<int>(Qt::DisplayRole, changedString)}; + // invalid index does nothing and returns false + QVERIFY(!testModel.setItemData(QModelIndex(), newItemData)); + // valid data is set, return value is true and dataChanged is emitted once + QVERIFY(testModel.setItemData(changeIndex, newItemData)); + QCOMPARE(changeIndex.data(Qt::DisplayRole).toString(), changedString); + QCOMPARE(changeIndex.data(Qt::EditRole).toString(), changedString); + QCOMPARE(dataChangedSpy.size(), 1); + QVariantList dataChangedArguments = dataChangedSpy.takeFirst(); + QCOMPARE(dataChangedArguments.at(0).value<QModelIndex>(), changeIndex); + QCOMPARE(dataChangedArguments.at(1).value<QModelIndex>(), changeIndex); + QCOMPARE(dataChangedArguments.at(2).value<QVector<int> >(), changeRoles); + // Unsupported roles do nothing return false + newItemData.clear(); + newItemData.insert(Qt::UserRole, changedString); + QVERIFY(!testModel.setItemData(changeIndex, newItemData)); + QCOMPARE(dataChangedSpy.size(), 0); + // If some but not all the roles are supported it returns false and does nothing + newItemData.insert(Qt::EditRole, changedString); + changeIndex = testModel.index(2, 0); + QVERIFY(!testModel.setItemData(changeIndex, newItemData)); + QCOMPARE(changeIndex.data(Qt::DisplayRole).toString(), QStringLiteral("Three")); + QCOMPARE(changeIndex.data(Qt::EditRole).toString(), QStringLiteral("Three")); + QCOMPARE(dataChangedSpy.size(), 0); + // Qt::EditRole and Qt::DisplayRole are both set, Qt::EditRole takes precedence + newItemData.clear(); + newItemData.insert(Qt::EditRole, changedString); + newItemData.insert(Qt::DisplayRole, QStringLiteral("Ignored")); + changeIndex = testModel.index(3, 0); + QVERIFY(testModel.setItemData(changeIndex, newItemData)); + QCOMPARE(changeIndex.data(Qt::DisplayRole).toString(), changedString); + QCOMPARE(changeIndex.data(Qt::EditRole).toString(), changedString); + QCOMPARE(dataChangedSpy.size(), 1); + dataChangedArguments = dataChangedSpy.takeFirst(); + QCOMPARE(dataChangedArguments.at(0).value<QModelIndex>(), changeIndex); + QCOMPARE(dataChangedArguments.at(1).value<QModelIndex>(), changeIndex); + QCOMPARE(dataChangedArguments.at(2).value<QVector<int> >(), changeRoles); +} + void tst_QStringListModel::supportedDragDropActions() { QStringListModel model; diff --git a/tests/auto/corelib/itemmodels/qtransposeproxymodel/qtransposeproxymodel.pro b/tests/auto/corelib/itemmodels/qtransposeproxymodel/qtransposeproxymodel.pro new file mode 100644 index 0000000000..3834add115 --- /dev/null +++ b/tests/auto/corelib/itemmodels/qtransposeproxymodel/qtransposeproxymodel.pro @@ -0,0 +1,6 @@ +CONFIG += testcase +TARGET = tst_qtransposeproxymodel +QT = core gui testlib + +SOURCES = tst_qtransposeproxymodel.cpp + diff --git a/tests/auto/corelib/itemmodels/qtransposeproxymodel/tst_qtransposeproxymodel.cpp b/tests/auto/corelib/itemmodels/qtransposeproxymodel/tst_qtransposeproxymodel.cpp new file mode 100644 index 0000000000..a30ac46571 --- /dev/null +++ b/tests/auto/corelib/itemmodels/qtransposeproxymodel/tst_qtransposeproxymodel.cpp @@ -0,0 +1,915 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Luca Beldi <v.ronin@yahoo.it> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QTest> +#include <QSignalSpy> +#include <QStandardItemModel> +#include <QStringListModel> +#include <QAbstractItemModelTester> +#include <random> + +#include <qtransposeproxymodel.h> + +class tst_QTransposeProxyModel : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void initTestCase(); + void index(); + void data(); + void setData_data(); + void setData(); + void parent(); + void mapToSource(); + void mapFromSource(); + void basicTest_data(); + void basicTest(); + void sort(); + void insertRowBase_data(); + void insertRowBase(); + void insertColumnBase_data(); + void insertColumnBase(); + void insertColumnProxy_data(); + void insertColumnProxy(); + void insertRowProxy_data(); + void insertRowProxy(); + void removeRowBase_data(); + void removeRowBase(); + void removeColumnBase_data(); + void removeColumnBase(); + void removeColumnProxy_data(); + void removeColumnProxy(); + void removeRowProxy_data(); + void removeRowProxy(); + void headerData(); + void setHeaderData(); + void span(); + void itemData(); + void setItemData(); + void moveRowsBase(); + void moveColumnsProxy(); +private: + void testTransposed( + const QAbstractItemModel *const baseModel, + const QAbstractItemModel *const transposed, + const QModelIndex &baseParent = QModelIndex(), + const QModelIndex &transposedParent = QModelIndex() + ); + QAbstractItemModel *createListModel(QObject *parent); + QAbstractItemModel *createTableModel(QObject *parent); + QAbstractItemModel *createTreeModel(QObject *parent); +}; + +QAbstractItemModel *tst_QTransposeProxyModel::createListModel(QObject *parent) +{ + QStringList sequence; + sequence.reserve(10); + for (int i = 0; i < 10; ++i) + sequence.append(QString::number(i)); + return new QStringListModel(sequence, parent); +} + +QAbstractItemModel *tst_QTransposeProxyModel::createTableModel(QObject *parent) +{ + QAbstractItemModel *model = new QStandardItemModel(parent); + model->insertRows(0, 5); + model->insertColumns(0, 4); + for (int i = 0; i < model->rowCount(); ++i) { + for (int j = 0; j < model->columnCount(); ++j) { + model->setData(model->index(i, j), QStringLiteral("%1,%2").arg(i).arg(j), Qt::EditRole); + model->setData(model->index(i, j), i, Qt::UserRole); + model->setData(model->index(i, j), j, Qt::UserRole + 1); + } + } + return model; +} + +QAbstractItemModel *tst_QTransposeProxyModel::createTreeModel(QObject *parent) +{ + QAbstractItemModel *model = new QStandardItemModel(parent); + model->insertRows(0, 5); + model->insertColumns(0, 4); + for (int i = 0; i < model->rowCount(); ++i) { + for (int j = 0; j < model->columnCount(); ++j) { + const QModelIndex parIdx = model->index(i, j); + model->setData(parIdx, QStringLiteral("%1,%2").arg(i).arg(j), Qt::EditRole); + model->setData(parIdx, i, Qt::UserRole); + model->setData(parIdx, j, Qt::UserRole + 1); + model->insertRows(0, 3, parIdx); + model->insertColumns(0, 2, parIdx); + for (int h = 0; h < model->rowCount(parIdx); ++h) { + for (int k = 0; k < model->columnCount(parIdx); ++k) { + const QModelIndex childIdx = model->index(h, k, parIdx); + model->setData(childIdx, QStringLiteral("%1,%2,%3,%4").arg(i).arg(j).arg(h).arg(k), Qt::EditRole); + model->setData(childIdx, i, Qt::UserRole); + model->setData(childIdx, j, Qt::UserRole + 1); + model->setData(childIdx, h, Qt::UserRole + 2); + model->setData(childIdx, k, Qt::UserRole + 3); + } + } + } + } + return model; +} + +void tst_QTransposeProxyModel::testTransposed( + const QAbstractItemModel *const baseModel, + const QAbstractItemModel *const transposed, + const QModelIndex &baseParent, + const QModelIndex &transposedParent +) +{ + QCOMPARE(transposed->hasChildren(transposedParent), baseModel->hasChildren(baseParent)); + QCOMPARE(transposed->columnCount(transposedParent), baseModel->rowCount(baseParent)); + QCOMPARE(transposed->rowCount(transposedParent), baseModel->columnCount(baseParent)); + for (int i = 0, maxRow = baseModel->rowCount(baseParent); i < maxRow; ++i) { + for (int j = 0, maxCol = baseModel->columnCount(baseParent); j < maxCol; ++j) { + const QModelIndex baseIdx = baseModel->index(i, j, baseParent); + const QModelIndex transIdx = transposed->index(j, i, transposedParent); + QCOMPARE(transIdx.data(), baseIdx.data()); + QCOMPARE(transIdx.data(Qt::UserRole), baseIdx.data(Qt::UserRole)); + QCOMPARE(transIdx.data(Qt::UserRole + 1), baseIdx.data(Qt::UserRole + 1)); + QCOMPARE(transIdx.data(Qt::UserRole + 2), baseIdx.data(Qt::UserRole + 2)); + QCOMPARE(transIdx.data(Qt::UserRole + 3), baseIdx.data(Qt::UserRole + 3)); + if (baseModel->hasChildren(baseIdx)) { + testTransposed(baseModel, transposed, baseIdx, transIdx); + } + } + } +} + +void tst_QTransposeProxyModel::initTestCase() +{ + qRegisterMetaType<QList<QPersistentModelIndex> >(); + qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>(); +} + +void tst_QTransposeProxyModel::index() +{ + QAbstractItemModel *model = createTreeModel(this); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + QVERIFY(!proxy.index(0, -1).isValid()); + QVERIFY(!proxy.index(0, -1).isValid()); + QVERIFY(!proxy.index(-1, -1).isValid()); + QVERIFY(!proxy.index(0, proxy.columnCount()).isValid()); + QVERIFY(!proxy.index(proxy.rowCount(), 0).isValid()); + QVERIFY(!proxy.index(proxy.rowCount(), proxy.columnCount()).isValid()); + QModelIndex tempIdx = proxy.index(0, 1); + QVERIFY(tempIdx.isValid()); + QCOMPARE(tempIdx.row(), 0); + QCOMPARE(tempIdx.column(), 1); + tempIdx = proxy.index(0, 1, tempIdx); + QVERIFY(tempIdx.isValid()); + QCOMPARE(tempIdx.row(), 0); + QCOMPARE(tempIdx.column(), 1); + delete model; +} + +void tst_QTransposeProxyModel::data() +{ + QStringListModel model{QStringList{"A", "B"}}; + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(&model); + QCOMPARE(proxy.index(0, 1).data().toString(), QStringLiteral("B")); +} + +void tst_QTransposeProxyModel::parent() +{ + QAbstractItemModel *model = createTreeModel(this); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + const QModelIndex parentIdx = proxy.index(0, 0); + const QModelIndex childIdx = proxy.index(0, 0, parentIdx); + QVERIFY(parentIdx.isValid()); + QVERIFY(childIdx.isValid()); + QCOMPARE(childIdx.parent(), parentIdx); + delete model; +} + +void tst_QTransposeProxyModel::mapToSource() +{ + QAbstractItemModel *model = createTreeModel(this); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + QVERIFY(!proxy.mapToSource(QModelIndex()).isValid()); + QCOMPARE(proxy.mapToSource(proxy.index(0, 0)), model->index(0, 0)); + QCOMPARE(proxy.mapToSource(proxy.index(1, 0)), model->index(0, 1)); + QCOMPARE(proxy.mapToSource(proxy.index(0, 1)), model->index(1, 0)); + const QModelIndex proxyParent = proxy.index(1, 0); + const QModelIndex sourceParent = model->index(0, 1); + QCOMPARE(proxy.mapToSource(proxy.index(0, 0, proxyParent)), model->index(0, 0, sourceParent)); + QCOMPARE(proxy.mapToSource(proxy.index(1, 0, proxyParent)), model->index(0, 1, sourceParent)); + QCOMPARE(proxy.mapToSource(proxy.index(0, 1, proxyParent)), model->index(1, 0, sourceParent)); + delete model; +} + +void tst_QTransposeProxyModel::mapFromSource() +{ + QAbstractItemModel *model = createTreeModel(this); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + QVERIFY(!proxy.mapFromSource(QModelIndex()).isValid()); + QCOMPARE(proxy.mapFromSource(model->index(0, 0)), proxy.index(0, 0)); + QCOMPARE(proxy.mapFromSource(model->index(0, 1)), proxy.index(1, 0)); + QCOMPARE(proxy.mapFromSource(model->index(1, 0)), proxy.index(0, 1)); + const QModelIndex proxyParent = proxy.index(1, 0); + const QModelIndex sourceParent = model->index(0, 1); + QCOMPARE(proxy.mapToSource(proxy.index(0, 0, proxyParent)), model->index(0, 0, sourceParent)); + QCOMPARE(proxy.mapFromSource(model->index(1, 0, sourceParent)), proxy.index(0, 1, proxyParent)); + QCOMPARE(proxy.mapFromSource(model->index(0, 1, sourceParent)), proxy.index(1, 0, proxyParent)); + delete model; +} + +void tst_QTransposeProxyModel::basicTest_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::newRow("List") << createListModel(this); + QTest::newRow("Table") << createTableModel(this); + QTest::newRow("Tree") << createTreeModel(this); +} + +void tst_QTransposeProxyModel::basicTest() +{ + QFETCH(QAbstractItemModel *, model); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + testTransposed(model, &proxy); + delete model; +} + +void tst_QTransposeProxyModel::sort() +{ + QStringList sequence; + sequence.reserve(100); + for (int i = 0; i < 100; ++i) + sequence.append(QStringLiteral("%1").arg(i, 3, 10, QLatin1Char('0'))); + std::shuffle(sequence.begin(), sequence.end(), std::mt19937(88)); + const QString firstItemBeforeSort = sequence.first(); + QStringListModel baseModel(sequence); + QTransposeProxyModel proxyModel; + new QAbstractItemModelTester(&proxyModel, &proxyModel); + proxyModel.setSourceModel(&baseModel); + QSignalSpy layoutChangedSpy(&proxyModel, &QAbstractItemModel::layoutChanged); + QVERIFY(layoutChangedSpy.isValid()); + QSignalSpy layoutAboutToBeChangedSpy(&proxyModel, &QAbstractItemModel::layoutAboutToBeChanged); + QVERIFY(layoutAboutToBeChangedSpy.isValid()); + QPersistentModelIndex firstIndexBeforeSort = proxyModel.index(0, 0); + baseModel.sort(0, Qt::AscendingOrder); + QCOMPARE(layoutChangedSpy.count(), 1); + QCOMPARE(layoutAboutToBeChangedSpy.count(), 1); + QCOMPARE(layoutChangedSpy.takeFirst().at(1).toInt(), int(QAbstractItemModel::HorizontalSortHint)); + QCOMPARE(firstIndexBeforeSort.data().toString(), firstItemBeforeSort); + for (int i = 0; i < 100; ++i) + QCOMPARE(proxyModel.index(0, i).data().toInt(), i); +} + +void tst_QTransposeProxyModel::removeColumnBase_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<QModelIndex>("parent"); + QTest::newRow("Table") << createTableModel(this) << QModelIndex(); + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << QModelIndex(); + QAbstractItemModel *model = createTreeModel(this); + QTest::newRow("Tree_Child_Item") << model << model->index(0, 0); +} + +void tst_QTransposeProxyModel::removeColumnBase() +{ + QFETCH(QAbstractItemModel * const, model); + QFETCH(const QModelIndex, parent); + QTransposeProxyModel proxy; + QSignalSpy rowRemoveSpy(&proxy, &QAbstractItemModel::rowsRemoved); + QVERIFY(rowRemoveSpy.isValid()); + QSignalSpy rowAboutToBeRemoveSpy(&proxy, &QAbstractItemModel::rowsAboutToBeRemoved); + QVERIFY(rowAboutToBeRemoveSpy.isValid()); + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + const int oldRowCount = proxy.rowCount(proxy.mapFromSource(parent)); + const QVariant expectedNewVal = model->index(0, 2, parent).data(); + QVERIFY(model->removeColumn(1, parent)); + QCOMPARE(proxy.rowCount(proxy.mapFromSource(parent)), oldRowCount - 1); + QCOMPARE(proxy.index(1, 0, proxy.mapFromSource(parent)).data(), expectedNewVal); + QCOMPARE(rowRemoveSpy.count(), 1); + QCOMPARE(rowAboutToBeRemoveSpy.count(), 1); + for (const auto &spyArgs : {rowRemoveSpy.takeFirst(), + rowAboutToBeRemoveSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxy.mapFromSource(parent)); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::insertColumnBase_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<QModelIndex>("parent"); + QTest::newRow("Table") << createTableModel(this) << QModelIndex(); + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << QModelIndex(); + QAbstractItemModel *model = createTreeModel(this); + QTest::newRow("Tree_Child_Item") << model << model->index(0, 0); +} + +void tst_QTransposeProxyModel::insertColumnBase() +{ + QFETCH(QAbstractItemModel * const, model); + QFETCH(const QModelIndex, parent); + QTransposeProxyModel proxy; + QSignalSpy rowInsertSpy(&proxy, &QAbstractItemModel::rowsInserted); + QVERIFY(rowInsertSpy.isValid()); + QSignalSpy rowAboutToBeInsertSpy(&proxy, &QAbstractItemModel::rowsAboutToBeInserted); + QVERIFY(rowAboutToBeInsertSpy.isValid()); + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + const int oldRowCount = proxy.rowCount(proxy.mapFromSource(parent)); + QVERIFY(model->insertColumn(1, parent)); + QCOMPARE(proxy.rowCount(proxy.mapFromSource(parent)), oldRowCount + 1); + QVERIFY(!proxy.index(1, 0, proxy.mapFromSource(parent)).data().isValid()); + QCOMPARE(rowInsertSpy.count(), 1); + QCOMPARE(rowAboutToBeInsertSpy.count(), 1); + for (const auto &spyArgs : {rowInsertSpy.takeFirst(), + rowAboutToBeInsertSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxy.mapFromSource(parent)); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::removeRowBase_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<QModelIndex>("parent"); + QTest::newRow("List") << createListModel(this) << QModelIndex(); + QTest::newRow("Table") << createTableModel(this) << QModelIndex(); + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << QModelIndex(); + QAbstractItemModel *model = createTreeModel(this); + QTest::newRow("Tree_Child_Item") << model << model->index(0, 0); +} + +void tst_QTransposeProxyModel::removeRowBase() +{ + QFETCH(QAbstractItemModel * const, model); + QFETCH(const QModelIndex, parent); + QTransposeProxyModel proxy; + QSignalSpy columnsRemoveSpy(&proxy, &QAbstractItemModel::columnsRemoved); + QVERIFY(columnsRemoveSpy.isValid()); + QSignalSpy columnsAboutToBeRemoveSpy(&proxy, &QAbstractItemModel::columnsAboutToBeRemoved); + QVERIFY(columnsAboutToBeRemoveSpy.isValid()); + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + const int oldColCount = proxy.columnCount(proxy.mapFromSource(parent)); + const QVariant expectedNewVal = model->index(2, 0, parent).data(); + QVERIFY(model->removeRow(1, parent)); + QCOMPARE(proxy.columnCount(proxy.mapFromSource(parent)), oldColCount - 1); + QCOMPARE(proxy.index(0, 1, proxy.mapFromSource(parent)).data(), expectedNewVal); + QCOMPARE(columnsRemoveSpy.count(), 1); + QCOMPARE(columnsAboutToBeRemoveSpy.count(), 1); + for (const auto &spyArgs : {columnsRemoveSpy.takeFirst(), + columnsAboutToBeRemoveSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxy.mapFromSource(parent)); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::insertRowBase_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<QModelIndex>("parent"); + QTest::newRow("List") << createListModel(this) << QModelIndex(); + QTest::newRow("Table") << createTableModel(this) << QModelIndex(); + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << QModelIndex(); + QAbstractItemModel *model = createTreeModel(this); + QTest::newRow("Tree_Child_Item") << model << model->index(0, 0); +} + +void tst_QTransposeProxyModel::insertRowBase() +{ + QFETCH(QAbstractItemModel * const, model); + QFETCH(const QModelIndex, parent); + QTransposeProxyModel proxy; + QSignalSpy columnsInsertSpy(&proxy, &QAbstractItemModel::columnsInserted); + QVERIFY(columnsInsertSpy.isValid()); + QSignalSpy columnsAboutToBeInsertSpy(&proxy, &QAbstractItemModel::columnsAboutToBeInserted); + QVERIFY(columnsAboutToBeInsertSpy.isValid()); + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + const int oldColCount = proxy.columnCount(proxy.mapFromSource(parent)); + QVERIFY(model->insertRow(1, parent)); + QCOMPARE(proxy.columnCount(proxy.mapFromSource(parent)), oldColCount + 1); + QVERIFY(proxy.index(0, 1, proxy.mapFromSource(parent)).data().isNull()); + QCOMPARE(columnsInsertSpy.count(), 1); + QCOMPARE(columnsAboutToBeInsertSpy.count(), 1); + for (const auto &spyArgs : {columnsInsertSpy.takeFirst(), + columnsAboutToBeInsertSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxy.mapFromSource(parent)); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::removeColumnProxy_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<bool>("rootItem"); + QTest::newRow("List") << createListModel(this) << true; + QTest::newRow("Table") << createTableModel(this) << true; + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << true; + QTest::newRow("Tree_Child_Item") << createTreeModel(this) << false; +} + +void tst_QTransposeProxyModel::removeColumnProxy() +{ + QFETCH(QAbstractItemModel *, model); + QFETCH(bool, rootItem); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + QSignalSpy columnsRemoveSpy(&proxy, &QAbstractItemModel::columnsRemoved); + QVERIFY(columnsRemoveSpy.isValid()); + QSignalSpy columnsAboutToBeRemoveSpy(&proxy, &QAbstractItemModel::columnsAboutToBeRemoved); + QVERIFY(columnsAboutToBeRemoveSpy.isValid()); + QSignalSpy rowsRemoveSpy(model, &QAbstractItemModel::rowsRemoved); + QVERIFY(rowsRemoveSpy.isValid()); + QSignalSpy rowsAboutToBeRemoveSpy(model, &QAbstractItemModel::rowsAboutToBeRemoved); + QVERIFY(rowsAboutToBeRemoveSpy.isValid()); + proxy.setSourceModel(model); + const QModelIndex proxyParent = rootItem ? QModelIndex() : proxy.index(0, 1); + const QModelIndex sourceParent = proxy.mapToSource(proxyParent); + const int oldColCount = proxy.columnCount(proxyParent); + const int oldRowCount = model->rowCount(sourceParent); + const QVariant expectedNewVal = proxy.index(0, 2, proxyParent).data(); + QVERIFY(proxy.removeColumn(1, proxyParent)); + QCOMPARE(proxy.columnCount(proxyParent), oldColCount - 1); + QCOMPARE(model->rowCount(sourceParent), oldRowCount - 1); + QCOMPARE(proxy.index(0, 1, proxyParent).data(), expectedNewVal); + QCOMPARE(model->index(1, 0, sourceParent).data(), expectedNewVal); + QCOMPARE(columnsRemoveSpy.count(), 1); + QCOMPARE(columnsAboutToBeRemoveSpy.count(), 1); + QCOMPARE(rowsRemoveSpy.count(), 1); + QCOMPARE(rowsAboutToBeRemoveSpy.count(), 1); + for (const auto &spyArgs : {columnsRemoveSpy.takeFirst(), + columnsAboutToBeRemoveSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxyParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + for (const auto &spyArgs : {rowsRemoveSpy.takeFirst(), + rowsAboutToBeRemoveSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), sourceParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::insertColumnProxy_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<bool>("rootItem"); + QTest::newRow("List") << createListModel(this) << true; + QTest::newRow("Table") << createTableModel(this) << true; + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << true; + QTest::newRow("Tree_Child_Item") << createTreeModel(this) << false; +} + +void tst_QTransposeProxyModel::insertColumnProxy() +{ + QFETCH(QAbstractItemModel *, model); + QFETCH(bool, rootItem); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + QSignalSpy columnsInsertSpy(&proxy, &QAbstractItemModel::columnsInserted); + QVERIFY(columnsInsertSpy.isValid()); + QSignalSpy columnsAboutToBeInsertSpy(&proxy, &QAbstractItemModel::columnsAboutToBeInserted); + QVERIFY(columnsAboutToBeInsertSpy.isValid()); + QSignalSpy rowsInsertSpy(model, &QAbstractItemModel::rowsInserted); + QVERIFY(rowsInsertSpy.isValid()); + QSignalSpy rowsAboutToBeInsertSpy(model, &QAbstractItemModel::rowsAboutToBeInserted); + QVERIFY(rowsAboutToBeInsertSpy.isValid()); + proxy.setSourceModel(model); + const QModelIndex proxyParent = rootItem ? QModelIndex() : proxy.index(0, 1); + const QModelIndex sourceParent = proxy.mapToSource(proxyParent); + const int oldColCount = proxy.columnCount(proxyParent); + const int oldRowCount = model->rowCount(sourceParent); + QVERIFY(proxy.insertColumn(1, proxyParent)); + QCOMPARE(proxy.columnCount(proxyParent), oldColCount + 1); + QCOMPARE(model->rowCount(sourceParent), oldRowCount + 1); + QVERIFY(proxy.index(0, 1, proxyParent).data().isNull()); + QVERIFY(model->index(1, 0, sourceParent).data().isNull()); + QCOMPARE(columnsInsertSpy.count(), 1); + QCOMPARE(columnsAboutToBeInsertSpy.count(), 1); + QCOMPARE(rowsInsertSpy.count(), 1); + QCOMPARE(rowsAboutToBeInsertSpy.count(), 1); + for (const auto &spyArgs : {columnsInsertSpy.takeFirst(), + columnsAboutToBeInsertSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxyParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + for (const auto &spyArgs : {rowsInsertSpy.takeFirst(), + rowsAboutToBeInsertSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), sourceParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::removeRowProxy_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<bool>("rootItem"); + QTest::newRow("Table") << createTableModel(this) << true; + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << true; + QTest::newRow("Tree_Child_Item") << createTreeModel(this) << false; +} + +void tst_QTransposeProxyModel::removeRowProxy() +{ + QFETCH(QAbstractItemModel *, model); + QFETCH(bool, rootItem); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + QSignalSpy rowsRemoveSpy(&proxy, &QAbstractItemModel::rowsRemoved); + QVERIFY(rowsRemoveSpy.isValid()); + QSignalSpy rowsAboutToBeRemoveSpy(&proxy, &QAbstractItemModel::rowsAboutToBeRemoved); + QVERIFY(rowsAboutToBeRemoveSpy.isValid()); + QSignalSpy columnsRemoveSpy(model, &QAbstractItemModel::columnsRemoved); + QVERIFY(columnsRemoveSpy.isValid()); + QSignalSpy columnsAboutToBeRemoveSpy(model, &QAbstractItemModel::columnsAboutToBeRemoved); + QVERIFY(columnsAboutToBeRemoveSpy.isValid()); + proxy.setSourceModel(model); + const QModelIndex proxyParent = rootItem ? QModelIndex() : proxy.index(0, 1); + const QModelIndex sourceParent = proxy.mapToSource(proxyParent); + const int oldRowCount = proxy.rowCount(proxyParent); + const int oldColCount = model->columnCount(sourceParent); + const QVariant expectedNewVal = proxy.index(2, 0, proxyParent).data(); + QVERIFY(proxy.removeRow(1, proxyParent)); + QCOMPARE(proxy.rowCount(proxyParent), oldRowCount - 1); + QCOMPARE(model->columnCount(sourceParent), oldColCount - 1); + QCOMPARE(proxy.index(1, 0, proxyParent).data(), expectedNewVal); + QCOMPARE(model->index(0, 1, sourceParent).data(), expectedNewVal); + QCOMPARE(columnsRemoveSpy.count(), 1); + QCOMPARE(columnsAboutToBeRemoveSpy.count(), 1); + QCOMPARE(rowsRemoveSpy.count(), 1); + QCOMPARE(rowsAboutToBeRemoveSpy.count(), 1); + for (const auto &spyArgs : {columnsRemoveSpy.takeFirst(), + columnsAboutToBeRemoveSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), sourceParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + for (const auto &spyArgs : {rowsRemoveSpy.takeFirst(), + rowsAboutToBeRemoveSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxyParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::insertRowProxy_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<bool>("rootItem"); + QTest::newRow("Table") << createTableModel(this) << true; + QTest::newRow("Tree_Root_Item") << createTreeModel(this) << true; + QTest::newRow("Tree_Child_Item") << createTreeModel(this) << false; +} + +void tst_QTransposeProxyModel::insertRowProxy() +{ + QFETCH(QAbstractItemModel *, model); + QFETCH(bool, rootItem); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + QSignalSpy rowsInsertSpy(&proxy, &QAbstractItemModel::rowsInserted); + QVERIFY(rowsInsertSpy.isValid()); + QSignalSpy rowsAboutToBeInsertSpy(&proxy, &QAbstractItemModel::rowsAboutToBeInserted); + QVERIFY(rowsAboutToBeInsertSpy.isValid()); + QSignalSpy columnsInsertSpy(model, &QAbstractItemModel::columnsInserted); + QVERIFY(columnsInsertSpy.isValid()); + QSignalSpy columnsAboutToBeInsertSpy(model, &QAbstractItemModel::columnsAboutToBeInserted); + QVERIFY(columnsAboutToBeInsertSpy.isValid()); + proxy.setSourceModel(model); + const QModelIndex proxyParent = rootItem ? QModelIndex() : proxy.index(0, 1); + const QModelIndex sourceParent = proxy.mapToSource(proxyParent); + const int oldRowCount = proxy.rowCount(proxyParent); + const int oldColCount = model->columnCount(sourceParent); + QVERIFY(proxy.insertRow(1, proxyParent)); + QCOMPARE(proxy.rowCount(proxyParent), oldRowCount + 1); + QCOMPARE(model->columnCount(sourceParent), oldColCount + 1); + QVERIFY(proxy.index(1, 0, proxyParent).data().isNull()); + QVERIFY(model->index(0, 1, sourceParent).data().isNull()); + QCOMPARE(columnsInsertSpy.count(), 1); + QCOMPARE(columnsAboutToBeInsertSpy.count(), 1); + QCOMPARE(rowsInsertSpy.count(), 1); + QCOMPARE(rowsAboutToBeInsertSpy.count(), 1); + for (const auto &spyArgs : {columnsInsertSpy.takeFirst(), + columnsAboutToBeInsertSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), sourceParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + for (const auto &spyArgs : {rowsInsertSpy.takeFirst(), + rowsAboutToBeInsertSpy.takeFirst()}) { + QCOMPARE(spyArgs.at(0).value<QModelIndex>(), proxyParent); + QCOMPARE(spyArgs.at(1).toInt(), 1); + QCOMPARE(spyArgs.at(2).toInt(), 1); + } + delete model; +} + +void tst_QTransposeProxyModel::headerData() +{ + QStandardItemModel model; + model.insertRows(0, 3); + model.insertColumns(0, 5); + for (int i = 0; i < model.rowCount(); ++i) + model.setHeaderData(i, Qt::Horizontal, QChar('A' + i)); + for (int i = 1; i <= model.columnCount(); ++i) + model.setHeaderData(i, Qt::Vertical, i); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(&model); + for (int i = 0; i < model.rowCount(); ++i) + QCOMPARE(model.headerData(i, Qt::Horizontal), proxy.headerData(i, Qt::Vertical)); + for (int i = 0; i < model.columnCount(); ++i) + QCOMPARE(model.headerData(i, Qt::Vertical), proxy.headerData(i, Qt::Horizontal)); +} + +void tst_QTransposeProxyModel::setHeaderData() +{ + QStandardItemModel model; + model.insertRows(0, 3); + model.insertColumns(0, 5); + for (int i = 0; i < model.rowCount(); ++i) + model.setHeaderData(i, Qt::Horizontal, QChar('A' + i)); + for (int i = 1; i <= model.columnCount(); ++i) + model.setHeaderData(i, Qt::Vertical, i); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(&model); + QVERIFY(proxy.setHeaderData(1, Qt::Horizontal, 99)); + QCOMPARE(model.headerData(1, Qt::Vertical).toInt(), 99); + QVERIFY(proxy.setHeaderData(1, Qt::Vertical, QChar('Z'))); + QCOMPARE(model.headerData(1, Qt::Horizontal).toChar(), QChar('Z')); +} + +void tst_QTransposeProxyModel::span() +{ + class SpanModel : public QStandardItemModel + { + Q_DISABLE_COPY(SpanModel) + public: + SpanModel(int rows, int columns, QObject *parent = nullptr) + : QStandardItemModel(rows, columns, parent) + {} + QSize span(const QModelIndex &index) const override + { + Q_UNUSED(index) + return QSize(2, 1); + } + }; + SpanModel model(3, 5); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(&model); + QCOMPARE(proxy.span(proxy.index(0, 0)), QSize(1, 2)); +} + +void tst_QTransposeProxyModel::itemData() +{ + QAbstractItemModel *model = createTreeModel(this); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + QMap<int, QVariant> itmData = proxy.itemData(proxy.index(0, 1)); + QCOMPARE(itmData.value(Qt::DisplayRole).toString(), QStringLiteral("1,0")); + QCOMPARE(itmData.value(Qt::UserRole).toInt(), 1); + QCOMPARE(itmData.value(Qt::UserRole + 1).toInt(), 0); + itmData = proxy.itemData(proxy.index(1, 2, proxy.index(0, 1))); + QCOMPARE(itmData.value(Qt::DisplayRole).toString(), QStringLiteral("1,0,2,1")); + QCOMPARE(itmData.value(Qt::UserRole).toInt(), 1); + QCOMPARE(itmData.value(Qt::UserRole + 1).toInt(), 0); + QCOMPARE(itmData.value(Qt::UserRole + 2).toInt(), 2); + QCOMPARE(itmData.value(Qt::UserRole + 3).toInt(), 1); + QVERIFY(proxy.itemData(QModelIndex()).isEmpty()); + delete model; +} + +void tst_QTransposeProxyModel::setItemData() +{ + QAbstractItemModel *model = createTreeModel(this); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + QSignalSpy sourceDataChangeSpy(model, &QAbstractItemModel::dataChanged); + QVERIFY(sourceDataChangeSpy.isValid()); + QSignalSpy proxyDataChangeSpy(&proxy, &QAbstractItemModel::dataChanged); + QVERIFY(proxyDataChangeSpy.isValid()); + const QMap<int, QVariant> itmData = { + std::make_pair<int, QVariant>(Qt::DisplayRole, QStringLiteral("Test")), + std::make_pair<int, QVariant>(Qt::UserRole, 88), + std::make_pair<int, QVariant>(Qt::UserRole + 1, 99), + }; + QModelIndex idx = proxy.index(0, 1); + QVERIFY(proxy.setItemData(idx, itmData)); + QCOMPARE(idx.data(Qt::DisplayRole).toString(), QStringLiteral("Test")); + QCOMPARE(idx.data(Qt::UserRole).toInt(), 88); + QCOMPARE(idx.data(Qt::UserRole + 1).toInt(), 99); + QCOMPARE(sourceDataChangeSpy.size(), 1); + QCOMPARE(proxyDataChangeSpy.size(), 1); + auto signalData = proxyDataChangeSpy.takeFirst(); + QCOMPARE(signalData.at(0).value<QModelIndex>(), idx); + QCOMPARE(signalData.at(1).value<QModelIndex>(), idx); + const QVector<int> expectedRoles{Qt::DisplayRole, Qt::UserRole, Qt::EditRole, Qt::UserRole + 1}; + QVector<int> receivedRoles = signalData.at(2).value<QVector<int> >(); + QCOMPARE(receivedRoles.size(), expectedRoles.size()); + for (int role : expectedRoles) + QVERIFY(receivedRoles.contains(role)); + signalData = sourceDataChangeSpy.takeFirst(); + QCOMPARE(signalData.at(0).value<QModelIndex>(), proxy.mapToSource(idx)); + QCOMPARE(signalData.at(1).value<QModelIndex>(), proxy.mapToSource(idx)); + receivedRoles = signalData.at(2).value<QVector<int> >(); + QCOMPARE(receivedRoles.size(), expectedRoles.size()); + for (int role : expectedRoles) + QVERIFY(receivedRoles.contains(role)); + idx = proxy.index(1, 2, proxy.index(0, 1)); + QVERIFY(proxy.setItemData(idx, itmData)); + QCOMPARE(idx.data(Qt::DisplayRole).toString(), QStringLiteral("Test")); + QCOMPARE(idx.data(Qt::UserRole).toInt(), 88); + QCOMPARE(idx.data(Qt::UserRole + 1).toInt(), 99); + QCOMPARE(idx.data(Qt::UserRole + 2).toInt(), 2); + QCOMPARE(idx.data(Qt::UserRole + 3).toInt(), 1); + QCOMPARE(sourceDataChangeSpy.size(), 1); + QCOMPARE(proxyDataChangeSpy.size(), 1); + signalData = proxyDataChangeSpy.takeFirst(); + QCOMPARE(signalData.at(0).value<QModelIndex>(), idx); + QCOMPARE(signalData.at(1).value<QModelIndex>(), idx); + receivedRoles = signalData.at(2).value<QVector<int> >(); + QCOMPARE(receivedRoles.size(), expectedRoles.size()); + for (int role : expectedRoles) + QVERIFY(receivedRoles.contains(role)); + signalData = sourceDataChangeSpy.takeFirst(); + QCOMPARE(signalData.at(0).value<QModelIndex>(), proxy.mapToSource(idx)); + QCOMPARE(signalData.at(1).value<QModelIndex>(), proxy.mapToSource(idx)); + receivedRoles = signalData.at(2).value<QVector<int> >(); + QCOMPARE(receivedRoles.size(), expectedRoles.size()); + for (int role : expectedRoles) + QVERIFY(receivedRoles.contains(role)); + QVERIFY(!proxy.setItemData(QModelIndex(), itmData)); + delete model; +} + +void tst_QTransposeProxyModel::moveRowsBase() +{ + QStringListModel model{QStringList{"A", "B", "C", "D"}}; + QTransposeProxyModel proxy; + QSignalSpy columnsMoveSpy(&proxy, &QAbstractItemModel::columnsMoved); + QVERIFY(columnsMoveSpy.isValid()); + QSignalSpy columnsAboutToBeMoveSpy(&proxy, &QAbstractItemModel::columnsAboutToBeMoved); + QVERIFY(columnsAboutToBeMoveSpy.isValid()); + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(&model); + const QStringList expectedNewVal = {"B", "A", "C", "D"}; + QVERIFY(model.moveRows(QModelIndex(), 0, 1, QModelIndex(), 2)); + for (int i = 0; i < expectedNewVal.size(); ++i) + QCOMPARE(proxy.index(0, i).data(), expectedNewVal.at(i)); + QCOMPARE(columnsMoveSpy.count(), 1); + QCOMPARE(columnsAboutToBeMoveSpy.count(), 1); + for (const auto &spyArgs : {columnsMoveSpy.takeFirst(), + columnsAboutToBeMoveSpy.takeFirst()}) { + QVERIFY(!spyArgs.at(0).value<QModelIndex>().isValid()); + QCOMPARE(spyArgs.at(1).toInt(), 0); + QCOMPARE(spyArgs.at(2).toInt(), 0); + QVERIFY(!spyArgs.at(3).value<QModelIndex>().isValid()); + QCOMPARE(spyArgs.at(4).toInt(), 2); + } +} + +void tst_QTransposeProxyModel::moveColumnsProxy() +{ + QStringListModel model{QStringList{"A", "B", "C", "D"}}; + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + QSignalSpy columnsMoveSpy(&proxy, &QAbstractItemModel::columnsMoved); + QVERIFY(columnsMoveSpy.isValid()); + QSignalSpy columnsAboutToBeMoveSpy(&proxy, &QAbstractItemModel::columnsAboutToBeMoved); + QVERIFY(columnsAboutToBeMoveSpy.isValid()); + QSignalSpy rowsMoveSpy(&model, &QAbstractItemModel::rowsMoved); + QVERIFY(rowsMoveSpy.isValid()); + QSignalSpy rowsAboutToBeMoveSpy(&model, &QAbstractItemModel::rowsAboutToBeMoved); + QVERIFY(rowsAboutToBeMoveSpy.isValid()); + proxy.setSourceModel(&model); + const QStringList expectedNewVal = {"B", "A", "C", "D"}; + QVERIFY(proxy.moveColumns(QModelIndex(), 0, 1, QModelIndex(), 2)); + for (int i = 0; i < expectedNewVal.size(); ++i) + QCOMPARE(proxy.index(0, i).data(), expectedNewVal.at(i)); + for (int i = 0; i < expectedNewVal.size(); ++i) + QCOMPARE(model.index(i, 0).data(), expectedNewVal.at(i)); + QCOMPARE(columnsMoveSpy.count(), 1); + QCOMPARE(columnsAboutToBeMoveSpy.count(), 1); + QCOMPARE(rowsMoveSpy.count(), 1); + QCOMPARE(rowsAboutToBeMoveSpy.count(), 1); + for (const auto &spyArgs : {columnsMoveSpy.takeFirst(), + columnsAboutToBeMoveSpy.takeFirst(), + rowsMoveSpy.takeFirst(),rowsAboutToBeMoveSpy.takeFirst()}) { + QVERIFY(!spyArgs.at(0).value<QModelIndex>().isValid()); + QCOMPARE(spyArgs.at(1).toInt(), 0); + QCOMPARE(spyArgs.at(2).toInt(), 0); + QVERIFY(!spyArgs.at(3).value<QModelIndex>().isValid()); + } +} + +void tst_QTransposeProxyModel::setData_data() +{ + QTest::addColumn<QAbstractItemModel *>("model"); + QTest::addColumn<bool>("rootItem"); + QTest::addColumn<bool>("viaProxy"); + QTest::newRow("List_via_Base") << createListModel(this) << true << false; + QTest::newRow("Table_via_Base") << createTableModel(this) << true << false; + QTest::newRow("Tree_via_Base_Root_Item") << createTreeModel(this) << true << false; + QTest::newRow("Tree_via_Base_Child_Item") << createTreeModel(this) << false << false; + QTest::newRow("List_via_Proxy") << createListModel(this) << true << true; + QTest::newRow("Table_via_Proxy") << createTableModel(this) << true << true; + QTest::newRow("Tree_via_Proxy_Root_Item") << createTreeModel(this) << true << true; + QTest::newRow("Tree_via_Proxy_Child_Item") << createTreeModel(this) << false << true; +} + +void tst_QTransposeProxyModel::setData() +{ + QFETCH(QAbstractItemModel *, model); + QFETCH(bool, rootItem); + QFETCH(bool, viaProxy); + QTransposeProxyModel proxy; + new QAbstractItemModelTester(&proxy, &proxy); + proxy.setSourceModel(model); + QSignalSpy sourceDataChangeSpy(model, &QAbstractItemModel::dataChanged); + QVERIFY(sourceDataChangeSpy.isValid()); + QSignalSpy proxyDataChangeSpy(&proxy, &QAbstractItemModel::dataChanged); + QVERIFY(proxyDataChangeSpy.isValid()); + const QString testData = QStringLiteral("TestingSetData"); + if (viaProxy) { + const QModelIndex parIdx = rootItem ? QModelIndex() : proxy.index(0, 1); + QVERIFY(proxy.setData(proxy.index(0, 1, parIdx), testData)); + QCOMPARE(model->index(1, 0, proxy.mapToSource(parIdx)).data().toString(), testData); + } else { + const QModelIndex parIdx = rootItem ? QModelIndex() : model->index(1, 0); + QVERIFY(model->setData(model->index(1, 0, parIdx), testData)); + QCOMPARE(proxy.index(0, 1, proxy.mapFromSource(parIdx)).data().toString(), testData); + } + QCOMPARE(sourceDataChangeSpy.size(), 1); + QCOMPARE(proxyDataChangeSpy.size(), 1); + delete model; +} + +QTEST_GUILESS_MAIN(tst_QTransposeProxyModel) + +#include "tst_qtransposeproxymodel.moc" diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 5d9b5ca95c..fb11e4c522 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -73,6 +73,7 @@ private slots: void defined(); void threadSafety(); void namespaces(); + void id(); void qMetaTypeId(); void properties(); void normalizedTypes(); @@ -341,6 +342,7 @@ struct Bar ++failureCount; } } + ~Bar() {} public: static int failureCount; @@ -457,7 +459,7 @@ void tst_QMetaType::threadSafety() namespace TestSpace { - struct Foo { double d; }; + struct Foo { double d; public: ~Foo() {} }; struct QungTfu {}; } Q_DECLARE_METATYPE(TestSpace::Foo) @@ -475,6 +477,12 @@ void tst_QMetaType::namespaces() QCOMPARE(QMetaType::typeName(qungTfuId), "TestSpace::QungTfu"); } +void tst_QMetaType::id() +{ + QCOMPARE(QMetaType(QMetaType::QString).id(), QMetaType::QString); + QCOMPARE(QMetaType(::qMetaTypeId<TestSpace::Foo>()).id(), ::qMetaTypeId<TestSpace::Foo>()); +} + void tst_QMetaType::qMetaTypeId() { QCOMPARE(::qMetaTypeId<QString>(), int(QMetaType::QString)); @@ -508,11 +516,17 @@ void tst_QMetaType::properties() } template <typename T> -struct Whity { T t; }; +struct Whity { T t; Whity() {} }; Q_DECLARE_METATYPE( Whity < int > ) Q_DECLARE_METATYPE(Whity<double>) +#if !defined(Q_CC_CLANG) && defined(Q_CC_GNU) && Q_CC_GNU < 501 +QT_BEGIN_NAMESPACE +Q_DECLARE_TYPEINFO(Whity<double>, Q_MOVABLE_TYPE); +QT_END_NAMESPACE +#endif + void tst_QMetaType::normalizedTypes() { int WhityIntId = ::qMetaTypeId<Whity<int> >(); @@ -811,10 +825,13 @@ void tst_QMetaType::sizeOfStaticLess() QCOMPARE(size_t(QMetaType(type).sizeOf()), size); } -struct CustomMovable {}; +struct CustomMovable { CustomMovable() {} }; +#if !defined(Q_CC_CLANG) && defined(Q_CC_GNU) && Q_CC_GNU < 501 QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(CustomMovable, Q_MOVABLE_TYPE); QT_END_NAMESPACE +#endif + Q_DECLARE_METATYPE(CustomMovable); class CustomObject : public QObject @@ -843,13 +860,15 @@ public: }; Q_DECLARE_METATYPE(CustomMultiInheritanceObject*); -class C { char _[4]; }; -class M { char _[4]; }; +class C { char _[4]; public: C() = default; C(const C&) {} }; +class M { char _[4]; public: M() {} }; class P { char _[4]; }; QT_BEGIN_NAMESPACE +#if defined(Q_CC_GNU) && Q_CC_GNU < 501 Q_DECLARE_TYPEINFO(M, Q_MOVABLE_TYPE); Q_DECLARE_TYPEINFO(P, Q_PRIMITIVE_TYPE); +#endif QT_END_NAMESPACE // avoid the comma: @@ -895,7 +914,7 @@ QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(ADD_METATYPE_TEST_ROW) QT_FOR_EACH_STATIC_CORE_POINTER(ADD_METATYPE_TEST_ROW) #undef ADD_METATYPE_TEST_ROW QTest::newRow("TestSpace::Foo") << ::qMetaTypeId<TestSpace::Foo>() << false << true << false << false; - QTest::newRow("Whity<double>") << ::qMetaTypeId<Whity<double> >() << false << true << false << false; + QTest::newRow("Whity<double>") << ::qMetaTypeId<Whity<double> >() << true << true << false << false; QTest::newRow("CustomMovable") << ::qMetaTypeId<CustomMovable>() << true << true << false << false; QTest::newRow("CustomObject*") << ::qMetaTypeId<CustomObject*>() << true << false << true << false; QTest::newRow("CustomMultiInheritanceObject*") << ::qMetaTypeId<CustomMultiInheritanceObject*>() << true << false << true << false; @@ -1814,13 +1833,6 @@ DECLARE_NONSTREAMABLE(void) DECLARE_NONSTREAMABLE(void*) DECLARE_NONSTREAMABLE(QModelIndex) DECLARE_NONSTREAMABLE(QPersistentModelIndex) -DECLARE_NONSTREAMABLE(QJsonValue) -DECLARE_NONSTREAMABLE(QJsonObject) -DECLARE_NONSTREAMABLE(QJsonArray) -DECLARE_NONSTREAMABLE(QJsonDocument) -DECLARE_NONSTREAMABLE(QCborValue) -DECLARE_NONSTREAMABLE(QCborArray) -DECLARE_NONSTREAMABLE(QCborMap) DECLARE_NONSTREAMABLE(QObject*) DECLARE_NONSTREAMABLE(QWidget*) diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 06254091cd..31268c5cf3 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -41,6 +41,7 @@ #include <QThread> #include <QMutex> #include <QWaitCondition> +#include <QScopedPointer> #if QT_CONFIG(process) # include <QProcess> #endif @@ -285,104 +286,100 @@ static void playWithObjects() void tst_QObject::disconnect() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; - ReceiverObject *r2 = new ReceiverObject; + SenderObject s; + ReceiverObject r1; + ReceiverObject r2; - connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) ); + connect(&s, SIGNAL(signal1()), &r1, SLOT(slot1())); - connect( s, SIGNAL(signal2()), r1, SLOT(slot2()) ); - connect( s, SIGNAL(signal3()), r1, SLOT(slot3()) ); - connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) ); + connect(&s, SIGNAL(signal2()), &r1, SLOT(slot2())); + connect(&s, SIGNAL(signal3()), &r1, SLOT(slot3())); + connect(&s, SIGNAL(signal4()), &r1, SLOT(slot4())); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); - QVERIFY(r1->called(1)); - QVERIFY(r1->called(2)); - QVERIFY(r1->called(3)); - QVERIFY(r1->called(4)); - r1->reset(); + QVERIFY(r1.called(1)); + QVERIFY(r1.called(2)); + QVERIFY(r1.called(3)); + QVERIFY(r1.called(4)); + r1.reset(); // usual disconnect with all parameters given - bool ret = QObject::disconnect( s, SIGNAL(signal1()), r1, SLOT(slot1()) ); + bool ret = QObject::disconnect(&s, SIGNAL(signal1()), &r1, SLOT(slot1())); - s->emitSignal1(); + s.emitSignal1(); - QVERIFY(!r1->called(1)); - r1->reset(); + QVERIFY(!r1.called(1)); + r1.reset(); QVERIFY(ret); - ret = QObject::disconnect( s, SIGNAL(signal1()), r1, SLOT(slot1()) ); + ret = QObject::disconnect(&s, SIGNAL(signal1()), &r1, SLOT(slot1())); QVERIFY(!ret); // disconnect all signals from s from all slots from r1 - QObject::disconnect( s, 0, r1, 0 ); + QObject::disconnect(&s, 0, &r1, 0); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); - QVERIFY(!r1->called(2)); - QVERIFY(!r1->called(3)); - QVERIFY(!r1->called(4)); - r1->reset(); + QVERIFY(!r1.called(2)); + QVERIFY(!r1.called(3)); + QVERIFY(!r1.called(4)); + r1.reset(); - connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) ); - connect( s, SIGNAL(signal1()), r1, SLOT(slot2()) ); - connect( s, SIGNAL(signal1()), r1, SLOT(slot3()) ); - connect( s, SIGNAL(signal2()), r1, SLOT(slot4()) ); + connect(&s, SIGNAL(signal1()), &r1, SLOT(slot1())); + connect(&s, SIGNAL(signal1()), &r1, SLOT(slot2())); + connect(&s, SIGNAL(signal1()), &r1, SLOT(slot3())); + connect(&s, SIGNAL(signal2()), &r1, SLOT(slot4())); // disconnect s's signal1() from all slots of r1 - QObject::disconnect( s, SIGNAL(signal1()), r1, 0 ); + QObject::disconnect(&s, SIGNAL(signal1()), &r1, 0); - s->emitSignal1(); - s->emitSignal2(); + s.emitSignal1(); + s.emitSignal2(); - QVERIFY(!r1->called(1)); - QVERIFY(!r1->called(2)); - QVERIFY(!r1->called(3)); - QVERIFY(r1->called(4)); - r1->reset(); + QVERIFY(!r1.called(1)); + QVERIFY(!r1.called(2)); + QVERIFY(!r1.called(3)); + QVERIFY(r1.called(4)); + r1.reset(); // make sure all is disconnected again - QObject::disconnect( s, 0, r1, 0 ); + QObject::disconnect(&s, 0, &r1, 0); - connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) ); - connect( s, SIGNAL(signal1()), r2, SLOT(slot1()) ); - connect( s, SIGNAL(signal2()), r1, SLOT(slot2()) ); - connect( s, SIGNAL(signal2()), r2, SLOT(slot2()) ); - connect( s, SIGNAL(signal3()), r1, SLOT(slot3()) ); - connect( s, SIGNAL(signal3()), r2, SLOT(slot3()) ); + connect(&s, SIGNAL(signal1()), &r1, SLOT(slot1())); + connect(&s, SIGNAL(signal1()), &r2, SLOT(slot1())); + connect(&s, SIGNAL(signal2()), &r1, SLOT(slot2())); + connect(&s, SIGNAL(signal2()), &r2, SLOT(slot2())); + connect(&s, SIGNAL(signal3()), &r1, SLOT(slot3())); + connect(&s, SIGNAL(signal3()), &r2, SLOT(slot3())); // disconnect signal1() from all receivers - QObject::disconnect( s, SIGNAL(signal1()), 0, 0 ); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); + QObject::disconnect(&s, SIGNAL(signal1()), 0, 0); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); - QVERIFY(!r1->called(1)); - QVERIFY(!r2->called(1)); - QVERIFY(r1->called(2)); - QVERIFY(r2->called(2)); - QVERIFY(r1->called(2)); - QVERIFY(r2->called(2)); + QVERIFY(!r1.called(1)); + QVERIFY(!r2.called(1)); + QVERIFY(r1.called(2)); + QVERIFY(r2.called(2)); + QVERIFY(r1.called(2)); + QVERIFY(r2.called(2)); - r1->reset(); - r2->reset(); + r1.reset(); + r2.reset(); // disconnect all signals of s from all receivers - QObject::disconnect( s, 0, 0, 0 ); + QObject::disconnect(&s, 0, 0, 0); - QVERIFY(!r1->called(2)); - QVERIFY(!r2->called(2)); - QVERIFY(!r1->called(2)); - QVERIFY(!r2->called(2)); - - delete r2; - delete r1; - delete s; + QVERIFY(!r1.called(2)); + QVERIFY(!r2.called(2)); + QVERIFY(!r1.called(2)); + QVERIFY(!r2.called(2)); } class AutoConnectSender : public QObject @@ -504,14 +501,13 @@ void tst_QObject::connectSlotsByName() void tst_QObject::qobject_castTemplate() { - QObject *o = 0; - QVERIFY( !::qobject_cast<QObject*>(o) ); + QScopedPointer<QObject> o; + QVERIFY(!::qobject_cast<QObject*>(o.data())); - o = new SenderObject; - QVERIFY( ::qobject_cast<SenderObject*>(o) ); - QVERIFY( ::qobject_cast<QObject*>(o) ); - QVERIFY( !::qobject_cast<ReceiverObject*>(o) ); - delete o; + o.reset(new SenderObject); + QVERIFY(::qobject_cast<SenderObject*>(o.data())); + QVERIFY(::qobject_cast<QObject*>(o.data())); + QVERIFY(!::qobject_cast<ReceiverObject*>(o.data())); } void tst_QObject::findChildren() @@ -798,192 +794,197 @@ void tst_QObject::connectDisconnectNotify_data() void tst_QObject::connectDisconnectNotify() { - NotifyObject *s = new NotifyObject; - NotifyObject *r = new NotifyObject; + NotifyObject s; + NotifyObject r; QFETCH(QString, a_signal); QFETCH(QString, a_slot); // Obtaining meta methods - int signalIndx = ((SenderObject*)s)->metaObject()->indexOfSignal( + int signalIndx = ((SenderObject &)s).metaObject()->indexOfSignal( QMetaObject::normalizedSignature(a_signal.toLatin1().constData()+1).constData()); - int methodIndx = ((ReceiverObject*)r)->metaObject()->indexOfMethod( + int methodIndx = ((ReceiverObject &)r).metaObject()->indexOfMethod( QMetaObject::normalizedSignature(a_slot.toLatin1().constData()+1).constData()); - QMetaMethod signal = ((SenderObject*)s)->metaObject()->method(signalIndx); - QMetaMethod method = ((ReceiverObject*)r)->metaObject()->method(methodIndx); + QMetaMethod signal = ((SenderObject &)s).metaObject()->method(signalIndx); + QMetaMethod method = ((ReceiverObject &)r).metaObject()->method(methodIndx); QVERIFY(signal.isValid()); QVERIFY(method.isValid()); // Test connectNotify - QVERIFY(QObject::connect((SenderObject*)s, a_signal.toLatin1(), (ReceiverObject*)r, a_slot.toLatin1())); - QCOMPARE(s->connectedSignals.size(), 1); - QCOMPARE(s->connectedSignals.at(0), signal); - QVERIFY(s->disconnectedSignals.isEmpty()); + QVERIFY(QObject::connect((SenderObject *)&s, a_signal.toLatin1(), + (ReceiverObject *)&r, a_slot.toLatin1())); + QCOMPARE(s.connectedSignals.size(), 1); + QCOMPARE(s.connectedSignals.at(0), signal); + QVERIFY(s.disconnectedSignals.isEmpty()); // Test disconnectNotify - QVERIFY(QObject::disconnect((SenderObject*)s, a_signal.toLatin1(), (ReceiverObject*)r, a_slot.toLatin1())); - QCOMPARE(s->disconnectedSignals.size(), 1); - QCOMPARE(s->disconnectedSignals.at(0), signal); - QCOMPARE(s->connectedSignals.size(), 1); + QVERIFY(QObject::disconnect((SenderObject *)&s, a_signal.toLatin1(), + (ReceiverObject *)&r, a_slot.toLatin1())); + QCOMPARE(s.disconnectedSignals.size(), 1); + QCOMPARE(s.disconnectedSignals.at(0), signal); + QCOMPARE(s.connectedSignals.size(), 1); // Reconnect - s->clearNotifications(); - QVERIFY(QObject::connect((SenderObject*)s, a_signal.toLatin1(), (ReceiverObject*)r, a_slot.toLatin1())); - QCOMPARE(s->connectedSignals.size(), 1); - QCOMPARE(s->connectedSignals.at(0), signal); - QVERIFY(s->disconnectedSignals.isEmpty()); + s.clearNotifications(); + QVERIFY(QObject::connect((SenderObject *)&s, a_signal.toLatin1(), + (ReceiverObject *)&r, a_slot.toLatin1())); + QCOMPARE(s.connectedSignals.size(), 1); + QCOMPARE(s.connectedSignals.at(0), signal); + QVERIFY(s.disconnectedSignals.isEmpty()); // Test disconnectNotify for a complete disconnect - QVERIFY(((SenderObject*)s)->disconnect((ReceiverObject*)r)); - QCOMPARE(s->disconnectedSignals.size(), 1); - QCOMPARE(s->disconnectedSignals.at(0), QMetaMethod()); - QCOMPARE(s->connectedSignals.size(), 1); + QVERIFY(((SenderObject *)&s)->disconnect((ReceiverObject *)&r)); + QCOMPARE(s.disconnectedSignals.size(), 1); + QCOMPARE(s.disconnectedSignals.at(0), QMetaMethod()); + QCOMPARE(s.connectedSignals.size(), 1); // Test connectNotify when connecting by QMetaMethod - s->clearNotifications(); - QVERIFY(QObject::connect((SenderObject*)s, signal, (ReceiverObject*)r, method)); - QCOMPARE(s->connectedSignals.size(), 1); - QCOMPARE(s->connectedSignals.at(0), signal); - QVERIFY(s->disconnectedSignals.isEmpty()); + s.clearNotifications(); + QVERIFY(QObject::connect((SenderObject *)&s, signal, (ReceiverObject *)&r, method)); + QCOMPARE(s.connectedSignals.size(), 1); + QCOMPARE(s.connectedSignals.at(0), signal); + QVERIFY(s.disconnectedSignals.isEmpty()); // Test disconnectNotify when disconnecting by QMetaMethod - QVERIFY(QObject::disconnect((SenderObject*)s, signal, (ReceiverObject*)r, method)); - QCOMPARE(s->disconnectedSignals.size(), 1); - QCOMPARE(s->disconnectedSignals.at(0), signal); - QCOMPARE(s->connectedSignals.size(), 1); + QVERIFY(QObject::disconnect((SenderObject *)&s, signal, (ReceiverObject *)&r, method)); + QCOMPARE(s.disconnectedSignals.size(), 1); + QCOMPARE(s.disconnectedSignals.at(0), signal); + QCOMPARE(s.connectedSignals.size(), 1); // Reconnect - s->clearNotifications(); - QVERIFY(QObject::connect((SenderObject*)s, a_signal.toLatin1(), (ReceiverObject*)r, a_slot.toLatin1())); + s.clearNotifications(); + QVERIFY(QObject::connect((SenderObject *)&s, a_signal.toLatin1(), + (ReceiverObject *)&r, a_slot.toLatin1())); // Test disconnectNotify for a complete disconnect by QMetaMethod - QVERIFY(QObject::disconnect((SenderObject*)s, QMetaMethod(), 0, QMetaMethod())); - QCOMPARE(s->disconnectedSignals.size(), 1); - QCOMPARE(s->disconnectedSignals.at(0), QMetaMethod()); - QCOMPARE(s->connectedSignals.size(), 1); + QVERIFY(QObject::disconnect((SenderObject *)&s, QMetaMethod(), 0, QMetaMethod())); + QCOMPARE(s.disconnectedSignals.size(), 1); + QCOMPARE(s.disconnectedSignals.at(0), QMetaMethod()); + QCOMPARE(s.connectedSignals.size(), 1); // Test connectNotify when connecting by index - s->clearNotifications(); - QVERIFY(QMetaObject::connect((SenderObject*)s, signalIndx, (ReceiverObject*)r, methodIndx)); - QCOMPARE(s->connectedSignals.size(), 1); - QCOMPARE(s->connectedSignals.at(0), signal); - QVERIFY(s->disconnectedSignals.isEmpty()); + s.clearNotifications(); + QVERIFY(QMetaObject::connect((SenderObject *)&s, signalIndx, (ReceiverObject *)&r, methodIndx)); + QCOMPARE(s.connectedSignals.size(), 1); + QCOMPARE(s.connectedSignals.at(0), signal); + QVERIFY(s.disconnectedSignals.isEmpty()); // Test disconnectNotify when disconnecting by index - QVERIFY(QMetaObject::disconnect((SenderObject*)s, signalIndx, (ReceiverObject*)r, methodIndx)); - QCOMPARE(s->disconnectedSignals.size(), 1); - QCOMPARE(s->disconnectedSignals.at(0), signal); - QCOMPARE(s->connectedSignals.size(), 1); - - delete s; - delete r; + QVERIFY(QMetaObject::disconnect((SenderObject *)&s, signalIndx, + (ReceiverObject *)&r, methodIndx)); + QCOMPARE(s.disconnectedSignals.size(), 1); + QCOMPARE(s.disconnectedSignals.at(0), signal); + QCOMPARE(s.connectedSignals.size(), 1); } static void connectDisconnectNotifyTestSlot() {} void tst_QObject::connectDisconnectNotifyPMF() { - NotifyObject *s = new NotifyObject; - NotifyObject *r = new NotifyObject; + NotifyObject s; + NotifyObject r; QMetaMethod signal = QMetaMethod::fromSignal(&SenderObject::signal1); // Test connectNotify - QVERIFY(QObject::connect((SenderObject*)s, &SenderObject::signal1, (ReceiverObject*)r, &ReceiverObject::slot1)); - QCOMPARE(s->connectedSignals.size(), 1); - QCOMPARE(s->connectedSignals.at(0), signal); - QVERIFY(s->disconnectedSignals.isEmpty()); + QVERIFY(QObject::connect((SenderObject *)&s, &SenderObject::signal1, + (ReceiverObject *)&r, &ReceiverObject::slot1)); + QCOMPARE(s.connectedSignals.size(), 1); + QCOMPARE(s.connectedSignals.at(0), signal); + QVERIFY(s.disconnectedSignals.isEmpty()); // Test disconnectNotify - QVERIFY(QObject::disconnect((SenderObject*)s, &SenderObject::signal1, (ReceiverObject*)r, &ReceiverObject::slot1)); - QCOMPARE(s->disconnectedSignals.size(), 1); - QCOMPARE(s->disconnectedSignals.at(0), signal); - QCOMPARE(s->connectedSignals.size(), 1); + QVERIFY(QObject::disconnect((SenderObject *)&s, &SenderObject::signal1, + (ReceiverObject *)&r, &ReceiverObject::slot1)); + QCOMPARE(s.disconnectedSignals.size(), 1); + QCOMPARE(s.disconnectedSignals.at(0), signal); + QCOMPARE(s.connectedSignals.size(), 1); // Reconnect - s->clearNotifications(); - QVERIFY(QObject::connect((SenderObject*)s, &SenderObject::signal1, (ReceiverObject*)r, &ReceiverObject::slot1)); - QCOMPARE(s->connectedSignals.size(), 1); - QCOMPARE(s->connectedSignals.at(0), signal); - QVERIFY(s->disconnectedSignals.isEmpty()); + s.clearNotifications(); + QVERIFY(QObject::connect((SenderObject *)&s, &SenderObject::signal1, + (ReceiverObject *)&r, &ReceiverObject::slot1)); + QCOMPARE(s.connectedSignals.size(), 1); + QCOMPARE(s.connectedSignals.at(0), signal); + QVERIFY(s.disconnectedSignals.isEmpty()); // Test disconnectNotify with wildcard slot - QVERIFY(QObject::disconnect((SenderObject*)s, &SenderObject::signal1, (ReceiverObject*)r, 0)); - QCOMPARE(s->disconnectedSignals.size(), 1); - QCOMPARE(s->disconnectedSignals.at(0), signal); - QCOMPARE(s->connectedSignals.size(), 1); + QVERIFY(QObject::disconnect((SenderObject *)&s, &SenderObject::signal1, + (ReceiverObject *)&r, 0)); + QCOMPARE(s.disconnectedSignals.size(), 1); + QCOMPARE(s.disconnectedSignals.at(0), signal); + QCOMPARE(s.connectedSignals.size(), 1); // Reconnect - s->clearNotifications(); - QMetaObject::Connection conn = connect((SenderObject*)s, &SenderObject::signal1, - (ReceiverObject*)r, &ReceiverObject::slot1); + s.clearNotifications(); + QMetaObject::Connection conn = connect((SenderObject *)&s, &SenderObject::signal1, + (ReceiverObject *)&r, &ReceiverObject::slot1); QVERIFY(conn); // Test disconnectNotify when disconnecting by QMetaObject::Connection QVERIFY(QObject::disconnect(conn)); - QVERIFY(!s->disconnectedSignals.isEmpty()); + QVERIFY(!s.disconnectedSignals.isEmpty()); // Test connectNotify when connecting by function pointer - s->clearNotifications(); - QVERIFY(QObject::connect((SenderObject*)s, &SenderObject::signal1, connectDisconnectNotifyTestSlot)); - QCOMPARE(s->connectedSignals.size(), 1); - QCOMPARE(s->connectedSignals.at(0), signal); - QVERIFY(s->disconnectedSignals.isEmpty()); - - delete s; - delete r; + s.clearNotifications(); + QVERIFY(QObject::connect((SenderObject *)&s, &SenderObject::signal1, + connectDisconnectNotifyTestSlot)); + QCOMPARE(s.connectedSignals.size(), 1); + QCOMPARE(s.connectedSignals.at(0), signal); + QVERIFY(s.disconnectedSignals.isEmpty()); } void tst_QObject::disconnectNotify_receiverDestroyed() { - NotifyObject *s = new NotifyObject; - NotifyObject *r = new NotifyObject; - - QVERIFY(QObject::connect((SenderObject*)s, SIGNAL(signal1()), (ReceiverObject*)r, SLOT(slot1()))); - - delete r; - QCOMPARE(s->disconnectedSignals.count(), 1); - QCOMPARE(s->disconnectedSignals.at(0), QMetaMethod::fromSignal(&SenderObject::signal1)); + NotifyObject s; - s->disconnectedSignals.clear(); - r = new NotifyObject; + { + NotifyObject r; + QVERIFY(QObject::connect((SenderObject *)&s, SIGNAL(signal1()), + (ReceiverObject *)&r, SLOT(slot1()))); + } + QCOMPARE(s.disconnectedSignals.count(), 1); + QCOMPARE(s.disconnectedSignals.at(0), QMetaMethod::fromSignal(&SenderObject::signal1)); - QVERIFY(QObject::connect((SenderObject*)s, SIGNAL(signal3()), (ReceiverObject*)r, SLOT(slot3()))); + s.disconnectedSignals.clear(); - delete r; - QCOMPARE(s->disconnectedSignals.count(), 1); - QCOMPARE(s->disconnectedSignals.at(0), QMetaMethod::fromSignal(&SenderObject::signal3)); + { + NotifyObject r; + QVERIFY(QObject::connect((SenderObject *)&s, SIGNAL(signal3()), + (ReceiverObject *)&r, SLOT(slot3()))); + } - s->disconnectedSignals.clear(); - r = new NotifyObject; + QCOMPARE(s.disconnectedSignals.count(), 1); + QCOMPARE(s.disconnectedSignals.at(0), QMetaMethod::fromSignal(&SenderObject::signal3)); - QVERIFY(QObject::connect((SenderObject*)s, SIGNAL(destroyed()), (ReceiverObject*)r, SLOT(slot3()))); + s.disconnectedSignals.clear(); - delete r; - QCOMPARE(s->disconnectedSignals.count(), 1); - QCOMPARE(s->disconnectedSignals.at(0), QMetaMethod::fromSignal(&QObject::destroyed)); + { + NotifyObject r; + QVERIFY(QObject::connect((SenderObject *)&s, SIGNAL(destroyed()), (ReceiverObject *)&r, SLOT(slot3()))); + } - delete s; + QCOMPARE(s.disconnectedSignals.count(), 1); + QCOMPARE(s.disconnectedSignals.at(0), QMetaMethod::fromSignal(&QObject::destroyed)); } void tst_QObject::disconnectNotify_metaObjConnection() { - NotifyObject *s = new NotifyObject; - NotifyObject *r = new NotifyObject; - - QMetaObject::Connection c = QObject::connect((SenderObject*)s, SIGNAL(signal1()), - (ReceiverObject*)r, SLOT(slot1())); - QVERIFY(c); - QVERIFY(QObject::disconnect(c)); + NotifyObject s; + { + NotifyObject r; - QCOMPARE(s->disconnectedSignals.count(), 1); - QCOMPARE(s->disconnectedSignals.at(0), QMetaMethod::fromSignal(&SenderObject::signal1)); + QMetaObject::Connection c = QObject::connect((SenderObject *)&s, SIGNAL(signal1()), + (ReceiverObject *)&r, SLOT(slot1())); + QVERIFY(c); + QVERIFY(QObject::disconnect(c)); - delete r; - QCOMPARE(s->disconnectedSignals.count(), 1); + QCOMPARE(s.disconnectedSignals.count(), 1); + QCOMPARE(s.disconnectedSignals.at(0), QMetaMethod::fromSignal(&SenderObject::signal1)); - delete s; + QCOMPARE(s.disconnectedSignals.count(), 1); + } } class ConnectByNameNotifySenderObject : public QObject @@ -3463,130 +3464,131 @@ void tst_QObject::qobjectConstCast() void tst_QObject::uniqConnection() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; - ReceiverObject *r2 = new ReceiverObject; - r1->reset(); - r2->reset(); + SenderObject s; + ReceiverObject r1; + ReceiverObject r2; + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - QVERIFY( connect( s, SIGNAL(signal1()), r1, SLOT(slot1()) , Qt::UniqueConnection) ); - QVERIFY( connect( s, SIGNAL(signal1()), r2, SLOT(slot1()) , Qt::UniqueConnection) ); - QVERIFY( connect( s, SIGNAL(signal1()), r1, SLOT(slot3()) , Qt::UniqueConnection) ); - QVERIFY( connect( s, SIGNAL(signal3()), r1, SLOT(slot3()) , Qt::UniqueConnection) ); + QVERIFY(connect(&s, SIGNAL(signal1()), &r1, SLOT(slot1()) , Qt::UniqueConnection) ); + QVERIFY(connect(&s, SIGNAL(signal1()), &r2, SLOT(slot1()) , Qt::UniqueConnection) ); + QVERIFY(connect(&s, SIGNAL(signal1()), &r1, SLOT(slot3()) , Qt::UniqueConnection) ); + QVERIFY(connect(&s, SIGNAL(signal3()), &r1, SLOT(slot3()) , Qt::UniqueConnection) ); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); - - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 2 ); - QCOMPARE( r1->count_slot4, 0 ); - QCOMPARE( r2->count_slot1, 1 ); - QCOMPARE( r2->count_slot2, 0 ); - QCOMPARE( r2->count_slot3, 0 ); - QCOMPARE( r2->count_slot4, 0 ); - QCOMPARE( r1->sequence_slot1, 1 ); - QCOMPARE( r2->sequence_slot1, 2 ); - QCOMPARE( r1->sequence_slot3, 4 ); - - r1->reset(); - r2->reset(); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); + + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 2); + QCOMPARE(r1.count_slot4, 0); + QCOMPARE(r2.count_slot1, 1); + QCOMPARE(r2.count_slot2, 0); + QCOMPARE(r2.count_slot3, 0); + QCOMPARE(r2.count_slot4, 0); + QCOMPARE(r1.sequence_slot1, 1); + QCOMPARE(r2.sequence_slot1, 2); + QCOMPARE(r1.sequence_slot3, 4); + + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - QVERIFY( connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) , Qt::UniqueConnection) ); - QVERIFY( connect( s, SIGNAL(signal4()), r2, SLOT(slot4()) , Qt::UniqueConnection) ); - QVERIFY(!connect( s, SIGNAL(signal4()), r2, SLOT(slot4()) , Qt::UniqueConnection) ); - QVERIFY( connect( s, SIGNAL(signal1()), r2, SLOT(slot4()) , Qt::UniqueConnection) ); - QVERIFY(!connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) , Qt::UniqueConnection) ); + QVERIFY( connect(&s, SIGNAL(signal4()), &r1, SLOT(slot4()) , Qt::UniqueConnection)); + QVERIFY( connect(&s, SIGNAL(signal4()), &r2, SLOT(slot4()) , Qt::UniqueConnection)); + QVERIFY(!connect(&s, SIGNAL(signal4()), &r2, SLOT(slot4()) , Qt::UniqueConnection)); + QVERIFY( connect(&s, SIGNAL(signal1()), &r2, SLOT(slot4()) , Qt::UniqueConnection)); + QVERIFY(!connect(&s, SIGNAL(signal4()), &r1, SLOT(slot4()) , Qt::UniqueConnection)); - s->emitSignal4(); - QCOMPARE( r1->count_slot4, 1 ); - QCOMPARE( r2->count_slot4, 1 ); - QCOMPARE( r1->sequence_slot4, 1 ); - QCOMPARE( r2->sequence_slot4, 2 ); + s.emitSignal4(); + QCOMPARE(r1.count_slot4, 1); + QCOMPARE(r2.count_slot4, 1); + QCOMPARE(r1.sequence_slot4, 1); + QCOMPARE(r2.sequence_slot4, 2); - r1->reset(); - r2->reset(); + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - connect( s, SIGNAL(signal4()), r1, SLOT(slot4()) ); - - s->emitSignal4(); - QCOMPARE( r1->count_slot4, 2 ); - QCOMPARE( r2->count_slot4, 1 ); - QCOMPARE( r1->sequence_slot4, 3 ); - QCOMPARE( r2->sequence_slot4, 2 ); + connect(&s, SIGNAL(signal4()), &r1, SLOT(slot4())); - delete s; - delete r1; - delete r2; + s.emitSignal4(); + QCOMPARE(r1.count_slot4, 2); + QCOMPARE(r2.count_slot4, 1); + QCOMPARE(r1.sequence_slot4, 3); + QCOMPARE(r2.sequence_slot4, 2); } void tst_QObject::uniqConnectionPtr() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; - ReceiverObject *r2 = new ReceiverObject; - r1->reset(); - r2->reset(); + SenderObject s; + ReceiverObject r1; + ReceiverObject r2; + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - QVERIFY( connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 , Qt::UniqueConnection) ); - QVERIFY( connect( s, &SenderObject::signal1, r2, &ReceiverObject::slot1 , Qt::UniqueConnection) ); - QVERIFY( connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot3 , Qt::UniqueConnection) ); - QVERIFY( connect( s, &SenderObject::signal3, r1, &ReceiverObject::slot3 , Qt::UniqueConnection) ); + QVERIFY(connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot1 , + Qt::UniqueConnection)); + QVERIFY(connect(&s, &SenderObject::signal1, &r2, &ReceiverObject::slot1 , + Qt::UniqueConnection)); + QVERIFY(connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot3 , + Qt::UniqueConnection)); + QVERIFY(connect(&s, &SenderObject::signal3, &r1, &ReceiverObject::slot3 , + Qt::UniqueConnection)); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); - - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 2 ); - QCOMPARE( r1->count_slot4, 0 ); - QCOMPARE( r2->count_slot1, 1 ); - QCOMPARE( r2->count_slot2, 0 ); - QCOMPARE( r2->count_slot3, 0 ); - QCOMPARE( r2->count_slot4, 0 ); - QCOMPARE( r1->sequence_slot1, 1 ); - QCOMPARE( r2->sequence_slot1, 2 ); - QCOMPARE( r1->sequence_slot3, 4 ); - - r1->reset(); - r2->reset(); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); + + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 2); + QCOMPARE(r1.count_slot4, 0); + QCOMPARE(r2.count_slot1, 1); + QCOMPARE(r2.count_slot2, 0); + QCOMPARE(r2.count_slot3, 0); + QCOMPARE(r2.count_slot4, 0); + QCOMPARE(r1.sequence_slot1, 1); + QCOMPARE(r2.sequence_slot1, 2); + QCOMPARE(r1.sequence_slot3, 4); + + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - QVERIFY( connect( s, &SenderObject::signal4, r1, &ReceiverObject::slot4 , Qt::UniqueConnection) ); - QVERIFY( connect( s, &SenderObject::signal4, r2, &ReceiverObject::slot4 , Qt::UniqueConnection) ); - QVERIFY(!connect( s, &SenderObject::signal4, r2, &ReceiverObject::slot4 , Qt::UniqueConnection) ); - QVERIFY( connect( s, &SenderObject::signal1, r2, &ReceiverObject::slot4 , Qt::UniqueConnection) ); - QVERIFY(!connect( s, &SenderObject::signal4, r1, &ReceiverObject::slot4 , Qt::UniqueConnection) ); + QVERIFY( connect(&s, &SenderObject::signal4, &r1, &ReceiverObject::slot4 , + Qt::UniqueConnection)); + QVERIFY( connect(&s, &SenderObject::signal4, &r2, &ReceiverObject::slot4 , + Qt::UniqueConnection)); + QVERIFY(!connect(&s, &SenderObject::signal4, &r2, &ReceiverObject::slot4 , + Qt::UniqueConnection)); + QVERIFY( connect(&s, &SenderObject::signal1, &r2, &ReceiverObject::slot4 , + Qt::UniqueConnection)); + QVERIFY(!connect(&s, &SenderObject::signal4, &r1, &ReceiverObject::slot4 , + Qt::UniqueConnection)); - s->emitSignal4(); - QCOMPARE( r1->count_slot4, 1 ); - QCOMPARE( r2->count_slot4, 1 ); - QCOMPARE( r1->sequence_slot4, 1 ); - QCOMPARE( r2->sequence_slot4, 2 ); + s.emitSignal4(); + QCOMPARE(r1.count_slot4, 1); + QCOMPARE(r2.count_slot4, 1); + QCOMPARE(r1.sequence_slot4, 1); + QCOMPARE(r2.sequence_slot4, 2); - r1->reset(); - r2->reset(); + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - connect( s, &SenderObject::signal4, r1, &ReceiverObject::slot4 ); + connect(&s, &SenderObject::signal4, &r1, &ReceiverObject::slot4); - s->emitSignal4(); - QCOMPARE( r1->count_slot4, 2 ); - QCOMPARE( r2->count_slot4, 1 ); - QCOMPARE( r1->sequence_slot4, 3 ); - QCOMPARE( r2->sequence_slot4, 2 ); - - delete s; - delete r1; - delete r2; + s.emitSignal4(); + QCOMPARE(r1.count_slot4, 2); + QCOMPARE(r2.count_slot4, 1); + QCOMPARE(r1.sequence_slot4, 3); + QCOMPARE(r2.sequence_slot4, 2); } void tst_QObject::interfaceIid() @@ -3890,217 +3892,214 @@ void tst_QObject::isSignalConnectedAfterDisconnection() void tst_QObject::qMetaObjectConnect() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; - ReceiverObject *r2 = new ReceiverObject; - r1->reset(); - r2->reset(); - ReceiverObject::sequence = 0; - - int signal1Index = s->metaObject()->indexOfSignal("signal1()"); - int signal3Index = s->metaObject()->indexOfSignal("signal3()"); - int slot1Index = r1->metaObject()->indexOfSlot("slot1()"); - int slot2Index = r1->metaObject()->indexOfSlot("slot2()"); - int slot3Index = r1->metaObject()->indexOfSlot("slot3()"); - - QVERIFY(slot1Index > 0); - QVERIFY(slot2Index > 0); - QVERIFY(slot3Index > 0); - - QVERIFY( QMetaObject::connect( s, signal1Index, r1, slot1Index) ); - QVERIFY( QMetaObject::connect( s, signal3Index, r2, slot3Index) ); - QVERIFY( QMetaObject::connect( s, -1, r2, slot2Index) ); - - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 0 ); - QCOMPARE( r2->count_slot1, 0 ); - QCOMPARE( r2->count_slot2, 0 ); - QCOMPARE( r2->count_slot3, 0 ); - - s->emitSignal1(); - - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 0 ); - QCOMPARE( r2->count_slot1, 0 ); - QCOMPARE( r2->count_slot2, 1 ); - QCOMPARE( r2->count_slot3, 0 ); - - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); - - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 0 ); - QCOMPARE( r2->count_slot1, 0 ); - QCOMPARE( r2->count_slot2, 4 ); - QCOMPARE( r2->count_slot3, 1 ); - - QVERIFY( QMetaObject::disconnect( s, signal1Index, r1, slot1Index) ); - QVERIFY( QMetaObject::disconnect( s, signal3Index, r2, slot3Index) ); - QVERIFY( QMetaObject::disconnect( s, -1, r2, slot2Index) ); - - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); - - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 0 ); - QCOMPARE( r2->count_slot1, 0 ); - QCOMPARE( r2->count_slot2, 4 ); - QCOMPARE( r2->count_slot3, 1 ); - - //some "dynamic" signal - QVERIFY( QMetaObject::connect( s, s->metaObject()->methodOffset() + 20, r1, slot3Index) ); - QVERIFY( QMetaObject::connect( s, s->metaObject()->methodOffset() + 35, r2, slot1Index) ); - QVERIFY( QMetaObject::connect( s, -1, r1, slot2Index) ); - - r1->reset(); - r2->reset(); - - void *args[] = { 0 , 0 }; - QMetaObject::activate(s, s->metaObject()->methodOffset() + 20, args); - QMetaObject::activate(s, s->metaObject()->methodOffset() + 48, args); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 2 ); - QCOMPARE( r1->count_slot3, 1 ); - QCOMPARE( r2->count_slot1, 0 ); - QCOMPARE( r2->count_slot2, 0 ); - QCOMPARE( r2->count_slot3, 0 ); - - QMetaObject::activate(s, s->metaObject()->methodOffset() + 35, args); - s->emitSignal1(); - s->emitSignal2(); - - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 5 ); - QCOMPARE( r1->count_slot3, 1 ); - QCOMPARE( r2->count_slot1, 1 ); - QCOMPARE( r2->count_slot2, 0 ); - QCOMPARE( r2->count_slot3, 0 ); + ReceiverObject r1; + ReceiverObject r2; + int slot1Index, slot2Index, slot3Index; + { + SenderObject s; + r1.reset(); + r2.reset(); + ReceiverObject::sequence = 0; + + int signal1Index = s.metaObject()->indexOfSignal("signal1()"); + int signal3Index = s.metaObject()->indexOfSignal("signal3()"); + slot1Index = r1.metaObject()->indexOfSlot("slot1()"); + slot2Index = r1.metaObject()->indexOfSlot("slot2()"); + slot3Index = r1.metaObject()->indexOfSlot("slot3()"); + + QVERIFY(slot1Index > 0); + QVERIFY(slot2Index > 0); + QVERIFY(slot3Index > 0); + + QVERIFY(QMetaObject::connect(&s, signal1Index, &r1, slot1Index)); + QVERIFY(QMetaObject::connect(&s, signal3Index, &r2, slot3Index)); + QVERIFY(QMetaObject::connect(&s, -1, &r2, slot2Index)); + + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 0); + QCOMPARE(r2.count_slot1, 0); + QCOMPARE(r2.count_slot2, 0); + QCOMPARE(r2.count_slot3, 0); + + s.emitSignal1(); + + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 0); + QCOMPARE(r2.count_slot1, 0); + QCOMPARE(r2.count_slot2, 1); + QCOMPARE(r2.count_slot3, 0); + + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); + + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 0); + QCOMPARE(r2.count_slot1, 0); + QCOMPARE(r2.count_slot2, 4); + QCOMPARE(r2.count_slot3, 1); + + QVERIFY(QMetaObject::disconnect(&s, signal1Index, &r1, slot1Index)); + QVERIFY(QMetaObject::disconnect(&s, signal3Index, &r2, slot3Index)); + QVERIFY(QMetaObject::disconnect(&s, -1, &r2, slot2Index)); + + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); + + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 0); + QCOMPARE(r2.count_slot1, 0); + QCOMPARE(r2.count_slot2, 4); + QCOMPARE(r2.count_slot3, 1); + + //some "dynamic" signal + QVERIFY(QMetaObject::connect(&s, s.metaObject()->methodOffset() + 20, &r1, slot3Index)); + QVERIFY(QMetaObject::connect(&s, s.metaObject()->methodOffset() + 35, &r2, slot1Index)); + QVERIFY(QMetaObject::connect(&s, -1, &r1, slot2Index)); + + r1.reset(); + r2.reset(); + + void *args[] = { 0 , 0 }; + QMetaObject::activate(&s, s.metaObject()->methodOffset() + 20, args); + QMetaObject::activate(&s, s.metaObject()->methodOffset() + 48, args); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 2); + QCOMPARE(r1.count_slot3, 1); + QCOMPARE(r2.count_slot1, 0); + QCOMPARE(r2.count_slot2, 0); + QCOMPARE(r2.count_slot3, 0); + + QMetaObject::activate(&s, s.metaObject()->methodOffset() + 35, args); + s.emitSignal1(); + s.emitSignal2(); + + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 5); + QCOMPARE(r1.count_slot3, 1); + QCOMPARE(r2.count_slot1, 1); + QCOMPARE(r2.count_slot2, 0); + QCOMPARE(r2.count_slot3, 0); + } - delete s; - r1->reset(); - r2->reset(); + r1.reset(); + r2.reset(); #define SIGNAL_INDEX(S) obj1.metaObject()->indexOfSignal(QMetaObject::normalizedSignature(#S)) OverloadObject obj1; QObject obj2, obj3; - QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(int)) , r1, slot1Index); - QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(QObject *, QObject *, QObject *)) , r2, slot1Index); + QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(int)) , &r1, slot1Index); + QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(QObject *, QObject *, QObject *)) , + &r2, slot1Index); - QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(QObject *, QObject *, QObject *, QObject *)) , r1, slot2Index); - QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(QObject *)) , r2, slot2Index); - QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(int, int)) , r1, slot3Index); + QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(QObject *, QObject *, QObject *, QObject *)) , + &r1, slot2Index); + QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(QObject *)) , &r2, slot2Index); + QMetaObject::connect(&obj1, SIGNAL_INDEX(sig(int, int)) , &r1, slot3Index); emit obj1.sig(0.5); //connected to nothing emit obj1.sig(1, 'a'); //connected to nothing - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 0 ); - QCOMPARE( r2->count_slot1, 0 ); - QCOMPARE( r2->count_slot2, 0 ); - QCOMPARE( r2->count_slot3, 0 ); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 0); + QCOMPARE(r2.count_slot1, 0); + QCOMPARE(r2.count_slot2, 0); + QCOMPARE(r2.count_slot3, 0); emit obj1.sig(1); //this signal is connected emit obj1.sig(&obj2); - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 1 ); - QCOMPARE( r2->count_slot1, 0 ); - QCOMPARE( r2->count_slot2, 1 ); - QCOMPARE( r2->count_slot3, 0 ); + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 1); + QCOMPARE(r2.count_slot1, 0); + QCOMPARE(r2.count_slot2, 1); + QCOMPARE(r2.count_slot3, 0); emit obj1.sig(&obj2, &obj3); //this signal is connected - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 1 ); - QCOMPARE( r1->count_slot3, 1 ); - QCOMPARE( r2->count_slot1, 1 ); - QCOMPARE( r2->count_slot2, 1 ); - QCOMPARE( r2->count_slot3, 0 ); - - delete r1; - delete r2; - + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 1); + QCOMPARE(r1.count_slot3, 1); + QCOMPARE(r2.count_slot1, 1); + QCOMPARE(r2.count_slot2, 1); + QCOMPARE(r2.count_slot3, 0); } void tst_QObject::qMetaObjectDisconnectOne() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; + SenderObject s; + ReceiverObject r1; - int signal1Index = s->metaObject()->indexOfSignal("signal1()"); - int signal3Index = s->metaObject()->indexOfSignal("signal3()"); - int slot1Index = r1->metaObject()->indexOfSlot("slot1()"); - int slot2Index = r1->metaObject()->indexOfSlot("slot2()"); + int signal1Index = s.metaObject()->indexOfSignal("signal1()"); + int signal3Index = s.metaObject()->indexOfSignal("signal3()"); + int slot1Index = r1.metaObject()->indexOfSlot("slot1()"); + int slot2Index = r1.metaObject()->indexOfSlot("slot2()"); QVERIFY(signal1Index > 0); QVERIFY(signal3Index > 0); QVERIFY(slot1Index > 0); QVERIFY(slot2Index > 0); - QVERIFY( QMetaObject::connect(s, signal1Index, r1, slot1Index) ); - QVERIFY( QMetaObject::connect(s, signal3Index, r1, slot2Index) ); - QVERIFY( QMetaObject::connect(s, signal3Index, r1, slot2Index) ); - QVERIFY( QMetaObject::connect(s, signal3Index, r1, slot2Index) ); - - r1->reset(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); + QVERIFY(QMetaObject::connect(&s, signal1Index, &r1, slot1Index)); + QVERIFY(QMetaObject::connect(&s, signal3Index, &r1, slot2Index)); + QVERIFY(QMetaObject::connect(&s, signal3Index, &r1, slot2Index)); + QVERIFY(QMetaObject::connect(&s, signal3Index, &r1, slot2Index)); - s->emitSignal1(); - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); + r1.reset(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); - s->emitSignal3(); - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 3 ); + s.emitSignal1(); + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); - r1->reset(); - QVERIFY( QMetaObject::disconnectOne(s, signal1Index, r1, slot1Index) ); - QVERIFY( QMetaObject::disconnectOne(s, signal3Index, r1, slot2Index) ); + s.emitSignal3(); + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 3); - s->emitSignal1(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); + r1.reset(); + QVERIFY(QMetaObject::disconnectOne(&s, signal1Index, &r1, slot1Index)); + QVERIFY(QMetaObject::disconnectOne(&s, signal3Index, &r1, slot2Index)); - s->emitSignal3(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 2 ); + s.emitSignal1(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); - r1->reset(); - QVERIFY( false == QMetaObject::disconnectOne(s, signal1Index, r1, slot1Index) ); - QVERIFY( QMetaObject::disconnectOne(s, signal3Index, r1, slot2Index) ); + s.emitSignal3(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 2); - s->emitSignal1(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); + r1.reset(); + QVERIFY(!QMetaObject::disconnectOne(&s, signal1Index, &r1, slot1Index)); + QVERIFY( QMetaObject::disconnectOne(&s, signal3Index, &r1, slot2Index)); - s->emitSignal3(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 1 ); + s.emitSignal1(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); - r1->reset(); - QVERIFY( false == QMetaObject::disconnectOne(s, signal1Index, r1, slot1Index) ); - QVERIFY( QMetaObject::disconnectOne(s, signal3Index, r1, slot2Index) ); + s.emitSignal3(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 1); - s->emitSignal1(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); + r1.reset(); + QVERIFY(!QMetaObject::disconnectOne(&s, signal1Index, &r1, slot1Index)); + QVERIFY( QMetaObject::disconnectOne(&s, signal3Index, &r1, slot2Index)); - s->emitSignal3(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); + s.emitSignal1(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); - delete s; - delete r1; + s.emitSignal3(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); } class ConfusingObject : public SenderObject @@ -4222,106 +4221,95 @@ void tst_QObject::connectConstructorByMetaMethod() void tst_QObject::disconnectByMetaMethod() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; - ReceiverObject *r2 = new ReceiverObject; - - QMetaMethod signal1 = s->metaObject()->method( - s->metaObject()->indexOfMethod("signal1()")); - QMetaMethod signal2 = s->metaObject()->method( - s->metaObject()->indexOfMethod("signal2()")); - QMetaMethod signal3 = s->metaObject()->method( - s->metaObject()->indexOfMethod("signal3()")); - - QMetaMethod slot1 = r1->metaObject()->method( - r1->metaObject()->indexOfMethod("slot1()")); - QMetaMethod slot2 = r1->metaObject()->method( - r1->metaObject()->indexOfMethod("slot2()")); - QMetaMethod slot3 = r1->metaObject()->method( - r1->metaObject()->indexOfMethod("slot3()")); - QMetaMethod slot4 = r1->metaObject()->method( - r1->metaObject()->indexOfMethod("slot4()")); - - connect(s, signal1, r1, slot1); + SenderObject s; + ReceiverObject r1; + ReceiverObject r2; - s->emitSignal1(); + QMetaMethod signal1 = s.metaObject()->method(s.metaObject()->indexOfMethod("signal1()")); + QMetaMethod signal2 = s.metaObject()->method(s.metaObject()->indexOfMethod("signal2()")); + QMetaMethod signal3 = s.metaObject()->method(s.metaObject()->indexOfMethod("signal3()")); + + QMetaMethod slot1 = r1.metaObject()->method(r1.metaObject()->indexOfMethod("slot1()")); + QMetaMethod slot2 = r1.metaObject()->method(r1.metaObject()->indexOfMethod("slot2()")); + QMetaMethod slot3 = r1.metaObject()->method(r1.metaObject()->indexOfMethod("slot3()")); + QMetaMethod slot4 = r1.metaObject()->method(r1.metaObject()->indexOfMethod("slot4()")); + + connect(&s, signal1, &r1, slot1); - QVERIFY(r1->called(1)); - r1->reset(); + s.emitSignal1(); + + QVERIFY(r1.called(1)); + r1.reset(); // usual disconnect with all parameters given - bool ret = QObject::disconnect(s, signal1, r1, slot1); + bool ret = QObject::disconnect(&s, signal1, &r1, slot1); - s->emitSignal1(); + s.emitSignal1(); - QVERIFY(!r1->called(1)); - r1->reset(); + QVERIFY(!r1.called(1)); + r1.reset(); QVERIFY(ret); - ret = QObject::disconnect(s, signal1, r1, slot1); + ret = QObject::disconnect(&s, signal1, &r1, slot1); QVERIFY(!ret); - r1->reset(); + r1.reset(); - connect( s, signal1, r1, slot1 ); - connect( s, signal1, r1, slot2 ); - connect( s, signal1, r1, slot3 ); - connect( s, signal2, r1, slot4 ); + connect(&s, signal1, &r1, slot1); + connect(&s, signal1, &r1, slot2); + connect(&s, signal1, &r1, slot3); + connect(&s, signal2, &r1, slot4); // disconnect s's signal1() from all slots of r1 - QObject::disconnect(s, signal1, r1, QMetaMethod()); + QObject::disconnect(&s, signal1, &r1, QMetaMethod()); - s->emitSignal1(); - s->emitSignal2(); + s.emitSignal1(); + s.emitSignal2(); - QVERIFY(!r1->called(1)); - QVERIFY(!r1->called(2)); - QVERIFY(!r1->called(3)); - QVERIFY(r1->called(4)); - r1->reset(); + QVERIFY(!r1.called(1)); + QVERIFY(!r1.called(2)); + QVERIFY(!r1.called(3)); + QVERIFY(r1.called(4)); + r1.reset(); // make sure all is disconnected again - QObject::disconnect(s, 0, r1, 0); + QObject::disconnect(&s, 0, &r1, 0); - connect(s, signal1, r1, slot1); - connect(s, signal1, r2, slot1); - connect(s, signal2, r1, slot2); - connect(s, signal2, r2, slot2); - connect(s, signal3, r1, slot3); - connect(s, signal3, r2, slot3); + connect(&s, signal1, &r1, slot1); + connect(&s, signal1, &r2, slot1); + connect(&s, signal2, &r1, slot2); + connect(&s, signal2, &r2, slot2); + connect(&s, signal3, &r1, slot3); + connect(&s, signal3, &r2, slot3); // disconnect signal1() from all receivers - QObject::disconnect(s, signal1, 0, QMetaMethod()); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); + QObject::disconnect(&s, signal1, 0, QMetaMethod()); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); - QVERIFY(!r1->called(1)); - QVERIFY(!r2->called(1)); - QVERIFY(r1->called(2)); - QVERIFY(r2->called(2)); - QVERIFY(r1->called(2)); - QVERIFY(r2->called(2)); + QVERIFY(!r1.called(1)); + QVERIFY(!r2.called(1)); + QVERIFY(r1.called(2)); + QVERIFY(r2.called(2)); + QVERIFY(r1.called(2)); + QVERIFY(r2.called(2)); - r1->reset(); - r2->reset(); + r1.reset(); + r2.reset(); // disconnect all signals of s from all receivers - QObject::disconnect( s, 0, 0, 0 ); + QObject::disconnect(&s, 0, 0, 0); - connect( s, signal1, r1, slot1 ); - connect( s, signal1, r2, slot1 ); + connect(&s, signal1, &r1, slot1); + connect(&s, signal1, &r2, slot1); // disconnect all signals from slot1 of r1 - QObject::disconnect(s, QMetaMethod(), r1, slot1); + QObject::disconnect(&s, QMetaMethod(), &r1, slot1); - s->emitSignal1(); - - QVERIFY(!r1->called(1)); - QVERIFY(r2->called(1)); + s.emitSignal1(); - delete r2; - delete r1; - delete s; + QVERIFY(!r1.called(1)); + QVERIFY(r2.called(1)); } void tst_QObject::disconnectNotSignalMetaMethod() @@ -4459,63 +4447,64 @@ void tst_QObject::baseDestroyed() void tst_QObject::pointerConnect() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; - ReceiverObject *r2 = new ReceiverObject; - r1->reset(); - r2->reset(); + SenderObject s; + ReceiverObject r1; + ReceiverObject r2; + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; QTimer timer; - QVERIFY( connect( s, &SenderObject::signal1 , r1, &ReceiverObject::slot1 ) ); - QVERIFY( connect( s, &SenderObject::signal1 , r2, &ReceiverObject::slot1 ) ); - QVERIFY( connect( s, &SenderObject::signal1 , r1, &ReceiverObject::slot3 ) ); - QVERIFY( connect( s, &SenderObject::signal3 , r1, &ReceiverObject::slot3 ) ); - QVERIFY2( connect( &timer, &QTimer::timeout, r1, &ReceiverObject::deleteLater ), - "Signal connection failed most likely due to failing comparison of pointers to member functions caused by problems with -reduce-relocations on this platform."); + QVERIFY(connect(&s, &SenderObject::signal1 , &r1, &ReceiverObject::slot1)); + QVERIFY(connect(&s, &SenderObject::signal1 , &r2, &ReceiverObject::slot1)); + QVERIFY(connect(&s, &SenderObject::signal1 , &r1, &ReceiverObject::slot3)); + QVERIFY(connect(&s, &SenderObject::signal3 , &r1, &ReceiverObject::slot3)); + QVERIFY2(connect(&timer, &QTimer::timeout, &r1, &ReceiverObject::deleteLater), + "Signal connection failed most likely due to failing comparison of pointers to member " + "functions caused by problems with -reduce-relocations on this platform."); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); - - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); - QCOMPARE( r1->count_slot3, 2 ); - QCOMPARE( r1->count_slot4, 0 ); - QCOMPARE( r2->count_slot1, 1 ); - QCOMPARE( r2->count_slot2, 0 ); - QCOMPARE( r2->count_slot3, 0 ); - QCOMPARE( r2->count_slot4, 0 ); - QCOMPARE( r1->sequence_slot1, 1 ); - QCOMPARE( r2->sequence_slot1, 2 ); - QCOMPARE( r1->sequence_slot3, 4 ); - - r1->reset(); - r2->reset(); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); + + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); + QCOMPARE(r1.count_slot3, 2); + QCOMPARE(r1.count_slot4, 0); + QCOMPARE(r2.count_slot1, 1); + QCOMPARE(r2.count_slot2, 0); + QCOMPARE(r2.count_slot3, 0); + QCOMPARE(r2.count_slot4, 0); + QCOMPARE(r1.sequence_slot1, 1); + QCOMPARE(r2.sequence_slot1, 2); + QCOMPARE(r1.sequence_slot3, 4); + + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - QVERIFY( connect( s, &SenderObject::signal4, r1, &ReceiverObject::slot4 ) ); - QVERIFY( connect( s, &SenderObject::signal4, r2, &ReceiverObject::slot4 ) ); - QVERIFY( connect( s, &SenderObject::signal1, r2, &ReceiverObject::slot4 ) ); + QVERIFY(connect(&s, &SenderObject::signal4, &r1, &ReceiverObject::slot4)); + QVERIFY(connect(&s, &SenderObject::signal4, &r2, &ReceiverObject::slot4)); + QVERIFY(connect(&s, &SenderObject::signal1, &r2, &ReceiverObject::slot4)); - s->emitSignal4(); - QCOMPARE( r1->count_slot4, 1 ); - QCOMPARE( r2->count_slot4, 1 ); - QCOMPARE( r1->sequence_slot4, 1 ); - QCOMPARE( r2->sequence_slot4, 2 ); + s.emitSignal4(); + QCOMPARE(r1.count_slot4, 1); + QCOMPARE(r2.count_slot4, 1); + QCOMPARE(r1.sequence_slot4, 1); + QCOMPARE(r2.sequence_slot4, 2); - r1->reset(); - r2->reset(); + r1.reset(); + r2.reset(); ReceiverObject::sequence = 0; - connect( s, &SenderObject::signal4 , r1, &ReceiverObject::slot4 ); + connect(&s, &SenderObject::signal4 , &r1, &ReceiverObject::slot4); - s->emitSignal4(); - QCOMPARE( r1->count_slot4, 2 ); - QCOMPARE( r2->count_slot4, 1 ); - QCOMPARE( r1->sequence_slot4, 3 ); - QCOMPARE( r2->sequence_slot4, 2 ); + s.emitSignal4(); + QCOMPARE(r1.count_slot4, 2); + QCOMPARE(r2.count_slot4, 1); + QCOMPARE(r1.sequence_slot4, 3); + QCOMPARE(r2.sequence_slot4, 2); QMetaObject::Connection con; QVERIFY(!con); @@ -4523,116 +4512,107 @@ void tst_QObject::pointerConnect() //connect a slot to a signal (== error) QTest::ignoreMessage(QtWarningMsg, "QObject::connect: signal not found in ReceiverObject"); - con = connect(r1, &ReceiverObject::slot4 , s, &SenderObject::signal4 ); + con = connect(&r1, &ReceiverObject::slot4 , &s, &SenderObject::signal4); QVERIFY(!con); QVERIFY(!QObject::disconnect(con)); - - delete s; - delete r1; - delete r2; } void tst_QObject::pointerDisconnect() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; - ReceiverObject *r2 = new ReceiverObject; + SenderObject s; + ReceiverObject r1; + ReceiverObject r2; - connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 ); + connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot1); - connect( s, &SenderObject::signal2, r1, &ReceiverObject::slot2 ); - connect( s, &SenderObject::signal3, r1, &ReceiverObject::slot3 ); - connect( s, &SenderObject::signal4, r1, &ReceiverObject::slot4 ); + connect(&s, &SenderObject::signal2, &r1, &ReceiverObject::slot2); + connect(&s, &SenderObject::signal3, &r1, &ReceiverObject::slot3); + connect(&s, &SenderObject::signal4, &r1, &ReceiverObject::slot4); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); - QVERIFY(r1->called(1)); - QVERIFY(r1->called(2)); - QVERIFY(r1->called(3)); - QVERIFY(r1->called(4)); - r1->reset(); + QVERIFY(r1.called(1)); + QVERIFY(r1.called(2)); + QVERIFY(r1.called(3)); + QVERIFY(r1.called(4)); + r1.reset(); // usual disconnect with all parameters given - bool ret = QObject::disconnect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 ); + bool ret = QObject::disconnect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot1); - s->emitSignal1(); + s.emitSignal1(); - QVERIFY(!r1->called(1)); - r1->reset(); + QVERIFY(!r1.called(1)); + r1.reset(); QVERIFY(ret); - ret = QObject::disconnect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 ); + ret = QObject::disconnect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot1); QVERIFY(!ret); // disconnect all signals from s from all slots from r1 - QObject::disconnect( s, 0, r1, 0 ); + QObject::disconnect(&s, 0, &r1, 0); - s->emitSignal2(); - s->emitSignal3(); - s->emitSignal4(); + s.emitSignal2(); + s.emitSignal3(); + s.emitSignal4(); - QVERIFY(!r1->called(2)); - QVERIFY(!r1->called(3)); - QVERIFY(!r1->called(4)); - r1->reset(); + QVERIFY(!r1.called(2)); + QVERIFY(!r1.called(3)); + QVERIFY(!r1.called(4)); + r1.reset(); - connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 ); - connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot2 ); - connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot3 ); - connect( s, &SenderObject::signal2, r1, &ReceiverObject::slot4 ); + connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot1); + connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot2); + connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot3); + connect(&s, &SenderObject::signal2, &r1, &ReceiverObject::slot4); // disconnect s's signal1() from all slots of r1 - QObject::disconnect( s, &SenderObject::signal1, r1, 0 ); + QObject::disconnect(&s, &SenderObject::signal1, &r1, 0); - s->emitSignal1(); - s->emitSignal2(); + s.emitSignal1(); + s.emitSignal2(); - QVERIFY(!r1->called(1)); - QVERIFY(!r1->called(2)); - QVERIFY(!r1->called(3)); - QVERIFY(r1->called(4)); - r1->reset(); + QVERIFY(!r1.called(1)); + QVERIFY(!r1.called(2)); + QVERIFY(!r1.called(3)); + QVERIFY(r1.called(4)); + r1.reset(); // make sure all is disconnected again - QObject::disconnect( s, 0, r1, 0 ); + QObject::disconnect(&s, 0, &r1, 0); - connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 ); - connect( s, &SenderObject::signal1, r2, &ReceiverObject::slot1 ); - connect( s, &SenderObject::signal2, r1, &ReceiverObject::slot2 ); - connect( s, &SenderObject::signal2, r2, &ReceiverObject::slot2 ); - connect( s, &SenderObject::signal3, r1, &ReceiverObject::slot3 ); - connect( s, &SenderObject::signal3, r2, &ReceiverObject::slot3 ); + connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot1); + connect(&s, &SenderObject::signal1, &r2, &ReceiverObject::slot1); + connect(&s, &SenderObject::signal2, &r1, &ReceiverObject::slot2); + connect(&s, &SenderObject::signal2, &r2, &ReceiverObject::slot2); + connect(&s, &SenderObject::signal3, &r1, &ReceiverObject::slot3); + connect(&s, &SenderObject::signal3, &r2, &ReceiverObject::slot3); // disconnect signal1() from all receivers - QObject::disconnect( s, &SenderObject::signal1, 0, 0 ); - s->emitSignal1(); - s->emitSignal2(); - s->emitSignal3(); + QObject::disconnect(&s, &SenderObject::signal1, 0, 0); + s.emitSignal1(); + s.emitSignal2(); + s.emitSignal3(); - QVERIFY(!r1->called(1)); - QVERIFY(!r2->called(1)); - QVERIFY(r1->called(2)); - QVERIFY(r2->called(2)); - QVERIFY(r1->called(2)); - QVERIFY(r2->called(2)); + QVERIFY(!r1.called(1)); + QVERIFY(!r2.called(1)); + QVERIFY(r1.called(2)); + QVERIFY(r2.called(2)); + QVERIFY(r1.called(2)); + QVERIFY(r2.called(2)); - r1->reset(); - r2->reset(); + r1.reset(); + r2.reset(); // disconnect all signals of s from all receivers - QObject::disconnect( s, 0, 0, 0 ); - - QVERIFY(!r1->called(2)); - QVERIFY(!r2->called(2)); - QVERIFY(!r1->called(2)); - QVERIFY(!r2->called(2)); - - delete r2; - delete r1; - delete s; + QObject::disconnect(&s, 0, 0, 0); + QVERIFY(!r1.called(2)); + QVERIFY(!r2.called(2)); + QVERIFY(!r1.called(2)); + QVERIFY(!r2.called(2)); } @@ -4756,35 +4736,32 @@ void tst_QObject::customTypesPointer() void tst_QObject::connectCxx0x() { - SenderObject *s = new SenderObject; - ReceiverObject *r1 = new ReceiverObject; + SenderObject s; + ReceiverObject r1; - QObject::connect(s, &SenderObject::signal1, r1, &ReceiverObject::slot1); - QObject::connect(s, &SenderObject::signal3, r1, &ReceiverObject::slot2); - QObject::connect(s, &SenderObject::signal3, r1, &ReceiverObject::slot2); - QObject::connect(s, &SenderObject::signal3, r1, &ReceiverObject::slot2); + QObject::connect(&s, &SenderObject::signal1, &r1, &ReceiverObject::slot1); + QObject::connect(&s, &SenderObject::signal3, &r1, &ReceiverObject::slot2); + QObject::connect(&s, &SenderObject::signal3, &r1, &ReceiverObject::slot2); + QObject::connect(&s, &SenderObject::signal3, &r1, &ReceiverObject::slot2); - r1->reset(); - QCOMPARE( r1->count_slot1, 0 ); - QCOMPARE( r1->count_slot2, 0 ); + r1.reset(); + QCOMPARE(r1.count_slot1, 0); + QCOMPARE(r1.count_slot2, 0); - s->emitSignal1(); - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 0 ); + s.emitSignal1(); + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 0); - s->emitSignal3(); - QCOMPARE( r1->count_slot1, 1 ); - QCOMPARE( r1->count_slot2, 3 ); + s.emitSignal3(); + QCOMPARE(r1.count_slot1, 1); + QCOMPARE(r1.count_slot2, 3); // connect signal to signal - QObject::connect(s, &SenderObject::signal2, s, &SenderObject::signal1); + QObject::connect(&s, &SenderObject::signal2, &s, &SenderObject::signal1); - r1->reset(); - s->emitSignal2(); - QCOMPARE( r1->count_slot1, 1 ); - - delete s; - delete r1; + r1.reset(); + s.emitSignal2(); + QCOMPARE(r1.count_slot1, 1); } int receivedCount; diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 9df52887f7..fd3cc18af5 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -73,12 +73,12 @@ static inline QString testSuiteWarning() str << "\nCannot find the shared-mime-info test suite\nstarting from: " << QDir::toNativeSeparators(QDir::currentPath()) << "\n" "cd " << QDir::toNativeSeparators(QStringLiteral("tests/auto/corelib/mimetypes/qmimedatabase")) << "\n" - "wget http://cgit.freedesktop.org/xdg/shared-mime-info/snapshot/Release-1-8.zip\n" - "unzip Release-1-8.zip\n"; + "wget http://cgit.freedesktop.org/xdg/shared-mime-info/snapshot/Release-1-10.zip\n" + "unzip Release-1-10.zip\n"; #ifdef Q_OS_WIN - str << "mkdir testfiles\nxcopy /s Release-1-8 s-m-i\n"; + str << "mkdir testfiles\nxcopy /s Release-1-10 s-m-i\n"; #else - str << "ln -s Release-1-8 s-m-i\n"; + str << "ln -s Release-1-10 s-m-i\n"; #endif return result; } @@ -611,7 +611,7 @@ void tst_QMimeDatabase::allMimeTypes() QVERIFY(!lst.isEmpty()); // Hardcoding this is the only way to check both providers find the same number of mimetypes. - QCOMPARE(lst.count(), 749); + QCOMPARE(lst.count(), 779); foreach (const QMimeType &mime, lst) { const QString name = mime.name(); @@ -640,7 +640,7 @@ void tst_QMimeDatabase::suffixes_data() QTest::newRow("mimetype with multiple patterns") << "text/plain" << "*.asc;*.txt;*,v" << "txt"; QTest::newRow("mimetype with uncommon pattern") << "text/x-readme" << "README*" << QString(); QTest::newRow("mimetype with no patterns") << "application/x-ole-storage" << QString() << QString(); - QTest::newRow("default_mimetype") << "application/octet-stream" << "*.bin" << QString(); + QTest::newRow("default_mimetype") << "application/octet-stream" << QString() << QString(); } void tst_QMimeDatabase::suffixes() diff --git a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro index 541e73636c..5efe68f4af 100644 --- a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro +++ b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro @@ -3,6 +3,7 @@ TEMPLATE = subdirs tst.depends = lib theplugin SUBDIRS = lib \ + staticplugin \ theplugin \ tst !android:!win32:!darwin { diff --git a/tests/auto/corelib/plugin/qpluginloader/staticplugin/.gitignore b/tests/auto/corelib/plugin/qpluginloader/staticplugin/.gitignore new file mode 100644 index 0000000000..26f7ecd506 --- /dev/null +++ b/tests/auto/corelib/plugin/qpluginloader/staticplugin/.gitignore @@ -0,0 +1,3 @@ +*staticplugin.prl +libstaticplugin.a +staticplugin.lib diff --git a/tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp b/tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp new file mode 100644 index 0000000000..d891839b1e --- /dev/null +++ b/tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Intel Corporation. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <QtPlugin> +#include <QObject> + +class StaticPlugin : public QObject +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "SomeIID") +public: + StaticPlugin() {} +}; + +#include "main.moc" diff --git a/tests/auto/corelib/plugin/qpluginloader/staticplugin/staticplugin.pro b/tests/auto/corelib/plugin/qpluginloader/staticplugin/staticplugin.pro new file mode 100644 index 0000000000..ff65ab728c --- /dev/null +++ b/tests/auto/corelib/plugin/qpluginloader/staticplugin/staticplugin.pro @@ -0,0 +1,7 @@ +TEMPLATE = lib +CONFIG += plugin static +SOURCES = main.cpp +QT = core + +# Add extra metadata to the plugin +QMAKE_MOC_OPTIONS += -M ExtraMetaData=StaticPlugin -M ExtraMetaData=foo diff --git a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro index c20e56ba4c..a3885f4134 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro +++ b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro @@ -8,9 +8,14 @@ HEADERS = ../theplugin/plugininterface.h win32 { CONFIG(debug, debug|release) { TARGET = ../../debug/tst_qpluginloader + LIBS += -L../staticplugin/debug } else { TARGET = ../../release/tst_qpluginloader + LIBS += -L../staticplugin/release } +} else { + LIBS += -L../staticplugin } +LIBS += -lstaticplugin TESTDATA += ../elftest ../machtest diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp index c517c0809a..4316ea14ea 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2016 Intel Corporation. +** Copyright (C) 2018 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -121,8 +121,11 @@ private slots: void reloadPlugin(); void preloadedPlugin_data(); void preloadedPlugin(); + void staticPlugins(); }; +Q_IMPORT_PLUGIN(StaticPlugin) + void tst_QPluginLoader::cleanup() { // check if the library/plugin was leaked @@ -520,5 +523,37 @@ void tst_QPluginLoader::preloadedPlugin() QVERIFY(lib.unload()); } +void tst_QPluginLoader::staticPlugins() +{ + const QObjectList instances = QPluginLoader::staticInstances(); + QVERIFY(instances.size()); + + bool found = false; + for (QObject *obj : instances) { + found = obj->metaObject()->className() == QLatin1String("StaticPlugin"); + if (found) + break; + } + QVERIFY(found); + + const auto plugins = QPluginLoader::staticPlugins(); + QCOMPARE(plugins.size(), instances.size()); + + // find the metadata + QJsonObject metaData; + for (const auto &p : plugins) { + metaData = p.metaData(); + found = metaData.value("className").toString() == QLatin1String("StaticPlugin"); + if (found) + break; + } + QVERIFY(found); + + QCOMPARE(metaData.value("version").toInt(), QT_VERSION); + QCOMPARE(metaData.value("IID").toString(), "SomeIID"); + QCOMPARE(metaData.value("ExtraMetaData"), QJsonArray({ "StaticPlugin", "foo" })); +} + + QTEST_MAIN(tst_QPluginLoader) #include "tst_qpluginloader.moc" diff --git a/tests/auto/corelib/serialization/json/tst_qtjson.cpp b/tests/auto/corelib/serialization/json/tst_qtjson.cpp index 4651258ef3..083e78375a 100644 --- a/tests/auto/corelib/serialization/json/tst_qtjson.cpp +++ b/tests/auto/corelib/serialization/json/tst_qtjson.cpp @@ -153,6 +153,17 @@ private Q_SLOTS: void implicitValueType(); void implicitDocumentType(); + void streamSerializationQJsonDocument_data(); + void streamSerializationQJsonDocument(); + void streamSerializationQJsonArray_data(); + void streamSerializationQJsonArray(); + void streamSerializationQJsonObject_data(); + void streamSerializationQJsonObject(); + void streamSerializationQJsonValue_data(); + void streamSerializationQJsonValue(); + void streamSerializationQJsonValueEmpty(); + void streamVariantSerialization(); + private: QString testDataDir; }; @@ -3011,5 +3022,164 @@ void tst_QtJson::implicitDocumentType() QCOMPARE(arrayDocument[-1].toInt(123), 123); } +void tst_QtJson::streamSerializationQJsonDocument_data() +{ + QTest::addColumn<QJsonDocument>("document"); + QTest::newRow("empty") << QJsonDocument(); + QTest::newRow("object") << QJsonDocument(QJsonObject{{"value", 42}}); +} + +void tst_QtJson::streamSerializationQJsonDocument() +{ + // Check interface only, implementation is tested through to and from + // json functions. + QByteArray buffer; + QFETCH(QJsonDocument, document); + QJsonDocument output; + QDataStream save(&buffer, QIODevice::WriteOnly); + save << document; + QDataStream load(buffer); + load >> output; + QCOMPARE(output, document); +} + +void tst_QtJson::streamSerializationQJsonArray_data() +{ + QTest::addColumn<QJsonArray>("array"); + QTest::newRow("empty") << QJsonArray(); + QTest::newRow("values") << QJsonArray{665, 666, 667}; +} + +void tst_QtJson::streamSerializationQJsonArray() +{ + // Check interface only, implementation is tested through to and from + // json functions. + QByteArray buffer; + QFETCH(QJsonArray, array); + QJsonArray output; + QDataStream save(&buffer, QIODevice::WriteOnly); + save << array; + QDataStream load(buffer); + load >> output; + QCOMPARE(output, array); +} + +void tst_QtJson::streamSerializationQJsonObject_data() +{ + QTest::addColumn<QJsonObject>("object"); + QTest::newRow("empty") << QJsonObject(); + QTest::newRow("non-empty") << QJsonObject{{"foo", 665}, {"bar", 666}}; +} + +void tst_QtJson::streamSerializationQJsonObject() +{ + // Check interface only, implementation is tested through to and from + // json functions. + QByteArray buffer; + QFETCH(QJsonObject, object); + QJsonObject output; + QDataStream save(&buffer, QIODevice::WriteOnly); + save << object; + QDataStream load(buffer); + load >> output; + QCOMPARE(output, object); +} + +void tst_QtJson::streamSerializationQJsonValue_data() +{ + QTest::addColumn<QJsonValue>("value"); + QTest::newRow("double") << QJsonValue{665}; + QTest::newRow("bool") << QJsonValue{true}; + QTest::newRow("string") << QJsonValue{QStringLiteral("bum")}; + QTest::newRow("array") << QJsonValue{QJsonArray{12,1,5,6,7}}; + QTest::newRow("object") << QJsonValue{QJsonObject{{"foo", 665}, {"bar", 666}}}; +} + +void tst_QtJson::streamSerializationQJsonValue() +{ + QByteArray buffer; + QFETCH(QJsonValue, value); + QJsonValue output; + QDataStream save(&buffer, QIODevice::WriteOnly); + save << value; + QDataStream load(buffer); + load >> output; + QCOMPARE(output, value); +} + +void tst_QtJson::streamSerializationQJsonValueEmpty() +{ + QByteArray buffer; + { + QJsonValue undef{QJsonValue::Undefined}; + QDataStream save(&buffer, QIODevice::WriteOnly); + save << undef; + QDataStream load(buffer); + QJsonValue output; + load >> output; + QVERIFY(output.isUndefined()); + } + { + QJsonValue null{QJsonValue::Null}; + QDataStream save(&buffer, QIODevice::WriteOnly); + save << null; + QDataStream load(buffer); + QJsonValue output; + load >> output; + QVERIFY(output.isNull()); + } +} + +void tst_QtJson::streamVariantSerialization() +{ + // Check interface only, implementation is tested through to and from + // json functions. + QByteArray buffer; + { + QJsonDocument objectDoc(QJsonArray{665, 666, 667}); + QVariant output; + QVariant variant(objectDoc); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << variant; + QDataStream load(buffer); + load >> output; + QCOMPARE(output.userType(), QMetaType::QJsonDocument); + QCOMPARE(output.toJsonDocument(), objectDoc); + } + { + QJsonArray array{665, 666, 667}; + QVariant output; + QVariant variant(array); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << variant; + QDataStream load(buffer); + load >> output; + QCOMPARE(output.userType(), QMetaType::QJsonArray); + QCOMPARE(output.toJsonArray(), array); + } + { + QJsonObject obj{{"foo", 42}}; + QVariant output; + QVariant variant(obj); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << variant; + QDataStream load(buffer); + load >> output; + QCOMPARE(output.userType(), QMetaType::QJsonObject); + QCOMPARE(output.toJsonObject(), obj); + } + { + QJsonValue value{42}; + QVariant output; + QVariant variant(value); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << variant; + QDataStream load(buffer); + load >> output; + QCOMPARE(output.userType(), QMetaType::QJsonValue); + QCOMPARE(output.toJsonValue(), value); + } +} + QTEST_MAIN(tst_QtJson) #include "tst_qtjson.moc" diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp index 4b753eab6b..f69ce4120d 100644 --- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp +++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp @@ -97,6 +97,10 @@ private slots: void validation(); void toDiagnosticNotation_data(); void toDiagnosticNotation(); + + void datastreamSerialization_data(); + void datastreamSerialization(); + void streamVariantSerialization(); }; // Get the validation data from TinyCBOR (see src/3rdparty/tinycbor/tests/parser/data.cpp) @@ -380,11 +384,17 @@ void tst_QCborValue::arrayDefaultInitialization() QVERIFY(v.isArray()); QVERIFY(!v.isMap()); QVERIFY(!v.isTag()); - QVERIFY(v[0].isUndefined()); QCborArray a2 = v.toArray(); QVERIFY(a2.isEmpty()); QCOMPARE(a2, a); + auto front = v[0]; + QVERIFY(front.isUndefined()); + front = 1; + QCOMPARE(v[0], 1); + QVERIFY(a2.isEmpty()); + a2 = v.toArray(); + QCOMPARE(a2.size(), 1); } void tst_QCborValue::mapDefaultInitialization() @@ -421,7 +431,7 @@ void tst_QCborValue::mapDefaultInitialization() QVERIFY(m == QCborMap{}); QVERIFY(QCborMap{} == m); - QCborValue v(m); + const QCborValue v(m); QVERIFY(v.isMap()); QVERIFY(!v.isArray()); QVERIFY(!v.isTag()); @@ -723,6 +733,31 @@ void tst_QCborValue::arrayMutation() QCOMPARE(a.at(1), QCborValue(-1)); QCOMPARE(a2.at(1), QCborValue(nullptr)); QCOMPARE(++it, end); + + // Array accessed via value: + QCborValue val(a); + val[2] = QCborArray{2, 3, 5, 7}; + QCOMPARE(a.size(), 2); // Unchanged + QVERIFY(val.isArray()); + QCOMPARE(val.toArray().size(), 3); + val[2][4] = 17; + QVERIFY(val.isArray()); + QVERIFY(val[2].isArray()); + QCOMPARE(val[2].toArray().size(), 5); + QCOMPARE(val[2][4], 17); + QCOMPARE(val.toArray().size(), 3); + val[3] = 42; + QVERIFY(val.isArray()); + QCOMPARE(val.toArray().size(), 4); + QCOMPARE(val[3], 42); + + // Coerce to map on string key: + const QLatin1String any("any"); + val[any] = any; + QVERIFY(val.isMap()); + QCOMPARE(val.toMap().size(), 5); + QVERIFY(val[2].isArray()); + QCOMPARE(val[2].toArray().size(), 5); } void tst_QCborValue::mapMutation() @@ -778,6 +813,30 @@ void tst_QCborValue::mapMutation() QCOMPARE((m.end() - 1)->toInteger(), -1); QVERIFY((m2.end() - 1)->isNull()); QCOMPARE(++it, end); + + // Map accessed via value: + QCborValue val(m); + val[7] = QCborMap({{0, 2}, {1, 3}, {2, 5}}); + QCOMPARE(m.size(), 2); // Unchanged + QVERIFY(val.isMap()); + QCOMPARE(val.toMap().size(), 3); + val[7][3] = 11; + QVERIFY(val.isMap()); + QVERIFY(val[7].isMap()); + QCOMPARE(val[7].toMap().size(), 4); + val[14] = 42; + QVERIFY(val.isMap()); + QCOMPARE(val.toMap().size(), 4); + + const QLatin1String any("any"); + const QString hello(QStringLiteral("Hello World")); + val[any][3][hello] = any; + QVERIFY(val.isMap()); + QCOMPARE(val.toMap().size(), 5); + QVERIFY(val[any].isMap()); + QCOMPARE(val[any].toMap().size(), 1); + QVERIFY(val[any][3].isMap()); + QCOMPARE(val[any][3].toMap().size(), 1); } void tst_QCborValue::arrayPrepend() @@ -1690,6 +1749,83 @@ void tst_QCborValue::toDiagnosticNotation() QCOMPARE(result, expected); } + +void tst_QCborValue::datastreamSerialization_data() +{ + addCommonCborData(); +} + +void tst_QCborValue::datastreamSerialization() +{ + QFETCH(QCborValue, v); + QByteArray buffer; + { + QDataStream save(&buffer, QIODevice::WriteOnly); + save << v; + QDataStream load(buffer); + QCborValue output; + load >> output; + QCOMPARE(output, v); + } + if (v.isArray()) { + QCborArray array = v.toArray(); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << array; + QDataStream load(buffer); + QCborValue output; + load >> output; + QCOMPARE(output, array); + } else if (v.isMap()) { + QCborMap map = v.toMap(); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << map; + QDataStream load(buffer); + QCborValue output; + load >> output; + QCOMPARE(output, map); + } +} + +void tst_QCborValue::streamVariantSerialization() +{ + // Check interface only, implementation is tested through to and from + // cbor functions. + QByteArray buffer; + { + QCborArray array{665, 666, 667}; + QVariant output; + QVariant variant = QVariant::fromValue(array); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << variant; + QDataStream load(buffer); + load >> output; + QCOMPARE(output.userType(), QMetaType::QCborArray); + QCOMPARE(qvariant_cast<QCborArray>(output), array); + } + { + QCborMap obj{{"foo", 42}}; + QVariant output; + QVariant variant = QVariant::fromValue(obj); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << variant; + QDataStream load(buffer); + load >> output; + QCOMPARE(output.userType(), QMetaType::QCborMap); + QCOMPARE(qvariant_cast<QCborMap>(output), obj); + } + { + QCborValue value{42}; + QVariant output; + QVariant variant = QVariant::fromValue(value); + QDataStream save(&buffer, QIODevice::WriteOnly); + save << variant; + QDataStream load(buffer); + load >> output; + QCOMPARE(output.userType(), QMetaType::QCborValue); + QCOMPARE(qvariant_cast<QCborValue>(output), value); + } +} + QTEST_MAIN(tst_QCborValue) #include "tst_qcborvalue.moc" diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp index 011a0e1a85..d204727bbd 100644 --- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp @@ -135,6 +135,15 @@ private slots: void stream_QByteArray2(); + void stream_QJsonDocument(); + void stream_QJsonArray(); + void stream_QJsonObject(); + void stream_QJsonValue(); + + void stream_QCborArray(); + void stream_QCborMap(); + void stream_QCborValue(); + void setVersion_data(); void setVersion(); @@ -2095,6 +2104,138 @@ void tst_QDataStream::stream_QByteArray2() } } +void tst_QDataStream::stream_QJsonDocument() +{ + QByteArray buffer; + { + QDataStream save(&buffer, QIODevice::WriteOnly); + save << QByteArrayLiteral("invalidJson"); + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonDocument doc; + load >> doc; + QVERIFY(doc.isEmpty()); + QVERIFY(load.status() != QDataStream::Ok); + QCOMPARE(load.status(), QDataStream::ReadCorruptData); + } + { + QDataStream save(&buffer, QIODevice::WriteOnly); + QJsonDocument docSave(QJsonArray{1,2,3}); + save << docSave; + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonDocument docLoad; + load >> docLoad; + QCOMPARE(docLoad, docSave); + } +} + +void tst_QDataStream::stream_QJsonArray() +{ + QByteArray buffer; + { + QDataStream save(&buffer, QIODevice::WriteOnly); + save << QByteArrayLiteral("invalidJson"); + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonArray array; + load >> array; + QVERIFY(array.isEmpty()); + QVERIFY(load.status() != QDataStream::Ok); + QCOMPARE(load.status(), QDataStream::ReadCorruptData); + } + { + QDataStream save(&buffer, QIODevice::WriteOnly); + QJsonArray arraySave(QJsonArray{1,2,3}); + save << arraySave; + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonArray arrayLoad; + load >> arrayLoad; + QCOMPARE(arrayLoad, arraySave); + } +} + +void tst_QDataStream::stream_QJsonObject() +{ + QByteArray buffer; + { + QDataStream save(&buffer, QIODevice::WriteOnly); + save << QByteArrayLiteral("invalidJson"); + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonObject object; + load >> object; + QVERIFY(object.isEmpty()); + QVERIFY(load.status() != QDataStream::Ok); + QCOMPARE(load.status(), QDataStream::ReadCorruptData); + } + { + QDataStream save(&buffer, QIODevice::WriteOnly); + QJsonObject objSave{{"foo", 1}, {"bar", 2}}; + save << objSave; + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonObject objLoad; + load >> objLoad; + QCOMPARE(objLoad, objSave); + } +} + +void tst_QDataStream::stream_QJsonValue() +{ + QByteArray buffer; + { + QDataStream save(&buffer, QIODevice::WriteOnly); + save << quint8(42); + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonValue value; + load >> value; + QVERIFY(value.isUndefined()); + QVERIFY(load.status() != QDataStream::Ok); + QCOMPARE(load.status(), QDataStream::ReadCorruptData); + } + { + QDataStream save(&buffer, QIODevice::WriteOnly); + QJsonValue valueSave{42}; + save << valueSave; + QDataStream load(&buffer, QIODevice::ReadOnly); + QJsonValue valueLoad; + load >> valueLoad; + QCOMPARE(valueLoad, valueSave); + } +} + +void tst_QDataStream::stream_QCborArray() +{ + QByteArray buffer; + QDataStream save(&buffer, QIODevice::WriteOnly); + QCborArray arraySave({1, 2, 3}); + save << arraySave; + QDataStream load(&buffer, QIODevice::ReadOnly); + QCborArray arrayLoad; + load >> arrayLoad; + QCOMPARE(arrayLoad, arraySave); +} + +void tst_QDataStream::stream_QCborMap() +{ + QByteArray buffer; + QDataStream save(&buffer, QIODevice::WriteOnly); + QCborMap objSave{{"foo", 1}, {"bar", 2}}; + save << objSave; + QDataStream load(&buffer, QIODevice::ReadOnly); + QCborMap objLoad; + load >> objLoad; + QCOMPARE(objLoad, objSave); +} + +void tst_QDataStream::stream_QCborValue() +{ + QByteArray buffer; + QDataStream save(&buffer, QIODevice::WriteOnly); + QCborValue valueSave{42}; + save << valueSave; + QDataStream load(&buffer, QIODevice::ReadOnly); + QCborValue valueLoad; + load >> valueLoad; + QCOMPARE(valueLoad, valueSave); +} + void tst_QDataStream::setVersion_data() { QTest::addColumn<int>("vers"); diff --git a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp index 159fbd7b03..8bb35554c8 100644 --- a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp @@ -2665,28 +2665,30 @@ void tst_QTextStream::useCase2() // ------------------------------------------------------------------------------ void tst_QTextStream::manipulators_data() { - QTest::addColumn<int>("flags"); + QTest::addColumn<int>("base"); + QTest::addColumn<int>("alignFlag"); + QTest::addColumn<int>("numberFlag"); QTest::addColumn<int>("width"); QTest::addColumn<double>("realNumber"); QTest::addColumn<int>("intNumber"); QTest::addColumn<QString>("textData"); QTest::addColumn<QByteArray>("result"); - QTest::newRow("no flags") << 0 << 0 << 5.0 << 5 << QString("five") << QByteArray("55five"); - QTest::newRow("rightadjust") << 0 << 10 << 5.0 << 5 << QString("five") << QByteArray(" 5 5 five"); - - // ### FIX -// QTest::newRow("leftadjust") << int(QTextStream::left) << 10 << 5.0 << 5 << QString("five") << QByteArray("5 5 five "); -// QTest::newRow("showpos") << int(QTextStream::showpos) << 10 << 5.0 << 5 << QString("five") << QByteArray(" +5 +5 five"); -// QTest::newRow("showpos2") << int(QTextStream::showpos) << 5 << 3.14 << -5 << QString("five") << QByteArray("+3.14 -5 five"); -// QTest::newRow("hex") << int(QTextStream::hex | QTextStream::showbase) << 5 << 3.14 << -5 << QString("five") << QByteArray(" 3.14 -0x5 five"); -// QTest::newRow("hex uppercase") << int(QTextStream::hex | QTextStream::uppercase | QTextStream::showbase) << 5 << 3.14 << -5 << QString("five") << QByteArray(" 3.14 -0X5 five"); + QTest::newRow("no flags") << 10 << 0 << 0 << 0 << 5.0 << 5 << QString("five") << QByteArray("55five"); + QTest::newRow("rightadjust") << 10 << int(QTextStream::AlignRight) << 0 << 10 << 5.0 << 5 << QString("five") << QByteArray(" 5 5 five"); + QTest::newRow("leftadjust") << 10 << int(QTextStream::AlignLeft) << 0 << 10 << 5.0 << 5 << QString("five") << QByteArray("5 5 five "); + QTest::newRow("showpos") << 10 << int(QTextStream::AlignRight) << int(QTextStream::ForceSign) << 10 << 5.0 << 5 << QString("five") << QByteArray(" +5 +5 five"); + QTest::newRow("showpos2") << 10 << int(QTextStream::AlignRight) << int(QTextStream::ForceSign) << 5 << 3.14 << -5 << QString("five") << QByteArray("+3.14 -5 five"); + QTest::newRow("hex") << 16 << int(QTextStream::AlignRight) << int(QTextStream::ShowBase) << 5 << 3.14 << -5 << QString("five") << QByteArray(" 3.14 -0x5 five"); + QTest::newRow("hex") << 16 << int(QTextStream::AlignRight) << int(QTextStream::ShowBase | QTextStream::UppercaseBase) << 5 << 3.14 << -5 << QString("five") << QByteArray(" 3.14 -0X5 five"); } // ------------------------------------------------------------------------------ void tst_QTextStream::manipulators() { -// QFETCH(int, flags); + QFETCH(int, base); + QFETCH(int, alignFlag); + QFETCH(int, numberFlag); QFETCH(int, width); QFETCH(double, realNumber); QFETCH(int, intNumber); @@ -2700,14 +2702,16 @@ void tst_QTextStream::manipulators() stream.setCodec(QTextCodec::codecForName("ISO-8859-1")); stream.setAutoDetectUnicode(true); -// stream.setFlags(flags); + stream.setIntegerBase(base); + stream.setFieldAlignment(QTextStream::FieldAlignment(alignFlag)); + stream.setNumberFlags(QTextStream::NumberFlag(numberFlag)); stream.setFieldWidth(width); stream << realNumber; stream << intNumber; stream << textData; stream.flush(); - QCOMPARE(buffer.data().constData(), result.constData()); + QCOMPARE(buffer.data(), result); } void tst_QTextStream::generateBOM() diff --git a/tests/auto/corelib/tools/qbytearraylist/tst_qbytearraylist.cpp b/tests/auto/corelib/tools/qbytearraylist/tst_qbytearraylist.cpp index 85b4c4bfb7..2d2c536453 100644 --- a/tests/auto/corelib/tools/qbytearraylist/tst_qbytearraylist.cpp +++ b/tests/auto/corelib/tools/qbytearraylist/tst_qbytearraylist.cpp @@ -49,6 +49,9 @@ private slots: void operator_plus() const; void operator_plus_data() const; + void indexOf_data() const; + void indexOf() const; + void initializerList() const; }; @@ -259,6 +262,29 @@ void tst_QByteArrayList::operator_plus_data() const << ( QByteArrayList() << "a" << "" << "c" ); } +void tst_QByteArrayList::indexOf_data() const +{ + QTest::addColumn<QByteArrayList>("list"); + QTest::addColumn<QByteArray>("item"); + QTest::addColumn<int>("expectedResult"); + + QTest::newRow("empty") << QByteArrayList() << QByteArray("a") << -1; + QTest::newRow("found_1") << ( QByteArrayList() << "a" ) << QByteArray("a") << 0; + QTest::newRow("not_found_1") << ( QByteArrayList() << "a" ) << QByteArray("b") << -1; + QTest::newRow("found_2") << ( QByteArrayList() << "hello" << "world" ) << QByteArray("world") << 1; + QTest::newRow("returns_first") << ( QByteArrayList() << "hello" << "world" << "hello" << "again" ) << QByteArray("hello") << 0; +} + +void tst_QByteArrayList::indexOf() const +{ + QFETCH(QByteArrayList, list); + QFETCH(QByteArray, item); + QFETCH(int, expectedResult); + + QCOMPARE(list.indexOf(item), expectedResult); + QCOMPARE(list.indexOf(item.constData()), expectedResult); +} + void tst_QByteArrayList::initializerList() const { #ifdef Q_COMPILER_INITIALIZER_LISTS diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 943805e228..56792f38fb 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -37,9 +37,6 @@ #ifdef Q_OS_WIN # include <qt_windows.h> -# if defined(Q_OS_WINRT) -# define tzset() -# endif #endif class tst_QDateTime : public QObject @@ -145,9 +142,7 @@ private slots: void isDaylightTime() const; void daylightTransitions() const; void timeZones() const; -#if defined(Q_OS_UNIX) void systemTimeZoneChange() const; -#endif void invalid() const; @@ -174,7 +169,7 @@ private: void reset(const QByteArray &zone) { qputenv("TZ", zone.constData()); - tzset(); + qTzSet(); } ~TimeZoneRollback() { @@ -182,7 +177,7 @@ private: qunsetenv("TZ"); else qputenv("TZ", prior.constData()); - tzset(); + qTzSet(); } }; }; @@ -3412,33 +3407,10 @@ void tst_QDateTime::timeZones() const QCOMPARE(future.offsetFromUtc(), 28800); } -#if defined(Q_OS_UNIX) -// Currently disabled on Windows as adjusting the timezone -// requires additional privileges that aren't normally -// enabled for a process. This can be achieved by calling -// AdjustTokenPrivileges() and then SetTimeZoneInformation(), -// which will require linking to a different library to access that API. -static void setTimeZone(const QByteArray &tz) -{ - qputenv("TZ", tz); - ::tzset(); - -// following left for future reference, see comment above -// #if defined(Q_OS_WIN32) -// ::_tzset(); -// #endif -} - void tst_QDateTime::systemTimeZoneChange() const { - struct ResetTZ { - QByteArray original; - ResetTZ() : original(qgetenv("TZ")) {} - ~ResetTZ() { setTimeZone(original); } - } scopedReset; - // Set the timezone to Brisbane time - setTimeZone(QByteArray("AEST-10:00")); + TimeZoneRollback useZone(QByteArray("AEST-10:00")); QDateTime localDate = QDateTime(QDate(2012, 6, 1), QTime(2, 15, 30), Qt::LocalTime); QDateTime utcDate = QDateTime(QDate(2012, 6, 1), QTime(2, 15, 30), Qt::UTC); @@ -3451,16 +3423,18 @@ void tst_QDateTime::systemTimeZoneChange() const QVERIFY(tzDate.timeZone().isValid()); // Change to Indian time - setTimeZone(QByteArray("IST-05:30")); + useZone.reset(QByteArray("IST-05:30")); QCOMPARE(localDate, QDateTime(QDate(2012, 6, 1), QTime(2, 15, 30), Qt::LocalTime)); +#ifdef Q_OS_WINRT + QEXPECT_FAIL("", "WinRT gets this wrong, QTBUG-71185", Continue); +#endif QVERIFY(localMsecs != localDate.toMSecsSinceEpoch()); QCOMPARE(utcDate, QDateTime(QDate(2012, 6, 1), QTime(2, 15, 30), Qt::UTC)); QCOMPARE(utcDate.toMSecsSinceEpoch(), utcMsecs); QCOMPARE(tzDate, QDateTime(QDate(2012, 6, 1), QTime(2, 15, 30), QTimeZone("Australia/Brisbane"))); QCOMPARE(tzDate.toMSecsSinceEpoch(), tzMsecs); } -#endif void tst_QDateTime::invalid() const { diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 5d344834e6..9bb0c6811d 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -1989,9 +1989,11 @@ static void setWinLocaleInfo(LCTYPE type, const QString &value) # define LOCALE_SSHORTTIME 0x00000079 #endif -class RestoreLocaleHelper { +class RestoreLocaleHelper +{ public: - RestoreLocaleHelper() { + RestoreLocaleHelper() + { m_decimal = getWinLocaleInfo(LOCALE_SDECIMAL); m_thousand = getWinLocaleInfo(LOCALE_STHOUSAND); m_sdate = getWinLocaleInfo(LOCALE_SSHORTDATE); @@ -1999,7 +2001,8 @@ public: m_time = getWinLocaleInfo(LOCALE_SSHORTTIME); } - ~RestoreLocaleHelper() { + ~RestoreLocaleHelper() + { // restore these, or the user will get a surprise setWinLocaleInfo(LOCALE_SDECIMAL, m_decimal); setWinLocaleInfo(LOCALE_STHOUSAND, m_thousand); @@ -2007,12 +2010,10 @@ public: setWinLocaleInfo(LOCALE_SLONGDATE, m_ldate); setWinLocaleInfo(LOCALE_SSHORTTIME, m_time); - // make sure QLocale::system() gets updated - QLocalePrivate::updateSystemPrivate(); + QSystemLocale dummy; // to provoke a refresh of the system locale } QString m_decimal, m_thousand, m_sdate, m_ldate, m_time; - }; void tst_QLocale::windowsDefaultLocale() @@ -2028,8 +2029,7 @@ void tst_QLocale::windowsDefaultLocale() const QString shortTimeFormat = QStringLiteral("h^m^s"); setWinLocaleInfo(LOCALE_SSHORTTIME, shortTimeFormat); - // make sure QLocale::system() gets updated - QLocalePrivate::updateSystemPrivate(); + QSystemLocale dummy; // to provoke a refresh of the system locale QLocale locale = QLocale::system(); // make sure we are seeing the system's format strings @@ -2770,9 +2770,11 @@ void tst_QLocale::textDirection_data() case QLocale::Sabaean: case QLocale::Samaritan: case QLocale::Sindhi: + case QLocale::SouthernKurdish: case QLocale::Syriac: case QLocale::Uighur: case QLocale::Urdu: + case QLocale::WesternBalochi: case QLocale::Yiddish: // false if there is no locale data for language: rightToLeft = (QLocale(QLocale::Language(language)).language() diff --git a/tests/auto/corelib/tools/qoffsetstringarray/qoffsetstringarray.pro b/tests/auto/corelib/tools/qoffsetstringarray/qoffsetstringarray.pro new file mode 100644 index 0000000000..c8e6a8e05a --- /dev/null +++ b/tests/auto/corelib/tools/qoffsetstringarray/qoffsetstringarray.pro @@ -0,0 +1,6 @@ +CONFIG += testcase +TARGET = tst_qoffsetstringarray +QT = core testlib core-private +CONFIG += c++11 +CONFIG += strict_c++ +SOURCES = $$PWD/tst_qoffsetstringarray.cpp diff --git a/tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp b/tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp new file mode 100644 index 0000000000..dfa0450b18 --- /dev/null +++ b/tests/auto/corelib/tools/qoffsetstringarray/tst_qoffsetstringarray.cpp @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> + +#include <private/qoffsetstringarray_p.h> + + +class tst_QOffsetStringArray : public QObject +{ + Q_OBJECT + +private slots: + void init(); + void access(); +}; + + +constexpr const auto messages = qOffsetStringArray( + "level - 0", + "level - 1", + "level - 2", + "level - 3", + "level - 4", + "" +); + +constexpr const auto messages257 = qOffsetStringArray( + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "end" +); + +constexpr const auto messagesBigOffsets = qOffsetStringArray( + " 10 20 30 40 50 60 70 80 90", + " 10 20 30 40 50 60 70 80 90", + " 10 20 30 40 50 60 70 80 90", + " 10 20 30 40 50 60 70 80 90" +); + +void tst_QOffsetStringArray::init() +{ + static_assert(messages.sizeString == 51, "message.sizeString"); + static_assert(messages.sizeOffsets == 6, "message.sizeOffsets"); + static_assert(std::is_same<decltype(messages)::Type, quint8>::value, "messages::Type != quint8"); + + static_assert(messages257.sizeOffsets == 257, "messages257.sizeOffsets"); + static_assert(messages257.sizeString == 260, "messages257.sizeString"); + static_assert(std::is_same<decltype(messages257)::Type, quint16>::value, + "messages257::Type != quint16"); + + static_assert(messagesBigOffsets.sizeOffsets == 4, "messagesBigOffsets.sizeOffsets"); + static_assert(messagesBigOffsets.sizeString == 364, "messagesBigOffsets.sizeString"); + static_assert(std::is_same<decltype(messagesBigOffsets)::Type, quint16>::value, + "messagesBigOffsets::Type != quint16"); +} + +void tst_QOffsetStringArray::access() +{ + QCOMPARE(messages[0], "level - 0"); + QCOMPARE(messages[1], "level - 1"); + QCOMPARE(messages[2], "level - 2"); + QCOMPARE(messages[3], "level - 3"); + QCOMPARE(messages[4], "level - 4"); + QCOMPARE(messages[5], ""); + QCOMPARE(messages[6], ""); +} + + +QTEST_APPLESS_MAIN(tst_QOffsetStringArray) +#include "tst_qoffsetstringarray.moc" diff --git a/tests/auto/corelib/tools/qpair/tst_qpair.cpp b/tests/auto/corelib/tools/qpair/tst_qpair.cpp index 1d5f7536c8..dedc353e67 100644 --- a/tests/auto/corelib/tools/qpair/tst_qpair.cpp +++ b/tests/auto/corelib/tools/qpair/tst_qpair.cpp @@ -41,8 +41,8 @@ private Q_SLOTS: void taskQTBUG_48780_pairContainingCArray(); }; -class C { char _[4]; }; -class M { char _[4]; }; +class C { C() {} char _[4]; }; +class M { M() {} char _[4]; }; class P { char _[4]; }; QT_BEGIN_NAMESPACE diff --git a/tests/auto/corelib/tools/tools.pro b/tests/auto/corelib/tools/tools.pro index f28cf21b8b..2a975e67d1 100644 --- a/tests/auto/corelib/tools/tools.pro +++ b/tests/auto/corelib/tools/tools.pro @@ -35,6 +35,7 @@ SUBDIRS=\ qmap_strictiterators \ qmargins \ qmessageauthenticationcode \ + qoffsetstringarray \ qpair \ qpoint \ qpointf \ diff --git a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp index b79f3ea5e3..1ba7ee51b1 100644 --- a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp +++ b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp @@ -34,22 +34,27 @@ class tst_QDBusServiceWatcher: public QObject { Q_OBJECT - QString serviceName; int testCounter; public: tst_QDBusServiceWatcher(); private slots: void initTestCase(); - void init(); - + void watchForCreation_data(); void watchForCreation(); + void watchForDisappearance_data(); void watchForDisappearance(); void watchForDisappearanceUniqueConnection(); + void watchForOwnerChange_data(); void watchForOwnerChange(); + void modeChange_data(); void modeChange(); void disconnectedConnection(); + void setConnection_data(); void setConnection(); + +private: + QString generateServiceName(); }; tst_QDBusServiceWatcher::tst_QDBusServiceWatcher() @@ -63,18 +68,45 @@ void tst_QDBusServiceWatcher::initTestCase() QVERIFY(con.isConnected()); } -void tst_QDBusServiceWatcher::init() +QString tst_QDBusServiceWatcher::generateServiceName() { + return "com.example.TestService" + QString::number(testCounter++); +} + +void tst_QDBusServiceWatcher::watchForCreation_data() { - // change the service name from test to test - serviceName = "com.example.TestService" + QString::number(testCounter++); + QTest::addColumn<QString>("watchedName"); + QTest::addColumn<QString>("registeredName"); + + //com.example.TestService5 matches com.example.TestService5 + QString name = generateServiceName(); + QTest::newRow("normal") << name << name; + + //com.example* matches com.example.TestService5 + name = generateServiceName(); + QTest::newRow("wildcard") << "com.example*" << name; + + //com.example.TestService5* matches com.example.TestService5 + name = generateServiceName(); + QTest::newRow("wildcard_exact") << name+"*" << name; + + //com.example.TestService5* matches com.example.TestService5.Foo + name = generateServiceName(); + QTest::newRow("wildcard_subdomain") << name+"*" << name + ".Foo"; + + //com.example.TestService5* matches com.example.TestService5.Foo.Bar + name = generateServiceName(); + QTest::newRow("wildcard_subsubdomain") << name+"*" << name + ".Foo.Bar"; } void tst_QDBusServiceWatcher::watchForCreation() { + QFETCH(QString, watchedName); + QFETCH(QString, registeredName); + QDBusConnection con = QDBusConnection::sessionBus(); QVERIFY(con.isConnected()); - QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration); + QDBusServiceWatcher watcher(watchedName, con, QDBusServiceWatcher::WatchForRegistration); QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString))); @@ -82,18 +114,18 @@ void tst_QDBusServiceWatcher::watchForCreation() QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceRegistered(QString)), SLOT(exitLoop())); // register a name - QVERIFY(con.registerService(serviceName)); + QVERIFY(con.registerService(registeredName)); QTestEventLoop::instance().enterLoop(1); QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(spyR.count(), 1); - QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + QCOMPARE(spyR.at(0).at(0).toString(), registeredName); QCOMPARE(spyU.count(), 0); QCOMPARE(spyO.count(), 1); - QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(0).toString(), registeredName); QVERIFY(spyO.at(0).at(1).toString().isEmpty()); QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); @@ -102,31 +134,39 @@ void tst_QDBusServiceWatcher::watchForCreation() spyO.clear(); // unregister it: - con.unregisterService(serviceName); + con.unregisterService(registeredName); // and register again - QVERIFY(con.registerService(serviceName)); + QVERIFY(con.registerService(registeredName)); QTestEventLoop::instance().enterLoop(1); QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(spyR.count(), 1); - QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + QCOMPARE(spyR.at(0).at(0).toString(), registeredName); QCOMPARE(spyU.count(), 0); QCOMPARE(spyO.count(), 1); - QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(0).toString(), registeredName); QVERIFY(spyO.at(0).at(1).toString().isEmpty()); QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); } +void tst_QDBusServiceWatcher::watchForDisappearance_data() +{ + tst_QDBusServiceWatcher::watchForCreation_data(); +} + void tst_QDBusServiceWatcher::watchForDisappearance() { + QFETCH(QString, watchedName); + QFETCH(QString, registeredName); + QDBusConnection con = QDBusConnection::sessionBus(); QVERIFY(con.isConnected()); - QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForUnregistration); + QDBusServiceWatcher watcher(watchedName, con, QDBusServiceWatcher::WatchForUnregistration); watcher.setObjectName("watcher for disappearance"); QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); @@ -135,10 +175,10 @@ void tst_QDBusServiceWatcher::watchForDisappearance() QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceUnregistered(QString)), SLOT(exitLoop())); // register a name - QVERIFY(con.registerService(serviceName)); + QVERIFY(con.registerService(registeredName)); // unregister it: - con.unregisterService(serviceName); + con.unregisterService(registeredName); QTestEventLoop::instance().enterLoop(1); QVERIFY(!QTestEventLoop::instance().timeout()); @@ -146,10 +186,10 @@ void tst_QDBusServiceWatcher::watchForDisappearance() QCOMPARE(spyR.count(), 0); QCOMPARE(spyU.count(), 1); - QCOMPARE(spyU.at(0).at(0).toString(), serviceName); + QCOMPARE(spyU.at(0).at(0).toString(), registeredName); QCOMPARE(spyO.count(), 1); - QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(0).toString(), registeredName); QCOMPARE(spyO.at(0).at(1).toString(), con.baseService()); QVERIFY(spyO.at(0).at(2).toString().isEmpty()); } @@ -188,12 +228,20 @@ void tst_QDBusServiceWatcher::watchForDisappearanceUniqueConnection() QVERIFY(spyO.at(0).at(2).toString().isEmpty()); } +void tst_QDBusServiceWatcher::watchForOwnerChange_data() +{ + watchForCreation_data(); +} + void tst_QDBusServiceWatcher::watchForOwnerChange() { + QFETCH(QString, watchedName); + QFETCH(QString, registeredName); + QDBusConnection con = QDBusConnection::sessionBus(); QVERIFY(con.isConnected()); - QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForOwnerChange); + QDBusServiceWatcher watcher(watchedName, con, QDBusServiceWatcher::WatchForOwnerChange); QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString))); @@ -201,18 +249,18 @@ void tst_QDBusServiceWatcher::watchForOwnerChange() QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceRegistered(QString)), SLOT(exitLoop())); // register a name - QVERIFY(con.registerService(serviceName)); + QVERIFY(con.registerService(registeredName)); QTestEventLoop::instance().enterLoop(1); QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(spyR.count(), 1); - QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + QCOMPARE(spyR.at(0).at(0).toString(), registeredName); QCOMPARE(spyU.count(), 0); QCOMPARE(spyO.count(), 1); - QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(0).toString(), registeredName); QVERIFY(spyO.at(0).at(1).toString().isEmpty()); QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); @@ -221,35 +269,43 @@ void tst_QDBusServiceWatcher::watchForOwnerChange() spyO.clear(); // unregister it: - con.unregisterService(serviceName); + con.unregisterService(registeredName); // and register again - QVERIFY(con.registerService(serviceName)); + QVERIFY(con.registerService(registeredName)); QTestEventLoop::instance().enterLoop(1); QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(spyR.count(), 1); - QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + QCOMPARE(spyR.at(0).at(0).toString(), registeredName); QCOMPARE(spyU.count(), 1); - QCOMPARE(spyU.at(0).at(0).toString(), serviceName); + QCOMPARE(spyU.at(0).at(0).toString(), registeredName); QCOMPARE(spyO.count(), 2); - QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(0).toString(), registeredName); QCOMPARE(spyO.at(0).at(1).toString(), con.baseService()); QVERIFY(spyO.at(0).at(2).toString().isEmpty()); - QCOMPARE(spyO.at(1).at(0).toString(), serviceName); + QCOMPARE(spyO.at(1).at(0).toString(), registeredName); QVERIFY(spyO.at(1).at(1).toString().isEmpty()); QCOMPARE(spyO.at(1).at(2).toString(), con.baseService()); } +void tst_QDBusServiceWatcher::modeChange_data() +{ + watchForCreation_data(); +} + void tst_QDBusServiceWatcher::modeChange() { + QFETCH(QString, watchedName); + QFETCH(QString, registeredName); + QDBusConnection con = QDBusConnection::sessionBus(); QVERIFY(con.isConnected()); - QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration); + QDBusServiceWatcher watcher(watchedName, con, QDBusServiceWatcher::WatchForRegistration); QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString))); @@ -257,18 +313,18 @@ void tst_QDBusServiceWatcher::modeChange() QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceRegistered(QString)), SLOT(exitLoop())); // register a name - QVERIFY(con.registerService(serviceName)); + QVERIFY(con.registerService(registeredName)); QTestEventLoop::instance().enterLoop(1); QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(spyR.count(), 1); - QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + QCOMPARE(spyR.at(0).at(0).toString(), registeredName); QCOMPARE(spyU.count(), 0); QCOMPARE(spyO.count(), 1); - QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(0).toString(), registeredName); QVERIFY(spyO.at(0).at(1).toString().isEmpty()); QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); @@ -279,7 +335,7 @@ void tst_QDBusServiceWatcher::modeChange() watcher.setWatchMode(QDBusServiceWatcher::WatchForUnregistration); // unregister it: - con.unregisterService(serviceName); + con.unregisterService(registeredName); QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceUnregistered(QString)), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(1); @@ -288,10 +344,10 @@ void tst_QDBusServiceWatcher::modeChange() QCOMPARE(spyR.count(), 0); QCOMPARE(spyU.count(), 1); - QCOMPARE(spyU.at(0).at(0).toString(), serviceName); + QCOMPARE(spyU.at(0).at(0).toString(), registeredName); QCOMPARE(spyO.count(), 1); - QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(0).toString(), registeredName); QCOMPARE(spyO.at(0).at(1).toString(), con.baseService()); QVERIFY(spyO.at(0).at(2).toString().isEmpty()); } @@ -301,7 +357,7 @@ void tst_QDBusServiceWatcher::disconnectedConnection() QDBusConnection con(""); QVERIFY(!con.isConnected()); - QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration); + QDBusServiceWatcher watcher(generateServiceName(), con, QDBusServiceWatcher::WatchForRegistration); watcher.addWatchedService("com.example.somethingelse"); watcher.addWatchedService("org.freedesktop.DBus"); @@ -311,8 +367,15 @@ void tst_QDBusServiceWatcher::disconnectedConnection() watcher.setWatchedServices(QStringList()); } +void tst_QDBusServiceWatcher::setConnection_data() +{ + QTest::addColumn<QString>("serviceName"); + QTest::newRow("normal") << generateServiceName(); +} + void tst_QDBusServiceWatcher::setConnection() { + QFETCH(QString, serviceName); // begin with a disconnected connection QDBusConnection con(""); QVERIFY(!con.isConnected()); diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp index d19aa9b54f..2deb84fa5f 100644 --- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp +++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp @@ -202,9 +202,7 @@ void tst_QStandardItem::getSetData() QCOMPARE(qvariant_cast<QSize>(item.data(Qt::SizeHintRole)), sizeHint); QCOMPARE(qvariant_cast<QFont>(item.data(Qt::FontRole)), font); QCOMPARE(qvariant_cast<int>(item.data(Qt::TextAlignmentRole)), int(textAlignment)); - QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::BackgroundColorRole)), QBrush(backgroundColor)); QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::BackgroundRole)), QBrush(backgroundColor)); - QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::TextColorRole)), QBrush(textColor)); QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::ForegroundRole)), QBrush(textColor)); QCOMPARE(qvariant_cast<int>(item.data(Qt::CheckStateRole)), int(checkState)); QCOMPARE(qvariant_cast<QString>(item.data(Qt::AccessibleTextRole)), accessibleText); @@ -236,9 +234,7 @@ void tst_QStandardItem::getSetData() QCOMPARE(item.data(Qt::SizeHintRole), QVariant()); QCOMPARE(item.data(Qt::FontRole), QVariant()); QCOMPARE(item.data(Qt::TextAlignmentRole), QVariant()); - QCOMPARE(item.data(Qt::BackgroundColorRole), QVariant()); QCOMPARE(item.data(Qt::BackgroundRole), QVariant()); - QCOMPARE(item.data(Qt::TextColorRole), QVariant()); QCOMPARE(item.data(Qt::ForegroundRole), QVariant()); QCOMPARE(item.data(Qt::CheckStateRole), QVariant()); QCOMPARE(item.data(Qt::AccessibleTextRole), QVariant()); diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index e2d7a41bd1..550f70890e 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -1160,7 +1160,7 @@ void tst_QStandardItemModel::getSetItemData() QColor backgroundColor(Qt::blue); roles.insert(Qt::BackgroundRole, backgroundColor); QColor textColor(Qt::green); - roles.insert(Qt::TextColorRole, textColor); + roles.insert(Qt::ForegroundRole, textColor); Qt::CheckState checkState(Qt::PartiallyChecked); roles.insert(Qt::CheckStateRole, int(checkState)); QLatin1String accessibleText("accessibleText"); diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp index cca0e95c29..b2572188b9 100644 --- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp +++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp @@ -49,6 +49,8 @@ private slots: void construct(); void constructCopy_data(); void constructCopy(); + void saveAndLoadBuiltin_data(); + void saveAndLoadBuiltin(); }; #define FOR_EACH_GUI_METATYPE_BASE(F) \ @@ -442,5 +444,49 @@ FOR_EACH_GUI_METATYPE(RETURN_CONSTRUCT_COPY_FUNCTION) TypeTestFunctionGetter::get(type)(); } +template <typename T> +struct StreamingTraits +{ + // Streamable by default, as currently all gui built-in types are streamable + enum { isStreamable = 1 }; +}; + +void tst_QGuiMetaType::saveAndLoadBuiltin_data() +{ + QTest::addColumn<int>("type"); + QTest::addColumn<bool>("isStreamable"); + +#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \ + QTest::newRow(#RealType) << MetaTypeId << bool(StreamingTraits<RealType>::isStreamable); + QT_FOR_EACH_STATIC_GUI_CLASS(ADD_METATYPE_TEST_ROW) +#undef ADD_METATYPE_TEST_ROW +} + +void tst_QGuiMetaType::saveAndLoadBuiltin() +{ + QFETCH(int, type); + QFETCH(bool, isStreamable); + + void *value = QMetaType::create(type); + + QByteArray ba; + QDataStream stream(&ba, QIODevice::ReadWrite); + QCOMPARE(QMetaType::save(stream, type, value), isStreamable); + QCOMPARE(stream.status(), QDataStream::Ok); + + if (isStreamable) + QVERIFY(QMetaType::load(stream, type, value)); + + stream.device()->seek(0); + stream.resetStatus(); + QCOMPARE(QMetaType::load(stream, type, value), isStreamable); + QCOMPARE(stream.status(), QDataStream::Ok); + + if (isStreamable) + QVERIFY(QMetaType::load(stream, type, value)); + + QMetaType::destroy(type, value); +} + QTEST_MAIN(tst_QGuiMetaType) #include "tst_qguimetatype.moc" diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index cfd24a8701..7dbeb13aa7 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -835,17 +835,32 @@ void tst_QCssParser::colorValue_data() QTest::newRow("hexcolor") << "color: #12af0e" << QColor(0x12, 0xaf, 0x0e); QTest::newRow("functional1") << "color: rgb(21, 45, 73)" << QColor(21, 45, 73); QTest::newRow("functional2") << "color: rgb(100%, 0%, 100%)" << QColor(0xff, 0, 0xff); + QTest::newRow("rgb") << "color: rgb(10, 20, 30)" << QColor(10, 20, 30); QTest::newRow("rgba") << "color: rgba(10, 20, 30, 40)" << QColor(10, 20, 30, 40); QTest::newRow("rgbaf") << "color: rgba(10, 20, 30, 0.5)" << QColor(10, 20, 30, 127); - QTest::newRow("rgb") << "color: rgb(10, 20, 30, 40)" << QColor(10, 20, 30, 40); - QTest::newRow("hsl") << "color: hsv(10, 20, 30)" << QColor::fromHsv(10, 20, 30, 255); - QTest::newRow("hsla") << "color: hsva(10, 20, 30, 40)" << QColor::fromHsv(10, 20, 30, 40); + QTest::newRow("hsv") << "color: hsv(10, 20, 30)" << QColor::fromHsv(10, 20, 30); + QTest::newRow("hsva") << "color: hsva(10, 20, 30, 40)" << QColor::fromHsv(10, 20, 30, 40); + // the percent and float values are well chosen to not get in trouble due to rounding errors + QTest::newRow("hsva-percent") << "color: hsva(100%, 20%, 40%, 60%)" << QColor::fromHsv(359, 51, 102, 153); + QTest::newRow("hsva-float") << "color: hsva(180, 20%, 40%, 0.6)" << QColor::fromHsvF(0.5, 0.2, 0.4, 0.6); + QTest::newRow("hsl") << "color: hsl(60, 100%, 50%)" << QColor::fromHsl(60., 255, 127); + QTest::newRow("hsla") << "color: hsla(240, 255, 127, 192)" << QColor::fromHsl(240, 255, 127, 192); + QTest::newRow("hsla-percent") << "color: hsla(100%, 80%, 40%, 0%)" << QColor::fromHsl(359, 204, 102, 0); + QTest::newRow("hsla-float") << "color: hsla(252, 40%, 60%, 0.2)" << QColor::fromHslF(0.7, 0.4, 0.6, 0.2); QTest::newRow("invalid1") << "color: rgb(why, does, it, always, rain, on, me)" << QColor(); QTest::newRow("invalid2") << "color: rgba(i, meant, norway)" << QColor(); QTest::newRow("invalid3") << "color: rgb(21)" << QColor(); + QTest::newRow("invalid4") << "color: rgbx(1, 2, 3)" << QColor(); + QTest::newRow("invalid5") << "color: rgbax(1, 2, 3, 4)" << QColor(); + QTest::newRow("invalid6") << "color: hsv(360, 0, 0)" << QColor(); + QTest::newRow("invalid7") << "color: hsla(1, a, 1, 21)" << QColor(); QTest::newRow("role") << "color: palette(base)" << qApp->palette().color(QPalette::Base); QTest::newRow("role2") << "color: palette( window-text ) " << qApp->palette().color(QPalette::WindowText); QTest::newRow("transparent") << "color: transparent" << QColor(Qt::transparent); + + // ### Qt6: no longer valid + QTest::newRow("rgb-invalid") << "color: rgb(10, 20, 30, 40)" << QColor(10, 20, 30, 40); + QTest::newRow("rgba-invalid") << "color: rgba(10, 20, 30)" << QColor(10, 20, 30, 255); } void tst_QCssParser::colorValue() diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro index 048d952faf..96cd4cfdab 100644 --- a/tests/auto/gui/text/qfont/qfont.pro +++ b/tests/auto/gui/text/qfont/qfont.pro @@ -4,3 +4,4 @@ QT += testlib QT += core-private gui-private qtHaveModule(widgets): QT += widgets SOURCES += tst_qfont.cpp +RESOURCES += testfont.qrc diff --git a/tests/auto/gui/text/qfont/testfont.qrc b/tests/auto/gui/text/qfont/testfont.qrc new file mode 100644 index 0000000000..cf51e4a2b4 --- /dev/null +++ b/tests/auto/gui/text/qfont/testfont.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>weirdfont.otf</file> + </qresource> +</RCC> diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 8090f38a2c..9acf877790 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -66,6 +66,12 @@ private slots: void fromStringWithoutStyleName(); void sharing(); + void familyNameWithCommaQuote_data(); + void familyNameWithCommaQuote(); + void setFamilies_data(); + void setFamilies(); + void setFamiliesAndFamily_data(); + void setFamiliesAndFamily(); }; // Testing get/set functions @@ -116,6 +122,14 @@ void tst_QFont::exactMatch() QVERIFY(!QFont("sans-serif").exactMatch()); QVERIFY(!QFont("serif").exactMatch()); QVERIFY(!QFont("monospace").exactMatch()); + + font.setFamilies(QStringList() << "BogusFont"); + QVERIFY(!font.exactMatch()); + QVERIFY(!QFont("sans").exactMatch()); + QVERIFY(!QFont("sans-serif").exactMatch()); + QVERIFY(!QFont("serif").exactMatch()); + QVERIFY(!QFont("monospace").exactMatch()); + } void tst_QFont::italicOblique() @@ -277,6 +291,12 @@ void tst_QFont::resolve() QCOMPARE(f4.pointSize(), 45); f4 = f4.resolve(f3); QCOMPARE(f4.pointSize(), 55); + + QFont font5, font6; + const QStringList fontFamilies = { QStringLiteral("Arial") }; + font5.setFamilies(fontFamilies); + font6 = font6.resolve(font5); + QCOMPARE(font6.families(), fontFamilies); } #ifndef QT_NO_WIDGETS @@ -624,5 +644,108 @@ void tst_QFont::sharing() QVERIFY(QFontPrivate::get(f2)->engineData != QFontPrivate::get(f)->engineData); } +void tst_QFont::familyNameWithCommaQuote_data() +{ + QTest::addColumn<QString>("familyName"); + QTest::addColumn<QString>("chosenFamilyName"); + + const QString standardFont(QFont().defaultFamily()); + if (standardFont.isEmpty()) + QSKIP("No default font available on the system"); + const QString weirdFont(QLatin1String("'My, weird'' font name',")); + const QString commaSeparated(standardFont + QLatin1String(",Times New Roman")); + const QString commaSeparatedWeird(weirdFont + QLatin1String(",") + standardFont); + const QString commaSeparatedBogus(QLatin1String("BogusFont,") + standardFont); + + QTest::newRow("standard") << standardFont << standardFont; + QTest::newRow("weird") << weirdFont << weirdFont; + QTest::newRow("commaSeparated") << commaSeparated << standardFont; + QTest::newRow("commaSeparatedWeird") << commaSeparatedWeird << weirdFont; + QTest::newRow("commaSeparatedBogus") << commaSeparatedBogus << standardFont; +} + +void tst_QFont::familyNameWithCommaQuote() +{ + QFETCH(QString, familyName); + QFETCH(QString, chosenFamilyName); + + const int weirdFontId = QFontDatabase::addApplicationFont(":/weirdfont.otf"); + + QVERIFY(weirdFontId != -1); + QFont f(familyName); + QCOMPARE(f.family(), familyName); + QCOMPARE(QFontInfo(f).family(), chosenFamilyName); + + QFontDatabase::removeApplicationFont(weirdFontId); +} + +void tst_QFont::setFamilies_data() +{ + QTest::addColumn<QStringList>("families"); + QTest::addColumn<QString>("chosenFamilyName"); + + const QString weirdFont(QLatin1String("'My, weird'' font name',")); + const QString standardFont(QFont().defaultFamily()); + if (standardFont.isEmpty()) + QSKIP("No default font available on the system"); + + QTest::newRow("standard") << (QStringList() << standardFont) << standardFont; + QTest::newRow("weird") << (QStringList() << weirdFont) << weirdFont; + QTest::newRow("standard-weird") << (QStringList() << standardFont << weirdFont) << standardFont; + QTest::newRow("weird-standard") << (QStringList() << weirdFont << standardFont) << weirdFont; + QTest::newRow("nonexist-weird") << (QStringList() << "NonExistentFont" << weirdFont) << weirdFont; +} + +void tst_QFont::setFamilies() +{ + QFETCH(QStringList, families); + QFETCH(QString, chosenFamilyName); + + const int weirdFontId = QFontDatabase::addApplicationFont(":/weirdfont.otf"); + + QVERIFY(weirdFontId != -1); + QFont f; + f.setFamilies(families); + QCOMPARE(QFontInfo(f).family(), chosenFamilyName); + + QFontDatabase::removeApplicationFont(weirdFontId); +} + +void tst_QFont::setFamiliesAndFamily_data() +{ + QTest::addColumn<QStringList>("families"); + QTest::addColumn<QString>("family"); + QTest::addColumn<QString>("chosenFamilyName"); + + const QString weirdFont(QLatin1String("'My, weird'' font name',")); + const QString defaultFont(QFont().defaultFamily()); + if (defaultFont.isEmpty()) + QSKIP("No default font available on the system"); + + const QString timesFont(QLatin1String("Times")); + const QString nonExistFont(QLatin1String("NonExistentFont")); + + QTest::newRow("firstInFamilies") << (QStringList() << defaultFont << timesFont) << weirdFont << defaultFont; + QTest::newRow("secondInFamilies") << (QStringList() << nonExistFont << weirdFont) << defaultFont << weirdFont; + QTest::newRow("family") << (QStringList() << nonExistFont) << defaultFont << defaultFont; +} + +void tst_QFont::setFamiliesAndFamily() +{ + QFETCH(QStringList, families); + QFETCH(QString, family); + QFETCH(QString, chosenFamilyName); + + const int weirdFontId = QFontDatabase::addApplicationFont(":/weirdfont.otf"); + + QVERIFY(weirdFontId != -1); + QFont f; + f.setFamilies(families); + f.setFamily(family); + QCOMPARE(QFontInfo(f).family(), chosenFamilyName); + + QFontDatabase::removeApplicationFont(weirdFontId); +} + QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" diff --git a/tests/auto/gui/text/qfont/weirdfont.otf b/tests/auto/gui/text/qfont/weirdfont.otf Binary files differnew file mode 100644 index 0000000000..b91c559f5b --- /dev/null +++ b/tests/auto/gui/text/qfont/weirdfont.otf diff --git a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp index fbca313ea3..785cc3fef2 100644 --- a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp +++ b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp @@ -45,6 +45,8 @@ public: private slots: void engineData_data(); void engineData(); + void engineDataFamilies_data(); + void engineDataFamilies(); void clear(); }; @@ -109,6 +111,49 @@ void tst_QFontCache::engineData() QCOMPARE(engineData, QFontPrivate::get(f)->engineData); } +void tst_QFontCache::engineDataFamilies_data() +{ + QTest::addColumn<QStringList>("families"); + + const QStringList multiple = { QLatin1String("invalid"), QLatin1String("Times New Roman") }; + const QStringList multipleQuotes = { QLatin1String("'invalid'"), QLatin1String("Times New Roman") }; + const QStringList multiple2 = { QLatin1String("invalid"), QLatin1String("Times New Roman"), + QLatin1String("foobar"), QLatin1String("'baz'") }; + + QTest::newRow("unquoted-family-name") << QStringList(QLatin1String("Times New Roman")); + QTest::newRow("quoted-family-name") << QStringList(QLatin1String("Times New Roman")); + QTest::newRow("invalid") << QStringList(QLatin1String("invalid")); + QTest::newRow("multiple") << multiple; + QTest::newRow("multiple spaces quotes") << multipleQuotes; + QTest::newRow("multiple2") << multiple2; +} + +void tst_QFontCache::engineDataFamilies() +{ + QFETCH(QStringList, families); + + QFont f; + f.setFamily(QString()); // Unset the family as taken from the QGuiApplication default + f.setFamilies(families); + f.exactMatch(); // loads engine + QFontPrivate *d = QFontPrivate::get(f); + + QFontDef req = d->request; + // copy-pasted from QFontDatabase::load(), to engineer the cache key + if (req.pixelSize == -1) { + req.pixelSize = std::floor(((req.pointSize * d->dpi) / 72) * 100 + 0.5) / 100; + req.pixelSize = qRound(req.pixelSize); + } + if (req.pointSize < 0) + req.pointSize = req.pixelSize*72.0/d->dpi; + + req.families = families; + + QFontEngineData *engineData = QFontCache::instance()->findEngineData(req); + + QCOMPARE(engineData, QFontPrivate::get(f)->engineData); +} + void tst_QFontCache::clear() { #ifdef QT_BUILD_INTERNAL diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp index b7f014d0e2..1429e4cb7f 100644 --- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp +++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp @@ -491,10 +491,6 @@ void tst_QGlyphRun::drawMultiScriptText2() drawGlyphs.save("drawMultiScriptText2_drawGlyphIndexes.png"); #endif -#ifdef Q_OS_OSX - if (drawGlyphs.toImage() != textLayoutDraw.toImage()) - QEXPECT_FAIL("", "See QTBUG-32690", Continue); -#endif // Q_OS_OSX QCOMPARE(drawGlyphs, textLayoutDraw); } diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index 3e354b7523..08f7cf4fb2 100644 --- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -159,6 +159,7 @@ private slots: void nonZeroMarginOnImport(); void html_charFormatPropertiesUnset(); void html_headings(); + void html_quotedFontFamily_data(); void html_quotedFontFamily(); void html_spanBackgroundColor(); void defaultFont(); @@ -2184,23 +2185,45 @@ void tst_QTextDocumentFragment::html_headings() QCOMPARE(doc->blockCount(), 2); } -void tst_QTextDocumentFragment::html_quotedFontFamily() +void tst_QTextDocumentFragment::html_quotedFontFamily_data() { - setHtml("<div style=\"font-family: 'Foo Bar';\">Test</div>"); - QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar")); - - setHtml("<div style='font-family: \"Foo Bar\";'>Test</div>"); - QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar")); - - setHtml("<div style='font-family: \"Foo Bar\";'>Test</div>"); - QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar")); - - setHtml("<div style='font-family: Foo\n Bar;'>Test</div>"); - QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar")); + QTest::addColumn<QString>("html"); + QTest::addColumn<QString>("fontFamily"); + QTest::addColumn<QStringList>("fontFamilies"); + + const QString fooFamily = QLatin1String("Foo Bar"); + const QString weirdFamily = QLatin1String("'Weird, & font '' name',"); + + QTest::newRow("data1") << QString("<div style=\"font-family: 'Foo Bar';\">Test</div>") + << fooFamily << QStringList(fooFamily); + QTest::newRow("data2") << QString("<div style='font-family: \"Foo Bar\";'>Test</div>") + << QString("Foo Bar") << QStringList("Foo Bar"); + QTest::newRow("data3") << QString("<div style='font-family: Foo\n Bar;'>Test</div>") + << fooFamily << QStringList(fooFamily); + QTest::newRow("data4") << QString("<div style='font-family: Foo\n Bar, serif, \"bar foo\";'>Test" + "</div>") + << fooFamily << (QStringList() << "Foo Bar" << "serif" << "bar foo"); + QTest::newRow("data5") << QString("<div style='font-family: \"\\'Weird, & font \\'\\' name\\'," + "\";'>Test</div>") + << weirdFamily << QStringList(weirdFamily); + QTest::newRow("data6") << QString("<div style='font-family: \"\\'Weird, & font \\'\\' name\\'," + "\";'>Test</div>") + << weirdFamily << QStringList(weirdFamily); + QTest::newRow("data7") << QString("<div style='font-family: \"\\'Weird, & font \\'\\' name\\',\", " + "serif, \"bar foo\";'>Test</div>") + << weirdFamily + << (QStringList() << weirdFamily << "serif" << "bar foo"); +} - setHtml("<div style='font-family: Foo\n Bar, serif, \"bar foo\";'>Test</div>"); - QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar,serif,bar foo")); +void tst_QTextDocumentFragment::html_quotedFontFamily() +{ + QFETCH(QString, html); + QFETCH(QString, fontFamily); + QFETCH(QStringList, fontFamilies); + setHtml(html); + QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), fontFamily); + QCOMPARE(doc->begin().begin().fragment().charFormat().font().families(), fontFamilies); } void tst_QTextDocumentFragment::defaultFont() diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index a3c318420f..4225ff11c7 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -176,7 +176,7 @@ public: static QString ftpServerName() { -#ifdef QT_TEST_SERVER +#ifdef QT_TEST_SERVER_NAME return QString("vsftpd.") % serverDomainName(); #else return serverName(); @@ -184,7 +184,7 @@ public: } static QString ftpProxyServerName() { -#ifdef QT_TEST_SERVER +#ifdef QT_TEST_SERVER_NAME return QString("ftp-proxy.") % serverDomainName(); #else return serverName(); @@ -192,7 +192,7 @@ public: } static QString httpServerName() { -#ifdef QT_TEST_SERVER +#ifdef QT_TEST_SERVER_NAME return QString("apache2.") % serverDomainName(); #else return serverName(); @@ -200,7 +200,7 @@ public: } static QString httpProxyServerName() { -#ifdef QT_TEST_SERVER +#ifdef QT_TEST_SERVER_NAME return QString("squid.") % serverDomainName(); #else return serverName(); @@ -208,7 +208,7 @@ public: } static QString socksProxyServerName() { -#ifdef QT_TEST_SERVER +#ifdef QT_TEST_SERVER_NAME return QString("danted.") % serverDomainName(); #else return serverName(); diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index 8b49679042..6c3443a735 100644 --- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -35,7 +35,9 @@ #include <QtNetwork/QNetworkCookieJar> #include <QtNetwork/QNetworkCookie> #include <QtNetwork/QNetworkRequest> +#if QT_CONFIG(topleveldomain) #include "private/qtldurl_p.h" +#endif class tst_QNetworkCookieJar: public QObject { @@ -47,7 +49,7 @@ private slots: void setCookiesFromUrl(); void cookiesForUrl_data(); void cookiesForUrl(); -#ifdef QT_BUILD_INTERNAL +#if defined(QT_BUILD_INTERNAL) && QT_CONFIG(topleveldomain) void effectiveTLDs_data(); void effectiveTLDs(); #endif @@ -398,7 +400,7 @@ void tst_QNetworkCookieJar::cookiesForUrl() } // This test requires private API. -#ifdef QT_BUILD_INTERNAL +#if defined(QT_BUILD_INTERNAL) && QT_CONFIG(topleveldomain) void tst_QNetworkCookieJar::effectiveTLDs_data() { QTest::addColumn<QString>("domain"); diff --git a/tests/auto/network/ssl/qocsp/certs/alice.crt b/tests/auto/network/ssl/qocsp/certs/alice.crt new file mode 100644 index 0000000000..02df86a517 --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/alice.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADCBjjELMAkGA1UEBhMCTk8x +DTALBgNVBAgMBE9zbG8xEjAQBgNVBAcMCU9zbG8gQ2l0eTETMBEGA1UECgwKVGhl +IFF0IENBMTENMAsGA1UECwwEUVRDTjERMA8GA1UEAwwIY2ExcXQuaW8xJTAjBgkq +hkiG9w0BCQEWFnRpbXVyLnBvY2hlcHRzb3ZAcXQuaW8wHhcNMTgxMTIyMTEwNjE4 +WhcNMjgxMTE5MTEwNjE4WjCBkjELMAkGA1UEBhMCTk8xDTALBgNVBAgMBE9zbG8x +EjAQBgNVBAcMCU9zbG8gQ2l0eTEdMBsGA1UECgwUVGhlIEZhbW91cyBBbGljZSBM +dGQxDTALBgNVBAsMBEdPQUExEjAQBgNVBAMMCWFsaWNlLm9yZzEeMBwGCSqGSIb3 +DQEJARYPYWxpY2VAYWxpY2Uub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAtuGDR9oIEkK57xlxq/xc3u7B1ni4pdoyhf9r+pkgmu591qp2kl3Xcq3W +Ve5Z553orAUCAExPlKfFV+CYYAedSgsDYlKk8DN+f/n+hkG6Wl2qyFzHgl+mvPwa +eDqdVMIcDHGhSljALi9AqsN4lbrUhSxiyuPhAwl82WB0EIucmBs1NxSSZgFPRBLG +Uzy9WvtQFq1qtn795PVIUsNg68qZQ9BvRduOQAr3bg3anoYqytthWnzLWKri2QR4 +Z4Y0mvcbT/PZwhtcFZzDXG3Hvc7k3AroAbWoSghMEgok9TW9grKYkW2d5cpQTP+l +ptkB6yZ06MY9/uCdYzhm8eu2RgVndwIDAQABo3sweTAJBgNVHRMEAjAAMCwGCWCG +SAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4E +FgQUQz2PuE4VuqHtZYTvVLr4+0IuHTUwHwYDVR0jBBgwFoAUeBcnAkU7sTqm7i2Q +vTxwgr0nQ0QwDQYJKoZIhvcNAQELBQADggEBABGGmo1vUAXKQm9kowvUtjDpEIIY +TpT+KqiUBOgJg5fGn6a63vBn5GMA6eT948ywi9ZU2M9dIXJCM+bdqjXeOtt4bBPZ +xz6DcBPW9CoTR4CV1muNa95WIXzAHatq3XYG041ddMf41WG7QIdQsojBYEG0IYlv +PQx+B+m2cu7A04aI2tCS8aUh7Xc9wRilJ+h/FlYFFQzgyEKsd7CFgkyxG/sLyFNH +skYYk/DLlmaWa+YScHYB5kAk8StoETeMI2LLs7rgJmchi8eAxjLroYDUhQclUjqz +vlNM+4GvcF5RluyuEXFOZVdmQahkXcyu0Q3yxvsBbnDglmbb2YHPl/blB7w= +-----END CERTIFICATE----- diff --git a/tests/auto/network/ssl/qocsp/certs/alice.key b/tests/auto/network/ssl/qocsp/certs/alice.key new file mode 100644 index 0000000000..6f2666ebde --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/alice.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC24YNH2ggSQrnv +GXGr/Fze7sHWeLil2jKF/2v6mSCa7n3WqnaSXddyrdZV7lnnneisBQIATE+Up8VX +4JhgB51KCwNiUqTwM35/+f6GQbpaXarIXMeCX6a8/Bp4Op1UwhwMcaFKWMAuL0Cq +w3iVutSFLGLK4+EDCXzZYHQQi5yYGzU3FJJmAU9EEsZTPL1a+1AWrWq2fv3k9UhS +w2DryplD0G9F245ACvduDdqehirK22FafMtYquLZBHhnhjSa9xtP89nCG1wVnMNc +bce9zuTcCugBtahKCEwSCiT1Nb2CspiRbZ3lylBM/6Wm2QHrJnToxj3+4J1jOGbx +67ZGBWd3AgMBAAECggEADbzU+sHDF3QRuYdExbGYXFq9DtpUrIi+gNhWCSYVj+3Y +YBa//3CzLXcngZ78++wdvUZHBzS0SatspJRHffc0doprP6iLoUuM9hoWZ4lqcT1W +BeUKS53ZzZp2do+Yn/RQ3RJwFkCidxWvmuRCG6VEL5jM9wa1MWA2E7IuJcwHAFny +WIByosje5Qrd7eXDuVoqr1hjJ2UxIjIJ8Zgg3EE9wVUyJE3PU1HLz2AefonYRwbL +XlzNgnj0c9Ti9ejfyon+jTnpslLKtPal2kxyGoKPAngadAhCzqSaCWggACm7R8Ge +pZ0Y0pV7QReEgjfFd4D3qOqLRQZVJOMDb3vJu2/rsQKBgQDfKjfSpUweBM9li7GS +xXbDpC3Y8zQ2VY+2SvgYoYiYU/Y6YenxhKM1XDbWZxhxS8GVfCUAESFDOTZcMvdi +QEbG1uEmuCn1ksvrC2y54rtd8WDppcS0vJxCrU4nZG0v9IjVKp67B8EpBpAQeNb1 +tR6ByT2fLJu5+WU2S7OxqX7uLwKBgQDRyfKvrCQgdJOQlJlHOv1y1hN8WY51A8P/ +JbDXoun3PCPd+JczvFXCUh3ZLXqUEAX2qDOBD1pBM62EN6/A9ukO4mcMd8uYIet6 +nR4nVqXUjWuzXe6eo913lTDQrIOGWpViTc8fnvFlwBPfwzxbZNx38HZbw0L0nT7d +8TE/JxLROQKBgQC4Kzo4b8vadjPGZLueGbICkQp5IXR0ZrYcRdBrW1vEAn6Q/d84 +PzMFxV1IIXrNfSx8NiC+5mQh+yQ+gJ0iC1OdoxXag1+1V3lMN3h6C4B/bcWB7Rjh +40m9yRJXdgyZ59/Is8ydIzAosE7SGTelPNy5VR+yrfiySPxbC6x3MR8cZwKBgQCq +PVTg1bIjXDZ7NvsDYI1XaP07BXmi30FnhXByLFPsOzNn51jbtNNq8zQhjtRP3ojY +VjolWw4EpykBiCbpUfRiDbtN1NC0TaJHR8S2a4v6ZiCl123R8mu/pKOOUtAQcOWU +dkvD/zkpNqtqA4axK7H06n9Bi7yDwC7J7/Xkp5KPkQKBgFDprXrXg4zvIsxbXYZ3 +2bCaxyhBXNKcGwtWbbLfJcOwHJPns/abGkYIJ0NbMZX1LwTDfQWmC+8YKKvIlbKG +S2uk5H4qzupR4XN6YJ7SCHlGv2z0vxVjV7aWc1TME2iZQoBuO1urxPZwHd/euruo +kluWh1KV5XnWjBSYjZpiXxWl +-----END PRIVATE KEY----- diff --git a/tests/auto/network/ssl/qocsp/certs/ca1.crt b/tests/auto/network/ssl/qocsp/certs/ca1.crt new file mode 100644 index 0000000000..b5ae194fab --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/ca1.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID9DCCAtygAwIBAgIJAMQbE3657KDYMA0GCSqGSIb3DQEBCwUAMIGOMQswCQYD +VQQGEwJOTzENMAsGA1UECAwET3NsbzESMBAGA1UEBwwJT3NsbyBDaXR5MRMwEQYD +VQQKDApUaGUgUXQgQ0ExMQ0wCwYDVQQLDARRVENOMREwDwYDVQQDDAhjYTFxdC5p +bzElMCMGCSqGSIb3DQEJARYWdGltdXIucG9jaGVwdHNvdkBxdC5pbzAeFw0xODEx +MjIxMDIxMTNaFw0yODExMTkxMDIxMTNaMIGOMQswCQYDVQQGEwJOTzENMAsGA1UE +CAwET3NsbzESMBAGA1UEBwwJT3NsbyBDaXR5MRMwEQYDVQQKDApUaGUgUXQgQ0Ex +MQ0wCwYDVQQLDARRVENOMREwDwYDVQQDDAhjYTFxdC5pbzElMCMGCSqGSIb3DQEJ +ARYWdGltdXIucG9jaGVwdHNvdkBxdC5pbzCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAOCs3AV7sDKHJUJcm7a0OqnShIvoB1qv6UcOmlBmUzGl5GzX90Jz +7jYJoOPjxjNyRxMOsOReB1ZcSuIAjkdAEfFMaVe6j7qKTJ5ycTVY/fVoxyxsSNuI +xOJ6RCEjLHcxONEbkN/xI8LMdVko3m4P10r5GxwrgyPvpa87Yq5+XJ1BPWJyKbD7 +Tqpn3dvZUj0/POsMUTT7Q7VXOfDlZj58XWAC6ECTqJauhGFMhiwgqOn2Qo1W0QjV +DkGqRTdgIAM6Rv2cSRxgnflwW5QZ8kWUV81h/yx4cck/D9TcVxjr3Pvy6aJ/U41u +d4XJQgwCj4LJi4msw1S0CvZWmz+2BKxcbRsCAwEAAaNTMFEwHQYDVR0OBBYEFHgX +JwJFO7E6pu4tkL08cIK9J0NEMB8GA1UdIwQYMBaAFHgXJwJFO7E6pu4tkL08cIK9 +J0NEMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADp1kqDRcyVG +BdMge+Il10IjbpzzSjAoZiqiw69V99LiHW9ePbxG4AmliE6Za60GE5PCXOLjJh/5 +efgnIbybbyIOIT9iK4TXWLw2XW+rMY51c0RAxp2h/sc+5CZ0F0I811F5VUHXg2qR +U7C2zbzqAimN8TBm6FRe7NFQfqLCrsuFJjSc3obrqKQcpvRwxMk6NpkdoemzqLmY +lrBrTaeVbZ4ix3srVPvXRm9TdiC+JuuFmvulMfe+/wwnhb+dwT3JUC+EIq/Uf5Wb +g8lvB4ntitL8NLQ2hFGqYuoFNIGs6tRN71ohk+/ONqe9wJhcI9QAruPOvsg+8J0H +uGooX7PUNHg= +-----END CERTIFICATE----- diff --git a/tests/auto/network/ssl/qocsp/certs/ca1.key b/tests/auto/network/ssl/qocsp/certs/ca1.key new file mode 100644 index 0000000000..4ee080f706 --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/ca1.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDgrNwFe7AyhyVC +XJu2tDqp0oSL6Adar+lHDppQZlMxpeRs1/dCc+42CaDj48YzckcTDrDkXgdWXEri +AI5HQBHxTGlXuo+6ikyecnE1WP31aMcsbEjbiMTiekQhIyx3MTjRG5Df8SPCzHVZ +KN5uD9dK+RscK4Mj76WvO2KuflydQT1icimw+06qZ93b2VI9PzzrDFE0+0O1Vznw +5WY+fF1gAuhAk6iWroRhTIYsIKjp9kKNVtEI1Q5BqkU3YCADOkb9nEkcYJ35cFuU +GfJFlFfNYf8seHHJPw/U3FcY69z78umif1ONbneFyUIMAo+CyYuJrMNUtAr2Vps/ +tgSsXG0bAgMBAAECggEBAL1RCwjXw42gEUZM8KzQS0pD6IpXVrMU3ZWReXhb8Kg6 +KDOK+3+UXlpMXLUKfj1lgvxM+cNEdBxSIoszerARDc1s3KseufOui4dL2ZbhSQVc +Z9BH4lCSe4x3CCeAEvzQjhatirMY51BCpnMdm+fUE07KfwyKobNLQSpZ+Pod4f5i +oQbOiZYfRfU2quaWIsVb/a5IiUD0gG0KS9O5wX6VigVeFRpOPHT4YCQ1qds4HqQq +PKQtkLq0mo6beXCfXWrJ5Nc0QOIFlgSAHkeRR7zLK8MlaerwZ5YdeJIWuPM9l9H+ +34FVkHle1rPN6dJf7EPwWxn1PceFe3QYn1GHoiMmXfkCgYEA/U6iQypbLEKLmLbt +XTvhV1FVDQM42BX+ATNQ8Wro0ybdyzM+d4271uAUGTF1Zvxndv22p+JOmldWveAR +0iVK4mvrs25ACg27Bz3LiUaQB2OyYrj9M7TLgQ47gYEhwgnsSniFyrMcptNyIfW5 +GoB1N00EKiCvHyWo5LK6kRZt5QcCgYEA4xBOC/Otc9lTp24iSVA8Y7XJ+nlypFtc +pehf262jH11wEkWskmc9aP/kpxt9fUrDxf3YIOqITR4mMNn184P1WywHAQF7Adfd +3r5YBMVaanuaMsSuAZOJGyvuk2BE6328IKdE+3emndzXuQdDf0X2TUznwdKe9AzZ +qadCBLfUpk0CgYAgDKbzIJTQkMrg06RMu5rTVXMRZmr2zDGLLVb8dK5oqO4/G4i3 +z7MIiOmCFoPoN99PauKFc1jGpm5PL96RXC6RX14/IZ/wpbQYQnVSNR9cD/0uCIHg +3OsytP5KcHA5ANBoy78B2o+xe+dg7JozBDXQfWodem0t37Hy3bpFSTU2WQKBgETY +qcFn9hydNYcblpvCDz1wXjhq4H7DENlhFseF42LcMuHnbEbLtMwEYrDkXe1CYQ/E +QubgFcnELXI8dB2M0jT9qXX9m+1YJXanIgr4R8zngz6HcfcaY8TwUhsvYlZAvmzs +KrdQdR2CW4pHkIijjuWrPs3+7aEz0D9nblX94yU1AoGATVCfQOwmEMFHg33luMMt +0lTOHsar6g1O5vz0ZPZ1NjJF9Qe3+T7B4n4gq9pLwfi7Ohoa4CDmt0nKmy56dBha +5LM8mzw+PaH9a3pP93caS6k/X68TLOp7fwvnzP6HTjtis2sdYzVma6ghEF0zRdQr +6nWMI6Kx2kFaNdzKSHzxP5A= +-----END PRIVATE KEY----- diff --git a/tests/auto/network/ssl/qocsp/certs/infbob.key b/tests/auto/network/ssl/qocsp/certs/infbob.key new file mode 100644 index 0000000000..7878339151 --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/infbob.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDkF2BuPlkQa3Ox +JxnbQ+gy1mAxaGGzfnmGocraxVSKSssX3zSkeIrWB1kW3diOtIZ1jovYftHGsqoB +F5k6fN9dr37mFIZnilF6Bq0seYjNUl6I0d7Cf3NJSf7TG5+P+dAyNLN8aXILctY8 +krlSe4ysb++9xgawt2DYL3I0LBd+W27hd2BlfcmB4g2X3zOasjZM8F5HSBxF5e7f +fVaUmCC8S4jdXUQEbUNFk6HufDwDhP1gMtoGKHusWOdI5O6cQAfUUmRLSfi/jWoe +KLPafbj7KIcA8+YojOvub2guNpO42h9fc83/gCkkBJhwXNdIQjRUnz6Lu05kDTG9 +X28gbX9TAgMBAAECggEBAN9xCxVUXJmaOb6ciFblIi3TFm6wS62zw0chbgB8eQH0 +nRoonYBVWeSrVBnzf7bkoCe/Wb3fFo+o7KOfQ4spUwOK7SxlhPkfZgu9SJ4d/Obu +vw8XUTqF8iEkrM6P6/L2DX9xYzcIcSFIARlbvtJPmBJAocHtoRYyvltpt13mp6kt +/LVYR4qFAWRpPR6rnjlXEjfrE9taHWgIJEjwMj+IcTjnGiS1rX1T/JNhjRxsRJwU +qxqhYmeenNymyUJxS2B806EcG3UAJu63dK61VXN1dtPhS3FqjeR//GRlmy14n7RW +ZQAuT9dPB/WzUZVzEcOgTwe/+XsPTSfz7gpaoffgMJECgYEA/43xZRi48Dfp3tdq +qwwLf6Ya9pB2zb3XE8MUQhxsrygzL5ngZhmr2m0LgGCf5fXa983G6wzA6sOdpvve +jFAlBZYbWaYnvog9QIFcTj0S6PahGTBaR7PSNzK0UzoHYexYVCkyzQl1O2hktazd +Cankh/6IlAFkKbUSDqAwc07jNCkCgYEA5H0tNXpcDN6JTgKNe8YHM0GjZB+qGEoL +7YZbFlANjO9pOPY6JMQ3+DbOoruIH97CIyVYokuH0qRAfjm5LNiVYECFVFZRnGFb +BNPOPAnPJPISDF66zjW0KLMYCykJAHQ4SpHUPcJ6JnfBr76s/xSbNI9qnhpy3QYI +ATkqOrP25xsCgYEAy3pjmJGEv5BloM942VSv2yWRFn2UeuELXWrYuIMVbqndh6tH +50PNeA+XNtK4vktx3Bl2pzTybnrvDkRBwQsXT0lj4Y/Q2X509uWJb6plYiTtxLah +S7I8UUMIHbR4qFmdQvXCw0sikvjeJ2HKZaVml3ntmZs5+5N3GzolGcrYUXECgYEA +pPsBnsCoIJ66s7pCIKIfZtI5QT1f20P0EuDVemn5Ls9bwcaAuzV3WGFymKwiISj+ +MtRviFhTTTROYRYa8Be+3A4ad4gQS4M8bmLlYhKPIJUtlQL9jZHXcR/H9578ofhJ +AQcFIkb/XjFQiC58yX4+hxgbGufsEk2dkAyPwm1ZlQsCgYBTjnraJbYSz1v3MQKx +fHm9eHki/ODR3lWiCYYnnW3AwRa7AXS4ZiSw78wzkUX2XTJbE6JlEUH4M9DMzr4y +QBwKmx+3u+Im4WcZ889jo6XrF0X9mXRmY25+gr2ypTbKZjT8FCYcXIgiOxITLXZh +Bmn7KZcsdaPxSFn05ASEanLNqA== +-----END PRIVATE KEY----- diff --git a/tests/auto/network/ssl/qocsp/certs/infbobchain.crt b/tests/auto/network/ssl/qocsp/certs/infbobchain.crt new file mode 100644 index 0000000000..7ed13c2856 --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/infbobchain.crt @@ -0,0 +1,49 @@ +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQsFADCBjjELMAkGA1UEBhMCTk8x +DTALBgNVBAgMBE9zbG8xEjAQBgNVBAcMCU9zbG8gQ2l0eTETMBEGA1UECgwKVGhl +IFF0IENBMTENMAsGA1UECwwEUVRDTjERMA8GA1UEAwwIY2ExcXQuaW8xJTAjBgkq +hkiG9w0BCQEWFnRpbXVyLnBvY2hlcHRzb3ZAcXQuaW8wHhcNMTgxMTIyMTAyOTM3 +WhcNMjgxMTE5MTAyOTM3WjCBmDELMAkGA1UEBhMCTk8xDTALBgNVBAgMBE9zbG8x +EjAQBgNVBAcMCU9zbG8gQ2l0eTEkMCIGA1UECgwbVGhlIEluZmFtb3VzIFNuZWFr +eSBCb2IgTHRkMQwwCgYDVQQLDANCREExEzARBgNVBAMMCmluZmJvYi5jb20xHTAb +BgkqhkiG9w0BCQEWDmJvYkBpbmZib2IuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA5Bdgbj5ZEGtzsScZ20PoMtZgMWhhs355hqHK2sVUikrLF980 +pHiK1gdZFt3YjrSGdY6L2H7RxrKqAReZOnzfXa9+5hSGZ4pRegatLHmIzVJeiNHe +wn9zSUn+0xufj/nQMjSzfGlyC3LWPJK5UnuMrG/vvcYGsLdg2C9yNCwXfltu4Xdg +ZX3JgeINl98zmrI2TPBeR0gcReXu331WlJggvEuI3V1EBG1DRZOh7nw8A4T9YDLa +Bih7rFjnSOTunEAH1FJkS0n4v41qHiiz2n24+yiHAPPmKIzr7m9oLjaTuNofX3PN +/4ApJASYcFzXSEI0VJ8+i7tOZA0xvV9vIG1/UwIDAQABo3sweTAJBgNVHRMEAjAA +MCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAd +BgNVHQ4EFgQUloqk6Iihkkcxp85jAzeUPGVmapkwHwYDVR0jBBgwFoAUeBcnAkU7 +sTqm7i2QvTxwgr0nQ0QwDQYJKoZIhvcNAQELBQADggEBAGCdYFNskTzMilRtmw+v +oJQM3mc6LdYYuADCuh8O/GKaqUnE7V2XnMBYWMN93eeN9VXmK2yAZaQU1J6ruP1S +pLMzJ8hbQej+sm+XAHVxAtr34KmEC50gIn1cB/sRKxHMombbNl7EK44puFU7q58P +zBz5lTXXTfA954D/ijEMMSDvIZ25me6vrGPMj1LX/wC6CWadSr9IxAO9HQVQQqwv +AbbqrCvMSMv633/f1EYU8Q6jhUCTlnin4pXtriOnqi+6MZICaYRCUgV224Rs3OUS +jmrbOeoaZUpmOVmuoYXWeexe229G2KGiEIgnSBEk5OLFHCeZ8++WJ5/SLHt8MBLc +O0w= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID9DCCAtygAwIBAgIJAMQbE3657KDYMA0GCSqGSIb3DQEBCwUAMIGOMQswCQYD +VQQGEwJOTzENMAsGA1UECAwET3NsbzESMBAGA1UEBwwJT3NsbyBDaXR5MRMwEQYD +VQQKDApUaGUgUXQgQ0ExMQ0wCwYDVQQLDARRVENOMREwDwYDVQQDDAhjYTFxdC5p +bzElMCMGCSqGSIb3DQEJARYWdGltdXIucG9jaGVwdHNvdkBxdC5pbzAeFw0xODEx +MjIxMDIxMTNaFw0yODExMTkxMDIxMTNaMIGOMQswCQYDVQQGEwJOTzENMAsGA1UE +CAwET3NsbzESMBAGA1UEBwwJT3NsbyBDaXR5MRMwEQYDVQQKDApUaGUgUXQgQ0Ex +MQ0wCwYDVQQLDARRVENOMREwDwYDVQQDDAhjYTFxdC5pbzElMCMGCSqGSIb3DQEJ +ARYWdGltdXIucG9jaGVwdHNvdkBxdC5pbzCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAOCs3AV7sDKHJUJcm7a0OqnShIvoB1qv6UcOmlBmUzGl5GzX90Jz +7jYJoOPjxjNyRxMOsOReB1ZcSuIAjkdAEfFMaVe6j7qKTJ5ycTVY/fVoxyxsSNuI +xOJ6RCEjLHcxONEbkN/xI8LMdVko3m4P10r5GxwrgyPvpa87Yq5+XJ1BPWJyKbD7 +Tqpn3dvZUj0/POsMUTT7Q7VXOfDlZj58XWAC6ECTqJauhGFMhiwgqOn2Qo1W0QjV +DkGqRTdgIAM6Rv2cSRxgnflwW5QZ8kWUV81h/yx4cck/D9TcVxjr3Pvy6aJ/U41u +d4XJQgwCj4LJi4msw1S0CvZWmz+2BKxcbRsCAwEAAaNTMFEwHQYDVR0OBBYEFHgX +JwJFO7E6pu4tkL08cIK9J0NEMB8GA1UdIwQYMBaAFHgXJwJFO7E6pu4tkL08cIK9 +J0NEMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADp1kqDRcyVG +BdMge+Il10IjbpzzSjAoZiqiw69V99LiHW9ePbxG4AmliE6Za60GE5PCXOLjJh/5 +efgnIbybbyIOIT9iK4TXWLw2XW+rMY51c0RAxp2h/sc+5CZ0F0I811F5VUHXg2qR +U7C2zbzqAimN8TBm6FRe7NFQfqLCrsuFJjSc3obrqKQcpvRwxMk6NpkdoemzqLmY +lrBrTaeVbZ4ix3srVPvXRm9TdiC+JuuFmvulMfe+/wwnhb+dwT3JUC+EIq/Uf5Wb +g8lvB4ntitL8NLQ2hFGqYuoFNIGs6tRN71ohk+/ONqe9wJhcI9QAruPOvsg+8J0H +uGooX7PUNHg= +-----END CERTIFICATE----- diff --git a/tests/auto/network/ssl/qocsp/certs/ss1-private.key b/tests/auto/network/ssl/qocsp/certs/ss1-private.key new file mode 100644 index 0000000000..1c42daaf9f --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/ss1-private.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC4bXcfIjweShLx +6jBTKu/i5sXmlwTH9Z4PTzQ1VteKyEIDlnW5ocVWqRgBrvz3NlTFkDKkQXshkXyE +JyVZFbAPCfGsroZVISpFhUmJbPMBNn3SyGEU+sxWIpOZOKmG5tel6B4Bt5TWsRHL +mtU8Pv/APsz+i9JhgE25ksGhx16MqvdRv/xNGleF8qe+hDOeiNF3/lNv2hYb/MvD +1F73FBoDVnqty/VXXOJFb7elLE4ArXsTN/hip42Lbl1guYvnqnTZFhCHwMzRu4qc +3FTlemumfJpacpRnqVw2TURA5SdpTp9NYIxygEGNY201meNEjAEyg8GeFkAgu99R +LPQT+rTNAgMBAAECggEAPQEIfCXo2OQLrDWY0onLW7SWFZYyoKngJJRAYrxdA60G +GQW13zdhfS7ln/jv+B3ioI74EVkPj6T+GQCR3AvOdssFQ+dey93yi5hxIKIHJ4mM +ySI66qOi34MEa5RQjyzgfCJxeoPtGa7sgfqvOgRkuISNbk11w4abLx0aK5c08TY0 +JdeoWWhATaFZXl782Aw2FwGPTwOIf7GB09BJS3qUqlMT9fowLmWO10jOKkNtvcnT +2mAqT5cdZG1ffT5+f0JETPCbBPhhyE7VyYEVQfqTkRnEoz3hcZvjx91jD527+CSL +Qhg7zZu2oakyJQvpHETZ6cgrs7uDEiol7ARANezwyQKBgQDmapxV/qIOd5WFDVXw +lGt+dsELBBdMhvzr4A9eZdIZiXu48rdFG0XoECo5BKpXa1+ISr2od0U0YODrJrws +OHxHhlxGjJFs8kFteUPHyEZv6/rvkbA+xc0Uw04NnDRHBLK8VvX7MBWfvTqLN4bK +sZsMblscRBtEpFpN1fiJgnNASwKBgQDM56lBugtueBV9M4C/JF2is96d14ue3Y4i +SgMnHY18D3ru+KDuxPYoIs5Yos2vDWK2k8754WZ+WNXokjRoYPiFbeBPpI9NudJs +BUJz/sLJHjs3a4HrQs3hCuufczNxq9wQnALQHCMEqeBUTYCu/1+zYgwAu3Z/R8rJ +jKgexl+gRwKBgGrLCNCWpze7VzKGvsk1kSjZE5nueHoAqqMMgzMGUD2DyjMrU6QV +Au6O53Lr5aOE4Y9CzOqS9SFUsYprtpVsTLW94XDVX+W11ntN1At5mKPxJKn6xUwi +022HI9sNBfHQjKLcTz/vxmX2B3dU8gVqEenOEC5mppjG8A/ZV0ssigxHAoGAfGsG +OSSwoElGMxm8yVNZj9vMBufEnZhGH8f1FiE5seTsboKFpbXvCfvoc6WXYv2rvNUP +TmdxBrMGYAu2ytJm1Q4cr/9qDHYSsQiYizpcKCa1KjebUbDktgsde1pGGHWUUHmK +s7cCBGjqEAZnZtslzxRv2Vn639pF5hAEXXtywS0CgYAUIjhp43qgtbQdZMX7xbVR +lT26aq7NguCtt7njpgkhqc0HThb3I8ImrhNSDcS0/T9dPU70vt0ceruyRXmwX5hA +l28i5GzF5ufaRQdcsSR9u+P67nD5sTZBesbejXFySis5EC/97A4XZvkSfY4DQSZ+ +u8JJPZUlb2kGAHRpmxvpDA== +-----END PRIVATE KEY----- diff --git a/tests/auto/network/ssl/qocsp/certs/ss1.crt b/tests/auto/network/ssl/qocsp/certs/ss1.crt new file mode 100644 index 0000000000..43ca8316c2 --- /dev/null +++ b/tests/auto/network/ssl/qocsp/certs/ss1.crt @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIEKzCCAxOgAwIBAgIJAOO/b5uLSmT8MA0GCSqGSIb3DQEBBQUAMIGqMQswCQYD +VQQGEwJOTzENMAsGA1UECAwET3NsbzENMAsGA1UEBwwET3NsbzESMBAGA1UECgwJ +VGhlIFF0IENBMScwJQYDVQQLDB5SJkQgKGZha2UgY2VydGlmaWNhdGVzIGlzc3Vl +cikxGTAXBgNVBAMMEFRpbXVyIFBvY2hlcHRzb3YxJTAjBgkqhkiG9w0BCQEWFnRp +bXVyLnBvY2hlcHRzb3ZAcXQuaW8wIBcNMTgxMTE3MDUxNDA1WhgPMjExODEwMjQw +NTE0MDVaMIGqMQswCQYDVQQGEwJOTzENMAsGA1UECAwET3NsbzENMAsGA1UEBwwE +T3NsbzESMBAGA1UECgwJVGhlIFF0IENBMScwJQYDVQQLDB5SJkQgKGZha2UgY2Vy +dGlmaWNhdGVzIGlzc3VlcikxGTAXBgNVBAMMEFRpbXVyIFBvY2hlcHRzb3YxJTAj +BgkqhkiG9w0BCQEWFnRpbXVyLnBvY2hlcHRzb3ZAcXQuaW8wggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQC4bXcfIjweShLx6jBTKu/i5sXmlwTH9Z4PTzQ1 +VteKyEIDlnW5ocVWqRgBrvz3NlTFkDKkQXshkXyEJyVZFbAPCfGsroZVISpFhUmJ +bPMBNn3SyGEU+sxWIpOZOKmG5tel6B4Bt5TWsRHLmtU8Pv/APsz+i9JhgE25ksGh +x16MqvdRv/xNGleF8qe+hDOeiNF3/lNv2hYb/MvD1F73FBoDVnqty/VXXOJFb7el +LE4ArXsTN/hip42Lbl1guYvnqnTZFhCHwMzRu4qc3FTlemumfJpacpRnqVw2TURA +5SdpTp9NYIxygEGNY201meNEjAEyg8GeFkAgu99RLPQT+rTNAgMBAAGjUDBOMB0G +A1UdDgQWBBSyHPlJr6BrpwMY7Sxg2R3CpQR7UzAfBgNVHSMEGDAWgBSyHPlJr6Br +pwMY7Sxg2R3CpQR7UzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQBD +o86xp1WwvX6mYzF94ifZlkq1aDN6/njj2B9fvJCtygfqq6b9BrQJ0hNeqRh8OaIh +v2YmjbdUaoYguHmUxL+SeS67Sp8QBoSwdU5x0i8ygrigBrbb3myNqN6hGvpGy9E0 +B8PnVDt9DaOCunaMyGNPMLNPVGYULmberGtxV9wilcH4Q6WZrk9IhuyfqeBZtBYM +IcjV3OKdUv/ggu2IZSN7njKcgr+uyPt0Ymo9GozJSTdnN/E4hsRgzcgzCMf2fxzj +nGcsDRQ4L1R8p1zDlduxmmk42zGCGz3duFX7dijAxJWirS8Zsea4aooLgDQYT/zI +8hKd3KC3knLhPcxFKiUg +-----END CERTIFICATE----- diff --git a/tests/auto/network/ssl/qocsp/qocsp.pro b/tests/auto/network/ssl/qocsp/qocsp.pro new file mode 100644 index 0000000000..f4e846f39b --- /dev/null +++ b/tests/auto/network/ssl/qocsp/qocsp.pro @@ -0,0 +1,15 @@ +CONFIG += testcase + +SOURCES += tst_qocsp.cpp +QT = core network network-private testlib + +TARGET = tst_qocsp + +win32 { + CONFIG(debug, debug|release) { + DESTDIR = debug + } else { + DESTDIR = release + } +} + diff --git a/tests/auto/network/ssl/qocsp/tst_qocsp.cpp b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp new file mode 100644 index 0000000000..9716c04bbb --- /dev/null +++ b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp @@ -0,0 +1,823 @@ +/**************************************************************************** + ** + ** Copyright (C) 2018 The Qt Company Ltd. + ** Contact: https://www.qt.io/licensing/ + ** + ** This file is part of the test suite of the Qt Toolkit. + ** + ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ + ** Commercial License Usage + ** Licensees holding valid commercial Qt licenses may use this file in + ** accordance with the commercial license agreement provided with the + ** Software or, alternatively, in accordance with the terms contained in + ** a written agreement between you and The Qt Company. For licensing terms + ** and conditions see https://www.qt.io/terms-conditions. For further + ** information use the contact form at https://www.qt.io/contact-us. + ** + ** GNU General Public License Usage + ** Alternatively, this file may be used under the terms of the GNU + ** General Public License version 3 as published by the Free Software + ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT + ** included in the packaging of this file. Please review the following + ** information to ensure the GNU General Public License requirements will + ** be met: https://www.gnu.org/licenses/gpl-3.0.html. + ** + ** $QT_END_LICENSE$ + ** + ****************************************************************************/ + +#include <QtTest/QtTest> + +#include <QtNetwork/private/qtnetworkglobal_p.h> + +#include <QtNetwork/private/qsslsocket_openssl_symbols_p.h> +#include <QtNetwork/private/qsslsocket_openssl_p.h> + +#include <QtNetwork/qsslcertificate.h> +#include <QtNetwork/qtcpserver.h> +#include <QtNetwork/qsslerror.h> +#include <QtNetwork/qsslkey.h> +#include <QtNetwork/qssl.h> + +#include <QtCore/qsharedpointer.h> +#include <QtCore/qbytearray.h> +#include <QtCore/qfileinfo.h> +#include <QtCore/qstring.h> +#include <QtCore/qfile.h> +#include <QtCore/qlist.h> +#include <QtCore/qdir.h> + +#include <openssl/ocsp.h> + +#include <algorithm> +#include <utility> + +// NOTE: the word 'subject' in the code below means the subject of a status request, +// so in general it's our peer's certificate we are asking about. + +using SslError = QT_PREPEND_NAMESPACE(QSslError); +using VectorOfErrors = QT_PREPEND_NAMESPACE(QVector<SslError>); +using Latin1String = QT_PREPEND_NAMESPACE(QLatin1String); + +Q_DECLARE_METATYPE(SslError) +Q_DECLARE_METATYPE(VectorOfErrors) +Q_DECLARE_METATYPE(Latin1String) + +QT_BEGIN_NAMESPACE + +namespace { + +using OcspResponse = QSharedPointer<OCSP_RESPONSE>; +using BasicResponse = QSharedPointer<OCSP_BASICRESP>; +using SingleResponse = QSharedPointer<OCSP_SINGLERESP>; +using CertId = QSharedPointer<OCSP_CERTID>; +using EvpKey = QSharedPointer<EVP_PKEY>; +using Asn1Time = QSharedPointer<ASN1_TIME>; +using CertificateChain = QList<QSslCertificate>; + +using NativeX509Ptr = X509 *; + +class X509Stack { +public: + explicit X509Stack(const QList<QSslCertificate> &chain); + + ~X509Stack(); + + int size() const; + X509 *operator[](int index) const; + operator STACK_OF(X509) *() const; + +private: + OPENSSL_STACK *stack = nullptr; + + Q_DISABLE_COPY(X509Stack) +}; + +X509Stack::X509Stack(const QList<QSslCertificate> &chain) +{ + if (!chain.size()) + return; + + stack = q_OPENSSL_sk_new_null(); + if (!stack) + return; + + for (const QSslCertificate &cert : chain) { + X509 *nativeCert = NativeX509Ptr(cert.handle()); + if (!nativeCert) + continue; + q_OPENSSL_sk_push(stack, nativeCert); + q_X509_up_ref(nativeCert); + } +} + +X509Stack::~X509Stack() +{ + if (stack) + q_OPENSSL_sk_pop_free(stack, reinterpret_cast<void(*)(void*)>(q_X509_free)); +} + +int X509Stack::size() const +{ + if (stack) + return q_OPENSSL_sk_num(stack); + return 0; +} + +X509 *X509Stack::operator[](int index) const +{ + return NativeX509Ptr(q_OPENSSL_sk_value(stack, index)); +} + +X509Stack::operator STACK_OF(X509) *() const +{ + return reinterpret_cast<STACK_OF(X509)*>(stack); +} + +struct OcspTimeStamp +{ + OcspTimeStamp() = default; + OcspTimeStamp(long secondsBeforeNow, long secondsAfterNow); + + static Asn1Time timeToAsn1Time(long adjustment); + + Asn1Time thisUpdate; + Asn1Time nextUpdate; +}; + +OcspTimeStamp::OcspTimeStamp(long secondsBeforeNow, long secondsAfterNow) +{ + Asn1Time start = timeToAsn1Time(secondsBeforeNow); + Asn1Time end = timeToAsn1Time(secondsAfterNow); + if (start.data() && end.data()) { + thisUpdate.swap(start); + nextUpdate.swap(end); + } +} + +Asn1Time OcspTimeStamp::timeToAsn1Time(long adjustment) +{ + if (ASN1_TIME *adjusted = q_X509_gmtime_adj(nullptr, adjustment)) + return Asn1Time(adjusted, q_ASN1_TIME_free); + return Asn1Time{}; +} + +struct OcspResponder +{ + OcspResponder(const OcspTimeStamp &stamp, const CertificateChain &subjs, + const CertificateChain &respChain, const QSslKey &respPKey); + + QByteArray buildResponse(int responseStatus, int certificateStatus) const; + static EvpKey privateKeyToEVP_PKEY(const QSslKey &privateKey); + static CertId certificateToCertId(X509 *subject, X509 *issuer); + static QByteArray responseToDer(OCSP_RESPONSE *response); + + OcspTimeStamp timeStamp; + // Plural, we can send a 'wrong' BasicResponse containing more than + // 1 SingleResponse. + X509Stack subjects; + X509Stack responderChain; + QSslKey responderKey; +}; + +OcspResponder::OcspResponder(const OcspTimeStamp &stamp, const CertificateChain &subjs, + const CertificateChain &respChain, const QSslKey &respPKey) + : timeStamp(stamp), + subjects(subjs), + responderChain(respChain), + responderKey(respPKey) +{ +} + +QByteArray OcspResponder::buildResponse(int responseStatus, int certificateStatus) const +{ + if (responseStatus != OCSP_RESPONSE_STATUS_SUCCESSFUL) { + OCSP_RESPONSE *response = q_OCSP_response_create(responseStatus, nullptr); + if (!response) + return {}; + const OcspResponse rGuard(response, q_OCSP_RESPONSE_free); + return responseToDer(response); + } + + Q_ASSERT(subjects.size() && responderChain.size() && responderKey.handle()); + + const EvpKey nativeKey = privateKeyToEVP_PKEY(responderKey); + if (!nativeKey.data()) + return {}; + + OCSP_BASICRESP *basicResponse = q_OCSP_BASICRESP_new(); + if (!basicResponse) + return {}; + const BasicResponse brGuard(basicResponse, q_OCSP_BASICRESP_free); + + for (int i = 0, e = subjects.size(); i < e; ++i) { + X509 *subject = subjects[i]; + Q_ASSERT(subject); + CertId certId = certificateToCertId(subject, responderChain[0]); + if (!certId.data()) + return {}; + + // NOTE: we do not own this 'singleResponse': + ASN1_TIME *revisionTime = certificateStatus == V_OCSP_CERTSTATUS_REVOKED ? + timeStamp.thisUpdate.data() : nullptr; + + if (!q_OCSP_basic_add1_status(basicResponse, certId.data(), certificateStatus, 0, revisionTime, + timeStamp.thisUpdate.data(), timeStamp.nextUpdate.data())) { + return {}; + } + } + + if (q_OCSP_basic_sign(basicResponse, responderChain[0], nativeKey.data(), q_EVP_sha1(), + responderChain, 0) != 1) { + return {}; + } + + OCSP_RESPONSE *ocspResponse = q_OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, basicResponse); + if (!ocspResponse) + return {}; + const OcspResponse rGuard(ocspResponse, q_OCSP_RESPONSE_free); + return responseToDer(ocspResponse); +} + +EvpKey OcspResponder::privateKeyToEVP_PKEY(const QSslKey &privateKey) +{ + const EvpKey nullKey; + if (privateKey.isNull() || privateKey.algorithm() != QSsl::Rsa) { + // We use only RSA keys in this auto-test, since we test OCSP only, + // not handshake/TLS in general. + return nullKey; + } + + EVP_PKEY *nativeKey = q_EVP_PKEY_new(); + if (!nativeKey) + return nullKey; + + const EvpKey keyGuard(nativeKey, q_EVP_PKEY_free); + if (!q_EVP_PKEY_set1_RSA(nativeKey, reinterpret_cast<RSA *>(privateKey.handle()))) + return nullKey; + + return keyGuard; +} + +CertId OcspResponder::certificateToCertId(X509 *subject, X509 *issuer) +{ + const CertId nullId; + if (!subject || !issuer) + return nullId; + + const EVP_MD *digest = q_EVP_sha1(); + if (!digest) + return nullId; + + OCSP_CERTID *certId = q_OCSP_cert_to_id(digest, subject, issuer); + if (!certId) + return nullId; + + return CertId(certId, q_OCSP_CERTID_free); +} + +QByteArray OcspResponder::responseToDer(OCSP_RESPONSE *response) +{ + if (!response) + return {}; + + const int derSize = q_i2d_OCSP_RESPONSE(response, nullptr); + if (derSize <= 0) + return {}; + + QByteArray derData(derSize, Qt::Uninitialized); + unsigned char *pData = reinterpret_cast<unsigned char *>(derData.data()); + const int serializedSize = q_i2d_OCSP_RESPONSE(response, &pData); + if (serializedSize != derSize) + return {}; + + return derData; +} + +// The QTcpServer capable of sending OCSP status responses. +class OcspServer : public QTcpServer +{ + Q_OBJECT + +public: + OcspServer(const CertificateChain &serverChain, const QSslKey &privateKey); + + void configureResponse(const QByteArray &responseDer); + QString hostName() const; + QString peerVerifyName() const; + +Q_SIGNALS: + void internalServerError(); + +private: + void incomingConnection(qintptr descriptor) override; + +public: + QSslConfiguration serverConfig; + QSslSocket serverSocket; +}; + +OcspServer::OcspServer(const CertificateChain &serverChain, const QSslKey &privateKey) +{ + Q_ASSERT(serverChain.size()); + Q_ASSERT(!privateKey.isNull()); + + serverConfig = QSslConfiguration::defaultConfiguration(); + serverConfig.setLocalCertificateChain(serverChain); + serverConfig.setPrivateKey(privateKey); +} + +void OcspServer::configureResponse(const QByteArray &responseDer) +{ + serverConfig.setBackendConfigurationOption("Qt-OCSP-response", responseDer); +} + +QString OcspServer::hostName() const +{ + // It's 'name' and not 'address' to be consistent with QSslSocket's naming style, + // where it's connectToHostEncrypted(hostName, ...) + const QHostAddress &addr = serverAddress(); + if (addr == QHostAddress::Any || addr == QHostAddress::AnyIPv4) + return QStringLiteral("127.0.0.1"); + if (addr == QHostAddress::AnyIPv6) + return QStringLiteral("::1"); + return addr.toString(); +} + +QString OcspServer::peerVerifyName() const +{ + const CertificateChain &localChain = serverConfig.localCertificateChain(); + if (localChain.isEmpty()) + return {}; + const auto cert = localChain.first(); + if (cert.isNull()) + return {}; + + const QStringList &names = cert.subjectInfo(QSslCertificate::CommonName); + return names.isEmpty() ? QString{} : names.first(); +} + +void OcspServer::incomingConnection(qintptr socketDescriptor) +{ + close(); + + if (!serverSocket.setSocketDescriptor(socketDescriptor)) { + emit internalServerError(); + return; + } + + serverSocket.setSslConfiguration(serverConfig); + // Since we test a client, not a server, we don't care about any + // possible errors on the server (QAbstractSocket or QSslSocket-related). + // Thus, we don't connect to any error signal. + serverSocket.startServerEncryption(); +} + +} // unnamed namespace + +class tst_QOcsp : public QObject +{ + Q_OBJECT + +public slots: + void initTestCase(); + +private slots: + void connectSelfSigned(); + void badStatus_data(); + void badStatus(); + void multipleSingleResponses(); + void malformedResponse(); + void expiredResponse_data(); + void expiredResponse(); + void noNextUpdate(); + void wrongCertificateInResponse_data(); + void wrongCertificateInResponse(); + void untrustedResponder(); + + // OCSPTODO: more tests in future ... + +private: + void setupOcspClient(QSslSocket &clientSocket, const CertificateChain &trustedCAs, + const QString &peerName); + bool containsOcspErrors(const QList<QSslError> &errorsFound) const; + static bool containsError(const QList<QSslError> &errors, QSslError::SslError code); + static QByteArray goodResponse(const CertificateChain &subject, const CertificateChain &responder, + const QSslKey &privateKey, long beforeNow = -1000, long afterNow = 1000); + static bool loadPrivateKey(const QString &keyName, QSslKey &key); + static CertificateChain issuerToChain(const CertificateChain &chain); + static CertificateChain subjectToChain(const CertificateChain &chain); + + static QString certDirPath; + + void (QSslSocket::*socketErrorSignal)(QAbstractSocket::SocketError) = &QAbstractSocket::error; + void (QSslSocket::*tlsErrorsSignal)(const QList<QSslError> &) = &QSslSocket::sslErrors; + void (QTestEventLoop::*exitLoopSlot)() = &QTestEventLoop::exitLoop; + + const int handshakeTimeoutMS = 500; + QTestEventLoop loop; + + std::vector<QSslError::SslError> ocspErrorCodes = {QSslError::OcspNoResponseFound, + QSslError::OcspMalformedRequest, + QSslError::OcspMalformedResponse, + QSslError::OcspInternalError, + QSslError::OcspTryLater, + QSslError::OcspSigRequred, + QSslError::OcspUnauthorized, + QSslError::OcspResponseCannotBeTrusted, + QSslError::OcspResponseCertIdUnknown, + QSslError::OcspResponseExpired, + QSslError::OcspStatusUnknown}; +}; + +#define QCOMPARE_SINGLE_ERROR(sslSocket, expectedError) \ + const auto &tlsErrors = sslSocket.sslErrors(); \ + QCOMPARE(tlsErrors.size(), 1); \ + QCOMPARE(tlsErrors[0].error(), expectedError) + +#define QVERIFY_HANDSHAKE_WITHOUT_ERRORS(sslSocket) \ + QVERIFY(sslSocket.isEncrypted()); \ + QCOMPARE(sslSocket.state(), QAbstractSocket::ConnectedState); \ + QVERIFY(sslSocket.sslErrors().isEmpty()) + +#define QDECLARE_CHAIN(object, chainFileName) \ + CertificateChain object = QSslCertificate::fromPath(certDirPath + QLatin1String(chainFileName)); \ + QVERIFY(object.size()) + +#define QDECLARE_PRIVATE_KEY(key, keyFileName) \ + QSslKey key; \ + QVERIFY(loadPrivateKey(QLatin1String(keyFileName), key)) + +QString tst_QOcsp::certDirPath; + +void tst_QOcsp::initTestCase() +{ + QVERIFY(QSslSocket::supportsSsl()); + + certDirPath = QFileInfo(QFINDTESTDATA("certs")).absolutePath(); + QVERIFY(certDirPath.size() > 0); + certDirPath += QDir::separator() + QStringLiteral("certs") + QDir::separator(); +} + +void tst_QOcsp::connectSelfSigned() +{ + // This test may look a bit confusing, since we have essentially 1 + // self-signed certificate, which we trust for the purpose of this test, + // but we also request its (the certificate's) status and then we sign + // the status response using the same certificate and the corresponding + // private key. Anyway, we test the very basic things here: we send + // an OCSP status request, we verify the response (if server has sent it), + // and detect errors (if any). + QDECLARE_CHAIN(subjectChain, "ss1.crt"); + QDECLARE_CHAIN(responderChain, "ss1.crt"); + QDECLARE_PRIVATE_KEY(privateKey, "ss1-private.key"); + { + // This server ignores our status request: + const QSslError::SslError expectedError = QSslError::OcspNoResponseFound; + + OcspServer server(subjectChain, privateKey); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + QSslConfiguration clientConfig = QSslConfiguration::defaultConfiguration(); + auto roots = clientConfig.caCertificates(); + setupOcspClient(clientSocket, issuerToChain(subjectChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY(!clientSocket.isEncrypted()); + QCOMPARE_SINGLE_ERROR(clientSocket, expectedError); + } + { + // Now the server will send a valid 'status: good' response. + OcspServer server(subjectChain, privateKey); + const QByteArray response(goodResponse(subjectChain, responderChain, privateKey)); + QVERIFY(response.size()); + server.configureResponse(response); + QVERIFY(server.listen()); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, issuerToChain(subjectChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY_HANDSHAKE_WITHOUT_ERRORS(clientSocket); + } +} + +void tst_QOcsp::badStatus_data() +{ + QTest::addColumn<int>("responseStatus"); + QTest::addColumn<int>("certificateStatus"); + QTest::addColumn<QSslError>("expectedError"); + + QTest::addRow("malformed-request") << OCSP_RESPONSE_STATUS_MALFORMEDREQUEST << 1 << QSslError(QSslError::OcspMalformedRequest); + QTest::addRow("internal-error") << OCSP_RESPONSE_STATUS_INTERNALERROR << 2 << QSslError(QSslError::OcspInternalError); + QTest::addRow("try-later") << OCSP_RESPONSE_STATUS_TRYLATER << 3 << QSslError(QSslError::OcspTryLater); + QTest::addRow("signed-request-require") << OCSP_RESPONSE_STATUS_SIGREQUIRED << 2 << QSslError(QSslError::OcspSigRequred); + QTest::addRow("unauthorized-request") << OCSP_RESPONSE_STATUS_UNAUTHORIZED << 1 <<QSslError(QSslError::OcspUnauthorized); + + QTest::addRow("certificate-revoked") << OCSP_RESPONSE_STATUS_SUCCESSFUL << V_OCSP_CERTSTATUS_REVOKED + << QSslError(QSslError::CertificateRevoked); + QTest::addRow("status-unknown") << OCSP_RESPONSE_STATUS_SUCCESSFUL << V_OCSP_CERTSTATUS_UNKNOWN + << QSslError(QSslError::OcspStatusUnknown); +} + +void tst_QOcsp::badStatus() +{ + // This test works with two types of 'bad' responses: + // 1. 'Error messages' (the response's status is anything but SUCCESSFUL, + // no information about the certificate itself, no signature); + // 2. 'REVOKED' or 'UNKNOWN' status for a certificate in question. + QFETCH(const int, responseStatus); + QFETCH(const int, certificateStatus); + QFETCH(const QSslError, expectedError); + + QDECLARE_CHAIN(subjectChain, "infbobchain.crt"); + QCOMPARE(subjectChain.size(), 2); + QDECLARE_CHAIN(responderChain, "ca1.crt"); + QDECLARE_PRIVATE_KEY(subjPrivateKey, "infbob.key"); + QDECLARE_PRIVATE_KEY(respPrivateKey, "ca1.key"); + + OcspServer server(subjectChain, subjPrivateKey); + const OcspTimeStamp stamp(-1000, 1000); + OcspResponder builder(stamp, subjectToChain(subjectChain), responderChain, respPrivateKey); + const QByteArray response(builder.buildResponse(responseStatus, certificateStatus)); + QVERIFY(response.size()); + server.configureResponse(response); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, issuerToChain(subjectChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY(!clientSocket.isEncrypted()); + QCOMPARE_SINGLE_ERROR(clientSocket, expectedError.error()); +} + +void tst_QOcsp::multipleSingleResponses() +{ + // We handle a response with more than one SingleResponse as malformed: + const QSslError::SslError expectedError = QSslError::OcspMalformedResponse; + + // Here we use subjectChain only to generate a response, the server + // is configured with the responder chain (it's the same cert after all). + QDECLARE_CHAIN(subjectChain, "ss1.crt"); + QDECLARE_CHAIN(responderChain, "ss1.crt"); + QDECLARE_PRIVATE_KEY(privateKey, "ss1-private.key"); + + // Let's have more than 1 certificate in a chain: + subjectChain.append(subjectChain[0]); + + OcspServer server(responderChain, privateKey); + // Generate a BasicOCSPResponse containing 2 SingleResponses: + const QByteArray response(goodResponse(subjectChain, responderChain, privateKey)); + QVERIFY(response.size()); + server.configureResponse(response); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, issuerToChain(responderChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY(!clientSocket.isEncrypted()); + QCOMPARE_SINGLE_ERROR(clientSocket, expectedError); +} + +void tst_QOcsp::malformedResponse() +{ + QDECLARE_CHAIN(serverChain, "ss1.crt"); + QDECLARE_PRIVATE_KEY(privateKey, "ss1-private.key"); + + OcspServer server(serverChain, privateKey); + // Let's send some arbitrary bytes instead of DER and see what happens next: + server.configureResponse("Sure, you can trust me, this cert was not revoked (I don't say it was issued at all)!"); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, issuerToChain(serverChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY(!clientSocket.isEncrypted()); + QCOMPARE(clientSocket.error(), QAbstractSocket::SslHandshakeFailedError); +} + +void tst_QOcsp::expiredResponse_data() +{ + QTest::addColumn<long>("beforeNow"); + QTest::addColumn<long>("afterNow"); + + QTest::addRow("expired") << -2000L << -1000L; + QTest::addRow("not-valid-yet") << 5000L << 10000L; + QTest::addRow("next-before-this") << -1000L << -2000L; +} + +void tst_QOcsp::expiredResponse() +{ + // We report different kinds of problems with [thisUpdate, nextUpdate] + // as 'expired' (to keep it simple): + const QSslError::SslError expectedError = QSslError::OcspResponseExpired; + + QFETCH(const long, beforeNow); + QFETCH(const long, afterNow); + + QDECLARE_CHAIN(subjectChain, "ss1.crt"); + QDECLARE_CHAIN(responderChain, "ss1.crt"); + QDECLARE_PRIVATE_KEY(privateKey, "ss1-private.key"); + + OcspServer server(subjectChain, privateKey); + const QByteArray response(goodResponse(subjectChain, responderChain, privateKey, beforeNow, afterNow)); + QVERIFY(response.size()); + server.configureResponse(response); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, issuerToChain(subjectChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY(!clientSocket.isEncrypted()); + QCOMPARE_SINGLE_ERROR(clientSocket, expectedError); +} + +void tst_QOcsp::noNextUpdate() +{ + // RFC2560, 2.4: + // "If nextUpdate is not set, the responder is indicating that newer + // revocation information is available all the time." + // + // This test is just to verify that we correctly handle such responses. + QDECLARE_CHAIN(subjectChain, "ss1.crt"); + QDECLARE_CHAIN(responderChain, "ss1.crt"); + QDECLARE_PRIVATE_KEY(privateKey, "ss1-private.key"); + + OcspServer server(subjectChain, privateKey); + OcspTimeStamp openRange(-1000, 0); + openRange.nextUpdate.clear(); + const OcspResponder responder(openRange, subjectChain, responderChain, privateKey); + const QByteArray response(responder.buildResponse(OCSP_RESPONSE_STATUS_SUCCESSFUL, + V_OCSP_CERTSTATUS_GOOD)); + QVERIFY(response.size()); + server.configureResponse(response); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, issuerToChain(subjectChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY_HANDSHAKE_WITHOUT_ERRORS(clientSocket); +} + +void tst_QOcsp::wrongCertificateInResponse_data() +{ + QTest::addColumn<QLatin1String>("respChainName"); + QTest::addColumn<QLatin1String>("respKeyName"); + QTest::addColumn<QLatin1String>("wrongChainName"); + + QTest::addRow("same-CA-wrong-subject") << QLatin1String("ca1.crt") << QLatin1String("ca1.key") + << QLatin1String("alice.crt"); + QTest::addRow("wrong-CA-same-subject") << QLatin1String("ss1.crt") << QLatin1String("ss1-private.key") + << QLatin1String("alice.crt"); + QTest::addRow("wrong-CA-wrong-subject") << QLatin1String("ss1.crt") << QLatin1String("ss1-private.key") + << QLatin1String("ss1.crt"); +} + +void tst_QOcsp::wrongCertificateInResponse() +{ + QFETCH(const QLatin1String, respChainName); + QFETCH(const QLatin1String, respKeyName); + QFETCH(const QLatin1String, wrongChainName); + // In this test, the server will send a valid response (correctly signed + // by a trusted key/cert) but for a wrong certificate (not the one the + // server presented to the client in the server's 'Certificate' message). + const QSslError::SslError expectedError = QSslError::OcspResponseCertIdUnknown; + + QDECLARE_CHAIN(subjectChain, "infbobchain.crt"); + QDECLARE_PRIVATE_KEY(subjectKey, "infbob.key"); + QDECLARE_CHAIN(responderChain, respChainName); + QDECLARE_PRIVATE_KEY(responderKey, respKeyName); + + QDECLARE_CHAIN(wrongChain, wrongChainName); + + OcspServer server(subjectToChain(subjectChain), subjectKey); + const QByteArray wrongResponse(goodResponse(wrongChain, responderChain, responderKey)); + QVERIFY(wrongResponse.size()); + server.configureResponse(wrongResponse); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, issuerToChain(subjectChain), server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY(!clientSocket.isEncrypted()); + QVERIFY(containsError(clientSocket.sslErrors(), expectedError)); +} + +void tst_QOcsp::untrustedResponder() +{ + const QSslError::SslError expectedError = QSslError::OcspResponseCannotBeTrusted; + + QDECLARE_CHAIN(subjectChain, "infbobchain.crt"); + QDECLARE_PRIVATE_KEY(subjectKey, "infbob.key"); + QDECLARE_CHAIN(responderChain, "ca1.crt"); + QDECLARE_PRIVATE_KEY(responderKey, "ca1.key"); + + OcspServer server(subjectChain, subjectKey); + const QByteArray response(goodResponse(subjectToChain(subjectChain), responderChain, responderKey)); + QVERIFY(response.size()); + server.configureResponse(response); + QVERIFY(server.listen()); + connect(&server, &OcspServer::internalServerError, &loop, exitLoopSlot); + + QSslSocket clientSocket; + setupOcspClient(clientSocket, {}, server.peerVerifyName()); + clientSocket.connectToHostEncrypted(server.hostName(), server.serverPort()); + loop.enterLoopMSecs(handshakeTimeoutMS); + + QVERIFY(!clientSocket.isEncrypted()); + QVERIFY(containsError(clientSocket.sslErrors(), expectedError)); +} + +void tst_QOcsp::setupOcspClient(QSslSocket &clientSocket, const CertificateChain &caCerts, const QString &name) +{ + QSslConfiguration clientConfig = QSslConfiguration::defaultConfiguration(); + clientConfig.setOcspStaplingEnabled(true); + + if (caCerts.size()) { + auto roots = clientConfig.caCertificates(); + roots.append(caCerts); + clientConfig.setCaCertificates(roots); + } + + clientSocket.setSslConfiguration(clientConfig); + clientSocket.setPeerVerifyName(name); + + connect(&clientSocket, socketErrorSignal, &loop, exitLoopSlot); + connect(&clientSocket, tlsErrorsSignal, &loop, exitLoopSlot); + connect(&clientSocket, &QSslSocket::encrypted, &loop, exitLoopSlot); +} + +bool tst_QOcsp::containsOcspErrors(const QList<QSslError> &errorsFound) const +{ + for (auto code : ocspErrorCodes) { + if (containsError(errorsFound, code)) + return true; + } + return false; +} + +bool tst_QOcsp::containsError(const QList<QSslError> &errors, QSslError::SslError code) +{ + const auto it = std::find_if(errors.begin(), errors.end(), + [&code](const QSslError &other){return other.error() == code;}); + return it != errors.end(); +} + +QByteArray tst_QOcsp::goodResponse(const CertificateChain &subject, const CertificateChain &responder, + const QSslKey &privateKey, long beforeNow, long afterNow) +{ + const OcspResponder builder(OcspTimeStamp(beforeNow, afterNow), subject, responder, privateKey); + return builder.buildResponse(OCSP_RESPONSE_STATUS_SUCCESSFUL, V_OCSP_CERTSTATUS_GOOD); +} + +bool tst_QOcsp::loadPrivateKey(const QString &keyFileName, QSslKey &key) +{ + QFile keyFile(certDirPath + keyFileName); + if (!keyFile.open(QIODevice::ReadOnly)) + return false; + key = QSslKey(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey); + return !key.isNull(); +} + +CertificateChain tst_QOcsp::issuerToChain(const CertificateChain &chain) +{ + // Here we presume that, if the chain isn't a single self-signed certificate, its second + // entry is the issuer. + const int length = chain.size(); + Q_ASSERT(length > 0); + return CertificateChain() << chain[length > 1 ? 1 : 0]; +} + +CertificateChain tst_QOcsp::subjectToChain(const CertificateChain &chain) +{ + Q_ASSERT(chain.size()); + return CertificateChain() << chain[0]; +} + +QT_END_NAMESPACE + +QTEST_MAIN(tst_QOcsp) + +#include "tst_qocsp.moc" diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pri-1024.der b/tests/auto/network/ssl/qsslkey/keys/dh-pri-1024.der Binary files differnew file mode 100644 index 0000000000..687009e087 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pri-1024.der diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pri-1024.pem b/tests/auto/network/ssl/qsslkey/keys/dh-pri-1024.pem new file mode 100644 index 0000000000..233e0dfb37 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pri-1024.pem @@ -0,0 +1,9 @@ +-----BEGIN PRIVATE KEY----- +MIIBIQIBADCBlQYJKoZIhvcNAQMBMIGHAoGBAIlk2YX0TJzfQ18ZzZroQoE5Nyjt +bWxWRxBriG/c+JWhBwttVDb6lzLN+GVJxXVPfc6JJmDORVRxdxAlMqu++2Vqpsnl +/H8xIXsxjuTcTjq8sXagGRa0LfeggkUD64tEhO4iZ8Q2TIdb3OHkAF0Sn+06b/0e +iIz323Kywq0CsspTAgECBIGDAoGAQCo39UHP4s2ZVH4nOmWgNlb4JsHPX4EzqDBr +ig46hvMLAFrILYnsCbqqD/+GNAUl1PV/nfEQoAk/HvtACqLFLG5/3jK2w6dVHGEo +JnVOGz9vZpWUx+SCslHJRFaeE+6AAbbvrTr0lci29Ta4IesHlamRsj+ZaUrVX6k/ +/9OTGAo= +-----END PRIVATE KEY----- diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pri-2048.der b/tests/auto/network/ssl/qsslkey/keys/dh-pri-2048.der Binary files differnew file mode 100644 index 0000000000..e193f25f07 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pri-2048.der diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pri-2048.pem b/tests/auto/network/ssl/qsslkey/keys/dh-pri-2048.pem new file mode 100644 index 0000000000..32299b2b6c --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pri-2048.pem @@ -0,0 +1,14 @@ +-----BEGIN PRIVATE KEY----- +MIICJgIBADCCARcGCSqGSIb3DQEDATCCAQgCggEBAJsiReJxBjkC7Hy99AJATusq +YsNQHhjoeTLPeHhsBuLtJK18Krk736V09efX6qeAEmvgMQbvbHqtrOaY3q6dut6C +UTGVW+oVg3d/Y8qakkanvEnIlliaTIyWIz0JMjO2prC6AuU/QEzZcQVUS6bxyn3D +iYFxCE6+7cJJpEH9HVbcrl+J6Ch6ax5rQGUyxpSMkmItLJx92upRxOnaxJMHR+ZF +OSdDPfrkINpEzahnhteLszddyLasnE0or6ZnXYLvKsT1Uu6QwDc4EO1FJHScoeep +zsK/VRcXzMpj/1Rl+F9E/AikCqHRrnvISt25wrK0Mwy854P2T7dJlBNewc6vE6MC +AQIEggEEAoIBAGIctO30MoZ9DiuKbOBpqM9rl2bNH/I46GGcfEiSsO/zOw2V9WFC +MxkjF0I1ilDfPY+Ag3bLB2n89DPcfXliYH9MFolehPTc1fWplhX3+ImdC6y95uXO +FV5xtcEQCbPktnUtkUdcAT5831p9lu1QJo+DzMPrQa7axMLj8heBAi4VqAi+8Q31 +dpGKuhCUlgs+pLENx1o0QY2kui6Z5uR0YhmA547lwBWA4XEv5OV9ExmxytiatvOv +PZKT1ID76LrL9bnnZvOEGczWLQvJ9VaaZSpoP+2QisRANWW4w57d+PIR1WR/FTSH +F6xocElUoTzuiSPzRz60aw/KkisImBBKERQ= +-----END PRIVATE KEY----- diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pri-512.der b/tests/auto/network/ssl/qsslkey/keys/dh-pri-512.der Binary files differnew file mode 100644 index 0000000000..42ddbaaae2 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pri-512.der diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pri-512.pem b/tests/auto/network/ssl/qsslkey/keys/dh-pri-512.pem new file mode 100644 index 0000000000..d2c3170b16 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pri-512.pem @@ -0,0 +1,6 @@ +-----BEGIN PRIVATE KEY----- +MIGcAgEAMFMGCSqGSIb3DQEDATBGAkEAvXx0QxJvIGA2ig8Je55R2rmeO4Ta2Esj +ANLuyVIFRbtuLFsdhU+amUc8bs9RUQmkUNzS92jkpAfqtCv+mQ06EwIBAgRCAkBJ +rDM0BTevOPIHpJzMtSQhw3e7Dr38HUfTn8zF3uYi1RCxjkTUukmzRLPTf0aqPgpd +8dSldjG/11aZORl8/mXO +-----END PRIVATE KEY----- diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pub-1024.der b/tests/auto/network/ssl/qsslkey/keys/dh-pub-1024.der Binary files differnew file mode 100644 index 0000000000..2805a67633 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pub-1024.der diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pub-1024.pem b/tests/auto/network/ssl/qsslkey/keys/dh-pub-1024.pem new file mode 100644 index 0000000000..da4e327ac9 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pub-1024.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBHzCBlQYJKoZIhvcNAQMBMIGHAoGBAIlk2YX0TJzfQ18ZzZroQoE5NyjtbWxW +RxBriG/c+JWhBwttVDb6lzLN+GVJxXVPfc6JJmDORVRxdxAlMqu++2Vqpsnl/H8x +IXsxjuTcTjq8sXagGRa0LfeggkUD64tEhO4iZ8Q2TIdb3OHkAF0Sn+06b/0eiIz3 +23Kywq0CsspTAgECA4GEAAKBgA8pxU1sMDvRWKpvJKNs3jNhZPQWFf4Tszu/cMcb +1qAQ/q0DRb41VvsUoMaCfef/plZleV4MG26owb574AJeC86wX5MbRDTPS4CzAn+I +an92AZl3vlYRQ2sSo3ktkyhw6LV1iewi08Ky7J4rqvG0Oo335QGEZlK1OgwBsyh0 +FKLe +-----END PUBLIC KEY----- diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pub-2048.der b/tests/auto/network/ssl/qsslkey/keys/dh-pub-2048.der Binary files differnew file mode 100644 index 0000000000..9e749d8a41 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pub-2048.der diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pub-2048.pem b/tests/auto/network/ssl/qsslkey/keys/dh-pub-2048.pem new file mode 100644 index 0000000000..f751157c87 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pub-2048.pem @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICJDCCARcGCSqGSIb3DQEDATCCAQgCggEBAJsiReJxBjkC7Hy99AJATusqYsNQ +HhjoeTLPeHhsBuLtJK18Krk736V09efX6qeAEmvgMQbvbHqtrOaY3q6dut6CUTGV +W+oVg3d/Y8qakkanvEnIlliaTIyWIz0JMjO2prC6AuU/QEzZcQVUS6bxyn3DiYFx +CE6+7cJJpEH9HVbcrl+J6Ch6ax5rQGUyxpSMkmItLJx92upRxOnaxJMHR+ZFOSdD +PfrkINpEzahnhteLszddyLasnE0or6ZnXYLvKsT1Uu6QwDc4EO1FJHScoeepzsK/ +VRcXzMpj/1Rl+F9E/AikCqHRrnvISt25wrK0Mwy854P2T7dJlBNewc6vE6MCAQID +ggEFAAKCAQAUeWRuqjl7F84USogxJOM1M4y8yKtBYY2KLs5iIVhzV4UZ+9+cMNZA +otLXJ/e8BH0diR0yk7tjxD6hjjqd+nyafIkJGPElDMnTbRPHg5zZYMmI5L/efdSm +OPbM7QsodrYH5aoF4c7hjMb/cttYVG2Yupsy4tfORuDbwL70upqOo6rkVq55eOGS +6pseEume/SD+7e3xIPJTkrMMzBFHG6H7bVHikT4O7yWV1iVzElj919yi+4Zy6TK8 +0hG6l31D5bsJpOduhHYZtN1yQpw+sGT6Yiepkjgt+1YkGFiiRs5vDl4DHeYHyAhL +oH9uKcm3q4lhaOeT5ml765g87qQD6+vr +-----END PUBLIC KEY----- diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pub-512.der b/tests/auto/network/ssl/qsslkey/keys/dh-pub-512.der Binary files differnew file mode 100644 index 0000000000..8a75babb6d --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pub-512.der diff --git a/tests/auto/network/ssl/qsslkey/keys/dh-pub-512.pem b/tests/auto/network/ssl/qsslkey/keys/dh-pub-512.pem new file mode 100644 index 0000000000..1f4e5c9a47 --- /dev/null +++ b/tests/auto/network/ssl/qsslkey/keys/dh-pub-512.pem @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGaMFMGCSqGSIb3DQEDATBGAkEAvXx0QxJvIGA2ig8Je55R2rmeO4Ta2EsjANLu +yVIFRbtuLFsdhU+amUc8bs9RUQmkUNzS92jkpAfqtCv+mQ06EwIBAgNDAAJARGBh +9FmRRZZAxBtXZmS8wIgDwWvjB63GQ+E1pDLtZPztvPQ2eqUjTgSuGKV5cDankAV1 +Pkj/IA0Xl+SuFhLLew== +-----END PUBLIC KEY----- diff --git a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh index 6210b42ab4..0106953bff 100755 --- a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh +++ b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh @@ -88,6 +88,27 @@ do openssl ec -in ec-pri-$size-$curve.pem -pubout -out ec-pub-$size-$curve.der -outform DER done +#--- DH ---------------------------------------------------------------------------- +for size in 512 1024 2048 +do + echo -e "\ngenerating DH parameters to PEM file ..." + openssl dhparam -out dhpar-$size.pem $size + + echo -e "\ngenerating DH private key to PEM file ..." + openssl genpkey -paramfile dhpar-$size.pem -out dh-pri-$size.pem + + /bin/rm dhpar-$size.pem + + echo -e "\ngenerating DH private key to DER file ..." + openssl pkey -in dh-pri-$size.pem -out dh-pri-$size.der -outform DER + + echo -e "\ngenerating DH public key to PEM file ..." + openssl pkey -in dh-pri-$size.pem -pubout -out dh-pub-$size.pem + + echo -e "\ngenerating DH public key to DER file ..." + openssl pkey -in dh-pri-$size.pem -pubout -out dh-pub-$size.der -outform DER +done + #--- PKCS#8 ------------------------------------------------------------------------ # Note: We'll just grab some of the keys generated earlier and convert those # https://www.openssl.org/docs/manmaster/man1/pkcs8.html#PKCS-5-v1.5-and-PKCS-12-algorithms diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp index ddfe52c5e4..70001f7375 100644 --- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp +++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp @@ -63,7 +63,7 @@ class tst_QSslKey : public QObject QList<KeyInfo> keyInfoList; - void createPlainTestRows(bool filter = false, QSsl::EncodingFormat format = QSsl::EncodingFormat::Pem); + void createPlainTestRows(bool pemOnly = false); public slots: void initTestCase(); @@ -111,13 +111,14 @@ void tst_QSslKey::initTestCase() QDir dir(testDataDir + "keys"); const QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Readable); - QRegExp rx(QLatin1String("^(rsa|dsa|ec)-(pub|pri)-(\\d+)-?[\\w-]*\\.(pem|der)$")); + QRegExp rx(QLatin1String("^(rsa|dsa|dh|ec)-(pub|pri)-(\\d+)-?[\\w-]*\\.(pem|der)$")); for (const QFileInfo &fileInfo : fileInfoList) { if (rx.indexIn(fileInfo.fileName()) >= 0) { keyInfoList << KeyInfo( fileInfo, rx.cap(1) == QLatin1String("rsa") ? QSsl::Rsa : - (rx.cap(1) == QLatin1String("dsa") ? QSsl::Dsa : QSsl::Ec), + rx.cap(1) == QLatin1String("dsa") ? QSsl::Dsa : + rx.cap(1) == QLatin1String("dh") ? QSsl::Dh : QSsl::Ec, rx.cap(2) == QLatin1String("pub") ? QSsl::PublicKey : QSsl::PrivateKey, rx.cap(3).toInt(), rx.cap(4) == QLatin1String("pem") ? QSsl::Pem : QSsl::Der); @@ -154,7 +155,7 @@ Q_DECLARE_METATYPE(QSsl::KeyAlgorithm) Q_DECLARE_METATYPE(QSsl::KeyType) Q_DECLARE_METATYPE(QSsl::EncodingFormat) -void tst_QSslKey::createPlainTestRows(bool filter, QSsl::EncodingFormat format) +void tst_QSslKey::createPlainTestRows(bool pemOnly) { QTest::addColumn<QString>("absFilePath"); QTest::addColumn<QSsl::KeyAlgorithm>("algorithm"); @@ -162,7 +163,7 @@ void tst_QSslKey::createPlainTestRows(bool filter, QSsl::EncodingFormat format) QTest::addColumn<int>("length"); QTest::addColumn<QSsl::EncodingFormat>("format"); foreach (KeyInfo keyInfo, keyInfoList) { - if (filter && keyInfo.format != format) + if (pemOnly && keyInfo.format != QSsl::EncodingFormat::Pem) continue; #ifdef Q_OS_WINRT if (keyInfo.fileInfo.fileName().contains("RC2-64")) diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index bca142e245..3e55278b4f 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1389,10 +1389,10 @@ void tst_QSslSocket::protocolServerSide() if (server.socket) QVERIFY(server.socket->error() == QAbstractSocket::UnknownSocketError); - QCOMPARE(int(client.state()), int(expectedState)); + QCOMPARE(client.state(), expectedState); } else if (server.socket->error() != QAbstractSocket::UnknownSocketError) { QVERIFY(client.error() == QAbstractSocket::UnknownSocketError); - QCOMPARE(int(server.socket->state()), int(expectedState)); + QCOMPARE(server.socket->state(), expectedState); } QCOMPARE(client.isEncrypted(), works); @@ -3316,10 +3316,10 @@ void tst_QSslSocket::verifyClientCertificate_data() validCerts += QSslCertificate::fromPath(testDataDir + "certs/bogus-ca.crt"); QCOMPARE(validCerts.size(), 2); - QTest::newRow("ValidClientCert:AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << validCerts << validKey << true; - QTest::newRow("ValidClientCert:QueryPeer") << QSslSocket::QueryPeer << validCerts << validKey << true; - QTest::newRow("ValidClientCert:VerifyNone") << QSslSocket::VerifyNone << validCerts << validKey << true; - QTest::newRow("ValidClientCert:VerifyPeer") << QSslSocket::VerifyPeer << validCerts << validKey << true; + QTest::newRow("ValidChainedClientCert:AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << validCerts << validKey << true; + QTest::newRow("ValidChainedClientCert:QueryPeer") << QSslSocket::QueryPeer << validCerts << validKey << true; + QTest::newRow("ValidChainedClientCert:VerifyNone") << QSslSocket::VerifyNone << validCerts << validKey << true; + QTest::newRow("ValidChainedClientCert:VerifyPeer") << QSslSocket::VerifyPeer << validCerts << validKey << true; } void tst_QSslSocket::verifyClientCertificate() @@ -3375,7 +3375,7 @@ void tst_QSslSocket::verifyClientCertificate() // check server socket QVERIFY(server.socket); - QCOMPARE(int(server.socket->state()), int(expectedState)); + QCOMPARE(server.socket->state(), expectedState); QCOMPARE(server.socket->isEncrypted(), works); if (peerVerifyMode == QSslSocket::VerifyNone || clientCerts.isEmpty()) { @@ -3387,7 +3387,7 @@ void tst_QSslSocket::verifyClientCertificate() } // check client socket - QCOMPARE(int(client.state()), int(expectedState)); + QCOMPARE(client.state(), expectedState); QCOMPARE(client.isEncrypted(), works); } diff --git a/tests/auto/network/ssl/ssl.pro b/tests/auto/network/ssl/ssl.pro index e89443ef4e..169e9bce83 100644 --- a/tests/auto/network/ssl/ssl.pro +++ b/tests/auto/network/ssl/ssl.pro @@ -21,6 +21,8 @@ qtConfig(ssl) { qdtlscookie \ qdtls } + + qtConfig(ocsp): SUBDIRS += qocsp } } diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 8cf43e243b..bdfa957083 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -199,6 +199,9 @@ private slots: void sqlite_openError(); + void sqlite_check_json1_data() { generic_data("QSQLITE"); } + void sqlite_check_json1(); + private: void createTestTables(QSqlDatabase db); void dropTestTables(QSqlDatabase db); @@ -2350,6 +2353,30 @@ void tst_QSqlDatabase::sqlite_openError() QCOMPARE(error.databaseText(), "unable to open database file"); } +void tst_QSqlDatabase::sqlite_check_json1() +{ + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db); + if (dbType != QSqlDriver::SQLite) + QSKIP("SQLite3 specific test"); + + QSqlQuery q(db); + const QString json1("{\"id\":1}"); + const QString tableName(qTableName("sqlite_check_json1", __FILE__, db)); + tst_Databases::safeDropTable(db, tableName); + QVERIFY_SQL(q, exec(QString("CREATE TABLE %1(text TEXT)").arg(tableName))); + QVERIFY_SQL(q, exec(QString("INSERT INTO %1 VALUES(json('%2'))").arg(tableName, json1))); + QVERIFY_SQL(q, prepare(QString("INSERT INTO %1 VALUES(?)").arg(tableName))); + q.addBindValue("json('{\"id\":2}')"); + QVERIFY_SQL(q, prepare(QString("SELECT * from %1 WHERE text = json('%2')").arg(tableName, json1))); + QVERIFY_SQL(q, exec()); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toString(), json1); + QFAIL_SQL(q, next()); +} + void tst_QSqlDatabase::cloneDatabase() { QFETCH(QString, dbName); diff --git a/tests/auto/testlib/outformat/outformat.pro b/tests/auto/testlib/outformat/outformat.pro new file mode 100644 index 0000000000..ea02f3167f --- /dev/null +++ b/tests/auto/testlib/outformat/outformat.pro @@ -0,0 +1,7 @@ +CONFIG += testcase +QT = core testlib + +SOURCES += tst_outformat.cpp +TARGET = outformat + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/outformat/tst_outformat.cpp b/tests/auto/testlib/outformat/tst_outformat.cpp new file mode 100644 index 0000000000..5d131159a9 --- /dev/null +++ b/tests/auto/testlib/outformat/tst_outformat.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> + +class tst_OutFormat : public QObject +{ + Q_OBJECT +private slots: + void toHex_data() const; + void toHex() const; + // other formats of interest ? +}; + +void tst_OutFormat::toHex_data() const +{ + QTest::addColumn<QByteArray>("raw"); + QTest::addColumn<QByteArray>("hex"); + + QTest::newRow("empty") << QByteArray("") << QByteArray(""); + QTest::newRow("long") + << QByteArray("Truncates in ellipsis when more than fifty characters long") + << QByteArray("54 72 75 6E 63 61 74 65 73 20 69 6E 20 65 6C 6C " + "69 70 73 69 73 20 77 68 65 6E 20 6D 6F 72 65 20 " + "74 68 61 6E 20 66 69 66 74 79 20 63 68 61 72 61 " + "63 74 ..."); + QTest::newRow("spaces") + << QByteArray(" \t\n\v\f\r") << QByteArray("20 09 0A 0B 0C 0D"); + QTest::newRow("ASCII-escapes") + << QByteArray("\a\b\\\"'\177") << QByteArray("07 08 5C 22 27 7F"); + // These are the ISO Latin-15 , pound, Euro, ..., y-umlaut + QTest::newRow("8-bit-sampler") + << QByteArray("\240\243\244\261\327\360\377") << QByteArray("A0 A3 A4 B1 D7 F0 FF"); +} + +void tst_OutFormat::toHex() const +{ + QFETCH(QByteArray, raw); + QFETCH(QByteArray, hex); + QScopedArrayPointer<char> repr(QTest::toHexRepresentation(raw.constData(), raw.size())); + QCOMPARE(repr.data(), hex); +} + +QTEST_APPLESS_MAIN(tst_OutFormat) + +#include "tst_outformat.moc" diff --git a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp index 0593ae74bf..60aa350145 100644 --- a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp +++ b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp @@ -79,9 +79,9 @@ void tst_QAbstractItemModelTester::treeWidgetModel() root->removeChild(remove); QTreeWidgetItem *parent = new QTreeWidgetItem(&widget, QStringList("parent")); new QTreeWidgetItem(parent, QStringList("child")); - widget.setItemHidden(parent, true); + parent->setHidden(true); - widget.sortByColumn(0); + widget.sortByColumn(0, Qt::AscendingOrder); } void tst_QAbstractItemModelTester::standardItemModel() diff --git a/tests/auto/testlib/selftests/blacklisted/BLACKLIST b/tests/auto/testlib/selftests/blacklisted/BLACKLIST index 36b7699cbd..a923c11416 100644 --- a/tests/auto/testlib/selftests/blacklisted/BLACKLIST +++ b/tests/auto/testlib/selftests/blacklisted/BLACKLIST @@ -1,12 +1,20 @@ -[pass] +obscure # no such platform; is ignored * + +[pass] +!* + [skip] * + [fail] * -[xpass] -* + [xfail] * + +[xpass] +* + [messages] * diff --git a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp index 8578752e22..90520385ec 100644 --- a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp +++ b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp @@ -45,7 +45,8 @@ private slots: void messages(); }; -// All the tests below have been blacklisted in blacklisted/BLACKLIST +// All the tests below except pass() have been blacklisted in blacklisted/BLACKLIST +// Contrast with ../silent/, for the same tests without blacklisting but with -silent void tst_Blacklisted::pass() { @@ -64,7 +65,7 @@ void tst_Blacklisted::fail() void tst_Blacklisted::xfail() { - QEXPECT_FAIL("", "This test should XFAIL then BFAIL", Abort); + QEXPECT_FAIL("", "This test should XFAIL then BPASS", Abort); QVERIFY(false); } diff --git a/tests/auto/testlib/selftests/expected_blacklisted.lightxml b/tests/auto/testlib/selftests/expected_blacklisted.lightxml index 4193628e7c..98d7a38ca9 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.lightxml +++ b/tests/auto/testlib/selftests/expected_blacklisted.lightxml @@ -25,7 +25,7 @@ </TestFunction> <TestFunction name="xfail"> <Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0"> - <Description><![CDATA[This test should XFAIL then BFAIL]]></Description> + <Description><![CDATA[This test should XFAIL then BPASS]]></Description> </Incident> <Incident type="bpass" file="" line="0" /> <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_blacklisted.tap b/tests/auto/testlib/selftests/expected_blacklisted.tap new file mode 100644 index 0000000000..f26155ded0 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_blacklisted.tap @@ -0,0 +1,43 @@ +TAP version 13 +# tst_Blacklisted +ok 1 - initTestCase() +ok 2 - pass() # TODO +ok 3 - skip() # SKIP This test should SKIP +not ok 4 - fail() # TODO 'false' returned FALSE. (This test should BFAIL) + --- + type: QVERIFY + message: This test should BFAIL + wanted: true (false) + found: false (false) + expected: true (false) + actual: false (false) + at: tst_Blacklisted::fail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:63) + file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp + line: 63 + ... +not ok 5 - xfail() # TODO This test should XFAIL then BPASS + --- + at: tst_Blacklisted::xfail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:69) + file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp + line: 69 + ... +ok 5 - xfail() # TODO +ok 6 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS) +# This is a warning that should not appear in silent test output +# This is an internal testlib warning that should not appear in silent test output +# This is a debug message that should not appear in silent test output +# This is a critical message that should not appear in silent test output +# This is an info message that should not appear in silent test output +# This is an internal testlib info message that should not appear in silent test output +# This is a fatal error message that should still appear in silent test output +not ok 7 - messages() # TODO Received a fatal error. + --- + # Received a fatal error. + at: tst_Blacklisted::messages() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..7 +# tests 7 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_blacklisted.teamcity b/tests/auto/testlib/selftests/expected_blacklisted.teamcity index 8180a7ce76..df58208fb3 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.teamcity +++ b/tests/auto/testlib/selftests/expected_blacklisted.teamcity @@ -7,7 +7,7 @@ ##teamcity[testStarted name='fail()' flowId='tst_Blacklisted'] ##teamcity[testFinished name='fail()' flowId='tst_Blacklisted'] ##teamcity[testStarted name='xfail()' flowId='tst_Blacklisted'] -##teamcity[testStdOut name='xfail()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This test should XFAIL then BFAIL' flowId='tst_Blacklisted'] +##teamcity[testStdOut name='xfail()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This test should XFAIL then BPASS' flowId='tst_Blacklisted'] ##teamcity[testFinished name='xfail()' flowId='tst_Blacklisted'] ##teamcity[testStarted name='xpass()' flowId='tst_Blacklisted'] ##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)' flowId='tst_Blacklisted'] diff --git a/tests/auto/testlib/selftests/expected_blacklisted.txt b/tests/auto/testlib/selftests/expected_blacklisted.txt index 6fa2403b59..3cfe40eb12 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.txt +++ b/tests/auto/testlib/selftests/expected_blacklisted.txt @@ -6,7 +6,7 @@ SKIP : tst_Blacklisted::skip() This test should SKIP Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] BFAIL : tst_Blacklisted::fail() 'false' returned FALSE. (This test should BFAIL) Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] -XFAIL : tst_Blacklisted::xfail() This test should XFAIL then BFAIL +XFAIL : tst_Blacklisted::xfail() This test should XFAIL then BPASS Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)] BPASS : tst_Blacklisted::xfail() XPASS : tst_Blacklisted::xpass() 'true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS) diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xml b/tests/auto/testlib/selftests/expected_blacklisted.xml index 443bc6b199..f0387bae00 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.xml +++ b/tests/auto/testlib/selftests/expected_blacklisted.xml @@ -27,7 +27,7 @@ </TestFunction> <TestFunction name="xfail"> <Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0"> - <Description><![CDATA[This test should XFAIL then BFAIL]]></Description> + <Description><![CDATA[This test should XFAIL then BPASS]]></Description> </Incident> <Incident type="bpass" file="" line="0" /> <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xunitxml b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml index 2752bc18b4..e2d0cd009b 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.xunitxml +++ b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml @@ -12,7 +12,7 @@ </testcase> <testcase result="bfail" name="fail"/> <testcase result="xfail" name="xfail"> - <!-- message="This test should XFAIL then BFAIL" type="info" --> + <!-- message="This test should XFAIL then BPASS" type="info" --> </testcase> <testcase result="xpass" name="xpass"> <failure message="'true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)" result="xpass"/> @@ -28,7 +28,7 @@ </testcase> <system-err> <![CDATA[This test should SKIP]]> -<![CDATA[This test should XFAIL then BFAIL]]> +<![CDATA[This test should XFAIL then BPASS]]> <![CDATA[This is a warning that should not appear in silent test output]]> <![CDATA[This is an internal testlib warning that should not appear in silent test output]]> <![CDATA[This is a debug message that should not appear in silent test output]]> diff --git a/tests/auto/testlib/selftests/expected_faildatatype.lightxml b/tests/auto/testlib/selftests/expected_faildatatype.lightxml new file mode 100644 index 0000000000..24992b78af --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.lightxml @@ -0,0 +1,22 @@ +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="value"> +<Message type="qdebug" file="" line="0"> + <Description><![CDATA[expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string']]></Description> +</Message> +<Message type="qfatal" file="" line="0"> + <Description><![CDATA[ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0]]></Description> +</Message> +<Incident type="fail" file="Unknown file" line="0"> + <Description><![CDATA[Received a fatal error.]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_faildatatype.tap b/tests/auto/testlib/selftests/expected_faildatatype.tap new file mode 100644 index 0000000000..684cea4126 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.tap @@ -0,0 +1,16 @@ +TAP version 13 +# tst_FailDataType +ok 1 - initTestCase() +# expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string' +# ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0 +not ok 2 - value() + --- + # Received a fatal error. + at: tst_FailDataType::value() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..2 +# tests 2 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_faildatatype.teamcity b/tests/auto/testlib/selftests/expected_faildatatype.teamcity new file mode 100644 index 0000000000..82731ae09e --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.teamcity @@ -0,0 +1,8 @@ +##teamcity[testSuiteStarted name='tst_FailDataType' flowId='tst_FailDataType'] +##teamcity[testStarted name='initTestCase()' flowId='tst_FailDataType'] +##teamcity[testFinished name='initTestCase()' flowId='tst_FailDataType'] +##teamcity[testStarted name='value()' flowId='tst_FailDataType'] +##teamcity[testFailed name='value()' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_FailDataType'] +##teamcity[testStdOut name='value()' out='QDEBUG: expected data of type |'QString|', got |'bool|' for element 0 of data with tag |'bool-as-string|'|nQFATAL: ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0' flowId='tst_FailDataType'] +##teamcity[testFinished name='value()' flowId='tst_FailDataType'] +##teamcity[testSuiteFinished name='tst_FailDataType' flowId='tst_FailDataType'] diff --git a/tests/auto/testlib/selftests/expected_faildatatype.txt b/tests/auto/testlib/selftests/expected_faildatatype.txt new file mode 100644 index 0000000000..4cfe3b7654 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.txt @@ -0,0 +1,9 @@ +********* Start testing of tst_FailDataType ********* +Config: Using QtTest library +PASS : tst_FailDataType::initTestCase() +QDEBUG : tst_FailDataType::value() expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string' +QFATAL : tst_FailDataType::value() ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0 +FAIL! : tst_FailDataType::value() Received a fatal error. + Loc: [Unknown file(0)] +Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_FailDataType ********* diff --git a/tests/auto/testlib/selftests/expected_faildatatype.xml b/tests/auto/testlib/selftests/expected_faildatatype.xml new file mode 100644 index 0000000000..8812bfab71 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<TestCase name="tst_FailDataType"> +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="value"> +<Message type="qdebug" file="" line="0"> + <Description><![CDATA[expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string']]></Description> +</Message> +<Message type="qfatal" file="" line="0"> + <Description><![CDATA[ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0]]></Description> +</Message> +<Incident type="fail" file="Unknown file" line="0"> + <Description><![CDATA[Received a fatal error.]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<Duration msecs="0"/> +</TestCase> diff --git a/tests/auto/testlib/selftests/expected_faildatatype.xunitxml b/tests/auto/testlib/selftests/expected_faildatatype.xunitxml new file mode 100644 index 0000000000..fcc0db3892 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_faildatatype.xunitxml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<testsuite errors="2" failures="1" tests="2" name="tst_FailDataType"> + <properties> + <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> + <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> + </properties> + <testcase result="pass" name="initTestCase"/> + <testcase result="fail" name="value"> + <!-- message="expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string'" type="qdebug" --> + <!-- message="ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 92" type="qfatal" --> + <failure message="Received a fatal error." result="fail"/> + </testcase> + <system-err> +<![CDATA[expected data of type 'QString', got 'bool' for element 0 of data with tag 'bool-as-string']]> +<![CDATA[ASSERT: "false" in file qtbase/src/testlib/qtestdata.cpp, line 0]]> + </system-err> +</testsuite> diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.lightxml b/tests/auto/testlib/selftests/expected_failfetchtype.lightxml new file mode 100644 index 0000000000..f7c84a1876 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.lightxml @@ -0,0 +1,21 @@ +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="fetch"> +<Message type="qfatal" file="" line="0"> + <DataTag><![CDATA[bool]]></DataTag> + <Description><![CDATA[Requested type 'QString' does not match available type 'bool'.]]></Description> +</Message> +<Incident type="fail" file="Unknown file" line="0"> + <DataTag><![CDATA[bool]]></DataTag> + <Description><![CDATA[Received a fatal error.]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.tap b/tests/auto/testlib/selftests/expected_failfetchtype.tap new file mode 100644 index 0000000000..94c3b6e1b2 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.tap @@ -0,0 +1,15 @@ +TAP version 13 +# tst_FailFetchType +ok 1 - initTestCase() +# Requested type 'QString' does not match available type 'bool'. +not ok 2 - fetch(bool) + --- + # Received a fatal error. + at: tst_FailFetchType::fetch() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..2 +# tests 2 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.teamcity b/tests/auto/testlib/selftests/expected_failfetchtype.teamcity new file mode 100644 index 0000000000..91cf0c6ae8 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.teamcity @@ -0,0 +1,8 @@ +##teamcity[testSuiteStarted name='tst_FailFetchType' flowId='tst_FailFetchType'] +##teamcity[testStarted name='initTestCase()' flowId='tst_FailFetchType'] +##teamcity[testFinished name='initTestCase()' flowId='tst_FailFetchType'] +##teamcity[testStarted name='fetch(bool)' flowId='tst_FailFetchType'] +##teamcity[testFailed name='fetch(bool)' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_FailFetchType'] +##teamcity[testStdOut name='fetch(bool)' out='QFATAL: Requested type |'QString|' does not match available type |'bool|'.' flowId='tst_FailFetchType'] +##teamcity[testFinished name='fetch(bool)' flowId='tst_FailFetchType'] +##teamcity[testSuiteFinished name='tst_FailFetchType' flowId='tst_FailFetchType'] diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.txt b/tests/auto/testlib/selftests/expected_failfetchtype.txt new file mode 100644 index 0000000000..d12cf0dc7d --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.txt @@ -0,0 +1,8 @@ +********* Start testing of tst_FailFetchType ********* +Config: Using QtTest library +PASS : tst_FailFetchType::initTestCase() +QFATAL : tst_FailFetchType::fetch(bool) Requested type 'QString' does not match available type 'bool'. +FAIL! : tst_FailFetchType::fetch(bool) Received a fatal error. + Loc: [Unknown file(0)] +Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_FailFetchType ********* diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.xml b/tests/auto/testlib/selftests/expected_failfetchtype.xml new file mode 100644 index 0000000000..a349baa710 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<TestCase name="tst_FailFetchType"> +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="fetch"> +<Message type="qfatal" file="" line="0"> + <DataTag><![CDATA[bool]]></DataTag> + <Description><![CDATA[Requested type 'QString' does not match available type 'bool'.]]></Description> +</Message> +<Incident type="fail" file="Unknown file" line="0"> + <DataTag><![CDATA[bool]]></DataTag> + <Description><![CDATA[Received a fatal error.]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<Duration msecs="0"/> +</TestCase> diff --git a/tests/auto/testlib/selftests/expected_failfetchtype.xunitxml b/tests/auto/testlib/selftests/expected_failfetchtype.xunitxml new file mode 100644 index 0000000000..a54a37a913 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failfetchtype.xunitxml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<testsuite errors="1" failures="1" tests="2" name="tst_FailFetchType"> + <properties> + <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> + <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> + </properties> + <testcase result="pass" name="initTestCase"/> + <testcase result="fail" name="fetch"> + <!-- tag="bool" message="Requested type 'QString' does not match available type 'bool'." type="qfatal" --> + <failure tag="bool" message="Received a fatal error." result="fail"/> + </testcase> + <system-err> +<![CDATA[Requested type 'QString' does not match available type 'bool'.]]> + </system-err> +</testsuite> diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml index 0dbc5dd8c8..37ccbfc2c5 100644 --- a/tests/auto/testlib/selftests/expected_float.lightxml +++ b/tests/auto/testlib/selftests/expected_float.lightxml @@ -34,6 +34,33 @@ </Incident> <Duration msecs="0"/> </TestFunction> +<TestFunction name="float16Comparisons"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[should SUCCEED 1]]></DataTag> +</Incident> +<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> + <DataTag><![CDATA[should FAIL 1]]></DataTag> + <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): 3]]></Description> +</Incident> +<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> + <DataTag><![CDATA[should FAIL 2]]></DataTag> + <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 0.0001 + Expected (operandRight): 0.0003]]></Description> +</Incident> +<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> + <DataTag><![CDATA[should FAIL 3]]></DataTag> + <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 98 + Expected (operandRight): 99]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[should SUCCEED 2]]></DataTag> +</Incident> + <Duration msecs="0"/> +</TestFunction> <TestFunction name="compareFloatTests"> <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> <DataTag><![CDATA[1e0]]></DataTag> diff --git a/tests/auto/testlib/selftests/expected_float.tap b/tests/auto/testlib/selftests/expected_float.tap index fae2dc9796..158eff1470 100644 --- a/tests/auto/testlib/selftests/expected_float.tap +++ b/tests/auto/testlib/selftests/expected_float.tap @@ -10,9 +10,9 @@ not ok 3 - floatComparisons(should FAIL 1) found: 1 (operandLeft) expected: 3 (operandRight) actual: 1 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 51 ... not ok 4 - floatComparisons(should FAIL 2) --- @@ -22,9 +22,9 @@ not ok 4 - floatComparisons(should FAIL 2) found: 1e-07 (operandLeft) expected: 3e-07 (operandRight) actual: 1e-07 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 51 ... not ok 5 - floatComparisons(should FAIL 3) --- @@ -34,12 +34,50 @@ not ok 5 - floatComparisons(should FAIL 3) found: 99998 (operandLeft) expected: 99999 (operandRight) actual: 99998 (operandLeft) - at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48) + at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:51) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 48 + line: 51 ... ok 6 - floatComparisons(should SUCCEED 2) -not ok 7 - compareFloatTests(1e0) +ok 7 - float16Comparisons(should SUCCEED 1) +not ok 8 - float16Comparisons(should FAIL 1) + --- + type: QCOMPARE + message: Compared qfloat16s are not the same (fuzzy compare) + wanted: 3 (operandRight) + found: 1 (operandLeft) + expected: 3 (operandRight) + actual: 1 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:90) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 90 + ... +not ok 9 - float16Comparisons(should FAIL 2) + --- + type: QCOMPARE + message: Compared qfloat16s are not the same (fuzzy compare) + wanted: 0.0003 (operandRight) + found: 0.0001 (operandLeft) + expected: 0.0003 (operandRight) + actual: 0.0001 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:90) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 90 + ... +not ok 10 - float16Comparisons(should FAIL 3) + --- + type: QCOMPARE + message: Compared qfloat16s are not the same (fuzzy compare) + wanted: 99 (operandRight) + found: 98 (operandLeft) + expected: 99 (operandRight) + actual: 98 (operandLeft) + at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:90) + file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp + line: 90 + ... +ok 11 - float16Comparisons(should SUCCEED 2) +not ok 12 - compareFloatTests(1e0) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -47,11 +85,11 @@ not ok 7 - compareFloatTests(1e0) found: 1 (t1) expected: 3 (t3) actual: 1 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:135) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 135 ... -not ok 8 - compareFloatTests(1e-7) +not ok 13 - compareFloatTests(1e-7) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -59,11 +97,11 @@ not ok 8 - compareFloatTests(1e-7) found: 1e-07 (t1) expected: 3e-07 (t3) actual: 1e-07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:135) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 135 ... -not ok 9 - compareFloatTests(1e+7) +not ok 14 - compareFloatTests(1e+7) --- type: QCOMPARE message: Compared floats are not the same (fuzzy compare) @@ -71,12 +109,12 @@ not ok 9 - compareFloatTests(1e+7) found: 1e+07 (t1) expected: 3e+07 (t3) actual: 1e+07 (t1) - at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96) + at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:135) file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp - line: 96 + line: 135 ... -ok 10 - cleanupTestCase() -1..10 -# tests 10 -# pass 4 -# fail 6 +ok 15 - cleanupTestCase() +1..15 +# tests 15 +# pass 6 +# fail 9 diff --git a/tests/auto/testlib/selftests/expected_float.teamcity b/tests/auto/testlib/selftests/expected_float.teamcity index d5b81593d8..140dc7edf9 100644 --- a/tests/auto/testlib/selftests/expected_float.teamcity +++ b/tests/auto/testlib/selftests/expected_float.teamcity @@ -14,6 +14,19 @@ ##teamcity[testFinished name='floatComparisons(should FAIL 3)' flowId='tst_float'] ##teamcity[testStarted name='floatComparisons(should SUCCEED 2)' flowId='tst_float'] ##teamcity[testFinished name='floatComparisons(should SUCCEED 2)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should SUCCEED 1)' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should SUCCEED 1)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should FAIL 1)' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): 3' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should FAIL 1)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should FAIL 2)' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0.0001|n Expected (operandRight): 0.0003' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should FAIL 2)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should FAIL 3)' flowId='tst_float'] +##teamcity[testFailed name='float16Comparisons(should FAIL 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 98|n Expected (operandRight): 99' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should FAIL 3)' flowId='tst_float'] +##teamcity[testStarted name='float16Comparisons(should SUCCEED 2)' flowId='tst_float'] +##teamcity[testFinished name='float16Comparisons(should SUCCEED 2)' flowId='tst_float'] ##teamcity[testStarted name='compareFloatTests(1e0)' flowId='tst_float'] ##teamcity[testFailed name='compareFloatTests(1e0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1|n Expected (t3): 3' flowId='tst_float'] ##teamcity[testFinished name='compareFloatTests(1e0)' flowId='tst_float'] diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt index 8abea6a67e..4e3554758d 100644 --- a/tests/auto/testlib/selftests/expected_float.txt +++ b/tests/auto/testlib/selftests/expected_float.txt @@ -15,6 +15,20 @@ FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the Expected (operandRight): 99999 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::floatComparisons(should SUCCEED 2) +PASS : tst_float::float16Comparisons(should SUCCEED 1) +FAIL! : tst_float::float16Comparisons(should FAIL 1) Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): 3 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::float16Comparisons(should FAIL 2) Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 0.0001 + Expected (operandRight): 0.0003 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +FAIL! : tst_float::float16Comparisons(should FAIL 3) Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 98 + Expected (operandRight): 99 + Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] +PASS : tst_float::float16Comparisons(should SUCCEED 2) FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuzzy compare) Actual (t1): 1 Expected (t3): 3 @@ -28,5 +42,5 @@ FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fu Expected (t3): 3e+07 Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)] PASS : tst_float::cleanupTestCase() -Totals: 4 passed, 6 failed, 0 skipped, 0 blacklisted, 0ms +Totals: 6 passed, 9 failed, 0 skipped, 0 blacklisted, 0ms ********* Finished testing of tst_float ********* diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml index 096e1a5b54..1f17d48d1b 100644 --- a/tests/auto/testlib/selftests/expected_float.xml +++ b/tests/auto/testlib/selftests/expected_float.xml @@ -36,6 +36,33 @@ </Incident> <Duration msecs="0"/> </TestFunction> +<TestFunction name="float16Comparisons"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[should SUCCEED 1]]></DataTag> +</Incident> +<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> + <DataTag><![CDATA[should FAIL 1]]></DataTag> + <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): 3]]></Description> +</Incident> +<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> + <DataTag><![CDATA[should FAIL 2]]></DataTag> + <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 0.0001 + Expected (operandRight): 0.0003]]></Description> +</Incident> +<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> + <DataTag><![CDATA[should FAIL 3]]></DataTag> + <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 98 + Expected (operandRight): 99]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[should SUCCEED 2]]></DataTag> +</Incident> + <Duration msecs="0"/> +</TestFunction> <TestFunction name="compareFloatTests"> <Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0"> <DataTag><![CDATA[1e0]]></DataTag> diff --git a/tests/auto/testlib/selftests/expected_float.xunitxml b/tests/auto/testlib/selftests/expected_float.xunitxml index 5de14e8d9b..87f11ccba5 100644 --- a/tests/auto/testlib/selftests/expected_float.xunitxml +++ b/tests/auto/testlib/selftests/expected_float.xunitxml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="0" failures="6" tests="4" name="tst_float"> +<testsuite errors="0" failures="9" tests="5" name="tst_float"> <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> @@ -17,6 +17,17 @@ Actual (operandLeft) : 99998 Expected (operandRight): 99999" result="fail"/> </testcase> + <testcase result="fail" name="float16Comparisons"> + <failure tag="should FAIL 1" message="Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 1 + Expected (operandRight): 3" result="fail"/> + <failure tag="should FAIL 2" message="Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 0.0001 + Expected (operandRight): 0.0003" result="fail"/> + <failure tag="should FAIL 3" message="Compared qfloat16s are not the same (fuzzy compare) + Actual (operandLeft) : 98 + Expected (operandRight): 99" result="fail"/> + </testcase> <testcase result="fail" name="compareFloatTests"> <failure tag="1e0" message="Compared floats are not the same (fuzzy compare) Actual (t1): 1 diff --git a/tests/auto/testlib/selftests/expected_watchdog.lightxml b/tests/auto/testlib/selftests/expected_watchdog.lightxml new file mode 100644 index 0000000000..1070324f2a --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.lightxml @@ -0,0 +1,19 @@ +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="delay"> +<Message type="qfatal" file="" line="0"> + <Description><![CDATA[Test function timed out]]></Description> +</Message> +<Incident type="fail" file="Unknown file" line="0"> + <Description><![CDATA[Received a fatal error.]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_watchdog.tap b/tests/auto/testlib/selftests/expected_watchdog.tap new file mode 100644 index 0000000000..3d4890b67e --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.tap @@ -0,0 +1,15 @@ +TAP version 13 +# tst_Watchdog +ok 1 - initTestCase() +# Test function timed out +not ok 2 - delay() + --- + # Received a fatal error. + at: tst_Watchdog::delay() (Unknown file:0) + file: Unknown file + line: 0 + ... +1..2 +# tests 2 +# pass 1 +# fail 1 diff --git a/tests/auto/testlib/selftests/expected_watchdog.teamcity b/tests/auto/testlib/selftests/expected_watchdog.teamcity new file mode 100644 index 0000000000..0d77bf70d5 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.teamcity @@ -0,0 +1,8 @@ +##teamcity[testSuiteStarted name='tst_Watchdog' flowId='tst_Watchdog'] +##teamcity[testStarted name='initTestCase()' flowId='tst_Watchdog'] +##teamcity[testFinished name='initTestCase()' flowId='tst_Watchdog'] +##teamcity[testStarted name='delay()' flowId='tst_Watchdog'] +##teamcity[testFailed name='delay()' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_Watchdog'] +##teamcity[testStdOut name='delay()' out='QFATAL: Test function timed out' flowId='tst_Watchdog'] +##teamcity[testFinished name='delay()' flowId='tst_Watchdog'] +##teamcity[testSuiteFinished name='tst_Watchdog' flowId='tst_Watchdog'] diff --git a/tests/auto/testlib/selftests/expected_watchdog.txt b/tests/auto/testlib/selftests/expected_watchdog.txt new file mode 100644 index 0000000000..4c9cde4ea2 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.txt @@ -0,0 +1,8 @@ +********* Start testing of tst_Watchdog ********* +Config: Using QtTest library +PASS : tst_Watchdog::initTestCase() +QFATAL : tst_Watchdog::delay() Test function timed out +FAIL! : tst_Watchdog::delay() Received a fatal error. + Loc: [Unknown file(0)] +Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_Watchdog ********* diff --git a/tests/auto/testlib/selftests/expected_watchdog.xml b/tests/auto/testlib/selftests/expected_watchdog.xml new file mode 100644 index 0000000000..f1642fba79 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<TestCase name="tst_Watchdog"> +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> + <Duration msecs="0"/> +</TestFunction> +<TestFunction name="delay"> +<Message type="qfatal" file="" line="0"> + <Description><![CDATA[Test function timed out]]></Description> +</Message> +<Incident type="fail" file="Unknown file" line="0"> + <Description><![CDATA[Received a fatal error.]]></Description> +</Incident> + <Duration msecs="0"/> +</TestFunction> +<Duration msecs="0"/> +</TestCase> diff --git a/tests/auto/testlib/selftests/expected_watchdog.xunitxml b/tests/auto/testlib/selftests/expected_watchdog.xunitxml new file mode 100644 index 0000000000..7e16ab2c34 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_watchdog.xunitxml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<testsuite errors="1" failures="1" tests="2" name="tst_Watchdog"> + <properties> + <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> + <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> + </properties> + <testcase result="pass" name="initTestCase"/> + <testcase result="fail" name="delay"> + <!-- message="Test function timed out" type="qfatal" --> + <failure message="Received a fatal error." result="fail"/> + </testcase> + <system-err> +<![CDATA[Test function timed out]]> + </system-err> +</testsuite> diff --git a/tests/auto/testlib/selftests/faildatatype/BLACKLIST b/tests/auto/testlib/selftests/faildatatype/BLACKLIST new file mode 100644 index 0000000000..bb1cae98e5 --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/BLACKLIST @@ -0,0 +1,4 @@ +# See qtbase/src/testlib/qtestblacklist.cpp for format +# Incidental test: exercise more of the blacklisting code +[value:bool-as-string] +* diff --git a/tests/auto/testlib/selftests/faildatatype/faildatatype.pro b/tests/auto/testlib/selftests/faildatatype/faildatatype.pro new file mode 100644 index 0000000000..4ff7352555 --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/faildatatype.pro @@ -0,0 +1,9 @@ +SOURCES += tst_faildatatype.cpp +QT = core testlib + +darwin: CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = faildatatype + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/faildatatype/tst_faildatatype.cpp b/tests/auto/testlib/selftests/faildatatype/tst_faildatatype.cpp new file mode 100644 index 0000000000..b49c7723ef --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/tst_faildatatype.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtTest/QtTest> + +class tst_FailDataType: public QObject +{ +Q_OBJECT +private slots: + void value_data() const; + void value() const; +}; + +void tst_FailDataType::value_data() const +{ + QTest::addColumn<QString>("value"); + + QTest::newRow("bool-as-string") << true; // assertion should fail here +} + +/*! \internal + This function should never be run because its _data() fails. + */ +void tst_FailDataType::value() const +{ + QFAIL("ERROR: this function is NOT supposed to be run."); +} + +QTEST_APPLESS_MAIN(tst_FailDataType) + +#include "tst_faildatatype.moc" diff --git a/tests/auto/testlib/selftests/failfetchtype/BLACKLIST b/tests/auto/testlib/selftests/failfetchtype/BLACKLIST new file mode 100644 index 0000000000..20a502724a --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/BLACKLIST @@ -0,0 +1,4 @@ +# See qtbase/src/testlib/qtestblacklist.cpp for format +# Incidental test: exercise more of the blacklisting code +[fetch:no-such-dataset] +* diff --git a/tests/auto/testlib/selftests/failfetchtype/failfetchtype.pro b/tests/auto/testlib/selftests/failfetchtype/failfetchtype.pro new file mode 100644 index 0000000000..5821018af4 --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/failfetchtype.pro @@ -0,0 +1,9 @@ +SOURCES += tst_failfetchtype.cpp +QT = core testlib + +darwin: CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = failfetchtype + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp b/tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp new file mode 100644 index 0000000000..2dd32a5a5e --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/tst_failfetchtype.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtTest/QtTest> + +class tst_FailFetchType: public QObject +{ +Q_OBJECT +private slots: + void fetch_data() const; + void fetch() const; +}; + +void tst_FailFetchType::fetch_data() const +{ + QTest::addColumn<bool>("value"); + + QTest::newRow("bool") << true; +} + +void tst_FailFetchType::fetch() const +{ + QFETCH(QString, value); // assertion should fail here + QFAIL("ERROR: this function is NOT supposed to be run."); +} + +QTEST_APPLESS_MAIN(tst_FailFetchType) + +#include "tst_failfetchtype.moc" diff --git a/tests/auto/testlib/selftests/float/tst_float.cpp b/tests/auto/testlib/selftests/float/tst_float.cpp index 2fffcc7803..b12bc24c58 100644 --- a/tests/auto/testlib/selftests/float/tst_float.cpp +++ b/tests/auto/testlib/selftests/float/tst_float.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ #include <QtCore/QCoreApplication> +#include <QtCore/qfloat16.h> #include <QtTest/QtTest> #include <QDebug> @@ -36,6 +37,8 @@ class tst_float: public QObject private slots: void floatComparisons() const; void floatComparisons_data() const; + void float16Comparisons() const; + void float16Comparisons_data() const; void compareFloatTests() const; void compareFloatTests_data() const; }; @@ -79,6 +82,42 @@ void tst_float::floatComparisons_data() const << float(100002); } +void tst_float::float16Comparisons() const +{ + QFETCH(qfloat16, operandLeft); + QFETCH(qfloat16, operandRight); + + QCOMPARE(operandLeft, operandRight); +} + +void tst_float::float16Comparisons_data() const +{ + QTest::addColumn<qfloat16>("operandLeft"); + QTest::addColumn<qfloat16>("operandRight"); + + QTest::newRow("should SUCCEED 1") + << qfloat16(0) + << qfloat16(0); + + QTest::newRow("should FAIL 1") + << qfloat16(1.000) + << qfloat16(3.000); + + QTest::newRow("should FAIL 2") + << qfloat16(1.000e-4f) + << qfloat16(3.000e-4f); + + // QCOMPARE for qfloat16s uses qFuzzyCompare() + + QTest::newRow("should FAIL 3") + << qfloat16(98) + << qfloat16(99); + + QTest::newRow("should SUCCEED 2") + << qfloat16(1001) + << qfloat16(1002); +} + void tst_float::compareFloatTests() const { QFETCH(float, t1); diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 1996416e8c..92588c614d 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -221,8 +221,71 @@ class Scanner (object): print('tst_selftests.cpp names', d, "as a test, but it doesn't exist") del re +# Keep in sync with tst_selftests.cpp's processEnvironment(): +def baseEnv(platname=None, + keep=('PATH', 'QT_QPA_PLATFORM'), + posix=('HOME', 'USER', 'QEMU_SET_ENV', 'QEMU_LD_PREFIX'), + nonapple=('DISPLAY', 'XAUTHLOCALHOSTNAME'), # and XDG_* + # Don't actually know how to test for QNX, so this is ignored: + qnx=('GRAPHICS_ROOT', 'TZ'), + # Probably not actually relevant + preserveLib=('QT_PLUGIN_PATH', 'LD_LIBRARY_PATH'), + # Shall be modified on first call (a *copy* is returned): + cached={}): + """Lazily-evaluated standard environment for sub-tests to run in. + + This prunes the parent process environment, selecting a only those + variables we chose to keep. The platname passed to the first call + helps select which variables to keep. The environment computed + then is cached: a copy of this is returned on that call and each + subsequent call.\n""" + + if not cached: + xdg = False + # The platform module may be more apt for the platform tests here. + if os.name == 'posix': + keep += posix + if platname != 'darwin': + keep += nonapple + xdg = True + if 'QT_PRESERVE_TESTLIB_PATH' in os.environ: + keep += preserveLib + + cached = dict( + LC_ALL = 'C', # Use standard locale + # Avoid interference from any qtlogging.ini files, e.g. in + # /etc/xdg/QtProject/, (must match tst_selftests.cpp's + # processEnvironment()'s value): + QT_LOGGING_RULES = '*.debug=true;qt.*=false') + + for k, v in os.environ.items(): + if k in keep or (xdg and k.startswith('XDG_')): + cached[k] = v + + return cached.copy() + +def testEnv(testname, + # Make sure this matches tst_Selftests::doRunSubTest(): + extraEnv = { + "crashers": { "QTEST_DISABLE_CORE_DUMP": "1", + "QTEST_DISABLE_STACK_DUMP": "1" }, + "watchdog": { "QTEST_FUNCTION_TIMEOUT": "100" }, + }, + # Must match tst_Selftests::runSubTest_data(): + crashers = ("assert", "blacklisted", "crashes", "crashedterminate", + "exceptionthrow", "faildatatype", "failfetchtype", + "fetchbogus", "silent", "watchdog")): + """Determine the environment in which to run a test.""" + data = baseEnv() + if testname in crashers: + data.update(extraEnv["crashers"]) + if testname in extraEnv: + data.update(extraEnv[testname]) + return data + def generateTestData(testname, clean, formats = ('xml', 'txt', 'xunitxml', 'lightxml', 'teamcity', 'tap'), + # Make sure this matches tst_Selftests::runSubTest_data(): extraArgs = { "commandlinedata": "fiveTablePasses fiveTablePasses:fiveTablePasses_data1 -v2", "benchlibcallgrind": "-callgrind", @@ -249,26 +312,22 @@ def generateTestData(testname, clean, print("Warning: directory", testname, "contains no test executable") return + # Prepare environment in which to run tests: + env = testEnv(testname) + print(" running", testname) for format in formats: cmd = [path, '-' + format] if testname in extraArgs: cmd += extraArgs[testname].split() - data = subprocess.Popen(cmd, stdout=subprocess.PIPE, + data = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env, universal_newlines=True).communicate()[0] with open('expected_' + testname + '.' + format, 'w') as out: out.write('\n'.join(clean(data))) # write() appends a newline, too def main(name, *args): """Minimal argument parsing and driver for the real work""" - os.environ.update( - LC_ALL = 'C', # Use standard locale - # Avoid interference from any qtlogging.ini files, e.g. in - # /etc/xdg/QtProject/, (must match tst_selftests.cpp's - # processEnvironment()'s value): - QT_LOGGING_RULES = '*.debug=true;qt.*=false') - herePath = os.getcwd() cleaner = Cleaner(herePath, name) @@ -280,6 +339,7 @@ def main(name, *args): if __name__ == '__main__': # Executed when script is run, not when imported (e.g. to debug) import sys + baseEnv(sys.platform) # initializes its cache if sys.platform.startswith('win'): print("This script does not work on Windows.") diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index 05ed6d9905..bc5a74a20a 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -21,6 +21,8 @@ SUBPROGRAMS = \ exceptionthrow \ expectfail \ failcleanup \ + faildatatype \ + failfetchtype \ failinit \ failinitdata \ fetchbogus \ @@ -48,6 +50,7 @@ SUBPROGRAMS = \ verbose2 \ verifyexceptionthrown \ warnings \ + watchdog \ xunit qtHaveModule(gui): SUBPROGRAMS += \ diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 08c6dec191..a5094c8b9e 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -468,10 +468,13 @@ void tst_Selftests::runSubTest_data() #endif << "expectfail" << "failcleanup" +#ifndef Q_OS_WIN // these assert, by design; so same problem as "assert" + << "faildatatype" + << "failfetchtype" +#endif << "failinit" << "failinitdata" -#if !defined(Q_OS_WIN) - // Disable this test on Windows, as the run-time will popup dialogs with warnings +#ifndef Q_OS_WIN // asserts, by design; so same problem as "assert" << "fetchbogus" #endif << "findtestdata" @@ -502,6 +505,7 @@ void tst_Selftests::runSubTest_data() << "verifyexceptionthrown" #endif //!QT_NO_EXCEPTIONS << "warnings" + << "watchdog" << "xunit" ; @@ -520,6 +524,7 @@ void tst_Selftests::runSubTest_data() foreach (QString const& subtest, tests) { QStringList arguments = loggerSet.arguments; + // Keep in sync with generateTestData()'s extraArgs in generate_expected_output.py: if (subtest == "commandlinedata") { arguments << QString("fiveTablePasses fiveTablePasses:fiveTablePasses_data1 -v2").split(' '); } @@ -612,10 +617,12 @@ void tst_Selftests::runSubTest_data() if (loggerSet.name.contains("teamcity") && subtest.startsWith("benchlib")) continue; // Skip benchmark for TeamCity logger + // Keep in sync with generateTestData()'s crashers in generate_expected_output.py: const bool crashes = subtest == QLatin1String("assert") || subtest == QLatin1String("exceptionthrow") || subtest == QLatin1String("fetchbogus") || subtest == QLatin1String("crashedterminate") + || subtest == QLatin1String("faildatatype") || subtest == QLatin1String("failfetchtype") || subtest == QLatin1String("crashes") || subtest == QLatin1String("silent") - || subtest == QLatin1String("blacklisted"); + || subtest == QLatin1String("blacklisted") || subtest == QLatin1String("watchdog"); QTest::newRow(qPrintable(QString("%1 %2").arg(subtest).arg(loggerSet.name))) << subtest << loggers @@ -690,9 +697,12 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QProcess proc; QProcessEnvironment environment = processEnvironment(); + // Keep in sync with generateTestData()'s extraEnv in generate_expected_output.py: if (crashes) { environment.insert("QTEST_DISABLE_CORE_DUMP", "1"); environment.insert("QTEST_DISABLE_STACK_DUMP", "1"); + if (subdir == QLatin1String("watchdog")) + environment.insert("QTEST_FUNCTION_TIMEOUT", "100"); } proc.setProcessEnvironment(environment); const QString path = subdir + QLatin1Char('/') + subdir; @@ -735,6 +745,7 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge if (subdir != QLatin1String("exceptionthrow") && subdir != QLatin1String("cmptest") // QImage comparison requires QGuiApplication && subdir != QLatin1String("fetchbogus") + && subdir != QLatin1String("watchdog") && subdir != QLatin1String("xunit") #ifdef Q_CC_MINGW && subdir != QLatin1String("blacklisted") // calls qFatal() @@ -742,11 +753,13 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge #endif #ifdef Q_OS_LINUX // QEMU outputs to stderr about uncaught signals - && (!EmulationDetector::isRunningArmOnX86() || - (subdir != QLatin1String("blacklisted") - && subdir != QLatin1String("silent") - && subdir != QLatin1String("assert") - && subdir != QLatin1String("crashes") + && !(EmulationDetector::isRunningArmOnX86() && + (subdir == QLatin1String("assert") + || subdir == QLatin1String("blacklisted") + || subdir == QLatin1String("crashes") + || subdir == QLatin1String("faildatatype") + || subdir == QLatin1String("failfetchtype") + || subdir == QLatin1String("silent") ) ) #endif @@ -896,16 +909,20 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir, const QString &actualLine, const QString &expectedLine, QString *errorMessage) const { - if (subdir == QLatin1String("assert") && actualLine.contains(QLatin1String("ASSERT: ")) - && expectedLine.contains(QLatin1String("ASSERT: ")) && actualLine != expectedLine) { + if (actualLine == expectedLine) + return true; + + if ((subdir == QLatin1String("assert") + || subdir == QLatin1String("faildatatype") || subdir == QLatin1String("failfetchtype")) + && actualLine.contains(QLatin1String("ASSERT: ")) + && expectedLine.contains(QLatin1String("ASSERT: "))) { // Q_ASSERT uses __FILE__, the exact contents of which are // undefined. If have we something that looks like a Q_ASSERT and we // were expecting to see a Q_ASSERT, we'll skip the line. return true; } - if (expectedLine.startsWith(QLatin1String("FAIL! : tst_Exception::throwException() Caught unhandled exce")) - && actualLine != expectedLine) { + if (expectedLine.startsWith(QLatin1String("FAIL! : tst_Exception::throwException() Caught unhandled exce"))) { // On some platforms we compile without RTTI, and as a result we never throw an exception if (actualLine.simplified() != QLatin1String("tst_Exception::throwException()")) { *errorMessage = QString::fromLatin1("'%1' != 'tst_Exception::throwException()'").arg(actualLine); @@ -944,9 +961,6 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir, if (actualLine.startsWith(QLatin1String("Totals:")) && expectedLine.startsWith(QLatin1String("Totals:"))) return true; - if (actualLine == expectedLine) - return true; - *errorMessage = msgMismatch(actualLine, expectedLine); return false; } diff --git a/tests/auto/testlib/selftests/watchdog/tst_watchdog.cpp b/tests/auto/testlib/selftests/watchdog/tst_watchdog.cpp new file mode 100644 index 0000000000..2f29609f71 --- /dev/null +++ b/tests/auto/testlib/selftests/watchdog/tst_watchdog.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> + +class tst_Watchdog : public QObject +{ + Q_OBJECT +private slots: + void delay() const; +}; + +void tst_Watchdog::delay() const +{ + bool ok = false; + const int fiveMinutes = 5 * 60 * 1000; + // Use the same env.var as the watch-dog and add a little to it: + const int timeout = qEnvironmentVariableIntValue("QTEST_FUNCTION_TIMEOUT", &ok); + QTest::qSleep(5000 + (ok && timeout > 0 ? timeout : fiveMinutes)); + // The watchdog timer should have interrupted us by now. + QFAIL("ERROR: this function should be interrupted."); +} + +QTEST_APPLESS_MAIN(tst_Watchdog) + +#include "tst_watchdog.moc" diff --git a/tests/auto/testlib/selftests/watchdog/watchdog.pro b/tests/auto/testlib/selftests/watchdog/watchdog.pro new file mode 100644 index 0000000000..ddcc3f6ca2 --- /dev/null +++ b/tests/auto/testlib/selftests/watchdog/watchdog.pro @@ -0,0 +1,14 @@ +SOURCES += tst_watchdog.cpp +QT = core testlib + +darwin: CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = watchdog + +# The test deliberately times out; so tell it to do so quickly +checkenv.name = QTEST_FUNCTION_TIMEOUT +checkenv.value = 100 +QT_TOOL_ENV += checkenv + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/testlib.pro b/tests/auto/testlib/testlib.pro index 25ccc591d6..587c76a189 100644 --- a/tests/auto/testlib/testlib.pro +++ b/tests/auto/testlib/testlib.pro @@ -1,6 +1,7 @@ -TEMPLATE=subdirs -SUBDIRS=\ +TEMPLATE = subdirs +SUBDIRS = \ + outformat \ qsignalspy \ selftests \ -qtHaveModule(widgets):SUBDIRS += qabstractitemmodeltester +qtHaveModule(widgets): SUBDIRS += qabstractitemmodeltester diff --git a/tests/auto/testserver.pri b/tests/auto/testserver.pri index b2f593235f..eefb29ab19 100644 --- a/tests/auto/testserver.pri +++ b/tests/auto/testserver.pri @@ -51,38 +51,66 @@ # 2. testserver_clean - Clean up server containers/images and tidy away related # files. -TESTSERVER_COMPOSE_FILE = $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml TESTSERVER_VERSION = $$system(docker-compose --version) -equals(QMAKE_HOST.os, Windows)|isEmpty(TESTSERVER_VERSION) { +equals(QMAKE_HOST.os, Darwin)|equals(QMAKE_HOST.os, Windows)|isEmpty(TESTSERVER_VERSION) { # Make check with server "qt-test-server.qt-test-net" as a fallback message("testserver: qt-test-server.qt-test-net") } else { # Make check with test servers - message("testserver:" $$TESTSERVER_VERSION) + equals(QMAKE_HOST.os, Darwin) { + # There is no docker bridge on macOS. It is impossible to ping a container. + # Docker docs recommends using port mapping to connect to a container; + # but it causes a port conflict if the user is running a service that + # binds the same port on the host. An alternative solution is to deploy + # the docker environment into VirtualBox using docker-machine. + TESTSERVER_COMPOSE_FILE = \ + $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-for-macOS.yml + + # The connection configuration for the target machine + MACHINE_CONFIG = $(shell docker-machine config qt-test-server) + + # The environment variables passed to the docker-compose file + TEST_ENV = 'MACHINE_IP=$(shell docker-machine ip qt-test-server)' + } else { + TESTSERVER_COMPOSE_FILE = $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml + DEFINES += QT_TEST_SERVER_NAME + } # Ensure that the docker-compose file is provided. It is a configuration # file which is mandatory for all docker-compose commands. You can get more # detail from the description of TESTSERVER_COMPOSE_FILE above. There is # also an example showing how to configure it manually. FILE_PRETEST_MSG = "Project variable 'TESTSERVER_COMPOSE_FILE' is not set" - testserver_pretest.commands = $(if $$TESTSERVER_COMPOSE_FILE,,$(error $$FILE_PRETEST_MSG)) + testserver_pretest.commands = $(info "testserver:" $$TESTSERVER_VERSION) + testserver_pretest.commands += $(if $$TESTSERVER_COMPOSE_FILE,,$(error $$FILE_PRETEST_MSG)) + + # Make sure docker-machine is both created and running. The docker_machine + # script is used to deploy the docker environment into VirtualBox. + # Example: qt5/coin/provisioning/common/shared/testserver/docker_machine.sh + !isEmpty(MACHINE_CONFIG) { + MACHINE_LIST_CMD = docker-machine ls -q --filter "Name=^qt-test-server$" + MACHINE_LIST_MSG = "Docker machine qt-test-server not found" + testserver_pretest.commands += \ + $(if $(shell $$MACHINE_LIST_CMD),,$(error $$MACHINE_LIST_MSG)) + + MACHINE_STATE_CMD = \ + docker-machine ls -q --filter "State=Running" --filter "Name=^qt-test-server$" + MACHINE_START_CMD = docker-machine start qt-test-server + testserver_pretest.commands += \ + $(if $(shell $$MACHINE_STATE_CMD),,$(shell $$MACHINE_START_CMD > /dev/null)) + } # Before starting the test servers, it requires the user to run the setup # script (coin/provisioning/.../testserver/docker_testserver.sh) in advance. - IMAGE_PRETEST_CMD = docker images -aq "qt-test-server-*" + IMAGE_PRETEST_CMD = docker $$MACHINE_CONFIG images -aq "qt-test-server-*" IMAGE_PRETEST_MSG = "Docker image qt-test-server-* not found" testserver_pretest.commands += $(if $(shell $$IMAGE_PRETEST_CMD),,$(error $$IMAGE_PRETEST_MSG)) # The domain name is relevant to https keycert (qnetworkreply/crts/qt-test-net-cacert.pem). DNSDOMAIN = test-net.qt.local - TEST_ENV += TESTSERVER_DOMAIN=$$DNSDOMAIN DEFINES += QT_TEST_SERVER QT_TEST_SERVER_DOMAIN=$$shell_quote(\"$${DNSDOMAIN}\") - # There is no docker bridge on macOS. It is impossible to ping a container. - # Docker docs recommends using port mapping to connect to a container. - equals(QMAKE_HOST.os, Darwin): TEST_ENV += TESTSERVER_BIND_LOCAL=1 - # Rename the check target of testcase feature check.target = check_network testserver_test.target = check @@ -91,18 +119,19 @@ equals(QMAKE_HOST.os, Windows)|isEmpty(TESTSERVER_VERSION) { testserver_test.depends = testserver_pretest # Bring up test servers and make sure the services are ready. - testserver_test.commands = $$TEST_ENV docker-compose -f $$TESTSERVER_COMPOSE_FILE up -d \ - --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} && + !isEmpty(TEST_ENV): testserver_test.commands = env $$TEST_ENV + testserver_test.commands += docker-compose $$MACHINE_CONFIG -f $$TESTSERVER_COMPOSE_FILE up \ + --detach --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} && # Check test cases with docker-based test servers. testserver_test.commands += $(MAKE) check_network; # Stop and remove test servers after testing. - testserver_test.commands += $$TEST_ENV docker-compose -f $$TESTSERVER_COMPOSE_FILE down \ + testserver_test.commands += docker-compose $$MACHINE_CONFIG -f $$TESTSERVER_COMPOSE_FILE down \ --timeout 1 # Destroy test servers and tidy away related files. - testserver_clean.commands = $$TEST_ENV docker-compose -f $$TESTSERVER_COMPOSE_FILE down \ + testserver_clean.commands = docker-compose $$MACHINE_CONFIG -f $$TESTSERVER_COMPOSE_FILE down \ --rmi all QMAKE_EXTRA_TARGETS += testserver_pretest testserver_test testserver_clean diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 92a94055a4..f1888aebab 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -682,6 +682,7 @@ private slots: void finalClasses(); void explicitOverrideControl_data(); void explicitOverrideControl(); + void overloadedAddressOperator(); void autoPropertyMetaTypeRegistration(); void autoMethodArgumentMetaTypeRegistration(); void autoSignalSpyMetaTypeRegistration(); @@ -2939,6 +2940,34 @@ void tst_Moc::explicitOverrideControl() #endif } +class OverloadedAddressOperator : public QObject +{ + Q_OBJECT +public: + void* operator&() { return nullptr; } +signals: + void self(OverloadedAddressOperator&); +public slots: + void assertSelf(OverloadedAddressOperator &o) + { + QCOMPARE(std::addressof(o), this); + testResult = (std::addressof(o) == this); + } +public: + bool testResult = false; +}; + +void tst_Moc::overloadedAddressOperator() +{ + OverloadedAddressOperator o; + OverloadedAddressOperator *p = std::addressof(o); + QCOMPARE(&o, nullptr); + QVERIFY(p); + QObject::connect(p, &OverloadedAddressOperator::self, p, &OverloadedAddressOperator::assertSelf); + emit o.self(o); + QVERIFY(o.testResult); +} + class CustomQObject : public QObject { Q_OBJECT diff --git a/tests/auto/tools/rcc/data/images/images.expected b/tests/auto/tools/rcc/data/images/images.expected index 45e96dccd0..2af071812e 100644 --- a/tests/auto/tools/rcc/data/images/images.expected +++ b/tests/auto/tools/rcc/data/images/images.expected @@ -115,7 +115,6 @@ namespace QT_NAMESPACE { #endif bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); - bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); #ifdef QT_NAMESPACE @@ -125,16 +124,18 @@ bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, int QT_RCC_MANGLE_NAMESPACE(qInitResources)(); int QT_RCC_MANGLE_NAMESPACE(qInitResources)() { + int version = 3; QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) - (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + (version, qt_resource_struct, qt_resource_name, qt_resource_data); return 1; } int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() { + int version = 3; QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) - (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + (version, qt_resource_struct, qt_resource_name, qt_resource_data); return 1; } diff --git a/tests/auto/tools/rcc/data/sizes/data/data-0.txt b/tests/auto/tools/rcc/data/sizes/data/data-0.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/data/data-0.txt diff --git a/tests/auto/tools/rcc/data/sizes/data/data-1.txt b/tests/auto/tools/rcc/data/sizes/data/data-1.txt new file mode 100644 index 0000000000..b516b2c489 --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/data/data-1.txt @@ -0,0 +1 @@ +@
\ No newline at end of file diff --git a/tests/auto/tools/rcc/data/sizes/data/data-2.txt b/tests/auto/tools/rcc/data/sizes/data/data-2.txt new file mode 100644 index 0000000000..a616ad491b --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/data/data-2.txt @@ -0,0 +1 @@ +01
\ No newline at end of file diff --git a/tests/auto/tools/rcc/data/sizes/data/data-35.txt b/tests/auto/tools/rcc/data/sizes/data/data-35.txt new file mode 100644 index 0000000000..19a8036a15 --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/data/data-35.txt @@ -0,0 +1 @@ +0123456789 0123456789 0123456789 12
\ No newline at end of file diff --git a/tests/auto/tools/rcc/data/sizes/size-0.expected b/tests/auto/tools/rcc/data/sizes/size-0.expected new file mode 100644 index 0000000000..2f70a607ab --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/size-0.expected @@ -0,0 +1,89 @@ +/**************************************************************************** +** Resource object code +** +IGNORE: ** Created by: The Resource Compiler for Qt version 5.11.2 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +static const unsigned char qt_resource_data[] = { +IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt + 0x0,0x0,0x0,0x0, + + +}; + +static const unsigned char qt_resource_name[] = { + // data + 0x0,0x4, + 0x0,0x6,0xa8,0xa1, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61, + // data-0.txt + 0x0,0xa, + 0x4,0xe,0xa,0xb4, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x30,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/data + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/data/data-0.txt + 0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, +TIMESTAMP:data/data-0.txt + +}; + +#ifdef QT_NAMESPACE +# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +# define QT_RCC_MANGLE_NAMESPACE0(x) x +# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b +# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) +# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ + QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) +#else +# define QT_RCC_PREPEND_NAMESPACE(name) name +# define QT_RCC_MANGLE_NAMESPACE(name) name +#endif + +#ifdef QT_NAMESPACE +namespace QT_NAMESPACE { +#endif + +bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); +bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +#ifdef QT_NAMESPACE +} +#endif + +int QT_RCC_MANGLE_NAMESPACE(qInitResources)(); +int QT_RCC_MANGLE_NAMESPACE(qInitResources)() +{ + int version = 3; + QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) + (version, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() +{ + int version = 3; + QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) + (version, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +namespace { + struct initializer { + initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); } + ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); } + } dummy; +} diff --git a/tests/auto/tools/rcc/data/sizes/size-0.qrc b/tests/auto/tools/rcc/data/sizes/size-0.qrc new file mode 100644 index 0000000000..9f47732fe2 --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/size-0.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>data/data-0.txt</file> +</qresource> +</RCC> diff --git a/tests/auto/tools/rcc/data/sizes/size-1.expected b/tests/auto/tools/rcc/data/sizes/size-1.expected new file mode 100644 index 0000000000..d1717a9255 --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/size-1.expected @@ -0,0 +1,90 @@ +/**************************************************************************** +** Resource object code +** +IGNORE:** Created by: The Resource Compiler for Qt version 5.11.2 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +static const unsigned char qt_resource_data[] = { +IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt + 0x0,0x0,0x0,0x1, + 0x40, + + +}; + +static const unsigned char qt_resource_name[] = { + // data + 0x0,0x4, + 0x0,0x6,0xa8,0xa1, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61, + // data-1.txt + 0x0,0xa, + 0x4,0x11,0xa,0xb4, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x31,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/data + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/data/data-1.txt + 0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, +TIMESTAMP:data/data-1.txt + +}; + +#ifdef QT_NAMESPACE +# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +# define QT_RCC_MANGLE_NAMESPACE0(x) x +# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b +# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) +# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ + QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) +#else +# define QT_RCC_PREPEND_NAMESPACE(name) name +# define QT_RCC_MANGLE_NAMESPACE(name) name +#endif + +#ifdef QT_NAMESPACE +namespace QT_NAMESPACE { +#endif + +bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); +bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +#ifdef QT_NAMESPACE +} +#endif + +int QT_RCC_MANGLE_NAMESPACE(qInitResources)(); +int QT_RCC_MANGLE_NAMESPACE(qInitResources)() +{ + int version = 3; + QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) + (version, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() +{ + int version = 3; + QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) + (version, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +namespace { + struct initializer { + initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); } + ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); } + } dummy; +} diff --git a/tests/auto/tools/rcc/data/sizes/size-1.qrc b/tests/auto/tools/rcc/data/sizes/size-1.qrc new file mode 100644 index 0000000000..9fde9a1722 --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/size-1.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>data/data-1.txt</file> +</qresource> +</RCC> diff --git a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected new file mode 100644 index 0000000000..7a7cc93df1 --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected @@ -0,0 +1,127 @@ +/**************************************************************************** +** Resource object code +** +IGNORE: ** Created by: The Resource Compiler for Qt version 5.11.2 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +static const unsigned char qt_resource_data[] = { +IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-2.txt + 0x0,0x0,0x0,0x2, + 0x30, + 0x31, +IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-35.txt + 0x0,0x0,0x0,0x23, + 0x30, + 0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35, + 0x36,0x37,0x38,0x39,0x20,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x20, + 0x31,0x32, +IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt + 0x0,0x0,0x0,0x1, + 0x40, + +IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt + 0x0,0x0,0x0,0x0, + + +}; + +static const unsigned char qt_resource_name[] = { + // data + 0x0,0x4, + 0x0,0x6,0xa8,0xa1, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61, + // data-2.txt + 0x0,0xa, + 0x4,0x8,0xa,0xb4, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x32,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74, + // data-35.txt + 0x0,0xb, + 0x0,0xb5,0x4f,0x74, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x33,0x0,0x35,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74, + // data-1.txt + 0x0,0xa, + 0x4,0x11,0xa,0xb4, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x31,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74, + // data-0.txt + 0x0,0xa, + 0x4,0xe,0xa,0xb4, + 0x0,0x64, + 0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x2d,0x0,0x30,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/data + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x2, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/data/data-35.txt + 0x0,0x0,0x0,0x28,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x6, +TIMESTAMP:data/data-35.txt + // :/data/data-2.txt + 0x0,0x0,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, +TIMESTAMP:data/data-2.txt + // :/data/data-0.txt + 0x0,0x0,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x32, +TIMESTAMP:data/data-0.txt + // :/data/data-1.txt + 0x0,0x0,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2d, +TIMESTAMP:data/data-1.txt + +}; + +#ifdef QT_NAMESPACE +# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +# define QT_RCC_MANGLE_NAMESPACE0(x) x +# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b +# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) +# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ + QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) +#else +# define QT_RCC_PREPEND_NAMESPACE(name) name +# define QT_RCC_MANGLE_NAMESPACE(name) name +#endif + +#ifdef QT_NAMESPACE +namespace QT_NAMESPACE { +#endif + +bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); +bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +#ifdef QT_NAMESPACE +} +#endif + +int QT_RCC_MANGLE_NAMESPACE(qInitResources)(); +int QT_RCC_MANGLE_NAMESPACE(qInitResources)() +{ + int version = 3; + QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) + (version, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() +{ + int version = 3; + QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) + (version, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +namespace { + struct initializer { + initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); } + ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); } + } dummy; +} diff --git a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.qrc b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.qrc new file mode 100644 index 0000000000..039c9203ff --- /dev/null +++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.qrc @@ -0,0 +1,8 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>data/data-2.txt</file> + <file>data/data-0.txt</file> + <file>data/data-35.txt</file> + <file>data/data-1.txt</file> +</qresource> +</RCC> diff --git a/tests/auto/tools/rcc/rcc.pro b/tests/auto/tools/rcc/rcc.pro index 264b8ecc66..3fdc4132a7 100644 --- a/tests/auto/tools/rcc/rcc.pro +++ b/tests/auto/tools/rcc/rcc.pro @@ -3,3 +3,10 @@ QT = core testlib TARGET = tst_rcc SOURCES += tst_rcc.cpp + +RESOURCES += \ + $$PWD/data/images/images.qrc \ + $$PWD/data/sizes/size-0.qrc \ + $$PWD/data/sizes/size-2-0-35-1.qrc \ + $$PWD/data/sizes/size-1.qrc + diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp index 54a2854ede..c810c6e364 100644 --- a/tests/auto/tools/rcc/tst_rcc.cpp +++ b/tests/auto/tools/rcc/tst_rcc.cpp @@ -55,9 +55,13 @@ private slots: void rcc_data(); void rcc(); + void binary_data(); void binary(); + void readback_data(); + void readback(); + void cleanupTestCase(); private: @@ -126,6 +130,13 @@ void tst_rcc::rcc_data() if (dataPath.isEmpty()) QFAIL("data path not found"); QTest::newRow("images") << dataPath << "images.qrc" << "images.expected"; + + QString sizesPath = QFINDTESTDATA("data/sizes/"); + if (sizesPath.isEmpty()) + QFAIL("data path not found"); + QTest::newRow("size-0") << sizesPath << "size-0.qrc" << "size-0.expected"; + QTest::newRow("size-1") << sizesPath << "size-1.qrc" << "size-1.expected"; + QTest::newRow("size-2-0-35-1") << sizesPath << "size-2-0-35-1.qrc" << "size-2-0-35-1.expected"; } void tst_rcc::rcc() @@ -148,9 +159,10 @@ void tst_rcc::rcc() return; } - // Launch + // Launch; force no compression, otherwise the output would be different + // depending on the compression algorithm we're using QProcess process; - process.start(m_rcc, QStringList(qrcfile)); + process.start(m_rcc, { "-no-compress", qrcfile }); if (!process.waitForFinished()) { const QString path = QString::fromLocal8Bit(qgetenv("PATH")); QString message = QString::fromLatin1("'%1' could not be found when run from '%2'. Path: '%3' "). @@ -185,8 +197,9 @@ static void createRccBinaryData(const QString &rcc, const QString &baseDir, QString currentDir = QDir::currentPath(); QDir::setCurrent(baseDir); + // same as above: force no compression QProcess rccProcess; - rccProcess.start(rcc, QStringList() << "-binary" << "-o" << rccFileName << qrcFileName); + rccProcess.start(rcc, { "-binary", "-no-compress", "-o", rccFileName, qrcFileName }); bool ok = rccProcess.waitForFinished(); if (!ok) { QString errorString = QString::fromLatin1("Could not start rcc (is it in PATH?): %1").arg(rccProcess.errorString()); @@ -353,6 +366,42 @@ void tst_rcc::binary() QLocale::setDefault(oldDefaultLocale); } +void tst_rcc::readback_data() +{ + QTest::addColumn<QString>("resourceName"); + QTest::addColumn<QString>("fileSystemName"); + + QTest::newRow("data-0") << ":data/data-0.txt" << "sizes/data/data-0.txt"; + QTest::newRow("data-1") << ":data/data-1.txt" << "sizes/data/data-1.txt"; + QTest::newRow("data-2") << ":data/data-2.txt" << "sizes/data/data-2.txt"; + QTest::newRow("data-35") << ":data/data-35.txt" << "sizes/data/data-35.txt"; + QTest::newRow("circle") << ":images/circle.png" << "images/images/circle.png"; + QTest::newRow("square") << ":images/square.png" << "images/images/square.png"; + QTest::newRow("triangle") << ":images/subdir/triangle.png" + << "images/images/subdir/triangle.png"; +} + +void tst_rcc::readback() +{ + QFETCH(QString, resourceName); + QFETCH(QString, fileSystemName); + + QString dataPath = QFINDTESTDATA("data/"); + if (dataPath.isEmpty()) + QFAIL("data path not found"); + + QFile resourceFile(resourceName); + QVERIFY(resourceFile.open(QIODevice::ReadOnly)); + QByteArray resourceData = resourceFile.readAll(); + resourceFile.close(); + + QFile fileSystemFile(dataPath + fileSystemName); + QVERIFY(fileSystemFile.open(QIODevice::ReadOnly)); + QByteArray fileSystemData = fileSystemFile.readAll(); + fileSystemFile.close(); + + QCOMPARE(resourceData, fileSystemData); +} void tst_rcc::cleanupTestCase() { diff --git a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h index 1f5004b2aa..8b17acc1cd 100644 --- a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h +++ b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'Dialog_with_Buttons_Bottom.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -41,7 +41,7 @@ public: void retranslateUi(QDialog *Dialog) { - Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", nullptr)); + Dialog->setWindowTitle(QCoreApplication::translate("Dialog", "Dialog", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h index 8dd8b11b62..cdb12ec2b8 100644 --- a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h +++ b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'Dialog_with_Buttons_Right.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -41,7 +41,7 @@ public: void retranslateUi(QDialog *Dialog) { - Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", nullptr)); + Dialog->setWindowTitle(QCoreApplication::translate("Dialog", "Dialog", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h b/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h index 95acabf3f8..abdeb5b823 100644 --- a/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h +++ b/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'Dialog_without_Buttons.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -32,7 +32,7 @@ public: void retranslateUi(QDialog *Dialog) { - Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", nullptr)); + Dialog->setWindowTitle(QCoreApplication::translate("Dialog", "Dialog", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/Main_Window.ui.h b/tests/auto/tools/uic/baseline/Main_Window.ui.h index 9e59e9f2e5..b78a3df8af 100644 --- a/tests/auto/tools/uic/baseline/Main_Window.ui.h +++ b/tests/auto/tools/uic/baseline/Main_Window.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'Main_Window.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -47,7 +47,7 @@ public: void retranslateUi(QMainWindow *MainWindow) { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", nullptr)); + MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/Widget.ui.h b/tests/auto/tools/uic/baseline/Widget.ui.h index 4318c2262f..906f648533 100644 --- a/tests/auto/tools/uic/baseline/Widget.ui.h +++ b/tests/auto/tools/uic/baseline/Widget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'Widget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -57,13 +57,13 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Form", nullptr)); - Alabel->setText(QApplication::translate("Form", "A label.\n" + Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr)); + Alabel->setText(QCoreApplication::translate("Form", "A label.\n" "One new line.\n" "Another new line.\n" "Last line.", nullptr)); - groupBox->setTitle(QApplication::translate("Form", "A Group Box", nullptr)); - pushButton->setText(QApplication::translate("Form", "PushButton", nullptr)); + groupBox->setTitle(QCoreApplication::translate("Form", "A Group Box", nullptr)); + pushButton->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/addlinkdialog.ui.h b/tests/auto/tools/uic/baseline/addlinkdialog.ui.h index 17f51a92f8..2a0ef18fa7 100644 --- a/tests/auto/tools/uic/baseline/addlinkdialog.ui.h +++ b/tests/auto/tools/uic/baseline/addlinkdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'addlinkdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -97,9 +97,9 @@ public: void retranslateUi(QDialog *AddLinkDialog) { - AddLinkDialog->setWindowTitle(QApplication::translate("AddLinkDialog", "Insert Link", nullptr)); - label->setText(QApplication::translate("AddLinkDialog", "Title:", nullptr)); - label_2->setText(QApplication::translate("AddLinkDialog", "URL:", nullptr)); + AddLinkDialog->setWindowTitle(QCoreApplication::translate("AddLinkDialog", "Insert Link", nullptr)); + label->setText(QCoreApplication::translate("AddLinkDialog", "Title:", nullptr)); + label_2->setText(QCoreApplication::translate("AddLinkDialog", "URL:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/addtorrentform.ui.h b/tests/auto/tools/uic/baseline/addtorrentform.ui.h index d259a011bf..b357d708d5 100644 --- a/tests/auto/tools/uic/baseline/addtorrentform.ui.h +++ b/tests/auto/tools/uic/baseline/addtorrentform.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'addtorrentform.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -209,23 +209,23 @@ public: void retranslateUi(QDialog *AddTorrentFile) { - AddTorrentFile->setWindowTitle(QApplication::translate("AddTorrentFile", "Add a torrent", nullptr)); - groupBox->setTitle(QApplication::translate("AddTorrentFile", "Select a torrent source", nullptr)); - label_4->setText(QApplication::translate("AddTorrentFile", "Destination:", nullptr)); - label_2->setText(QApplication::translate("AddTorrentFile", "Tracker URL:", nullptr)); - browseTorrents->setText(QApplication::translate("AddTorrentFile", "Browse", nullptr)); - label_5->setText(QApplication::translate("AddTorrentFile", "File(s):", nullptr)); - label_3->setText(QApplication::translate("AddTorrentFile", "Size:", nullptr)); - label_6->setText(QApplication::translate("AddTorrentFile", "Creator:", nullptr)); - announceUrl->setText(QApplication::translate("AddTorrentFile", "<none>", nullptr)); - label->setText(QApplication::translate("AddTorrentFile", "Torrent file:", nullptr)); - browseDestination->setText(QApplication::translate("AddTorrentFile", "Browse", nullptr)); - label_7->setText(QApplication::translate("AddTorrentFile", "Comment:", nullptr)); - commentLabel->setText(QApplication::translate("AddTorrentFile", "<none>", nullptr)); - creatorLabel->setText(QApplication::translate("AddTorrentFile", "<none>", nullptr)); - sizeLabel->setText(QApplication::translate("AddTorrentFile", "0", nullptr)); - okButton->setText(QApplication::translate("AddTorrentFile", "&OK", nullptr)); - cancelButton->setText(QApplication::translate("AddTorrentFile", "&Cancel", nullptr)); + AddTorrentFile->setWindowTitle(QCoreApplication::translate("AddTorrentFile", "Add a torrent", nullptr)); + groupBox->setTitle(QCoreApplication::translate("AddTorrentFile", "Select a torrent source", nullptr)); + label_4->setText(QCoreApplication::translate("AddTorrentFile", "Destination:", nullptr)); + label_2->setText(QCoreApplication::translate("AddTorrentFile", "Tracker URL:", nullptr)); + browseTorrents->setText(QCoreApplication::translate("AddTorrentFile", "Browse", nullptr)); + label_5->setText(QCoreApplication::translate("AddTorrentFile", "File(s):", nullptr)); + label_3->setText(QCoreApplication::translate("AddTorrentFile", "Size:", nullptr)); + label_6->setText(QCoreApplication::translate("AddTorrentFile", "Creator:", nullptr)); + announceUrl->setText(QCoreApplication::translate("AddTorrentFile", "<none>", nullptr)); + label->setText(QCoreApplication::translate("AddTorrentFile", "Torrent file:", nullptr)); + browseDestination->setText(QCoreApplication::translate("AddTorrentFile", "Browse", nullptr)); + label_7->setText(QCoreApplication::translate("AddTorrentFile", "Comment:", nullptr)); + commentLabel->setText(QCoreApplication::translate("AddTorrentFile", "<none>", nullptr)); + creatorLabel->setText(QCoreApplication::translate("AddTorrentFile", "<none>", nullptr)); + sizeLabel->setText(QCoreApplication::translate("AddTorrentFile", "0", nullptr)); + okButton->setText(QCoreApplication::translate("AddTorrentFile", "&OK", nullptr)); + cancelButton->setText(QCoreApplication::translate("AddTorrentFile", "&Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/authenticationdialog.ui.h b/tests/auto/tools/uic/baseline/authenticationdialog.ui.h index 16c9ce16a8..f8378b9a4e 100644 --- a/tests/auto/tools/uic/baseline/authenticationdialog.ui.h +++ b/tests/auto/tools/uic/baseline/authenticationdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'authenticationdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -103,12 +103,12 @@ public: void retranslateUi(QDialog *Dialog) { - Dialog->setWindowTitle(QApplication::translate("Dialog", "Http authentication required", nullptr)); - label->setText(QApplication::translate("Dialog", "You need to supply a Username and a Password to access this site", nullptr)); - label_2->setText(QApplication::translate("Dialog", "Username:", nullptr)); - label_3->setText(QApplication::translate("Dialog", "Password:", nullptr)); - label_4->setText(QApplication::translate("Dialog", "Site:", nullptr)); - siteDescription->setText(QApplication::translate("Dialog", "%1 at %2", nullptr)); + Dialog->setWindowTitle(QCoreApplication::translate("Dialog", "Http authentication required", nullptr)); + label->setText(QCoreApplication::translate("Dialog", "You need to supply a Username and a Password to access this site", nullptr)); + label_2->setText(QCoreApplication::translate("Dialog", "Username:", nullptr)); + label_3->setText(QCoreApplication::translate("Dialog", "Password:", nullptr)); + label_4->setText(QCoreApplication::translate("Dialog", "Site:", nullptr)); + siteDescription->setText(QCoreApplication::translate("Dialog", "%1 at %2", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/backside.ui.h b/tests/auto/tools/uic/baseline/backside.ui.h index e7053c632f..7f2b3662f3 100644 --- a/tests/auto/tools/uic/baseline/backside.ui.h +++ b/tests/auto/tools/uic/baseline/backside.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'backside.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -144,40 +144,40 @@ public: void retranslateUi(QWidget *BackSide) { - BackSide->setWindowTitle(QApplication::translate("BackSide", "BackSide", nullptr)); - groupBox->setTitle(QApplication::translate("BackSide", "Settings", nullptr)); - label->setText(QApplication::translate("BackSide", "Title:", nullptr)); - hostName->setText(QApplication::translate("BackSide", "Pad Navigator Example", nullptr)); - label_2->setText(QApplication::translate("BackSide", "Modified:", nullptr)); - label_3->setText(QApplication::translate("BackSide", "Extent", nullptr)); - groupBox_2->setTitle(QApplication::translate("BackSide", "Other input", nullptr)); + BackSide->setWindowTitle(QCoreApplication::translate("BackSide", "BackSide", nullptr)); + groupBox->setTitle(QCoreApplication::translate("BackSide", "Settings", nullptr)); + label->setText(QCoreApplication::translate("BackSide", "Title:", nullptr)); + hostName->setText(QCoreApplication::translate("BackSide", "Pad Navigator Example", nullptr)); + label_2->setText(QCoreApplication::translate("BackSide", "Modified:", nullptr)); + label_3->setText(QCoreApplication::translate("BackSide", "Extent", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("BackSide", "Other input", nullptr)); QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("BackSide", "Widgets On Graphics View", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("BackSide", "Widgets On Graphics View", nullptr)); const bool __sortingEnabled = treeWidget->isSortingEnabled(); treeWidget->setSortingEnabled(false); QTreeWidgetItem *___qtreewidgetitem1 = treeWidget->topLevelItem(0); - ___qtreewidgetitem1->setText(0, QApplication::translate("BackSide", "QGraphicsProxyWidget", nullptr)); + ___qtreewidgetitem1->setText(0, QCoreApplication::translate("BackSide", "QGraphicsProxyWidget", nullptr)); QTreeWidgetItem *___qtreewidgetitem2 = ___qtreewidgetitem1->child(0); - ___qtreewidgetitem2->setText(0, QApplication::translate("BackSide", "QGraphicsWidget", nullptr)); + ___qtreewidgetitem2->setText(0, QCoreApplication::translate("BackSide", "QGraphicsWidget", nullptr)); QTreeWidgetItem *___qtreewidgetitem3 = ___qtreewidgetitem2->child(0); - ___qtreewidgetitem3->setText(0, QApplication::translate("BackSide", "QObject", nullptr)); + ___qtreewidgetitem3->setText(0, QCoreApplication::translate("BackSide", "QObject", nullptr)); QTreeWidgetItem *___qtreewidgetitem4 = ___qtreewidgetitem2->child(1); - ___qtreewidgetitem4->setText(0, QApplication::translate("BackSide", "QGraphicsItem", nullptr)); + ___qtreewidgetitem4->setText(0, QCoreApplication::translate("BackSide", "QGraphicsItem", nullptr)); QTreeWidgetItem *___qtreewidgetitem5 = ___qtreewidgetitem2->child(2); - ___qtreewidgetitem5->setText(0, QApplication::translate("BackSide", "QGraphicsLayoutItem", nullptr)); + ___qtreewidgetitem5->setText(0, QCoreApplication::translate("BackSide", "QGraphicsLayoutItem", nullptr)); QTreeWidgetItem *___qtreewidgetitem6 = treeWidget->topLevelItem(1); - ___qtreewidgetitem6->setText(0, QApplication::translate("BackSide", "QGraphicsGridLayout", nullptr)); + ___qtreewidgetitem6->setText(0, QCoreApplication::translate("BackSide", "QGraphicsGridLayout", nullptr)); QTreeWidgetItem *___qtreewidgetitem7 = ___qtreewidgetitem6->child(0); - ___qtreewidgetitem7->setText(0, QApplication::translate("BackSide", "QGraphicsLayout", nullptr)); + ___qtreewidgetitem7->setText(0, QCoreApplication::translate("BackSide", "QGraphicsLayout", nullptr)); QTreeWidgetItem *___qtreewidgetitem8 = ___qtreewidgetitem7->child(0); - ___qtreewidgetitem8->setText(0, QApplication::translate("BackSide", "QGraphicsLayoutItem", nullptr)); + ___qtreewidgetitem8->setText(0, QCoreApplication::translate("BackSide", "QGraphicsLayoutItem", nullptr)); QTreeWidgetItem *___qtreewidgetitem9 = treeWidget->topLevelItem(2); - ___qtreewidgetitem9->setText(0, QApplication::translate("BackSide", "QGraphicsLinearLayout", nullptr)); + ___qtreewidgetitem9->setText(0, QCoreApplication::translate("BackSide", "QGraphicsLinearLayout", nullptr)); QTreeWidgetItem *___qtreewidgetitem10 = ___qtreewidgetitem9->child(0); - ___qtreewidgetitem10->setText(0, QApplication::translate("BackSide", "QGraphicsLayout", nullptr)); + ___qtreewidgetitem10->setText(0, QCoreApplication::translate("BackSide", "QGraphicsLayout", nullptr)); QTreeWidgetItem *___qtreewidgetitem11 = ___qtreewidgetitem10->child(0); - ___qtreewidgetitem11->setText(0, QApplication::translate("BackSide", "QGraphicsLayoutItem", nullptr)); + ___qtreewidgetitem11->setText(0, QCoreApplication::translate("BackSide", "QGraphicsLayoutItem", nullptr)); treeWidget->setSortingEnabled(__sortingEnabled); } // retranslateUi diff --git a/tests/auto/tools/uic/baseline/batchtranslation.ui.h b/tests/auto/tools/uic/baseline/batchtranslation.ui.h index 8a4dc7a677..1ca39ce171 100644 --- a/tests/auto/tools/uic/baseline/batchtranslation.ui.h +++ b/tests/auto/tools/uic/baseline/batchtranslation.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'batchtranslation.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -213,16 +213,16 @@ public: void retranslateUi(QDialog *databaseTranslationDialog) { - databaseTranslationDialog->setWindowTitle(QApplication::translate("databaseTranslationDialog", "Qt Linguist - Batch Translation", nullptr)); - groupBox->setTitle(QApplication::translate("databaseTranslationDialog", "Options", nullptr)); - ckOnlyUntranslated->setText(QApplication::translate("databaseTranslationDialog", "Only translate entries with no translation", nullptr)); - ckMarkFinished->setText(QApplication::translate("databaseTranslationDialog", "Set translated entries to finished", nullptr)); - groupBox_2->setTitle(QApplication::translate("databaseTranslationDialog", "Phrase book preference", nullptr)); - moveUpButton->setText(QApplication::translate("databaseTranslationDialog", "Move up", nullptr)); - moveDownButton->setText(QApplication::translate("databaseTranslationDialog", "Move down", nullptr)); - label->setText(QApplication::translate("databaseTranslationDialog", "The batch translator will search through the selected phrasebooks in the order given above.", nullptr)); - runButton->setText(QApplication::translate("databaseTranslationDialog", "&Run", nullptr)); - cancelButton->setText(QApplication::translate("databaseTranslationDialog", "&Cancel", nullptr)); + databaseTranslationDialog->setWindowTitle(QCoreApplication::translate("databaseTranslationDialog", "Qt Linguist - Batch Translation", nullptr)); + groupBox->setTitle(QCoreApplication::translate("databaseTranslationDialog", "Options", nullptr)); + ckOnlyUntranslated->setText(QCoreApplication::translate("databaseTranslationDialog", "Only translate entries with no translation", nullptr)); + ckMarkFinished->setText(QCoreApplication::translate("databaseTranslationDialog", "Set translated entries to finished", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("databaseTranslationDialog", "Phrase book preference", nullptr)); + moveUpButton->setText(QCoreApplication::translate("databaseTranslationDialog", "Move up", nullptr)); + moveDownButton->setText(QCoreApplication::translate("databaseTranslationDialog", "Move down", nullptr)); + label->setText(QCoreApplication::translate("databaseTranslationDialog", "The batch translator will search through the selected phrasebooks in the order given above.", nullptr)); + runButton->setText(QCoreApplication::translate("databaseTranslationDialog", "&Run", nullptr)); + cancelButton->setText(QCoreApplication::translate("databaseTranslationDialog", "&Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h b/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h index b5a44998be..11caa3f130 100644 --- a/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h +++ b/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'bookmarkdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -148,13 +148,13 @@ public: void retranslateUi(QDialog *BookmarkDialog) { - BookmarkDialog->setWindowTitle(QApplication::translate("BookmarkDialog", "Add Bookmark", nullptr)); - label->setText(QApplication::translate("BookmarkDialog", "Bookmark:", nullptr)); - label_2->setText(QApplication::translate("BookmarkDialog", "Add in Folder:", nullptr)); - toolButton->setText(QApplication::translate("BookmarkDialog", "+", nullptr)); + BookmarkDialog->setWindowTitle(QCoreApplication::translate("BookmarkDialog", "Add Bookmark", nullptr)); + label->setText(QCoreApplication::translate("BookmarkDialog", "Bookmark:", nullptr)); + label_2->setText(QCoreApplication::translate("BookmarkDialog", "Add in Folder:", nullptr)); + toolButton->setText(QCoreApplication::translate("BookmarkDialog", "+", nullptr)); QTreeWidgetItem *___qtreewidgetitem = bookmarkWidget->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("BookmarkDialog", "1", nullptr)); - newFolderButton->setText(QApplication::translate("BookmarkDialog", "New Folder", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("BookmarkDialog", "1", nullptr)); + newFolderButton->setText(QCoreApplication::translate("BookmarkDialog", "New Folder", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/bookwindow.ui.h b/tests/auto/tools/uic/baseline/bookwindow.ui.h index 8fe5f000e2..fbdcb17bd2 100644 --- a/tests/auto/tools/uic/baseline/bookwindow.ui.h +++ b/tests/auto/tools/uic/baseline/bookwindow.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'bookwindow.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -157,15 +157,15 @@ public: void retranslateUi(QMainWindow *BookWindow) { - BookWindow->setWindowTitle(QApplication::translate("BookWindow", "Books", nullptr)); - groupBox->setTitle(QApplication::translate("BookWindow", "Books", nullptr)); - groupBox_2->setTitle(QApplication::translate("BookWindow", "Details", nullptr)); - label_5->setText(QApplication::translate("BookWindow", "<b>Title:</b>", nullptr)); - label_2_2_2_2->setText(QApplication::translate("BookWindow", "<b>Author: </b>", nullptr)); - label_3->setText(QApplication::translate("BookWindow", "<b>Genre:</b>", nullptr)); - label_4->setText(QApplication::translate("BookWindow", "<b>Year:</b>", nullptr)); + BookWindow->setWindowTitle(QCoreApplication::translate("BookWindow", "Books", nullptr)); + groupBox->setTitle(QCoreApplication::translate("BookWindow", "Books", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("BookWindow", "Details", nullptr)); + label_5->setText(QCoreApplication::translate("BookWindow", "<b>Title:</b>", nullptr)); + label_2_2_2_2->setText(QCoreApplication::translate("BookWindow", "<b>Author: </b>", nullptr)); + label_3->setText(QCoreApplication::translate("BookWindow", "<b>Genre:</b>", nullptr)); + label_4->setText(QCoreApplication::translate("BookWindow", "<b>Year:</b>", nullptr)); yearEdit->setPrefix(QString()); - label->setText(QApplication::translate("BookWindow", "<b>Rating:</b>", nullptr)); + label->setText(QCoreApplication::translate("BookWindow", "<b>Rating:</b>", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/browserwidget.ui.h b/tests/auto/tools/uic/baseline/browserwidget.ui.h index 3db93c34cf..09c70ee3da 100644 --- a/tests/auto/tools/uic/baseline/browserwidget.ui.h +++ b/tests/auto/tools/uic/baseline/browserwidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'browserwidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -155,18 +155,18 @@ public: void retranslateUi(QWidget *Browser) { - Browser->setWindowTitle(QApplication::translate("Browser", "Qt SQL Browser", nullptr)); - insertRowAction->setText(QApplication::translate("Browser", "&Insert Row", nullptr)); -#ifndef QT_NO_STATUSTIP - insertRowAction->setStatusTip(QApplication::translate("Browser", "Inserts a new Row", nullptr)); -#endif // QT_NO_STATUSTIP - deleteRowAction->setText(QApplication::translate("Browser", "&Delete Row", nullptr)); -#ifndef QT_NO_STATUSTIP - deleteRowAction->setStatusTip(QApplication::translate("Browser", "Deletes the current Row", nullptr)); -#endif // QT_NO_STATUSTIP - groupBox->setTitle(QApplication::translate("Browser", "SQL Query", nullptr)); - clearButton->setText(QApplication::translate("Browser", "&Clear", nullptr)); - submitButton->setText(QApplication::translate("Browser", "&Submit", nullptr)); + Browser->setWindowTitle(QCoreApplication::translate("Browser", "Qt SQL Browser", nullptr)); + insertRowAction->setText(QCoreApplication::translate("Browser", "&Insert Row", nullptr)); +#if QT_CONFIG(statustip) + insertRowAction->setStatusTip(QCoreApplication::translate("Browser", "Inserts a new Row", nullptr)); +#endif // QT_CONFIG(statustip) + deleteRowAction->setText(QCoreApplication::translate("Browser", "&Delete Row", nullptr)); +#if QT_CONFIG(statustip) + deleteRowAction->setStatusTip(QCoreApplication::translate("Browser", "Deletes the current Row", nullptr)); +#endif // QT_CONFIG(statustip) + groupBox->setTitle(QCoreApplication::translate("Browser", "SQL Query", nullptr)); + clearButton->setText(QCoreApplication::translate("Browser", "&Clear", nullptr)); + submitButton->setText(QCoreApplication::translate("Browser", "&Submit", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h index 47f8f22132..4e7186041e 100644 --- a/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h +++ b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'bug18156QTreeWidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -57,9 +57,9 @@ public: void retranslateUi(QDialog *Dialog) { - Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", nullptr)); + Dialog->setWindowTitle(QCoreApplication::translate("Dialog", "Dialog", nullptr)); QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); - ___qtreewidgetitem->setText(1, QApplication::translate("Dialog", "4", nullptr)); + ___qtreewidgetitem->setText(1, QCoreApplication::translate("Dialog", "4", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/buttongroup.ui.h b/tests/auto/tools/uic/baseline/buttongroup.ui.h index 87814dcba1..f48db1d593 100644 --- a/tests/auto/tools/uic/baseline/buttongroup.ui.h +++ b/tests/auto/tools/uic/baseline/buttongroup.ui.h @@ -195,14 +195,14 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Easing curves", nullptr)); - groupBox_2->setTitle(QApplication::translate("Form", "Path type", nullptr)); - lineRadio->setText(QApplication::translate("Form", "Line", nullptr)); - circleRadio->setText(QApplication::translate("Form", "Circle", nullptr)); - groupBox->setTitle(QApplication::translate("Form", "Properties", nullptr)); - label->setText(QApplication::translate("Form", "Period", nullptr)); - label_3->setText(QApplication::translate("Form", "Overshoot", nullptr)); - label_2->setText(QApplication::translate("Form", "Amplitude", nullptr)); + Form->setWindowTitle(QCoreApplication::translate("Form", "Easing curves", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("Form", "Path type", nullptr)); + lineRadio->setText(QCoreApplication::translate("Form", "Line", nullptr)); + circleRadio->setText(QCoreApplication::translate("Form", "Circle", nullptr)); + groupBox->setTitle(QCoreApplication::translate("Form", "Properties", nullptr)); + label->setText(QCoreApplication::translate("Form", "Period", nullptr)); + label_3->setText(QCoreApplication::translate("Form", "Overshoot", nullptr)); + label_2->setText(QCoreApplication::translate("Form", "Amplitude", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/calculator.ui.h b/tests/auto/tools/uic/baseline/calculator.ui.h index 0387ee472b..bfe272f8ea 100644 --- a/tests/auto/tools/uic/baseline/calculator.ui.h +++ b/tests/auto/tools/uic/baseline/calculator.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'calculator.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -156,34 +156,34 @@ public: void retranslateUi(QWidget *Calculator) { - Calculator->setWindowTitle(QApplication::translate("Calculator", "Calculator", nullptr)); - backspaceButton->setText(QApplication::translate("Calculator", "Backspace", nullptr)); - clearButton->setText(QApplication::translate("Calculator", "Clear", nullptr)); - clearAllButton->setText(QApplication::translate("Calculator", "Clear All", nullptr)); - clearMemoryButton->setText(QApplication::translate("Calculator", "MC", nullptr)); - readMemoryButton->setText(QApplication::translate("Calculator", "MR", nullptr)); - setMemoryButton->setText(QApplication::translate("Calculator", "MS", nullptr)); - addToMemoryButton->setText(QApplication::translate("Calculator", "M+", nullptr)); - sevenButton->setText(QApplication::translate("Calculator", "7", nullptr)); - eightButton->setText(QApplication::translate("Calculator", "8", nullptr)); - nineButton->setText(QApplication::translate("Calculator", "9", nullptr)); - fourButton->setText(QApplication::translate("Calculator", "4", nullptr)); - fiveButton->setText(QApplication::translate("Calculator", "5", nullptr)); - sixButton->setText(QApplication::translate("Calculator", "6", nullptr)); - oneButton->setText(QApplication::translate("Calculator", "1", nullptr)); - twoButton->setText(QApplication::translate("Calculator", "2", nullptr)); - threeButton->setText(QApplication::translate("Calculator", "3", nullptr)); - zeroButton->setText(QApplication::translate("Calculator", "0", nullptr)); - pointButton->setText(QApplication::translate("Calculator", ".", nullptr)); - changeSignButton->setText(QApplication::translate("Calculator", "+-", nullptr)); - plusButton->setText(QApplication::translate("Calculator", "+", nullptr)); - divisionButton->setText(QApplication::translate("Calculator", "/", nullptr)); - timesButton->setText(QApplication::translate("Calculator", "*", nullptr)); - minusButton->setText(QApplication::translate("Calculator", "-", nullptr)); - squareRootButton->setText(QApplication::translate("Calculator", "Sqrt", nullptr)); - powerButton->setText(QApplication::translate("Calculator", "x^2", nullptr)); - reciprocalButton->setText(QApplication::translate("Calculator", "1/x", nullptr)); - equalButton->setText(QApplication::translate("Calculator", "=", nullptr)); + Calculator->setWindowTitle(QCoreApplication::translate("Calculator", "Calculator", nullptr)); + backspaceButton->setText(QCoreApplication::translate("Calculator", "Backspace", nullptr)); + clearButton->setText(QCoreApplication::translate("Calculator", "Clear", nullptr)); + clearAllButton->setText(QCoreApplication::translate("Calculator", "Clear All", nullptr)); + clearMemoryButton->setText(QCoreApplication::translate("Calculator", "MC", nullptr)); + readMemoryButton->setText(QCoreApplication::translate("Calculator", "MR", nullptr)); + setMemoryButton->setText(QCoreApplication::translate("Calculator", "MS", nullptr)); + addToMemoryButton->setText(QCoreApplication::translate("Calculator", "M+", nullptr)); + sevenButton->setText(QCoreApplication::translate("Calculator", "7", nullptr)); + eightButton->setText(QCoreApplication::translate("Calculator", "8", nullptr)); + nineButton->setText(QCoreApplication::translate("Calculator", "9", nullptr)); + fourButton->setText(QCoreApplication::translate("Calculator", "4", nullptr)); + fiveButton->setText(QCoreApplication::translate("Calculator", "5", nullptr)); + sixButton->setText(QCoreApplication::translate("Calculator", "6", nullptr)); + oneButton->setText(QCoreApplication::translate("Calculator", "1", nullptr)); + twoButton->setText(QCoreApplication::translate("Calculator", "2", nullptr)); + threeButton->setText(QCoreApplication::translate("Calculator", "3", nullptr)); + zeroButton->setText(QCoreApplication::translate("Calculator", "0", nullptr)); + pointButton->setText(QCoreApplication::translate("Calculator", ".", nullptr)); + changeSignButton->setText(QCoreApplication::translate("Calculator", "+-", nullptr)); + plusButton->setText(QCoreApplication::translate("Calculator", "+", nullptr)); + divisionButton->setText(QCoreApplication::translate("Calculator", "/", nullptr)); + timesButton->setText(QCoreApplication::translate("Calculator", "*", nullptr)); + minusButton->setText(QCoreApplication::translate("Calculator", "-", nullptr)); + squareRootButton->setText(QCoreApplication::translate("Calculator", "Sqrt", nullptr)); + powerButton->setText(QCoreApplication::translate("Calculator", "x^2", nullptr)); + reciprocalButton->setText(QCoreApplication::translate("Calculator", "1/x", nullptr)); + equalButton->setText(QCoreApplication::translate("Calculator", "=", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/calculatorform.ui.h b/tests/auto/tools/uic/baseline/calculatorform.ui.h index f4661c6237..bb30479d1f 100644 --- a/tests/auto/tools/uic/baseline/calculatorform.ui.h +++ b/tests/auto/tools/uic/baseline/calculatorform.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'calculatorform.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -170,13 +170,13 @@ public: void retranslateUi(QWidget *CalculatorForm) { - CalculatorForm->setWindowTitle(QApplication::translate("CalculatorForm", "Calculator Builder", nullptr)); - label->setText(QApplication::translate("CalculatorForm", "Input 1", nullptr)); - label_3->setText(QApplication::translate("CalculatorForm", "+", nullptr)); - label_2->setText(QApplication::translate("CalculatorForm", "Input 2", nullptr)); - label_3_2->setText(QApplication::translate("CalculatorForm", "=", nullptr)); - label_2_2_2->setText(QApplication::translate("CalculatorForm", "Output", nullptr)); - outputWidget->setText(QApplication::translate("CalculatorForm", "0", nullptr)); + CalculatorForm->setWindowTitle(QCoreApplication::translate("CalculatorForm", "Calculator Builder", nullptr)); + label->setText(QCoreApplication::translate("CalculatorForm", "Input 1", nullptr)); + label_3->setText(QCoreApplication::translate("CalculatorForm", "+", nullptr)); + label_2->setText(QCoreApplication::translate("CalculatorForm", "Input 2", nullptr)); + label_3_2->setText(QCoreApplication::translate("CalculatorForm", "=", nullptr)); + label_2_2_2->setText(QCoreApplication::translate("CalculatorForm", "Output", nullptr)); + outputWidget->setText(QCoreApplication::translate("CalculatorForm", "0", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/certificateinfo.ui.h b/tests/auto/tools/uic/baseline/certificateinfo.ui.h index 2aa47d40ad..4a70f86c3b 100644 --- a/tests/auto/tools/uic/baseline/certificateinfo.ui.h +++ b/tests/auto/tools/uic/baseline/certificateinfo.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'certificateinfo.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -90,9 +90,9 @@ public: void retranslateUi(QDialog *CertificateInfo) { - CertificateInfo->setWindowTitle(QApplication::translate("CertificateInfo", "Display Certificate Information", nullptr)); - groupBox->setTitle(QApplication::translate("CertificateInfo", "Certification Path", nullptr)); - groupBox_2->setTitle(QApplication::translate("CertificateInfo", "Certificate Information", nullptr)); + CertificateInfo->setWindowTitle(QCoreApplication::translate("CertificateInfo", "Display Certificate Information", nullptr)); + groupBox->setTitle(QCoreApplication::translate("CertificateInfo", "Certification Path", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("CertificateInfo", "Certificate Information", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/chatdialog.ui.h b/tests/auto/tools/uic/baseline/chatdialog.ui.h index ace6951669..2a1ba2e84c 100644 --- a/tests/auto/tools/uic/baseline/chatdialog.ui.h +++ b/tests/auto/tools/uic/baseline/chatdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'chatdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -97,8 +97,8 @@ public: void retranslateUi(QDialog *ChatDialog) { - ChatDialog->setWindowTitle(QApplication::translate("ChatDialog", "Chat", nullptr)); - label->setText(QApplication::translate("ChatDialog", "Message:", nullptr)); + ChatDialog->setWindowTitle(QCoreApplication::translate("ChatDialog", "Chat", nullptr)); + label->setText(QCoreApplication::translate("ChatDialog", "Message:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h index 8d4ccd53ae..27e468cfa6 100644 --- a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'chatmainwindow.ui' ** -** Created by: Qt User Interface Compiler version 5.9.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -125,9 +125,9 @@ public: statusbar = new QStatusBar(ChatMainWindow); statusbar->setObjectName(QString::fromUtf8("statusbar")); ChatMainWindow->setStatusBar(statusbar); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(messageLineEdit); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(chatHistory, messageLineEdit); QWidget::setTabOrder(messageLineEdit, sendButton); @@ -147,29 +147,29 @@ public: void retranslateUi(QMainWindow *ChatMainWindow) { - ChatMainWindow->setWindowTitle(QApplication::translate("ChatMainWindow", "Qt D-Bus Chat", nullptr)); - actionQuit->setText(QApplication::translate("ChatMainWindow", "Quit", nullptr)); -#ifndef QT_NO_SHORTCUT - actionQuit->setShortcut(QApplication::translate("ChatMainWindow", "Ctrl+Q", nullptr)); -#endif // QT_NO_SHORTCUT - actionAboutQt->setText(QApplication::translate("ChatMainWindow", "About Qt...", nullptr)); - actionChangeNickname->setText(QApplication::translate("ChatMainWindow", "Change nickname...", nullptr)); -#ifndef QT_NO_SHORTCUT - actionChangeNickname->setShortcut(QApplication::translate("ChatMainWindow", "Ctrl+N", nullptr)); -#endif // QT_NO_SHORTCUT -#ifndef QT_NO_TOOLTIP - chatHistory->setToolTip(QApplication::translate("ChatMainWindow", "Messages sent and received from other users", nullptr)); -#endif // QT_NO_TOOLTIP - label->setText(QApplication::translate("ChatMainWindow", "Message:", nullptr)); -#ifndef QT_NO_TOOLTIP - sendButton->setToolTip(QApplication::translate("ChatMainWindow", "Sends a message to other people", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS + ChatMainWindow->setWindowTitle(QCoreApplication::translate("ChatMainWindow", "Qt D-Bus Chat", nullptr)); + actionQuit->setText(QCoreApplication::translate("ChatMainWindow", "Quit", nullptr)); +#if QT_CONFIG(shortcut) + actionQuit->setShortcut(QCoreApplication::translate("ChatMainWindow", "Ctrl+Q", nullptr)); +#endif // QT_CONFIG(shortcut) + actionAboutQt->setText(QCoreApplication::translate("ChatMainWindow", "About Qt...", nullptr)); + actionChangeNickname->setText(QCoreApplication::translate("ChatMainWindow", "Change nickname...", nullptr)); +#if QT_CONFIG(shortcut) + actionChangeNickname->setShortcut(QCoreApplication::translate("ChatMainWindow", "Ctrl+N", nullptr)); +#endif // QT_CONFIG(shortcut) +#if QT_CONFIG(tooltip) + chatHistory->setToolTip(QCoreApplication::translate("ChatMainWindow", "Messages sent and received from other users", nullptr)); +#endif // QT_CONFIG(tooltip) + label->setText(QCoreApplication::translate("ChatMainWindow", "Message:", nullptr)); +#if QT_CONFIG(tooltip) + sendButton->setToolTip(QCoreApplication::translate("ChatMainWindow", "Sends a message to other people", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) sendButton->setWhatsThis(QString()); -#endif // QT_NO_WHATSTHIS - sendButton->setText(QApplication::translate("ChatMainWindow", "Send", nullptr)); - menuQuit->setTitle(QApplication::translate("ChatMainWindow", "Help", nullptr)); - menuFile->setTitle(QApplication::translate("ChatMainWindow", "File", nullptr)); +#endif // QT_CONFIG(whatsthis) + sendButton->setText(QCoreApplication::translate("ChatMainWindow", "Send", nullptr)); + menuQuit->setTitle(QCoreApplication::translate("ChatMainWindow", "Help", nullptr)); + menuFile->setTitle(QCoreApplication::translate("ChatMainWindow", "File", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/chatsetnickname.ui.h b/tests/auto/tools/uic/baseline/chatsetnickname.ui.h index c73dfb2c6e..cc11acb6da 100644 --- a/tests/auto/tools/uic/baseline/chatsetnickname.ui.h +++ b/tests/auto/tools/uic/baseline/chatsetnickname.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'chatsetnickname.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -112,10 +112,10 @@ public: void retranslateUi(QDialog *NicknameDialog) { - NicknameDialog->setWindowTitle(QApplication::translate("NicknameDialog", "Set nickname", nullptr)); - label->setText(QApplication::translate("NicknameDialog", "New nickname:", nullptr)); - okButton->setText(QApplication::translate("NicknameDialog", "OK", nullptr)); - cancelButton->setText(QApplication::translate("NicknameDialog", "Cancel", nullptr)); + NicknameDialog->setWindowTitle(QCoreApplication::translate("NicknameDialog", "Set nickname", nullptr)); + label->setText(QCoreApplication::translate("NicknameDialog", "New nickname:", nullptr)); + okButton->setText(QCoreApplication::translate("NicknameDialog", "OK", nullptr)); + cancelButton->setText(QCoreApplication::translate("NicknameDialog", "Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/config.ui.h b/tests/auto/tools/uic/baseline/config.ui.h index 8287e0b1ac..153718aca1 100644 --- a/tests/auto/tools/uic/baseline/config.ui.h +++ b/tests/auto/tools/uic/baseline/config.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'config.ui' ** -** Created by: Qt User Interface Compiler version 5.10.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -706,44 +706,44 @@ public: void retranslateUi(QDialog *Config) { - Config->setWindowTitle(QApplication::translate("Config", "Configure", nullptr)); - ButtonGroup1->setTitle(QApplication::translate("Config", "Size", nullptr)); - size_176_220->setText(QApplication::translate("Config", "176x220 \"SmartPhone\"", nullptr)); - size_240_320->setText(QApplication::translate("Config", "240x320 \"PDA\"", nullptr)); - size_320_240->setText(QApplication::translate("Config", "320x240 \"TV\" / \"QVGA\"", nullptr)); - size_640_480->setText(QApplication::translate("Config", "640x480 \"VGA\"", nullptr)); - size_800_600->setText(QApplication::translate("Config", "800x600", nullptr)); - size_1024_768->setText(QApplication::translate("Config", "1024x768", nullptr)); - size_custom->setText(QApplication::translate("Config", "Custom", nullptr)); - ButtonGroup2->setTitle(QApplication::translate("Config", "Depth", nullptr)); - depth_1->setText(QApplication::translate("Config", "1 bit monochrome", nullptr)); - depth_4gray->setText(QApplication::translate("Config", "4 bit grayscale", nullptr)); - depth_8->setText(QApplication::translate("Config", "8 bit", nullptr)); - depth_12->setText(QApplication::translate("Config", "12 (16) bit", nullptr)); - depth_15->setText(QApplication::translate("Config", "15 bit", nullptr)); - depth_16->setText(QApplication::translate("Config", "16 bit", nullptr)); - depth_18->setText(QApplication::translate("Config", "18 bit", nullptr)); - depth_24->setText(QApplication::translate("Config", "24 bit", nullptr)); - depth_32->setText(QApplication::translate("Config", "32 bit", nullptr)); - depth_32_argb->setText(QApplication::translate("Config", "32 bit ARGB", nullptr)); - TextLabel1_3->setText(QApplication::translate("Config", "Skin", nullptr)); - skin->setItemText(0, QApplication::translate("Config", "None", nullptr)); - - touchScreen->setText(QApplication::translate("Config", "Emulate touch screen (no mouse move)", nullptr)); - lcdScreen->setText(QApplication::translate("Config", "Emulate LCD screen (Only with fixed zoom of 3.0 times magnification)", nullptr)); - TextLabel1->setText(QApplication::translate("Config", "<p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>.", nullptr)); - GroupBox1->setTitle(QApplication::translate("Config", "Gamma", nullptr)); - TextLabel3->setText(QApplication::translate("Config", "Blue", nullptr)); - blabel->setText(QApplication::translate("Config", "1.0", nullptr)); - TextLabel2->setText(QApplication::translate("Config", "Green", nullptr)); - glabel->setText(QApplication::translate("Config", "1.0", nullptr)); - TextLabel7->setText(QApplication::translate("Config", "All", nullptr)); - TextLabel8->setText(QApplication::translate("Config", "1.0", nullptr)); - TextLabel1_2->setText(QApplication::translate("Config", "Red", nullptr)); - rlabel->setText(QApplication::translate("Config", "1.0", nullptr)); - PushButton3->setText(QApplication::translate("Config", "Set all to 1.0", nullptr)); - buttonOk->setText(QApplication::translate("Config", "&OK", nullptr)); - buttonCancel->setText(QApplication::translate("Config", "&Cancel", nullptr)); + Config->setWindowTitle(QCoreApplication::translate("Config", "Configure", nullptr)); + ButtonGroup1->setTitle(QCoreApplication::translate("Config", "Size", nullptr)); + size_176_220->setText(QCoreApplication::translate("Config", "176x220 \"SmartPhone\"", nullptr)); + size_240_320->setText(QCoreApplication::translate("Config", "240x320 \"PDA\"", nullptr)); + size_320_240->setText(QCoreApplication::translate("Config", "320x240 \"TV\" / \"QVGA\"", nullptr)); + size_640_480->setText(QCoreApplication::translate("Config", "640x480 \"VGA\"", nullptr)); + size_800_600->setText(QCoreApplication::translate("Config", "800x600", nullptr)); + size_1024_768->setText(QCoreApplication::translate("Config", "1024x768", nullptr)); + size_custom->setText(QCoreApplication::translate("Config", "Custom", nullptr)); + ButtonGroup2->setTitle(QCoreApplication::translate("Config", "Depth", nullptr)); + depth_1->setText(QCoreApplication::translate("Config", "1 bit monochrome", nullptr)); + depth_4gray->setText(QCoreApplication::translate("Config", "4 bit grayscale", nullptr)); + depth_8->setText(QCoreApplication::translate("Config", "8 bit", nullptr)); + depth_12->setText(QCoreApplication::translate("Config", "12 (16) bit", nullptr)); + depth_15->setText(QCoreApplication::translate("Config", "15 bit", nullptr)); + depth_16->setText(QCoreApplication::translate("Config", "16 bit", nullptr)); + depth_18->setText(QCoreApplication::translate("Config", "18 bit", nullptr)); + depth_24->setText(QCoreApplication::translate("Config", "24 bit", nullptr)); + depth_32->setText(QCoreApplication::translate("Config", "32 bit", nullptr)); + depth_32_argb->setText(QCoreApplication::translate("Config", "32 bit ARGB", nullptr)); + TextLabel1_3->setText(QCoreApplication::translate("Config", "Skin", nullptr)); + skin->setItemText(0, QCoreApplication::translate("Config", "None", nullptr)); + + touchScreen->setText(QCoreApplication::translate("Config", "Emulate touch screen (no mouse move)", nullptr)); + lcdScreen->setText(QCoreApplication::translate("Config", "Emulate LCD screen (Only with fixed zoom of 3.0 times magnification)", nullptr)); + TextLabel1->setText(QCoreApplication::translate("Config", "<p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>.", nullptr)); + GroupBox1->setTitle(QCoreApplication::translate("Config", "Gamma", nullptr)); + TextLabel3->setText(QCoreApplication::translate("Config", "Blue", nullptr)); + blabel->setText(QCoreApplication::translate("Config", "1.0", nullptr)); + TextLabel2->setText(QCoreApplication::translate("Config", "Green", nullptr)); + glabel->setText(QCoreApplication::translate("Config", "1.0", nullptr)); + TextLabel7->setText(QCoreApplication::translate("Config", "All", nullptr)); + TextLabel8->setText(QCoreApplication::translate("Config", "1.0", nullptr)); + TextLabel1_2->setText(QCoreApplication::translate("Config", "Red", nullptr)); + rlabel->setText(QCoreApplication::translate("Config", "1.0", nullptr)); + PushButton3->setText(QCoreApplication::translate("Config", "Set all to 1.0", nullptr)); + buttonOk->setText(QCoreApplication::translate("Config", "&OK", nullptr)); + buttonCancel->setText(QCoreApplication::translate("Config", "&Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/connectdialog.ui.h b/tests/auto/tools/uic/baseline/connectdialog.ui.h index a470a6705d..1e91b498f4 100644 --- a/tests/auto/tools/uic/baseline/connectdialog.ui.h +++ b/tests/auto/tools/uic/baseline/connectdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'connectdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -126,12 +126,12 @@ public: void retranslateUi(QDialog *ConnectDialog) { - ConnectDialog->setWindowTitle(QApplication::translate("ConnectDialog", "Configure Connection", nullptr)); - signalGroupBox->setTitle(QApplication::translate("ConnectDialog", "GroupBox", nullptr)); - editSignalsButton->setText(QApplication::translate("ConnectDialog", "Edit...", nullptr)); - slotGroupBox->setTitle(QApplication::translate("ConnectDialog", "GroupBox", nullptr)); - editSlotsButton->setText(QApplication::translate("ConnectDialog", "Edit...", nullptr)); - showAllCheckBox->setText(QApplication::translate("ConnectDialog", "Show signals and slots inherited from QWidget", nullptr)); + ConnectDialog->setWindowTitle(QCoreApplication::translate("ConnectDialog", "Configure Connection", nullptr)); + signalGroupBox->setTitle(QCoreApplication::translate("ConnectDialog", "GroupBox", nullptr)); + editSignalsButton->setText(QCoreApplication::translate("ConnectDialog", "Edit...", nullptr)); + slotGroupBox->setTitle(QCoreApplication::translate("ConnectDialog", "GroupBox", nullptr)); + editSlotsButton->setText(QCoreApplication::translate("ConnectDialog", "Edit...", nullptr)); + showAllCheckBox->setText(QCoreApplication::translate("ConnectDialog", "Show signals and slots inherited from QWidget", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/controller.ui.h b/tests/auto/tools/uic/baseline/controller.ui.h index 72b0956472..3ebfad187f 100644 --- a/tests/auto/tools/uic/baseline/controller.ui.h +++ b/tests/auto/tools/uic/baseline/controller.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'controller.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -75,12 +75,12 @@ public: void retranslateUi(QWidget *Controller) { - Controller->setWindowTitle(QApplication::translate("Controller", "Controller", nullptr)); - label->setText(QApplication::translate("Controller", "Controller", nullptr)); - decelerate->setText(QApplication::translate("Controller", "Decelerate", nullptr)); - accelerate->setText(QApplication::translate("Controller", "Accelerate", nullptr)); - right->setText(QApplication::translate("Controller", "Right", nullptr)); - left->setText(QApplication::translate("Controller", "Left", nullptr)); + Controller->setWindowTitle(QCoreApplication::translate("Controller", "Controller", nullptr)); + label->setText(QCoreApplication::translate("Controller", "Controller", nullptr)); + decelerate->setText(QCoreApplication::translate("Controller", "Decelerate", nullptr)); + accelerate->setText(QCoreApplication::translate("Controller", "Accelerate", nullptr)); + right->setText(QCoreApplication::translate("Controller", "Right", nullptr)); + left->setText(QCoreApplication::translate("Controller", "Left", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/cookies.ui.h b/tests/auto/tools/uic/baseline/cookies.ui.h index 144c306874..2cc21888b1 100644 --- a/tests/auto/tools/uic/baseline/cookies.ui.h +++ b/tests/auto/tools/uic/baseline/cookies.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'cookies.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -91,9 +91,9 @@ public: void retranslateUi(QDialog *CookiesDialog) { - CookiesDialog->setWindowTitle(QApplication::translate("CookiesDialog", "Cookies", nullptr)); - removeButton->setText(QApplication::translate("CookiesDialog", "&Remove", nullptr)); - removeAllButton->setText(QApplication::translate("CookiesDialog", "Remove &All Cookies", nullptr)); + CookiesDialog->setWindowTitle(QCoreApplication::translate("CookiesDialog", "Cookies", nullptr)); + removeButton->setText(QCoreApplication::translate("CookiesDialog", "&Remove", nullptr)); + removeAllButton->setText(QCoreApplication::translate("CookiesDialog", "Remove &All Cookies", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h b/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h index a3bf7a449e..77212cf2f3 100644 --- a/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h +++ b/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'cookiesexceptions.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -158,15 +158,15 @@ public: void retranslateUi(QDialog *CookiesExceptionsDialog) { - CookiesExceptionsDialog->setWindowTitle(QApplication::translate("CookiesExceptionsDialog", "Cookie Exceptions", nullptr)); - newExceptionGroupBox->setTitle(QApplication::translate("CookiesExceptionsDialog", "New Exception", nullptr)); - label->setText(QApplication::translate("CookiesExceptionsDialog", "Domain:", nullptr)); - blockButton->setText(QApplication::translate("CookiesExceptionsDialog", "Block", nullptr)); - allowForSessionButton->setText(QApplication::translate("CookiesExceptionsDialog", "Allow For Session", nullptr)); - allowButton->setText(QApplication::translate("CookiesExceptionsDialog", "Allow", nullptr)); - ExceptionsGroupBox->setTitle(QApplication::translate("CookiesExceptionsDialog", "Exceptions", nullptr)); - removeButton->setText(QApplication::translate("CookiesExceptionsDialog", "&Remove", nullptr)); - removeAllButton->setText(QApplication::translate("CookiesExceptionsDialog", "Remove &All", nullptr)); + CookiesExceptionsDialog->setWindowTitle(QCoreApplication::translate("CookiesExceptionsDialog", "Cookie Exceptions", nullptr)); + newExceptionGroupBox->setTitle(QCoreApplication::translate("CookiesExceptionsDialog", "New Exception", nullptr)); + label->setText(QCoreApplication::translate("CookiesExceptionsDialog", "Domain:", nullptr)); + blockButton->setText(QCoreApplication::translate("CookiesExceptionsDialog", "Block", nullptr)); + allowForSessionButton->setText(QCoreApplication::translate("CookiesExceptionsDialog", "Allow For Session", nullptr)); + allowButton->setText(QCoreApplication::translate("CookiesExceptionsDialog", "Allow", nullptr)); + ExceptionsGroupBox->setTitle(QCoreApplication::translate("CookiesExceptionsDialog", "Exceptions", nullptr)); + removeButton->setText(QCoreApplication::translate("CookiesExceptionsDialog", "&Remove", nullptr)); + removeAllButton->setText(QCoreApplication::translate("CookiesExceptionsDialog", "Remove &All", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/default.ui.h b/tests/auto/tools/uic/baseline/default.ui.h index fafff9d728..fbbe81d0b8 100644 --- a/tests/auto/tools/uic/baseline/default.ui.h +++ b/tests/auto/tools/uic/baseline/default.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'default.ui' ** -** Created by: Qt User Interface Compiler version 5.10.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -192,13 +192,13 @@ public: statusbar = new QStatusBar(MainWindow); statusbar->setObjectName(QString::fromUtf8("statusbar")); MainWindow->setStatusBar(statusbar); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) nameLabel->setBuddy(nameCombo); ageLabel->setBuddy(ageSpinBox); passwordLabel->setBuddy(passwordEdit); label->setBuddy(professionList); countryLabel->setBuddy(professionList); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(maleRadioButton, femaleRadioButton); QWidget::setTabOrder(femaleRadioButton, ageSpinBox); QWidget::setTabOrder(ageSpinBox, passwordEdit); @@ -226,84 +226,84 @@ public: void retranslateUi(QMainWindow *MainWindow) { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", nullptr)); - exitAction->setText(QApplication::translate("MainWindow", "&Exit", nullptr)); - aboutQtAction->setText(QApplication::translate("MainWindow", "About Qt", nullptr)); - editStyleAction->setText(QApplication::translate("MainWindow", "Edit &Style", nullptr)); - aboutAction->setText(QApplication::translate("MainWindow", "About", nullptr)); - nameLabel->setText(QApplication::translate("MainWindow", "&Name:", nullptr)); - nameCombo->setItemText(0, QApplication::translate("MainWindow", "Girish", nullptr)); - nameCombo->setItemText(1, QApplication::translate("MainWindow", "Jasmin", nullptr)); - nameCombo->setItemText(2, QApplication::translate("MainWindow", "Simon", nullptr)); - nameCombo->setItemText(3, QApplication::translate("MainWindow", "Zack", nullptr)); - -#ifndef QT_NO_TOOLTIP - nameCombo->setToolTip(QApplication::translate("MainWindow", "Specify your name", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - femaleRadioButton->setToolTip(QApplication::translate("MainWindow", "Check this if you are female", nullptr)); -#endif // QT_NO_TOOLTIP - femaleRadioButton->setText(QApplication::translate("MainWindow", "&Female", nullptr)); -#ifndef QT_NO_TOOLTIP - agreeCheckBox->setToolTip(QApplication::translate("MainWindow", "Please read the license before checking this", nullptr)); -#endif // QT_NO_TOOLTIP - agreeCheckBox->setText(QApplication::translate("MainWindow", "I &accept the terms and conditions", nullptr)); -#ifndef QT_NO_TOOLTIP - maleRadioButton->setToolTip(QApplication::translate("MainWindow", "Check this if you are male", nullptr)); -#endif // QT_NO_TOOLTIP - maleRadioButton->setText(QApplication::translate("MainWindow", "&Male", nullptr)); - genderLabel->setText(QApplication::translate("MainWindow", "Gender:", nullptr)); -#ifndef QT_NO_TOOLTIP - ageSpinBox->setToolTip(QApplication::translate("MainWindow", "Specify your age", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - ageSpinBox->setStatusTip(QApplication::translate("MainWindow", "Specify your age here", nullptr)); -#endif // QT_NO_STATUSTIP - ageLabel->setText(QApplication::translate("MainWindow", "&Age:", nullptr)); - passwordLabel->setText(QApplication::translate("MainWindow", "&Password:", nullptr)); -#ifndef QT_NO_TOOLTIP - passwordEdit->setToolTip(QApplication::translate("MainWindow", "Specify your password", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - passwordEdit->setStatusTip(QApplication::translate("MainWindow", "Specify your password here", nullptr)); -#endif // QT_NO_STATUSTIP - passwordEdit->setText(QApplication::translate("MainWindow", "Password", nullptr)); - label->setText(QApplication::translate("MainWindow", "Profession", nullptr)); - countryLabel->setText(QApplication::translate("MainWindow", "&Country", nullptr)); + MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr)); + exitAction->setText(QCoreApplication::translate("MainWindow", "&Exit", nullptr)); + aboutQtAction->setText(QCoreApplication::translate("MainWindow", "About Qt", nullptr)); + editStyleAction->setText(QCoreApplication::translate("MainWindow", "Edit &Style", nullptr)); + aboutAction->setText(QCoreApplication::translate("MainWindow", "About", nullptr)); + nameLabel->setText(QCoreApplication::translate("MainWindow", "&Name:", nullptr)); + nameCombo->setItemText(0, QCoreApplication::translate("MainWindow", "Girish", nullptr)); + nameCombo->setItemText(1, QCoreApplication::translate("MainWindow", "Jasmin", nullptr)); + nameCombo->setItemText(2, QCoreApplication::translate("MainWindow", "Simon", nullptr)); + nameCombo->setItemText(3, QCoreApplication::translate("MainWindow", "Zack", nullptr)); + +#if QT_CONFIG(tooltip) + nameCombo->setToolTip(QCoreApplication::translate("MainWindow", "Specify your name", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + femaleRadioButton->setToolTip(QCoreApplication::translate("MainWindow", "Check this if you are female", nullptr)); +#endif // QT_CONFIG(tooltip) + femaleRadioButton->setText(QCoreApplication::translate("MainWindow", "&Female", nullptr)); +#if QT_CONFIG(tooltip) + agreeCheckBox->setToolTip(QCoreApplication::translate("MainWindow", "Please read the license before checking this", nullptr)); +#endif // QT_CONFIG(tooltip) + agreeCheckBox->setText(QCoreApplication::translate("MainWindow", "I &accept the terms and conditions", nullptr)); +#if QT_CONFIG(tooltip) + maleRadioButton->setToolTip(QCoreApplication::translate("MainWindow", "Check this if you are male", nullptr)); +#endif // QT_CONFIG(tooltip) + maleRadioButton->setText(QCoreApplication::translate("MainWindow", "&Male", nullptr)); + genderLabel->setText(QCoreApplication::translate("MainWindow", "Gender:", nullptr)); +#if QT_CONFIG(tooltip) + ageSpinBox->setToolTip(QCoreApplication::translate("MainWindow", "Specify your age", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + ageSpinBox->setStatusTip(QCoreApplication::translate("MainWindow", "Specify your age here", nullptr)); +#endif // QT_CONFIG(statustip) + ageLabel->setText(QCoreApplication::translate("MainWindow", "&Age:", nullptr)); + passwordLabel->setText(QCoreApplication::translate("MainWindow", "&Password:", nullptr)); +#if QT_CONFIG(tooltip) + passwordEdit->setToolTip(QCoreApplication::translate("MainWindow", "Specify your password", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + passwordEdit->setStatusTip(QCoreApplication::translate("MainWindow", "Specify your password here", nullptr)); +#endif // QT_CONFIG(statustip) + passwordEdit->setText(QCoreApplication::translate("MainWindow", "Password", nullptr)); + label->setText(QCoreApplication::translate("MainWindow", "Profession", nullptr)); + countryLabel->setText(QCoreApplication::translate("MainWindow", "&Country", nullptr)); const bool __sortingEnabled = professionList->isSortingEnabled(); professionList->setSortingEnabled(false); QListWidgetItem *___qlistwidgetitem = professionList->item(0); - ___qlistwidgetitem->setText(QApplication::translate("MainWindow", "Developer", nullptr)); + ___qlistwidgetitem->setText(QCoreApplication::translate("MainWindow", "Developer", nullptr)); QListWidgetItem *___qlistwidgetitem1 = professionList->item(1); - ___qlistwidgetitem1->setText(QApplication::translate("MainWindow", "Student", nullptr)); + ___qlistwidgetitem1->setText(QCoreApplication::translate("MainWindow", "Student", nullptr)); QListWidgetItem *___qlistwidgetitem2 = professionList->item(2); - ___qlistwidgetitem2->setText(QApplication::translate("MainWindow", "Fisherman", nullptr)); + ___qlistwidgetitem2->setText(QCoreApplication::translate("MainWindow", "Fisherman", nullptr)); professionList->setSortingEnabled(__sortingEnabled); -#ifndef QT_NO_TOOLTIP - professionList->setToolTip(QApplication::translate("MainWindow", "Select your profession", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - professionList->setStatusTip(QApplication::translate("MainWindow", "Select your profession", nullptr)); -#endif // QT_NO_STATUSTIP -#ifndef QT_NO_WHATSTHIS - professionList->setWhatsThis(QApplication::translate("MainWindow", "Select your profession", nullptr)); -#endif // QT_NO_WHATSTHIS - countryCombo->setItemText(0, QApplication::translate("MainWindow", "Germany", nullptr)); - countryCombo->setItemText(1, QApplication::translate("MainWindow", "India", nullptr)); - countryCombo->setItemText(2, QApplication::translate("MainWindow", "Norway", nullptr)); - countryCombo->setItemText(3, QApplication::translate("MainWindow", "United States Of America", nullptr)); - countryCombo->setItemText(4, QApplication::translate("MainWindow", "United Kingdom", nullptr)); - -#ifndef QT_NO_TOOLTIP - countryCombo->setToolTip(QApplication::translate("MainWindow", "Specify your country", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - countryCombo->setStatusTip(QApplication::translate("MainWindow", "Specify your country here", nullptr)); -#endif // QT_NO_STATUSTIP - menu_File->setTitle(QApplication::translate("MainWindow", "&File", nullptr)); - menu_Help->setTitle(QApplication::translate("MainWindow", "&Help", nullptr)); +#if QT_CONFIG(tooltip) + professionList->setToolTip(QCoreApplication::translate("MainWindow", "Select your profession", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + professionList->setStatusTip(QCoreApplication::translate("MainWindow", "Select your profession", nullptr)); +#endif // QT_CONFIG(statustip) +#if QT_CONFIG(whatsthis) + professionList->setWhatsThis(QCoreApplication::translate("MainWindow", "Select your profession", nullptr)); +#endif // QT_CONFIG(whatsthis) + countryCombo->setItemText(0, QCoreApplication::translate("MainWindow", "Germany", nullptr)); + countryCombo->setItemText(1, QCoreApplication::translate("MainWindow", "India", nullptr)); + countryCombo->setItemText(2, QCoreApplication::translate("MainWindow", "Norway", nullptr)); + countryCombo->setItemText(3, QCoreApplication::translate("MainWindow", "United States Of America", nullptr)); + countryCombo->setItemText(4, QCoreApplication::translate("MainWindow", "United Kingdom", nullptr)); + +#if QT_CONFIG(tooltip) + countryCombo->setToolTip(QCoreApplication::translate("MainWindow", "Specify your country", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + countryCombo->setStatusTip(QCoreApplication::translate("MainWindow", "Specify your country here", nullptr)); +#endif // QT_CONFIG(statustip) + menu_File->setTitle(QCoreApplication::translate("MainWindow", "&File", nullptr)); + menu_Help->setTitle(QCoreApplication::translate("MainWindow", "&Help", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/dialog.ui.h b/tests/auto/tools/uic/baseline/dialog.ui.h index 2a159312b9..aeed71d058 100644 --- a/tests/auto/tools/uic/baseline/dialog.ui.h +++ b/tests/auto/tools/uic/baseline/dialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'dialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -58,10 +58,10 @@ public: void retranslateUi(QDialog *Dialog) { - Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", nullptr)); - loadFromFileButton->setText(QApplication::translate("Dialog", "Load Image From File...", nullptr)); - label->setText(QApplication::translate("Dialog", "Launch two of these dialogs. In the first, press the top button and load an image from a file. In the second, press the bottom button and display the loaded image from shared memory.", nullptr)); - loadFromSharedMemoryButton->setText(QApplication::translate("Dialog", "Display Image From Shared Memory", nullptr)); + Dialog->setWindowTitle(QCoreApplication::translate("Dialog", "Dialog", nullptr)); + loadFromFileButton->setText(QCoreApplication::translate("Dialog", "Load Image From File...", nullptr)); + label->setText(QCoreApplication::translate("Dialog", "Launch two of these dialogs. In the first, press the top button and load an image from a file. In the second, press the bottom button and display the loaded image from shared memory.", nullptr)); + loadFromSharedMemoryButton->setText(QCoreApplication::translate("Dialog", "Display Image From Shared Memory", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/downloaditem.ui.h b/tests/auto/tools/uic/baseline/downloaditem.ui.h index f0e8e88307..31d938f0eb 100644 --- a/tests/auto/tools/uic/baseline/downloaditem.ui.h +++ b/tests/auto/tools/uic/baseline/downloaditem.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'downloaditem.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -124,13 +124,13 @@ public: void retranslateUi(QWidget *DownloadItem) { - DownloadItem->setWindowTitle(QApplication::translate("DownloadItem", "Form", nullptr)); - fileIcon->setText(QApplication::translate("DownloadItem", "Ico", nullptr)); - fileNameLabel->setProperty("text", QVariant(QApplication::translate("DownloadItem", "Filename", nullptr))); + DownloadItem->setWindowTitle(QCoreApplication::translate("DownloadItem", "Form", nullptr)); + fileIcon->setText(QCoreApplication::translate("DownloadItem", "Ico", nullptr)); + fileNameLabel->setProperty("text", QVariant(QCoreApplication::translate("DownloadItem", "Filename", nullptr))); downloadInfoLabel->setProperty("text", QVariant(QString())); - tryAgainButton->setText(QApplication::translate("DownloadItem", "Try Again", nullptr)); - stopButton->setText(QApplication::translate("DownloadItem", "Stop", nullptr)); - openButton->setText(QApplication::translate("DownloadItem", "Open", nullptr)); + tryAgainButton->setText(QCoreApplication::translate("DownloadItem", "Try Again", nullptr)); + stopButton->setText(QCoreApplication::translate("DownloadItem", "Stop", nullptr)); + openButton->setText(QCoreApplication::translate("DownloadItem", "Open", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/downloads.ui.h b/tests/auto/tools/uic/baseline/downloads.ui.h index 1df992d30f..1b5b825792 100644 --- a/tests/auto/tools/uic/baseline/downloads.ui.h +++ b/tests/auto/tools/uic/baseline/downloads.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'downloads.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -79,9 +79,9 @@ public: void retranslateUi(QDialog *DownloadDialog) { - DownloadDialog->setWindowTitle(QApplication::translate("DownloadDialog", "Downloads", nullptr)); - cleanupButton->setText(QApplication::translate("DownloadDialog", "Clean up", nullptr)); - itemCount->setText(QApplication::translate("DownloadDialog", "0 Items", nullptr)); + DownloadDialog->setWindowTitle(QCoreApplication::translate("DownloadDialog", "Downloads", nullptr)); + cleanupButton->setText(QCoreApplication::translate("DownloadDialog", "Clean up", nullptr)); + itemCount->setText(QCoreApplication::translate("DownloadDialog", "0 Items", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h index 194ff578e8..20d6567576 100644 --- a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h +++ b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'embeddeddialog.ui' ** -** Created by: Qt User Interface Compiler version 5.10.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -83,12 +83,12 @@ public: formLayout->setWidget(3, QFormLayout::FieldRole, spacing); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(layoutDirection); label_2->setBuddy(fontComboBox); label_3->setBuddy(style); label_4->setBuddy(spacing); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(embeddedDialog); @@ -97,14 +97,14 @@ public: void retranslateUi(QDialog *embeddedDialog) { - embeddedDialog->setWindowTitle(QApplication::translate("embeddedDialog", "Embedded Dialog", nullptr)); - label->setText(QApplication::translate("embeddedDialog", "Layout Direction:", nullptr)); - layoutDirection->setItemText(0, QApplication::translate("embeddedDialog", "Left to Right", nullptr)); - layoutDirection->setItemText(1, QApplication::translate("embeddedDialog", "Right to Left", nullptr)); - - label_2->setText(QApplication::translate("embeddedDialog", "Select Font:", nullptr)); - label_3->setText(QApplication::translate("embeddedDialog", "Style:", nullptr)); - label_4->setText(QApplication::translate("embeddedDialog", "Layout spacing:", nullptr)); + embeddedDialog->setWindowTitle(QCoreApplication::translate("embeddedDialog", "Embedded Dialog", nullptr)); + label->setText(QCoreApplication::translate("embeddedDialog", "Layout Direction:", nullptr)); + layoutDirection->setItemText(0, QCoreApplication::translate("embeddedDialog", "Left to Right", nullptr)); + layoutDirection->setItemText(1, QCoreApplication::translate("embeddedDialog", "Right to Left", nullptr)); + + label_2->setText(QCoreApplication::translate("embeddedDialog", "Select Font:", nullptr)); + label_3->setText(QCoreApplication::translate("embeddedDialog", "Style:", nullptr)); + label_4->setText(QCoreApplication::translate("embeddedDialog", "Layout spacing:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/enumnostdset.ui.h b/tests/auto/tools/uic/baseline/enumnostdset.ui.h index 233fc616ac..54ec7c4161 100644 --- a/tests/auto/tools/uic/baseline/enumnostdset.ui.h +++ b/tests/auto/tools/uic/baseline/enumnostdset.ui.h @@ -38,7 +38,7 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Form", nullptr)); + Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/filespage.ui.h b/tests/auto/tools/uic/baseline/filespage.ui.h index 29ed981a8a..327b2c571b 100644 --- a/tests/auto/tools/uic/baseline/filespage.ui.h +++ b/tests/auto/tools/uic/baseline/filespage.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'filespage.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -80,10 +80,10 @@ public: void retranslateUi(QWidget *FilesPage) { - FilesPage->setWindowTitle(QApplication::translate("FilesPage", "Form", nullptr)); - fileLabel->setText(QApplication::translate("FilesPage", "Files:", nullptr)); - removeButton->setText(QApplication::translate("FilesPage", "Remove", nullptr)); - removeAllButton->setText(QApplication::translate("FilesPage", "Remove All", nullptr)); + FilesPage->setWindowTitle(QCoreApplication::translate("FilesPage", "Form", nullptr)); + fileLabel->setText(QCoreApplication::translate("FilesPage", "Files:", nullptr)); + removeButton->setText(QCoreApplication::translate("FilesPage", "Remove", nullptr)); + removeAllButton->setText(QCoreApplication::translate("FilesPage", "Remove All", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/filternamedialog.ui.h b/tests/auto/tools/uic/baseline/filternamedialog.ui.h index 716c291fdd..0098282d59 100644 --- a/tests/auto/tools/uic/baseline/filternamedialog.ui.h +++ b/tests/auto/tools/uic/baseline/filternamedialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'filternamedialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -76,8 +76,8 @@ public: void retranslateUi(QDialog *FilterNameDialogClass) { - FilterNameDialogClass->setWindowTitle(QApplication::translate("FilterNameDialogClass", "FilterNameDialog", nullptr)); - label->setText(QApplication::translate("FilterNameDialogClass", "Filter Name:", nullptr)); + FilterNameDialogClass->setWindowTitle(QCoreApplication::translate("FilterNameDialogClass", "FilterNameDialog", nullptr)); + label->setText(QCoreApplication::translate("FilterNameDialogClass", "Filter Name:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/filterpage.ui.h b/tests/auto/tools/uic/baseline/filterpage.ui.h index f6610fdc4d..1581c6554d 100644 --- a/tests/auto/tools/uic/baseline/filterpage.ui.h +++ b/tests/auto/tools/uic/baseline/filterpage.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'filterpage.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -103,14 +103,14 @@ public: void retranslateUi(QWidget *FilterPage) { - FilterPage->setWindowTitle(QApplication::translate("FilterPage", "Form", nullptr)); - label->setText(QApplication::translate("FilterPage", "Filter attributes for current documentation (comma separated list):", nullptr)); - groupBox->setTitle(QApplication::translate("FilterPage", "Custom Filters", nullptr)); + FilterPage->setWindowTitle(QCoreApplication::translate("FilterPage", "Form", nullptr)); + label->setText(QCoreApplication::translate("FilterPage", "Filter attributes for current documentation (comma separated list):", nullptr)); + groupBox->setTitle(QCoreApplication::translate("FilterPage", "Custom Filters", nullptr)); QTreeWidgetItem *___qtreewidgetitem = customFilterWidget->headerItem(); - ___qtreewidgetitem->setText(1, QApplication::translate("FilterPage", "2", nullptr)); - ___qtreewidgetitem->setText(0, QApplication::translate("FilterPage", "1", nullptr)); - addButton->setText(QApplication::translate("FilterPage", "Add", nullptr)); - removeButton->setText(QApplication::translate("FilterPage", "Remove", nullptr)); + ___qtreewidgetitem->setText(1, QCoreApplication::translate("FilterPage", "2", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("FilterPage", "1", nullptr)); + addButton->setText(QCoreApplication::translate("FilterPage", "Add", nullptr)); + removeButton->setText(QCoreApplication::translate("FilterPage", "Remove", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/finddialog.ui.h b/tests/auto/tools/uic/baseline/finddialog.ui.h index a427be3614..f335eee2e4 100644 --- a/tests/auto/tools/uic/baseline/finddialog.ui.h +++ b/tests/auto/tools/uic/baseline/finddialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'finddialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -172,9 +172,9 @@ public: hboxLayout->addLayout(vboxLayout1); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) findWhat->setBuddy(led); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(led, findNxt); QWidget::setTabOrder(findNxt, cancel); QWidget::setTabOrder(cancel, comments); @@ -193,40 +193,40 @@ public: void retranslateUi(QDialog *FindDialog) { - FindDialog->setWindowTitle(QApplication::translate("FindDialog", "Find", nullptr)); -#ifndef QT_NO_WHATSTHIS - FindDialog->setWhatsThis(QApplication::translate("FindDialog", "This window allows you to search for some text in the translation source file.", nullptr)); -#endif // QT_NO_WHATSTHIS - findWhat->setText(QApplication::translate("FindDialog", "&Find what:", nullptr)); -#ifndef QT_NO_WHATSTHIS - led->setWhatsThis(QApplication::translate("FindDialog", "Type in the text to search for.", nullptr)); -#endif // QT_NO_WHATSTHIS - groupBox->setTitle(QApplication::translate("FindDialog", "Options", nullptr)); -#ifndef QT_NO_WHATSTHIS - sourceText->setWhatsThis(QApplication::translate("FindDialog", "Source texts are searched when checked.", nullptr)); -#endif // QT_NO_WHATSTHIS - sourceText->setText(QApplication::translate("FindDialog", "&Source texts", nullptr)); -#ifndef QT_NO_WHATSTHIS - translations->setWhatsThis(QApplication::translate("FindDialog", "Translations are searched when checked.", nullptr)); -#endif // QT_NO_WHATSTHIS - translations->setText(QApplication::translate("FindDialog", "&Translations", nullptr)); -#ifndef QT_NO_WHATSTHIS - matchCase->setWhatsThis(QApplication::translate("FindDialog", "Texts such as 'TeX' and 'tex' are considered as different when checked.", nullptr)); -#endif // QT_NO_WHATSTHIS - matchCase->setText(QApplication::translate("FindDialog", "&Match case", nullptr)); -#ifndef QT_NO_WHATSTHIS - comments->setWhatsThis(QApplication::translate("FindDialog", "Comments and contexts are searched when checked.", nullptr)); -#endif // QT_NO_WHATSTHIS - comments->setText(QApplication::translate("FindDialog", "&Comments", nullptr)); - ignoreAccelerators->setText(QApplication::translate("FindDialog", "Ignore &accelerators", nullptr)); -#ifndef QT_NO_WHATSTHIS - findNxt->setWhatsThis(QApplication::translate("FindDialog", "Click here to find the next occurrence of the text you typed in.", nullptr)); -#endif // QT_NO_WHATSTHIS - findNxt->setText(QApplication::translate("FindDialog", "Find Next", nullptr)); -#ifndef QT_NO_WHATSTHIS - cancel->setWhatsThis(QApplication::translate("FindDialog", "Click here to close this window.", nullptr)); -#endif // QT_NO_WHATSTHIS - cancel->setText(QApplication::translate("FindDialog", "Cancel", nullptr)); + FindDialog->setWindowTitle(QCoreApplication::translate("FindDialog", "Find", nullptr)); +#if QT_CONFIG(whatsthis) + FindDialog->setWhatsThis(QCoreApplication::translate("FindDialog", "This window allows you to search for some text in the translation source file.", nullptr)); +#endif // QT_CONFIG(whatsthis) + findWhat->setText(QCoreApplication::translate("FindDialog", "&Find what:", nullptr)); +#if QT_CONFIG(whatsthis) + led->setWhatsThis(QCoreApplication::translate("FindDialog", "Type in the text to search for.", nullptr)); +#endif // QT_CONFIG(whatsthis) + groupBox->setTitle(QCoreApplication::translate("FindDialog", "Options", nullptr)); +#if QT_CONFIG(whatsthis) + sourceText->setWhatsThis(QCoreApplication::translate("FindDialog", "Source texts are searched when checked.", nullptr)); +#endif // QT_CONFIG(whatsthis) + sourceText->setText(QCoreApplication::translate("FindDialog", "&Source texts", nullptr)); +#if QT_CONFIG(whatsthis) + translations->setWhatsThis(QCoreApplication::translate("FindDialog", "Translations are searched when checked.", nullptr)); +#endif // QT_CONFIG(whatsthis) + translations->setText(QCoreApplication::translate("FindDialog", "&Translations", nullptr)); +#if QT_CONFIG(whatsthis) + matchCase->setWhatsThis(QCoreApplication::translate("FindDialog", "Texts such as 'TeX' and 'tex' are considered as different when checked.", nullptr)); +#endif // QT_CONFIG(whatsthis) + matchCase->setText(QCoreApplication::translate("FindDialog", "&Match case", nullptr)); +#if QT_CONFIG(whatsthis) + comments->setWhatsThis(QCoreApplication::translate("FindDialog", "Comments and contexts are searched when checked.", nullptr)); +#endif // QT_CONFIG(whatsthis) + comments->setText(QCoreApplication::translate("FindDialog", "&Comments", nullptr)); + ignoreAccelerators->setText(QCoreApplication::translate("FindDialog", "Ignore &accelerators", nullptr)); +#if QT_CONFIG(whatsthis) + findNxt->setWhatsThis(QCoreApplication::translate("FindDialog", "Click here to find the next occurrence of the text you typed in.", nullptr)); +#endif // QT_CONFIG(whatsthis) + findNxt->setText(QCoreApplication::translate("FindDialog", "Find Next", nullptr)); +#if QT_CONFIG(whatsthis) + cancel->setWhatsThis(QCoreApplication::translate("FindDialog", "Click here to close this window.", nullptr)); +#endif // QT_CONFIG(whatsthis) + cancel->setText(QCoreApplication::translate("FindDialog", "Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/form.ui.h b/tests/auto/tools/uic/baseline/form.ui.h index ecc63e339b..df8163f726 100644 --- a/tests/auto/tools/uic/baseline/form.ui.h +++ b/tests/auto/tools/uic/baseline/form.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'form.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -123,9 +123,9 @@ public: void retranslateUi(QWidget *WorldTimeForm) { - WorldTimeForm->setWindowTitle(QApplication::translate("WorldTimeForm", "World Time Clock", nullptr)); - label->setText(QApplication::translate("WorldTimeForm", "Current time:", nullptr)); - label_2->setText(QApplication::translate("WorldTimeForm", "Set time zone:", nullptr)); + WorldTimeForm->setWindowTitle(QCoreApplication::translate("WorldTimeForm", "World Time Clock", nullptr)); + label->setText(QCoreApplication::translate("WorldTimeForm", "Current time:", nullptr)); + label_2->setText(QCoreApplication::translate("WorldTimeForm", "Set time zone:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h index d2cfa03edb..17c301e959 100644 --- a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h +++ b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'formwindowsettings.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -250,12 +250,12 @@ public: gridLayout->addWidget(gridPanel, 1, 0, 1, 2); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label_2->setBuddy(defaultSpacingSpinBox); label->setBuddy(defaultMarginSpinBox); label_3->setBuddy(marginFunctionLineEdit); label_3_2->setBuddy(spacingFunctionLineEdit); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(authorLineEdit, defaultMarginSpinBox); QWidget::setTabOrder(defaultMarginSpinBox, defaultSpacingSpinBox); QWidget::setTabOrder(defaultSpacingSpinBox, marginFunctionLineEdit); @@ -271,17 +271,17 @@ public: void retranslateUi(QDialog *FormWindowSettings) { - FormWindowSettings->setWindowTitle(QApplication::translate("FormWindowSettings", "Form Settings", nullptr)); - layoutDefaultGroupBox->setTitle(QApplication::translate("FormWindowSettings", "Layout &Default", nullptr)); - label_2->setText(QApplication::translate("FormWindowSettings", "&Spacing:", nullptr)); - label->setText(QApplication::translate("FormWindowSettings", "&Margin:", nullptr)); - layoutFunctionGroupBox->setTitle(QApplication::translate("FormWindowSettings", "&Layout Function", nullptr)); - label_3->setText(QApplication::translate("FormWindowSettings", "Ma&rgin:", nullptr)); - label_3_2->setText(QApplication::translate("FormWindowSettings", "Spa&cing:", nullptr)); - pixmapFunctionGroupBox_2->setTitle(QApplication::translate("FormWindowSettings", "&Author", nullptr)); - includeHintsGroupBox->setTitle(QApplication::translate("FormWindowSettings", "&Include Hints", nullptr)); - pixmapFunctionGroupBox->setTitle(QApplication::translate("FormWindowSettings", "&Pixmap Function", nullptr)); - gridPanel->setTitle(QApplication::translate("FormWindowSettings", "Grid", nullptr)); + FormWindowSettings->setWindowTitle(QCoreApplication::translate("FormWindowSettings", "Form Settings", nullptr)); + layoutDefaultGroupBox->setTitle(QCoreApplication::translate("FormWindowSettings", "Layout &Default", nullptr)); + label_2->setText(QCoreApplication::translate("FormWindowSettings", "&Spacing:", nullptr)); + label->setText(QCoreApplication::translate("FormWindowSettings", "&Margin:", nullptr)); + layoutFunctionGroupBox->setTitle(QCoreApplication::translate("FormWindowSettings", "&Layout Function", nullptr)); + label_3->setText(QCoreApplication::translate("FormWindowSettings", "Ma&rgin:", nullptr)); + label_3_2->setText(QCoreApplication::translate("FormWindowSettings", "Spa&cing:", nullptr)); + pixmapFunctionGroupBox_2->setTitle(QCoreApplication::translate("FormWindowSettings", "&Author", nullptr)); + includeHintsGroupBox->setTitle(QCoreApplication::translate("FormWindowSettings", "&Include Hints", nullptr)); + pixmapFunctionGroupBox->setTitle(QCoreApplication::translate("FormWindowSettings", "&Pixmap Function", nullptr)); + gridPanel->setTitle(QCoreApplication::translate("FormWindowSettings", "Grid", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/generalpage.ui.h b/tests/auto/tools/uic/baseline/generalpage.ui.h index bd04285d28..6488bfc061 100644 --- a/tests/auto/tools/uic/baseline/generalpage.ui.h +++ b/tests/auto/tools/uic/baseline/generalpage.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'generalpage.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -73,9 +73,9 @@ public: void retranslateUi(QWidget *GeneralPage) { - GeneralPage->setWindowTitle(QApplication::translate("GeneralPage", "Form", nullptr)); - label->setText(QApplication::translate("GeneralPage", "Namespace:", nullptr)); - label_2->setText(QApplication::translate("GeneralPage", "Virtual Folder:", nullptr)); + GeneralPage->setWindowTitle(QCoreApplication::translate("GeneralPage", "Form", nullptr)); + label->setText(QCoreApplication::translate("GeneralPage", "Namespace:", nullptr)); + label_2->setText(QCoreApplication::translate("GeneralPage", "Virtual Folder:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/gridalignment.ui.h b/tests/auto/tools/uic/baseline/gridalignment.ui.h index 421f257c9a..f85ed818f7 100644 --- a/tests/auto/tools/uic/baseline/gridalignment.ui.h +++ b/tests/auto/tools/uic/baseline/gridalignment.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'gridalignment.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -61,11 +61,11 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Form", nullptr)); - pushButton->setText(QApplication::translate("Form", "Left", nullptr)); - pushButton_3->setText(QApplication::translate("Form", "Top", nullptr)); - pushButton_2->setText(QApplication::translate("Form", "Right", nullptr)); - pushButton_4->setText(QApplication::translate("Form", "Bottom", nullptr)); + Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr)); + pushButton->setText(QCoreApplication::translate("Form", "Left", nullptr)); + pushButton_3->setText(QCoreApplication::translate("Form", "Top", nullptr)); + pushButton_2->setText(QCoreApplication::translate("Form", "Right", nullptr)); + pushButton_4->setText(QCoreApplication::translate("Form", "Bottom", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/gridpanel.ui.h b/tests/auto/tools/uic/baseline/gridpanel.ui.h index 858b71d0cc..54c9a3b5de 100644 --- a/tests/auto/tools/uic/baseline/gridpanel.ui.h +++ b/tests/auto/tools/uic/baseline/gridpanel.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'gridpanel.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -120,10 +120,10 @@ public: vboxLayout->addWidget(m_gridGroupBox); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(m_deltaXSpinBox); label_2->setBuddy(m_deltaYSpinBox); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(qdesigner_internal__GridPanel); @@ -132,14 +132,14 @@ public: void retranslateUi(QWidget *qdesigner_internal__GridPanel) { - qdesigner_internal__GridPanel->setWindowTitle(QApplication::translate("qdesigner_internal::GridPanel", "Form", nullptr)); - m_gridGroupBox->setTitle(QApplication::translate("qdesigner_internal::GridPanel", "Grid", nullptr)); - m_visibleCheckBox->setText(QApplication::translate("qdesigner_internal::GridPanel", "Visible", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::GridPanel", "Grid &X", nullptr)); - m_snapXCheckBox->setText(QApplication::translate("qdesigner_internal::GridPanel", "Snap", nullptr)); - m_resetButton->setText(QApplication::translate("qdesigner_internal::GridPanel", "Reset", nullptr)); - label_2->setText(QApplication::translate("qdesigner_internal::GridPanel", "Grid &Y", nullptr)); - m_snapYCheckBox->setText(QApplication::translate("qdesigner_internal::GridPanel", "Snap", nullptr)); + qdesigner_internal__GridPanel->setWindowTitle(QCoreApplication::translate("qdesigner_internal::GridPanel", "Form", nullptr)); + m_gridGroupBox->setTitle(QCoreApplication::translate("qdesigner_internal::GridPanel", "Grid", nullptr)); + m_visibleCheckBox->setText(QCoreApplication::translate("qdesigner_internal::GridPanel", "Visible", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::GridPanel", "Grid &X", nullptr)); + m_snapXCheckBox->setText(QCoreApplication::translate("qdesigner_internal::GridPanel", "Snap", nullptr)); + m_resetButton->setText(QCoreApplication::translate("qdesigner_internal::GridPanel", "Reset", nullptr)); + label_2->setText(QCoreApplication::translate("qdesigner_internal::GridPanel", "Grid &Y", nullptr)); + m_snapYCheckBox->setText(QCoreApplication::translate("qdesigner_internal::GridPanel", "Snap", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/helpdialog.ui.h b/tests/auto/tools/uic/baseline/helpdialog.ui.h index abcf280cf9..1f6cf8783d 100644 --- a/tests/auto/tools/uic/baseline/helpdialog.ui.h +++ b/tests/auto/tools/uic/baseline/helpdialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'helpdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -273,11 +273,11 @@ public: vboxLayout->addWidget(framePrepare); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) TextLabel1->setBuddy(editIndex); TextLabel1_2->setBuddy(termsEdit); TextLabel2->setBuddy(resultBox); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(tabWidget, listContents); QWidget::setTabOrder(listContents, editIndex); QWidget::setTabOrder(editIndex, listIndex); @@ -296,77 +296,77 @@ public: void retranslateUi(QWidget *HelpDialog) { - HelpDialog->setWindowTitle(QApplication::translate("HelpDialog", "Help", nullptr)); -#ifndef QT_NO_WHATSTHIS - HelpDialog->setWhatsThis(QApplication::translate("HelpDialog", "<b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p>", nullptr)); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_WHATSTHIS - tabWidget->setWhatsThis(QApplication::translate("HelpDialog", "Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.", nullptr)); -#endif // QT_NO_WHATSTHIS + HelpDialog->setWindowTitle(QCoreApplication::translate("HelpDialog", "Help", nullptr)); +#if QT_CONFIG(whatsthis) + HelpDialog->setWhatsThis(QCoreApplication::translate("HelpDialog", "<b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p>", nullptr)); +#endif // QT_CONFIG(whatsthis) +#if QT_CONFIG(whatsthis) + tabWidget->setWhatsThis(QCoreApplication::translate("HelpDialog", "Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.", nullptr)); +#endif // QT_CONFIG(whatsthis) QTreeWidgetItem *___qtreewidgetitem = listContents->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("HelpDialog", "column 1", nullptr)); -#ifndef QT_NO_WHATSTHIS - listContents->setWhatsThis(QApplication::translate("HelpDialog", "<b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p>", nullptr)); -#endif // QT_NO_WHATSTHIS - tabWidget->setTabText(tabWidget->indexOf(contentPage), QApplication::translate("HelpDialog", "Con&tents", nullptr)); - TextLabel1->setText(QApplication::translate("HelpDialog", "&Look For:", nullptr)); -#ifndef QT_NO_TOOLTIP - editIndex->setToolTip(QApplication::translate("HelpDialog", "Enter keyword", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - editIndex->setWhatsThis(QApplication::translate("HelpDialog", "<b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p>", nullptr)); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_WHATSTHIS - listIndex->setWhatsThis(QApplication::translate("HelpDialog", "<b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p>", nullptr)); -#endif // QT_NO_WHATSTHIS - tabWidget->setTabText(tabWidget->indexOf(indexPage), QApplication::translate("HelpDialog", "&Index", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("HelpDialog", "column 1", nullptr)); +#if QT_CONFIG(whatsthis) + listContents->setWhatsThis(QCoreApplication::translate("HelpDialog", "<b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p>", nullptr)); +#endif // QT_CONFIG(whatsthis) + tabWidget->setTabText(tabWidget->indexOf(contentPage), QCoreApplication::translate("HelpDialog", "Con&tents", nullptr)); + TextLabel1->setText(QCoreApplication::translate("HelpDialog", "&Look For:", nullptr)); +#if QT_CONFIG(tooltip) + editIndex->setToolTip(QCoreApplication::translate("HelpDialog", "Enter keyword", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + editIndex->setWhatsThis(QCoreApplication::translate("HelpDialog", "<b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p>", nullptr)); +#endif // QT_CONFIG(whatsthis) +#if QT_CONFIG(whatsthis) + listIndex->setWhatsThis(QCoreApplication::translate("HelpDialog", "<b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p>", nullptr)); +#endif // QT_CONFIG(whatsthis) + tabWidget->setTabText(tabWidget->indexOf(indexPage), QCoreApplication::translate("HelpDialog", "&Index", nullptr)); QTreeWidgetItem *___qtreewidgetitem1 = listBookmarks->headerItem(); - ___qtreewidgetitem1->setText(0, QApplication::translate("HelpDialog", "column 1", nullptr)); -#ifndef QT_NO_WHATSTHIS - listBookmarks->setWhatsThis(QApplication::translate("HelpDialog", "Displays the list of bookmarks.", nullptr)); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_TOOLTIP - buttonAdd->setToolTip(QApplication::translate("HelpDialog", "Add new bookmark", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - buttonAdd->setWhatsThis(QApplication::translate("HelpDialog", "Add the currently displayed page as a new bookmark.", nullptr)); -#endif // QT_NO_WHATSTHIS - buttonAdd->setText(QApplication::translate("HelpDialog", "&New", nullptr)); -#ifndef QT_NO_TOOLTIP - buttonRemove->setToolTip(QApplication::translate("HelpDialog", "Delete bookmark", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - buttonRemove->setWhatsThis(QApplication::translate("HelpDialog", "Delete the selected bookmark.", nullptr)); -#endif // QT_NO_WHATSTHIS - buttonRemove->setText(QApplication::translate("HelpDialog", "&Delete", nullptr)); - tabWidget->setTabText(tabWidget->indexOf(bookmarkPage), QApplication::translate("HelpDialog", "&Bookmarks", nullptr)); - TextLabel1_2->setText(QApplication::translate("HelpDialog", "Searching f&or:", nullptr)); -#ifndef QT_NO_TOOLTIP - termsEdit->setToolTip(QApplication::translate("HelpDialog", "Enter searchword(s).", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - termsEdit->setWhatsThis(QApplication::translate("HelpDialog", "<b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p>", nullptr)); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_WHATSTHIS - resultBox->setWhatsThis(QApplication::translate("HelpDialog", "<b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p>", nullptr)); -#endif // QT_NO_WHATSTHIS - TextLabel2->setText(QApplication::translate("HelpDialog", "Found &Documents:", nullptr)); -#ifndef QT_NO_TOOLTIP - helpButton->setToolTip(QApplication::translate("HelpDialog", "Display the help page.", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - helpButton->setWhatsThis(QApplication::translate("HelpDialog", "Display the help page for the full text search.", nullptr)); -#endif // QT_NO_WHATSTHIS - helpButton->setText(QApplication::translate("HelpDialog", "He&lp", nullptr)); -#ifndef QT_NO_TOOLTIP - searchButton->setToolTip(QApplication::translate("HelpDialog", "Start searching.", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - searchButton->setWhatsThis(QApplication::translate("HelpDialog", "Pressing this button starts the search.", nullptr)); -#endif // QT_NO_WHATSTHIS - searchButton->setText(QApplication::translate("HelpDialog", "&Search", nullptr)); - tabWidget->setTabText(tabWidget->indexOf(searchPage), QApplication::translate("HelpDialog", "&Search", nullptr)); - labelPrepare->setText(QApplication::translate("HelpDialog", "Preparing...", nullptr)); + ___qtreewidgetitem1->setText(0, QCoreApplication::translate("HelpDialog", "column 1", nullptr)); +#if QT_CONFIG(whatsthis) + listBookmarks->setWhatsThis(QCoreApplication::translate("HelpDialog", "Displays the list of bookmarks.", nullptr)); +#endif // QT_CONFIG(whatsthis) +#if QT_CONFIG(tooltip) + buttonAdd->setToolTip(QCoreApplication::translate("HelpDialog", "Add new bookmark", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + buttonAdd->setWhatsThis(QCoreApplication::translate("HelpDialog", "Add the currently displayed page as a new bookmark.", nullptr)); +#endif // QT_CONFIG(whatsthis) + buttonAdd->setText(QCoreApplication::translate("HelpDialog", "&New", nullptr)); +#if QT_CONFIG(tooltip) + buttonRemove->setToolTip(QCoreApplication::translate("HelpDialog", "Delete bookmark", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + buttonRemove->setWhatsThis(QCoreApplication::translate("HelpDialog", "Delete the selected bookmark.", nullptr)); +#endif // QT_CONFIG(whatsthis) + buttonRemove->setText(QCoreApplication::translate("HelpDialog", "&Delete", nullptr)); + tabWidget->setTabText(tabWidget->indexOf(bookmarkPage), QCoreApplication::translate("HelpDialog", "&Bookmarks", nullptr)); + TextLabel1_2->setText(QCoreApplication::translate("HelpDialog", "Searching f&or:", nullptr)); +#if QT_CONFIG(tooltip) + termsEdit->setToolTip(QCoreApplication::translate("HelpDialog", "Enter searchword(s).", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + termsEdit->setWhatsThis(QCoreApplication::translate("HelpDialog", "<b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p>", nullptr)); +#endif // QT_CONFIG(whatsthis) +#if QT_CONFIG(whatsthis) + resultBox->setWhatsThis(QCoreApplication::translate("HelpDialog", "<b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p>", nullptr)); +#endif // QT_CONFIG(whatsthis) + TextLabel2->setText(QCoreApplication::translate("HelpDialog", "Found &Documents:", nullptr)); +#if QT_CONFIG(tooltip) + helpButton->setToolTip(QCoreApplication::translate("HelpDialog", "Display the help page.", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + helpButton->setWhatsThis(QCoreApplication::translate("HelpDialog", "Display the help page for the full text search.", nullptr)); +#endif // QT_CONFIG(whatsthis) + helpButton->setText(QCoreApplication::translate("HelpDialog", "He&lp", nullptr)); +#if QT_CONFIG(tooltip) + searchButton->setToolTip(QCoreApplication::translate("HelpDialog", "Start searching.", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + searchButton->setWhatsThis(QCoreApplication::translate("HelpDialog", "Pressing this button starts the search.", nullptr)); +#endif // QT_CONFIG(whatsthis) + searchButton->setText(QCoreApplication::translate("HelpDialog", "&Search", nullptr)); + tabWidget->setTabText(tabWidget->indexOf(searchPage), QCoreApplication::translate("HelpDialog", "&Search", nullptr)); + labelPrepare->setText(QCoreApplication::translate("HelpDialog", "Preparing...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/history.ui.h b/tests/auto/tools/uic/baseline/history.ui.h index 715312d11a..7f48fb9f54 100644 --- a/tests/auto/tools/uic/baseline/history.ui.h +++ b/tests/auto/tools/uic/baseline/history.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'history.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -91,9 +91,9 @@ public: void retranslateUi(QDialog *HistoryDialog) { - HistoryDialog->setWindowTitle(QApplication::translate("HistoryDialog", "History", nullptr)); - removeButton->setText(QApplication::translate("HistoryDialog", "&Remove", nullptr)); - removeAllButton->setText(QApplication::translate("HistoryDialog", "Remove &All", nullptr)); + HistoryDialog->setWindowTitle(QCoreApplication::translate("HistoryDialog", "History", nullptr)); + removeButton->setText(QCoreApplication::translate("HistoryDialog", "&Remove", nullptr)); + removeAllButton->setText(QCoreApplication::translate("HistoryDialog", "Remove &All", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/icontheme.ui.h b/tests/auto/tools/uic/baseline/icontheme.ui.h index 936d6b5cf7..f1f6e42a02 100644 --- a/tests/auto/tools/uic/baseline/icontheme.ui.h +++ b/tests/auto/tools/uic/baseline/icontheme.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'icontheme.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -75,10 +75,10 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Form", nullptr)); - fileicon->setText(QApplication::translate("Form", "fileicon", nullptr)); - fileandthemeicon->setText(QApplication::translate("Form", "PushButton", nullptr)); - themeicon->setText(QApplication::translate("Form", "PushButton", nullptr)); + Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr)); + fileicon->setText(QCoreApplication::translate("Form", "fileicon", nullptr)); + fileandthemeicon->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); + themeicon->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/idbased.ui.h b/tests/auto/tools/uic/baseline/idbased.ui.h index e246313e11..0209895a3c 100644 --- a/tests/auto/tools/uic/baseline/idbased.ui.h +++ b/tests/auto/tools/uic/baseline/idbased.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'idbased.ui' ** -** Created by: Qt User Interface Compiler version 5.11.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -44,15 +44,15 @@ public: void retranslateUi(QWidget *Form) { Form->setWindowTitle(qtTrId("windowTitleId")); -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) pushButton->setToolTip(qtTrId("buttonToolTipId")); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) pushButton->setStatusTip(qtTrId("buttonStatusTipId")); -#endif // QT_NO_STATUSTIP -#ifndef QT_NO_WHATSTHIS +#endif // QT_CONFIG(statustip) +#if QT_CONFIG(whatsthis) pushButton->setWhatsThis(qtTrId("buttonWhatsThisId")); -#endif // QT_NO_WHATSTHIS +#endif // QT_CONFIG(whatsthis) pushButton->setText(qtTrId("buttonTextId")); } // retranslateUi diff --git a/tests/auto/tools/uic/baseline/identifierpage.ui.h b/tests/auto/tools/uic/baseline/identifierpage.ui.h index 322a9cf30a..420d668fe9 100644 --- a/tests/auto/tools/uic/baseline/identifierpage.ui.h +++ b/tests/auto/tools/uic/baseline/identifierpage.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'identifierpage.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -89,10 +89,10 @@ public: void retranslateUi(QWidget *IdentifierPage) { - IdentifierPage->setWindowTitle(QApplication::translate("IdentifierPage", "Form", nullptr)); - identifierCheckBox->setText(QApplication::translate("IdentifierPage", "Create identifiers", nullptr)); - globalButton->setText(QApplication::translate("IdentifierPage", "Global prefix:", nullptr)); - fileNameButton->setText(QApplication::translate("IdentifierPage", "Inherit prefix from file names", nullptr)); + IdentifierPage->setWindowTitle(QCoreApplication::translate("IdentifierPage", "Form", nullptr)); + identifierCheckBox->setText(QCoreApplication::translate("IdentifierPage", "Create identifiers", nullptr)); + globalButton->setText(QCoreApplication::translate("IdentifierPage", "Global prefix:", nullptr)); + fileNameButton->setText(QCoreApplication::translate("IdentifierPage", "Inherit prefix from file names", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/imagedialog.ui.h b/tests/auto/tools/uic/baseline/imagedialog.ui.h index e32e7639fa..993652222d 100644 --- a/tests/auto/tools/uic/baseline/imagedialog.ui.h +++ b/tests/auto/tools/uic/baseline/imagedialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'imagedialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -196,14 +196,14 @@ public: void retranslateUi(QDialog *dialog) { - dialog->setWindowTitle(QApplication::translate("ImageDialog", "Create Image", nullptr)); - widthLabel->setText(QApplication::translate("ImageDialog", "Width:", nullptr)); - heightLabel->setText(QApplication::translate("ImageDialog", "Height:", nullptr)); - nameLineEdit->setText(QApplication::translate("ImageDialog", "Untitled image", nullptr)); - nameLabel->setText(QApplication::translate("ImageDialog", "Name:", nullptr)); - colorDepthLabel->setText(QApplication::translate("ImageDialog", "Color depth:", nullptr)); - okButton->setText(QApplication::translate("ImageDialog", "OK", nullptr)); - cancelButton->setText(QApplication::translate("ImageDialog", "Cancel", nullptr)); + dialog->setWindowTitle(QCoreApplication::translate("ImageDialog", "Create Image", nullptr)); + widthLabel->setText(QCoreApplication::translate("ImageDialog", "Width:", nullptr)); + heightLabel->setText(QCoreApplication::translate("ImageDialog", "Height:", nullptr)); + nameLineEdit->setText(QCoreApplication::translate("ImageDialog", "Untitled image", nullptr)); + nameLabel->setText(QCoreApplication::translate("ImageDialog", "Name:", nullptr)); + colorDepthLabel->setText(QCoreApplication::translate("ImageDialog", "Color depth:", nullptr)); + okButton->setText(QCoreApplication::translate("ImageDialog", "OK", nullptr)); + cancelButton->setText(QCoreApplication::translate("ImageDialog", "Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/inputpage.ui.h b/tests/auto/tools/uic/baseline/inputpage.ui.h index 9367dec6df..0cb4cce4f2 100644 --- a/tests/auto/tools/uic/baseline/inputpage.ui.h +++ b/tests/auto/tools/uic/baseline/inputpage.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'inputpage.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -81,9 +81,9 @@ public: void retranslateUi(QWidget *InputPage) { - InputPage->setWindowTitle(QApplication::translate("InputPage", "Form", nullptr)); - label->setText(QApplication::translate("InputPage", "File name:", nullptr)); - browseButton->setText(QApplication::translate("InputPage", "...", nullptr)); + InputPage->setWindowTitle(QCoreApplication::translate("InputPage", "Form", nullptr)); + label->setText(QCoreApplication::translate("InputPage", "File name:", nullptr)); + browseButton->setText(QCoreApplication::translate("InputPage", "...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/installdialog.ui.h b/tests/auto/tools/uic/baseline/installdialog.ui.h index 3ec7f69b76..b452971f19 100644 --- a/tests/auto/tools/uic/baseline/installdialog.ui.h +++ b/tests/auto/tools/uic/baseline/installdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'installdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -120,13 +120,13 @@ public: void retranslateUi(QDialog *InstallDialog) { - InstallDialog->setWindowTitle(QApplication::translate("InstallDialog", "Install Documentation", nullptr)); - label->setText(QApplication::translate("InstallDialog", "Available Documentation:", nullptr)); - installButton->setText(QApplication::translate("InstallDialog", "Install", nullptr)); - cancelButton->setText(QApplication::translate("InstallDialog", "Cancel", nullptr)); - closeButton->setText(QApplication::translate("InstallDialog", "Close", nullptr)); - label_4->setText(QApplication::translate("InstallDialog", "Installation Path:", nullptr)); - browseButton->setText(QApplication::translate("InstallDialog", "...", nullptr)); + InstallDialog->setWindowTitle(QCoreApplication::translate("InstallDialog", "Install Documentation", nullptr)); + label->setText(QCoreApplication::translate("InstallDialog", "Available Documentation:", nullptr)); + installButton->setText(QCoreApplication::translate("InstallDialog", "Install", nullptr)); + cancelButton->setText(QCoreApplication::translate("InstallDialog", "Cancel", nullptr)); + closeButton->setText(QCoreApplication::translate("InstallDialog", "Close", nullptr)); + label_4->setText(QCoreApplication::translate("InstallDialog", "Installation Path:", nullptr)); + browseButton->setText(QCoreApplication::translate("InstallDialog", "...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/languagesdialog.ui.h b/tests/auto/tools/uic/baseline/languagesdialog.ui.h index cf2599fd07..f605d942d4 100644 --- a/tests/auto/tools/uic/baseline/languagesdialog.ui.h +++ b/tests/auto/tools/uic/baseline/languagesdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'languagesdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -108,39 +108,39 @@ public: void retranslateUi(QDialog *LanguagesDialog) { - LanguagesDialog->setWindowTitle(QApplication::translate("LanguagesDialog", "Auxiliary Languages", nullptr)); + LanguagesDialog->setWindowTitle(QCoreApplication::translate("LanguagesDialog", "Auxiliary Languages", nullptr)); QTreeWidgetItem *___qtreewidgetitem = languagesList->headerItem(); - ___qtreewidgetitem->setText(1, QApplication::translate("LanguagesDialog", "File", nullptr)); - ___qtreewidgetitem->setText(0, QApplication::translate("LanguagesDialog", "Locale", nullptr)); -#ifndef QT_NO_TOOLTIP - upButton->setToolTip(QApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" + ___qtreewidgetitem->setText(1, QCoreApplication::translate("LanguagesDialog", "File", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("LanguagesDialog", "Locale", nullptr)); +#if QT_CONFIG(tooltip) + upButton->setToolTip(QCoreApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Move selected language up</p></body></html>", nullptr)); -#endif // QT_NO_TOOLTIP - upButton->setText(QApplication::translate("LanguagesDialog", "up", nullptr)); -#ifndef QT_NO_TOOLTIP - downButton->setToolTip(QApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" +#endif // QT_CONFIG(tooltip) + upButton->setText(QCoreApplication::translate("LanguagesDialog", "up", nullptr)); +#if QT_CONFIG(tooltip) + downButton->setToolTip(QCoreApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\">Move selected language down</p></body></html>", nullptr)); -#endif // QT_NO_TOOLTIP - downButton->setText(QApplication::translate("LanguagesDialog", "down", nullptr)); -#ifndef QT_NO_TOOLTIP - removeButton->setToolTip(QApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" +#endif // QT_CONFIG(tooltip) + downButton->setText(QCoreApplication::translate("LanguagesDialog", "down", nullptr)); +#if QT_CONFIG(tooltip) + removeButton->setToolTip(QCoreApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Remove selected language</p></body></html>", nullptr)); -#endif // QT_NO_TOOLTIP - removeButton->setText(QApplication::translate("LanguagesDialog", "remove", nullptr)); -#ifndef QT_NO_TOOLTIP - openFileButton->setToolTip(QApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" +#endif // QT_CONFIG(tooltip) + removeButton->setText(QCoreApplication::translate("LanguagesDialog", "remove", nullptr)); +#if QT_CONFIG(tooltip) + openFileButton->setToolTip(QCoreApplication::translate("LanguagesDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Open auxiliary language files</p></body></html>", nullptr)); -#endif // QT_NO_TOOLTIP - openFileButton->setText(QApplication::translate("LanguagesDialog", "...", nullptr)); - okButton->setText(QApplication::translate("LanguagesDialog", "OK", nullptr)); +#endif // QT_CONFIG(tooltip) + openFileButton->setText(QCoreApplication::translate("LanguagesDialog", "...", nullptr)); + okButton->setText(QCoreApplication::translate("LanguagesDialog", "OK", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h index 14067ced18..721d4c9950 100644 --- a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'listwidgeteditor.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -172,28 +172,28 @@ public: void retranslateUi(QDialog *qdesigner_internal__ListWidgetEditor) { - qdesigner_internal__ListWidgetEditor->setWindowTitle(QApplication::translate("qdesigner_internal::ListWidgetEditor", "Dialog", nullptr)); - groupBox->setTitle(QApplication::translate("qdesigner_internal::ListWidgetEditor", "Items List", nullptr)); -#ifndef QT_NO_TOOLTIP - listWidget->setToolTip(QApplication::translate("qdesigner_internal::ListWidgetEditor", "Items List", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - newItemButton->setToolTip(QApplication::translate("qdesigner_internal::ListWidgetEditor", "New Item", nullptr)); -#endif // QT_NO_TOOLTIP - newItemButton->setText(QApplication::translate("qdesigner_internal::ListWidgetEditor", "&New", nullptr)); -#ifndef QT_NO_TOOLTIP - deleteItemButton->setToolTip(QApplication::translate("qdesigner_internal::ListWidgetEditor", "Delete Item", nullptr)); -#endif // QT_NO_TOOLTIP - deleteItemButton->setText(QApplication::translate("qdesigner_internal::ListWidgetEditor", "&Delete", nullptr)); -#ifndef QT_NO_TOOLTIP - moveItemUpButton->setToolTip(QApplication::translate("qdesigner_internal::ListWidgetEditor", "Move Item Up", nullptr)); -#endif // QT_NO_TOOLTIP - moveItemUpButton->setText(QApplication::translate("qdesigner_internal::ListWidgetEditor", "U", nullptr)); -#ifndef QT_NO_TOOLTIP - moveItemDownButton->setToolTip(QApplication::translate("qdesigner_internal::ListWidgetEditor", "Move Item Down", nullptr)); -#endif // QT_NO_TOOLTIP - moveItemDownButton->setText(QApplication::translate("qdesigner_internal::ListWidgetEditor", "D", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::ListWidgetEditor", "Icon", nullptr)); + qdesigner_internal__ListWidgetEditor->setWindowTitle(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "Dialog", nullptr)); + groupBox->setTitle(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "Items List", nullptr)); +#if QT_CONFIG(tooltip) + listWidget->setToolTip(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "Items List", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + newItemButton->setToolTip(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "New Item", nullptr)); +#endif // QT_CONFIG(tooltip) + newItemButton->setText(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "&New", nullptr)); +#if QT_CONFIG(tooltip) + deleteItemButton->setToolTip(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "Delete Item", nullptr)); +#endif // QT_CONFIG(tooltip) + deleteItemButton->setText(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "&Delete", nullptr)); +#if QT_CONFIG(tooltip) + moveItemUpButton->setToolTip(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "Move Item Up", nullptr)); +#endif // QT_CONFIG(tooltip) + moveItemUpButton->setText(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "U", nullptr)); +#if QT_CONFIG(tooltip) + moveItemDownButton->setToolTip(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "Move Item Down", nullptr)); +#endif // QT_CONFIG(tooltip) + moveItemDownButton->setText(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "D", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::ListWidgetEditor", "Icon", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/mainwindow.ui.h b/tests/auto/tools/uic/baseline/mainwindow.ui.h index fe84d0baa3..df61d57ceb 100644 --- a/tests/auto/tools/uic/baseline/mainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/mainwindow.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'mainwindow.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -361,30 +361,30 @@ public: void retranslateUi(QMainWindow *MainWindow) { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MakeQPF", nullptr)); - actionAdd_Custom_Font->setText(QApplication::translate("MainWindow", "&Add Custom Font...", nullptr)); - action_Exit->setText(QApplication::translate("MainWindow", "&Exit", nullptr)); - groupBox->setTitle(QApplication::translate("MainWindow", "Font Properties", nullptr)); - label->setText(QApplication::translate("MainWindow", "Family:", nullptr)); - label_2->setText(QApplication::translate("MainWindow", "Pixel Size:", nullptr)); - label_7->setText(QApplication::translate("MainWindow", "Weight:", nullptr)); - italic->setText(QApplication::translate("MainWindow", "Italic", nullptr)); - groupBox_2->setTitle(QApplication::translate("MainWindow", "Glyph Coverage", nullptr)); - chooseFromCodePoints->setText(QApplication::translate("MainWindow", "Choose from Unicode Codepoints:", nullptr)); - selectAll->setText(QApplication::translate("MainWindow", "Select &All", nullptr)); - deselectAll->setText(QApplication::translate("MainWindow", "&Deselect All", nullptr)); - invertSelection->setText(QApplication::translate("MainWindow", "&Invert Selection", nullptr)); - chooseFromSampleFile->setText(QApplication::translate("MainWindow", "Choose from Sample Text File (UTF-8 Encoded):", nullptr)); - label_5->setText(QApplication::translate("MainWindow", "Path:", nullptr)); - browseSampleFile->setText(QApplication::translate("MainWindow", "Browse...", nullptr)); - charCount->setText(QApplication::translate("MainWindow", "TextLabel", nullptr)); - groupBox_3->setTitle(QApplication::translate("MainWindow", "Preview", nullptr)); - groupBox_4->setTitle(QApplication::translate("MainWindow", "Output Options", nullptr)); - label_3->setText(QApplication::translate("MainWindow", "Path:", nullptr)); - browsePath->setText(QApplication::translate("MainWindow", "Browse...", nullptr)); - label_4->setText(QApplication::translate("MainWindow", "Filename:", nullptr)); - generate->setText(QApplication::translate("MainWindow", "Generate Pre-Rendered Font...", nullptr)); - menuFile->setTitle(QApplication::translate("MainWindow", "File", nullptr)); + MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MakeQPF", nullptr)); + actionAdd_Custom_Font->setText(QCoreApplication::translate("MainWindow", "&Add Custom Font...", nullptr)); + action_Exit->setText(QCoreApplication::translate("MainWindow", "&Exit", nullptr)); + groupBox->setTitle(QCoreApplication::translate("MainWindow", "Font Properties", nullptr)); + label->setText(QCoreApplication::translate("MainWindow", "Family:", nullptr)); + label_2->setText(QCoreApplication::translate("MainWindow", "Pixel Size:", nullptr)); + label_7->setText(QCoreApplication::translate("MainWindow", "Weight:", nullptr)); + italic->setText(QCoreApplication::translate("MainWindow", "Italic", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("MainWindow", "Glyph Coverage", nullptr)); + chooseFromCodePoints->setText(QCoreApplication::translate("MainWindow", "Choose from Unicode Codepoints:", nullptr)); + selectAll->setText(QCoreApplication::translate("MainWindow", "Select &All", nullptr)); + deselectAll->setText(QCoreApplication::translate("MainWindow", "&Deselect All", nullptr)); + invertSelection->setText(QCoreApplication::translate("MainWindow", "&Invert Selection", nullptr)); + chooseFromSampleFile->setText(QCoreApplication::translate("MainWindow", "Choose from Sample Text File (UTF-8 Encoded):", nullptr)); + label_5->setText(QCoreApplication::translate("MainWindow", "Path:", nullptr)); + browseSampleFile->setText(QCoreApplication::translate("MainWindow", "Browse...", nullptr)); + charCount->setText(QCoreApplication::translate("MainWindow", "TextLabel", nullptr)); + groupBox_3->setTitle(QCoreApplication::translate("MainWindow", "Preview", nullptr)); + groupBox_4->setTitle(QCoreApplication::translate("MainWindow", "Output Options", nullptr)); + label_3->setText(QCoreApplication::translate("MainWindow", "Path:", nullptr)); + browsePath->setText(QCoreApplication::translate("MainWindow", "Browse...", nullptr)); + label_4->setText(QCoreApplication::translate("MainWindow", "Filename:", nullptr)); + generate->setText(QCoreApplication::translate("MainWindow", "Generate Pre-Rendered Font...", nullptr)); + menuFile->setTitle(QCoreApplication::translate("MainWindow", "File", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/mydialog.ui.h b/tests/auto/tools/uic/baseline/mydialog.ui.h index 1a784d1b0a..e71927092f 100644 --- a/tests/auto/tools/uic/baseline/mydialog.ui.h +++ b/tests/auto/tools/uic/baseline/mydialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'mydialog.ui' ** -** Created by: Qt User Interface Compiler version 5.9.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -56,12 +56,12 @@ public: void retranslateUi(QDialog *MyDialog) { - MyDialog->setWindowTitle(QApplication::translate("MyDialog", "Mach 2!", nullptr)); - aLabel->setText(QApplication::translate("MyDialog", "Join the life in the fastlane; - PCH enable your project today! -", nullptr)); - aButton->setText(QApplication::translate("MyDialog", "&Quit", nullptr)); -#ifndef QT_NO_SHORTCUT - aButton->setShortcut(QApplication::translate("MyDialog", "Alt+Q", nullptr)); -#endif // QT_NO_SHORTCUT + MyDialog->setWindowTitle(QCoreApplication::translate("MyDialog", "Mach 2!", nullptr)); + aLabel->setText(QCoreApplication::translate("MyDialog", "Join the life in the fastlane; - PCH enable your project today! -", nullptr)); + aButton->setText(QCoreApplication::translate("MyDialog", "&Quit", nullptr)); +#if QT_CONFIG(shortcut) + aButton->setShortcut(QCoreApplication::translate("MyDialog", "Alt+Q", nullptr)); +#endif // QT_CONFIG(shortcut) } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/myform.ui.h b/tests/auto/tools/uic/baseline/myform.ui.h index d3a08e04c9..87d88e8246 100644 --- a/tests/auto/tools/uic/baseline/myform.ui.h +++ b/tests/auto/tools/uic/baseline/myform.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'myform.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -120,17 +120,17 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Export Document", nullptr)); - groupBox->setTitle(QApplication::translate("Form", "Export Options", nullptr)); - radioButton_2->setText(QApplication::translate("Form", "&DocBook", nullptr)); - radioButton->setText(QApplication::translate("Form", "&LaTeX", nullptr)); - checkBox_2->setText(QApplication::translate("Form", "Include p&ictures", nullptr)); - checkBox->setText(QApplication::translate("Form", "&Compress", nullptr)); - radioButton_2_2->setText(QApplication::translate("Form", "&HTML", nullptr)); - radioButton_3->setText(QApplication::translate("Form", "&PostScript", nullptr)); - radioButton_4->setText(QApplication::translate("Form", "PD&F", nullptr)); - checkBox_3->setText(QApplication::translate("Form", "Include &metadata", nullptr)); - checkBox_4->setText(QApplication::translate("Form", "Create inde&x", nullptr)); + Form->setWindowTitle(QCoreApplication::translate("Form", "Export Document", nullptr)); + groupBox->setTitle(QCoreApplication::translate("Form", "Export Options", nullptr)); + radioButton_2->setText(QCoreApplication::translate("Form", "&DocBook", nullptr)); + radioButton->setText(QCoreApplication::translate("Form", "&LaTeX", nullptr)); + checkBox_2->setText(QCoreApplication::translate("Form", "Include p&ictures", nullptr)); + checkBox->setText(QCoreApplication::translate("Form", "&Compress", nullptr)); + radioButton_2_2->setText(QCoreApplication::translate("Form", "&HTML", nullptr)); + radioButton_3->setText(QCoreApplication::translate("Form", "&PostScript", nullptr)); + radioButton_4->setText(QCoreApplication::translate("Form", "PD&F", nullptr)); + checkBox_3->setText(QCoreApplication::translate("Form", "Include &metadata", nullptr)); + checkBox_4->setText(QCoreApplication::translate("Form", "Create inde&x", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/newactiondialog.ui.h b/tests/auto/tools/uic/baseline/newactiondialog.ui.h index ca99ab8356..4b3b6bcf1a 100644 --- a/tests/auto/tools/uic/baseline/newactiondialog.ui.h +++ b/tests/auto/tools/uic/baseline/newactiondialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'newactiondialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -143,11 +143,11 @@ public: verticalLayout->addWidget(buttonBox); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(editActionText); label_3->setBuddy(editObjectName); label_2->setBuddy(iconSelector); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(editActionText, editObjectName); retranslateUi(qdesigner_internal__NewActionDialog); @@ -159,10 +159,10 @@ public: void retranslateUi(QDialog *qdesigner_internal__NewActionDialog) { - qdesigner_internal__NewActionDialog->setWindowTitle(QApplication::translate("qdesigner_internal::NewActionDialog", "New Action...", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::NewActionDialog", "&Text:", nullptr)); - label_3->setText(QApplication::translate("qdesigner_internal::NewActionDialog", "Object &name:", nullptr)); - label_2->setText(QApplication::translate("qdesigner_internal::NewActionDialog", "&Icon:", nullptr)); + qdesigner_internal__NewActionDialog->setWindowTitle(QCoreApplication::translate("qdesigner_internal::NewActionDialog", "New Action...", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::NewActionDialog", "&Text:", nullptr)); + label_3->setText(QCoreApplication::translate("qdesigner_internal::NewActionDialog", "Object &name:", nullptr)); + label_2->setText(QCoreApplication::translate("qdesigner_internal::NewActionDialog", "&Icon:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h index f5fd6f1fa4..406f8bc1a3 100644 --- a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h +++ b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'newdynamicpropertydialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -108,9 +108,9 @@ public: void retranslateUi(QDialog *qdesigner_internal__NewDynamicPropertyDialog) { - qdesigner_internal__NewDynamicPropertyDialog->setWindowTitle(QApplication::translate("qdesigner_internal::NewDynamicPropertyDialog", "Create Dynamic Property", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::NewDynamicPropertyDialog", "Property Name", nullptr)); - label_2->setText(QApplication::translate("qdesigner_internal::NewDynamicPropertyDialog", "Property Type", nullptr)); + qdesigner_internal__NewDynamicPropertyDialog->setWindowTitle(QCoreApplication::translate("qdesigner_internal::NewDynamicPropertyDialog", "Create Dynamic Property", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::NewDynamicPropertyDialog", "Property Name", nullptr)); + label_2->setText(QCoreApplication::translate("qdesigner_internal::NewDynamicPropertyDialog", "Property Type", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/newform.ui.h b/tests/auto/tools/uic/baseline/newform.ui.h index 80e70dcf66..2f680f822f 100644 --- a/tests/auto/tools/uic/baseline/newform.ui.h +++ b/tests/auto/tools/uic/baseline/newform.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'newform.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -132,11 +132,11 @@ public: void retranslateUi(QDialog *NewForm) { - NewForm->setWindowTitle(QApplication::translate("NewForm", "New Form", nullptr)); + NewForm->setWindowTitle(QCoreApplication::translate("NewForm", "New Form", nullptr)); QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("NewForm", "0", nullptr)); - lblPreview->setText(QApplication::translate("NewForm", "Choose a template for a preview", nullptr)); - chkShowOnStartup->setText(QApplication::translate("NewForm", "Show this Dialog on Startup", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("NewForm", "0", nullptr)); + lblPreview->setText(QCoreApplication::translate("NewForm", "Choose a template for a preview", nullptr)); + chkShowOnStartup->setText(QCoreApplication::translate("NewForm", "Show this Dialog on Startup", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/orderdialog.ui.h b/tests/auto/tools/uic/baseline/orderdialog.ui.h index 0ee08257f4..532ec2d41c 100644 --- a/tests/auto/tools/uic/baseline/orderdialog.ui.h +++ b/tests/auto/tools/uic/baseline/orderdialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'orderdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -130,14 +130,14 @@ public: void retranslateUi(QDialog *qdesigner_internal__OrderDialog) { - qdesigner_internal__OrderDialog->setWindowTitle(QApplication::translate("qdesigner_internal::OrderDialog", "Change Page Order", nullptr)); - groupBox->setTitle(QApplication::translate("qdesigner_internal::OrderDialog", "Page Order", nullptr)); -#ifndef QT_NO_TOOLTIP - upButton->setToolTip(QApplication::translate("qdesigner_internal::OrderDialog", "Move page up", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - downButton->setToolTip(QApplication::translate("qdesigner_internal::OrderDialog", "Move page down", nullptr)); -#endif // QT_NO_TOOLTIP + qdesigner_internal__OrderDialog->setWindowTitle(QCoreApplication::translate("qdesigner_internal::OrderDialog", "Change Page Order", nullptr)); + groupBox->setTitle(QCoreApplication::translate("qdesigner_internal::OrderDialog", "Page Order", nullptr)); +#if QT_CONFIG(tooltip) + upButton->setToolTip(QCoreApplication::translate("qdesigner_internal::OrderDialog", "Move page up", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + downButton->setToolTip(QCoreApplication::translate("qdesigner_internal::OrderDialog", "Move page down", nullptr)); +#endif // QT_CONFIG(tooltip) } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/outputpage.ui.h b/tests/auto/tools/uic/baseline/outputpage.ui.h index 00491bb3d8..9d2593dc77 100644 --- a/tests/auto/tools/uic/baseline/outputpage.ui.h +++ b/tests/auto/tools/uic/baseline/outputpage.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'outputpage.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -87,9 +87,9 @@ public: void retranslateUi(QWidget *OutputPage) { - OutputPage->setWindowTitle(QApplication::translate("OutputPage", "Form", nullptr)); - label->setText(QApplication::translate("OutputPage", "Project file name:", nullptr)); - label_2->setText(QApplication::translate("OutputPage", "Collection file name:", nullptr)); + OutputPage->setWindowTitle(QCoreApplication::translate("OutputPage", "Form", nullptr)); + label->setText(QCoreApplication::translate("OutputPage", "Project file name:", nullptr)); + label_2->setText(QCoreApplication::translate("OutputPage", "Collection file name:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/pagefold.ui.h b/tests/auto/tools/uic/baseline/pagefold.ui.h index c1ff03648d..a0594b7ec7 100644 --- a/tests/auto/tools/uic/baseline/pagefold.ui.h +++ b/tests/auto/tools/uic/baseline/pagefold.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'pagefold.ui' ** -** Created by: Qt User Interface Compiler version 5.10.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -213,13 +213,13 @@ public: statusbar = new QStatusBar(MainWindow); statusbar->setObjectName(QString::fromUtf8("statusbar")); MainWindow->setStatusBar(statusbar); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) ageLabel->setBuddy(ageSpinBox); nameLabel->setBuddy(nameCombo); passwordLabel->setBuddy(passwordEdit); label->setBuddy(professionList); countryLabel->setBuddy(professionList); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) menubar->addAction(menu_File->menuAction()); menubar->addAction(menu_Help->menuAction()); @@ -242,84 +242,84 @@ public: void retranslateUi(QMainWindow *MainWindow) { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", nullptr)); - exitAction->setText(QApplication::translate("MainWindow", "&Exit", nullptr)); - aboutQtAction->setText(QApplication::translate("MainWindow", "About Qt", nullptr)); - editStyleAction->setText(QApplication::translate("MainWindow", "Edit &Style", nullptr)); - aboutAction->setText(QApplication::translate("MainWindow", "About", nullptr)); - nameCombo->setItemText(0, QApplication::translate("MainWindow", "Girish", nullptr)); - nameCombo->setItemText(1, QApplication::translate("MainWindow", "Jasmin", nullptr)); - nameCombo->setItemText(2, QApplication::translate("MainWindow", "Simon", nullptr)); - nameCombo->setItemText(3, QApplication::translate("MainWindow", "Zack", nullptr)); - -#ifndef QT_NO_TOOLTIP - nameCombo->setToolTip(QApplication::translate("MainWindow", "Specify your name", nullptr)); -#endif // QT_NO_TOOLTIP - femaleRadioButton->setStyleSheet(QApplication::translate("MainWindow", "Check this if you are female", nullptr)); - femaleRadioButton->setText(QApplication::translate("MainWindow", "&Female", nullptr)); - genderLabel->setText(QApplication::translate("MainWindow", "Gender:", nullptr)); - ageLabel->setText(QApplication::translate("MainWindow", "&Age:", nullptr)); -#ifndef QT_NO_TOOLTIP - maleRadioButton->setToolTip(QApplication::translate("MainWindow", "Check this if you are male", nullptr)); -#endif // QT_NO_TOOLTIP - maleRadioButton->setText(QApplication::translate("MainWindow", "&Male", nullptr)); - nameLabel->setText(QApplication::translate("MainWindow", "&Name:", nullptr)); - passwordLabel->setText(QApplication::translate("MainWindow", "&Password:", nullptr)); -#ifndef QT_NO_TOOLTIP - ageSpinBox->setToolTip(QApplication::translate("MainWindow", "Specify your age", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - ageSpinBox->setStatusTip(QApplication::translate("MainWindow", "Specify your age", nullptr)); -#endif // QT_NO_STATUSTIP -#ifndef QT_NO_TOOLTIP - agreeCheckBox->setToolTip(QApplication::translate("MainWindow", "Please read the LICENSE file before checking", nullptr)); -#endif // QT_NO_TOOLTIP - agreeCheckBox->setText(QApplication::translate("MainWindow", "I &accept the terms and &conditions", nullptr)); -#ifndef QT_NO_TOOLTIP - passwordEdit->setToolTip(QApplication::translate("MainWindow", "Specify your password", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - passwordEdit->setStatusTip(QApplication::translate("MainWindow", "Specify your password", nullptr)); -#endif // QT_NO_STATUSTIP - passwordEdit->setText(QApplication::translate("MainWindow", "Password", nullptr)); + MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr)); + exitAction->setText(QCoreApplication::translate("MainWindow", "&Exit", nullptr)); + aboutQtAction->setText(QCoreApplication::translate("MainWindow", "About Qt", nullptr)); + editStyleAction->setText(QCoreApplication::translate("MainWindow", "Edit &Style", nullptr)); + aboutAction->setText(QCoreApplication::translate("MainWindow", "About", nullptr)); + nameCombo->setItemText(0, QCoreApplication::translate("MainWindow", "Girish", nullptr)); + nameCombo->setItemText(1, QCoreApplication::translate("MainWindow", "Jasmin", nullptr)); + nameCombo->setItemText(2, QCoreApplication::translate("MainWindow", "Simon", nullptr)); + nameCombo->setItemText(3, QCoreApplication::translate("MainWindow", "Zack", nullptr)); + +#if QT_CONFIG(tooltip) + nameCombo->setToolTip(QCoreApplication::translate("MainWindow", "Specify your name", nullptr)); +#endif // QT_CONFIG(tooltip) + femaleRadioButton->setStyleSheet(QCoreApplication::translate("MainWindow", "Check this if you are female", nullptr)); + femaleRadioButton->setText(QCoreApplication::translate("MainWindow", "&Female", nullptr)); + genderLabel->setText(QCoreApplication::translate("MainWindow", "Gender:", nullptr)); + ageLabel->setText(QCoreApplication::translate("MainWindow", "&Age:", nullptr)); +#if QT_CONFIG(tooltip) + maleRadioButton->setToolTip(QCoreApplication::translate("MainWindow", "Check this if you are male", nullptr)); +#endif // QT_CONFIG(tooltip) + maleRadioButton->setText(QCoreApplication::translate("MainWindow", "&Male", nullptr)); + nameLabel->setText(QCoreApplication::translate("MainWindow", "&Name:", nullptr)); + passwordLabel->setText(QCoreApplication::translate("MainWindow", "&Password:", nullptr)); +#if QT_CONFIG(tooltip) + ageSpinBox->setToolTip(QCoreApplication::translate("MainWindow", "Specify your age", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + ageSpinBox->setStatusTip(QCoreApplication::translate("MainWindow", "Specify your age", nullptr)); +#endif // QT_CONFIG(statustip) +#if QT_CONFIG(tooltip) + agreeCheckBox->setToolTip(QCoreApplication::translate("MainWindow", "Please read the LICENSE file before checking", nullptr)); +#endif // QT_CONFIG(tooltip) + agreeCheckBox->setText(QCoreApplication::translate("MainWindow", "I &accept the terms and &conditions", nullptr)); +#if QT_CONFIG(tooltip) + passwordEdit->setToolTip(QCoreApplication::translate("MainWindow", "Specify your password", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + passwordEdit->setStatusTip(QCoreApplication::translate("MainWindow", "Specify your password", nullptr)); +#endif // QT_CONFIG(statustip) + passwordEdit->setText(QCoreApplication::translate("MainWindow", "Password", nullptr)); const bool __sortingEnabled = professionList->isSortingEnabled(); professionList->setSortingEnabled(false); QListWidgetItem *___qlistwidgetitem = professionList->item(0); - ___qlistwidgetitem->setText(QApplication::translate("MainWindow", "Developer", nullptr)); + ___qlistwidgetitem->setText(QCoreApplication::translate("MainWindow", "Developer", nullptr)); QListWidgetItem *___qlistwidgetitem1 = professionList->item(1); - ___qlistwidgetitem1->setText(QApplication::translate("MainWindow", "Student", nullptr)); + ___qlistwidgetitem1->setText(QCoreApplication::translate("MainWindow", "Student", nullptr)); QListWidgetItem *___qlistwidgetitem2 = professionList->item(2); - ___qlistwidgetitem2->setText(QApplication::translate("MainWindow", "Fisherman", nullptr)); + ___qlistwidgetitem2->setText(QCoreApplication::translate("MainWindow", "Fisherman", nullptr)); professionList->setSortingEnabled(__sortingEnabled); -#ifndef QT_NO_TOOLTIP - professionList->setToolTip(QApplication::translate("MainWindow", "Select your profession", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - professionList->setStatusTip(QApplication::translate("MainWindow", "Specify your name here", nullptr)); -#endif // QT_NO_STATUSTIP -#ifndef QT_NO_WHATSTHIS - professionList->setWhatsThis(QApplication::translate("MainWindow", "Specify your name here", nullptr)); -#endif // QT_NO_WHATSTHIS - label->setText(QApplication::translate("MainWindow", "Profession:", nullptr)); - countryCombo->setItemText(0, QApplication::translate("MainWindow", "Egypt", nullptr)); - countryCombo->setItemText(1, QApplication::translate("MainWindow", "France", nullptr)); - countryCombo->setItemText(2, QApplication::translate("MainWindow", "Germany", nullptr)); - countryCombo->setItemText(3, QApplication::translate("MainWindow", "India", nullptr)); - countryCombo->setItemText(4, QApplication::translate("MainWindow", "Italy", nullptr)); - countryCombo->setItemText(5, QApplication::translate("MainWindow", "Korea", nullptr)); - countryCombo->setItemText(6, QApplication::translate("MainWindow", "Norway", nullptr)); - -#ifndef QT_NO_TOOLTIP - countryCombo->setToolTip(QApplication::translate("MainWindow", "Specify country of origin", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_STATUSTIP - countryCombo->setStatusTip(QApplication::translate("MainWindow", "Specify country of origin", nullptr)); -#endif // QT_NO_STATUSTIP - countryLabel->setText(QApplication::translate("MainWindow", "Pro&fession", nullptr)); - menu_File->setTitle(QApplication::translate("MainWindow", "&File", nullptr)); - menu_Help->setTitle(QApplication::translate("MainWindow", "&Help", nullptr)); +#if QT_CONFIG(tooltip) + professionList->setToolTip(QCoreApplication::translate("MainWindow", "Select your profession", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + professionList->setStatusTip(QCoreApplication::translate("MainWindow", "Specify your name here", nullptr)); +#endif // QT_CONFIG(statustip) +#if QT_CONFIG(whatsthis) + professionList->setWhatsThis(QCoreApplication::translate("MainWindow", "Specify your name here", nullptr)); +#endif // QT_CONFIG(whatsthis) + label->setText(QCoreApplication::translate("MainWindow", "Profession:", nullptr)); + countryCombo->setItemText(0, QCoreApplication::translate("MainWindow", "Egypt", nullptr)); + countryCombo->setItemText(1, QCoreApplication::translate("MainWindow", "France", nullptr)); + countryCombo->setItemText(2, QCoreApplication::translate("MainWindow", "Germany", nullptr)); + countryCombo->setItemText(3, QCoreApplication::translate("MainWindow", "India", nullptr)); + countryCombo->setItemText(4, QCoreApplication::translate("MainWindow", "Italy", nullptr)); + countryCombo->setItemText(5, QCoreApplication::translate("MainWindow", "Korea", nullptr)); + countryCombo->setItemText(6, QCoreApplication::translate("MainWindow", "Norway", nullptr)); + +#if QT_CONFIG(tooltip) + countryCombo->setToolTip(QCoreApplication::translate("MainWindow", "Specify country of origin", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(statustip) + countryCombo->setStatusTip(QCoreApplication::translate("MainWindow", "Specify country of origin", nullptr)); +#endif // QT_CONFIG(statustip) + countryLabel->setText(QCoreApplication::translate("MainWindow", "Pro&fession", nullptr)); + menu_File->setTitle(QCoreApplication::translate("MainWindow", "&File", nullptr)); + menu_Help->setTitle(QCoreApplication::translate("MainWindow", "&Help", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/paletteeditor.ui.h b/tests/auto/tools/uic/baseline/paletteeditor.ui.h index 0061164960..0d0ef75cf9 100644 --- a/tests/auto/tools/uic/baseline/paletteeditor.ui.h +++ b/tests/auto/tools/uic/baseline/paletteeditor.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'paletteeditor.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -197,16 +197,16 @@ public: void retranslateUi(QDialog *qdesigner_internal__PaletteEditor) { - qdesigner_internal__PaletteEditor->setWindowTitle(QApplication::translate("qdesigner_internal::PaletteEditor", "Edit Palette", nullptr)); - advancedBox->setTitle(QApplication::translate("qdesigner_internal::PaletteEditor", "Tune Palette", nullptr)); + qdesigner_internal__PaletteEditor->setWindowTitle(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Edit Palette", nullptr)); + advancedBox->setTitle(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Tune Palette", nullptr)); buildButton->setText(QString()); - detailsRadio->setText(QApplication::translate("qdesigner_internal::PaletteEditor", "Show Details", nullptr)); - computeRadio->setText(QApplication::translate("qdesigner_internal::PaletteEditor", "Compute Details", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::PaletteEditor", "Quick", nullptr)); - GroupBox126->setTitle(QApplication::translate("qdesigner_internal::PaletteEditor", "Preview", nullptr)); - disabledRadio->setText(QApplication::translate("qdesigner_internal::PaletteEditor", "Disabled", nullptr)); - inactiveRadio->setText(QApplication::translate("qdesigner_internal::PaletteEditor", "Inactive", nullptr)); - activeRadio->setText(QApplication::translate("qdesigner_internal::PaletteEditor", "Active", nullptr)); + detailsRadio->setText(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Show Details", nullptr)); + computeRadio->setText(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Compute Details", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Quick", nullptr)); + GroupBox126->setTitle(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Preview", nullptr)); + disabledRadio->setText(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Disabled", nullptr)); + inactiveRadio->setText(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Inactive", nullptr)); + activeRadio->setText(QCoreApplication::translate("qdesigner_internal::PaletteEditor", "Active", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/passworddialog.ui.h b/tests/auto/tools/uic/baseline/passworddialog.ui.h index 9ab95c4de9..0542098ec2 100644 --- a/tests/auto/tools/uic/baseline/passworddialog.ui.h +++ b/tests/auto/tools/uic/baseline/passworddialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'passworddialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -98,11 +98,11 @@ public: void retranslateUi(QDialog *PasswordDialog) { - PasswordDialog->setWindowTitle(QApplication::translate("PasswordDialog", "Authentication Required", nullptr)); - iconLabel->setText(QApplication::translate("PasswordDialog", "DUMMY ICON", nullptr)); - introLabel->setText(QApplication::translate("PasswordDialog", "INTRO TEXT DUMMY", nullptr)); - label->setText(QApplication::translate("PasswordDialog", "Username:", nullptr)); - lblPassword->setText(QApplication::translate("PasswordDialog", "Password:", nullptr)); + PasswordDialog->setWindowTitle(QCoreApplication::translate("PasswordDialog", "Authentication Required", nullptr)); + iconLabel->setText(QCoreApplication::translate("PasswordDialog", "DUMMY ICON", nullptr)); + introLabel->setText(QCoreApplication::translate("PasswordDialog", "INTRO TEXT DUMMY", nullptr)); + label->setText(QCoreApplication::translate("PasswordDialog", "Username:", nullptr)); + lblPassword->setText(QCoreApplication::translate("PasswordDialog", "Password:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/pathpage.ui.h b/tests/auto/tools/uic/baseline/pathpage.ui.h index eb151f9550..bc9f254965 100644 --- a/tests/auto/tools/uic/baseline/pathpage.ui.h +++ b/tests/auto/tools/uic/baseline/pathpage.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'pathpage.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -104,11 +104,11 @@ public: void retranslateUi(QWidget *PathPage) { - PathPage->setWindowTitle(QApplication::translate("PathPage", "Form", nullptr)); - label_2->setText(QApplication::translate("PathPage", "File filters:", nullptr)); - label->setText(QApplication::translate("PathPage", "Documentation source file paths:", nullptr)); - addButton->setText(QApplication::translate("PathPage", "Add", nullptr)); - removeButton->setText(QApplication::translate("PathPage", "Remove", nullptr)); + PathPage->setWindowTitle(QCoreApplication::translate("PathPage", "Form", nullptr)); + label_2->setText(QCoreApplication::translate("PathPage", "File filters:", nullptr)); + label->setText(QCoreApplication::translate("PathPage", "Documentation source file paths:", nullptr)); + addButton->setText(QCoreApplication::translate("PathPage", "Add", nullptr)); + removeButton->setText(QCoreApplication::translate("PathPage", "Remove", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h index 27a0fa79ed..25989c4bd3 100644 --- a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h +++ b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'phrasebookbox.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -165,11 +165,11 @@ public: unnamed->addLayout(buttonLayout); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) target->setBuddy(targetLed); source->setBuddy(sourceLed); definition->setBuddy(definitionLed); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(sourceLed, targetLed); QWidget::setTabOrder(targetLed, definitionLed); QWidget::setTabOrder(definitionLed, newBut); @@ -184,38 +184,38 @@ public: void retranslateUi(QDialog *PhraseBookBox) { - PhraseBookBox->setWindowTitle(QApplication::translate("PhraseBookBox", "Edit Phrase Book", nullptr)); -#ifndef QT_NO_WHATSTHIS - PhraseBookBox->setWhatsThis(QApplication::translate("PhraseBookBox", "This window allows you to add, modify, or delete phrases in a phrase book.", nullptr)); -#endif // QT_NO_WHATSTHIS - target->setText(QApplication::translate("PhraseBookBox", "&Translation:", nullptr)); -#ifndef QT_NO_WHATSTHIS - targetLed->setWhatsThis(QApplication::translate("PhraseBookBox", "This is the phrase in the target language corresponding to the source phrase.", nullptr)); -#endif // QT_NO_WHATSTHIS - source->setText(QApplication::translate("PhraseBookBox", "S&ource phrase:", nullptr)); -#ifndef QT_NO_WHATSTHIS - definitionLed->setWhatsThis(QApplication::translate("PhraseBookBox", "This is a definition for the source phrase.", nullptr)); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_WHATSTHIS - sourceLed->setWhatsThis(QApplication::translate("PhraseBookBox", "This is the phrase in the source language.", nullptr)); -#endif // QT_NO_WHATSTHIS - definition->setText(QApplication::translate("PhraseBookBox", "&Definition:", nullptr)); -#ifndef QT_NO_WHATSTHIS - newBut->setWhatsThis(QApplication::translate("PhraseBookBox", "Click here to add the phrase to the phrase book.", nullptr)); -#endif // QT_NO_WHATSTHIS - newBut->setText(QApplication::translate("PhraseBookBox", "&New Phrase", nullptr)); -#ifndef QT_NO_WHATSTHIS - removeBut->setWhatsThis(QApplication::translate("PhraseBookBox", "Click here to remove the phrase from the phrase book.", nullptr)); -#endif // QT_NO_WHATSTHIS - removeBut->setText(QApplication::translate("PhraseBookBox", "&Remove Phrase", nullptr)); -#ifndef QT_NO_WHATSTHIS - saveBut->setWhatsThis(QApplication::translate("PhraseBookBox", "Click here to save the changes made.", nullptr)); -#endif // QT_NO_WHATSTHIS - saveBut->setText(QApplication::translate("PhraseBookBox", "&Save", nullptr)); -#ifndef QT_NO_WHATSTHIS - closeBut->setWhatsThis(QApplication::translate("PhraseBookBox", "Click here to close this window.", nullptr)); -#endif // QT_NO_WHATSTHIS - closeBut->setText(QApplication::translate("PhraseBookBox", "Close", nullptr)); + PhraseBookBox->setWindowTitle(QCoreApplication::translate("PhraseBookBox", "Edit Phrase Book", nullptr)); +#if QT_CONFIG(whatsthis) + PhraseBookBox->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "This window allows you to add, modify, or delete phrases in a phrase book.", nullptr)); +#endif // QT_CONFIG(whatsthis) + target->setText(QCoreApplication::translate("PhraseBookBox", "&Translation:", nullptr)); +#if QT_CONFIG(whatsthis) + targetLed->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "This is the phrase in the target language corresponding to the source phrase.", nullptr)); +#endif // QT_CONFIG(whatsthis) + source->setText(QCoreApplication::translate("PhraseBookBox", "S&ource phrase:", nullptr)); +#if QT_CONFIG(whatsthis) + definitionLed->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "This is a definition for the source phrase.", nullptr)); +#endif // QT_CONFIG(whatsthis) +#if QT_CONFIG(whatsthis) + sourceLed->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "This is the phrase in the source language.", nullptr)); +#endif // QT_CONFIG(whatsthis) + definition->setText(QCoreApplication::translate("PhraseBookBox", "&Definition:", nullptr)); +#if QT_CONFIG(whatsthis) + newBut->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "Click here to add the phrase to the phrase book.", nullptr)); +#endif // QT_CONFIG(whatsthis) + newBut->setText(QCoreApplication::translate("PhraseBookBox", "&New Phrase", nullptr)); +#if QT_CONFIG(whatsthis) + removeBut->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "Click here to remove the phrase from the phrase book.", nullptr)); +#endif // QT_CONFIG(whatsthis) + removeBut->setText(QCoreApplication::translate("PhraseBookBox", "&Remove Phrase", nullptr)); +#if QT_CONFIG(whatsthis) + saveBut->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "Click here to save the changes made.", nullptr)); +#endif // QT_CONFIG(whatsthis) + saveBut->setText(QCoreApplication::translate("PhraseBookBox", "&Save", nullptr)); +#if QT_CONFIG(whatsthis) + closeBut->setWhatsThis(QCoreApplication::translate("PhraseBookBox", "Click here to close this window.", nullptr)); +#endif // QT_CONFIG(whatsthis) + closeBut->setText(QCoreApplication::translate("PhraseBookBox", "Close", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/pixmapfunction.ui.h b/tests/auto/tools/uic/baseline/pixmapfunction.ui.h index 1644380c15..5a24aeeded 100644 --- a/tests/auto/tools/uic/baseline/pixmapfunction.ui.h +++ b/tests/auto/tools/uic/baseline/pixmapfunction.ui.h @@ -58,9 +58,9 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Form", nullptr)); + Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr)); label->setText(QString()); - pushButton->setText(QApplication::translate("Form", "PushButton", nullptr)); + pushButton->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/plugindialog.ui.h b/tests/auto/tools/uic/baseline/plugindialog.ui.h index 3634b8436f..72e4d22b78 100644 --- a/tests/auto/tools/uic/baseline/plugindialog.ui.h +++ b/tests/auto/tools/uic/baseline/plugindialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'plugindialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -111,11 +111,11 @@ public: void retranslateUi(QDialog *PluginDialog) { - PluginDialog->setWindowTitle(QApplication::translate("PluginDialog", "Plugin Information", nullptr)); - label->setText(QApplication::translate("PluginDialog", "TextLabel", nullptr)); + PluginDialog->setWindowTitle(QCoreApplication::translate("PluginDialog", "Plugin Information", nullptr)); + label->setText(QCoreApplication::translate("PluginDialog", "TextLabel", nullptr)); QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("PluginDialog", "1", nullptr)); - message->setText(QApplication::translate("PluginDialog", "TextLabel", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("PluginDialog", "1", nullptr)); + message->setText(QCoreApplication::translate("PluginDialog", "TextLabel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/preferencesdialog.ui.h b/tests/auto/tools/uic/baseline/preferencesdialog.ui.h index 289e6775b4..c4002eaff7 100644 --- a/tests/auto/tools/uic/baseline/preferencesdialog.ui.h +++ b/tests/auto/tools/uic/baseline/preferencesdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'preferencesdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -150,11 +150,11 @@ public: void retranslateUi(QDialog *PreferencesDialog) { - PreferencesDialog->setWindowTitle(QApplication::translate("PreferencesDialog", "Preferences", nullptr)); - m_uiModeGroupBox->setTitle(QApplication::translate("PreferencesDialog", "User Interface Mode", nullptr)); - m_templatePathGroupBox->setTitle(QApplication::translate("PreferencesDialog", "Additional Template Paths", nullptr)); - m_addTemplatePathButton->setText(QApplication::translate("PreferencesDialog", "...", nullptr)); - m_removeTemplatePathButton->setText(QApplication::translate("PreferencesDialog", "...", nullptr)); + PreferencesDialog->setWindowTitle(QCoreApplication::translate("PreferencesDialog", "Preferences", nullptr)); + m_uiModeGroupBox->setTitle(QCoreApplication::translate("PreferencesDialog", "User Interface Mode", nullptr)); + m_templatePathGroupBox->setTitle(QCoreApplication::translate("PreferencesDialog", "Additional Template Paths", nullptr)); + m_addTemplatePathButton->setText(QCoreApplication::translate("PreferencesDialog", "...", nullptr)); + m_removeTemplatePathButton->setText(QCoreApplication::translate("PreferencesDialog", "...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h b/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h index 3c729b9c65..71e8605832 100644 --- a/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h +++ b/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'previewconfigurationwidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -108,14 +108,14 @@ public: void retranslateUi(QGroupBox *PreviewConfigurationWidget) { - PreviewConfigurationWidget->setWindowTitle(QApplication::translate("PreviewConfigurationWidget", "Form", nullptr)); - PreviewConfigurationWidget->setTitle(QApplication::translate("PreviewConfigurationWidget", "Print/Preview Configuration", nullptr)); - m_styleLabel->setText(QApplication::translate("PreviewConfigurationWidget", "Style", nullptr)); - m_appStyleSheetLabel->setText(QApplication::translate("PreviewConfigurationWidget", "Style sheet", nullptr)); - m_appStyleSheetChangeButton->setText(QApplication::translate("PreviewConfigurationWidget", "...", nullptr)); - m_appStyleSheetClearButton->setText(QApplication::translate("PreviewConfigurationWidget", "...", nullptr)); - m_skinLabel->setText(QApplication::translate("PreviewConfigurationWidget", "Device skin", nullptr)); - m_skinRemoveButton->setText(QApplication::translate("PreviewConfigurationWidget", "...", nullptr)); + PreviewConfigurationWidget->setWindowTitle(QCoreApplication::translate("PreviewConfigurationWidget", "Form", nullptr)); + PreviewConfigurationWidget->setTitle(QCoreApplication::translate("PreviewConfigurationWidget", "Print/Preview Configuration", nullptr)); + m_styleLabel->setText(QCoreApplication::translate("PreviewConfigurationWidget", "Style", nullptr)); + m_appStyleSheetLabel->setText(QCoreApplication::translate("PreviewConfigurationWidget", "Style sheet", nullptr)); + m_appStyleSheetChangeButton->setText(QCoreApplication::translate("PreviewConfigurationWidget", "...", nullptr)); + m_appStyleSheetClearButton->setText(QCoreApplication::translate("PreviewConfigurationWidget", "...", nullptr)); + m_skinLabel->setText(QCoreApplication::translate("PreviewConfigurationWidget", "Device skin", nullptr)); + m_skinRemoveButton->setText(QCoreApplication::translate("PreviewConfigurationWidget", "...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/previewdialogbase.ui.h b/tests/auto/tools/uic/baseline/previewdialogbase.ui.h index 8d4c0dae9f..25017bced0 100644 --- a/tests/auto/tools/uic/baseline/previewdialogbase.ui.h +++ b/tests/auto/tools/uic/baseline/previewdialogbase.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'previewdialogbase.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -156,10 +156,10 @@ public: vboxLayout->addLayout(hboxLayout2); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(paperSizeCombo); label_2->setBuddy(paperOrientationCombo); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(PreviewDialogBase); QObject::connect(buttonBox, SIGNAL(accepted()), PreviewDialogBase, SLOT(accept())); @@ -170,11 +170,11 @@ public: void retranslateUi(QDialog *PreviewDialogBase) { - PreviewDialogBase->setWindowTitle(QApplication::translate("PreviewDialogBase", "Print Preview", nullptr)); - label->setText(QApplication::translate("PreviewDialogBase", "&Paper Size:", nullptr)); - label_2->setText(QApplication::translate("PreviewDialogBase", "&Orientation:", nullptr)); + PreviewDialogBase->setWindowTitle(QCoreApplication::translate("PreviewDialogBase", "Print Preview", nullptr)); + label->setText(QCoreApplication::translate("PreviewDialogBase", "&Paper Size:", nullptr)); + label_2->setText(QCoreApplication::translate("PreviewDialogBase", "&Orientation:", nullptr)); QTreeWidgetItem *___qtreewidgetitem = pageList->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("PreviewDialogBase", "1", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("PreviewDialogBase", "1", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/previewwidget.ui.h b/tests/auto/tools/uic/baseline/previewwidget.ui.h index 6e359416c8..2d883e984f 100644 --- a/tests/auto/tools/uic/baseline/previewwidget.ui.h +++ b/tests/auto/tools/uic/baseline/previewwidget.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'previewwidget.ui' ** -** Created by: Qt User Interface Compiler version 5.10.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -235,18 +235,18 @@ public: void retranslateUi(QWidget *qdesigner_internal__PreviewWidget) { - qdesigner_internal__PreviewWidget->setWindowTitle(QApplication::translate("qdesigner_internal::PreviewWidget", "Preview Window", nullptr)); - LineEdit1->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "LineEdit", nullptr)); - ComboBox1->setItemText(0, QApplication::translate("qdesigner_internal::PreviewWidget", "ComboBox", nullptr)); - - PushButton1->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "PushButton", nullptr)); - ButtonGroup2->setTitle(QApplication::translate("qdesigner_internal::PreviewWidget", "ButtonGroup2", nullptr)); - CheckBox1->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "CheckBox1", nullptr)); - CheckBox2->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "CheckBox2", nullptr)); - ButtonGroup1->setTitle(QApplication::translate("qdesigner_internal::PreviewWidget", "ButtonGroup", nullptr)); - RadioButton1->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "RadioButton1", nullptr)); - RadioButton2->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "RadioButton2", nullptr)); - RadioButton3->setText(QApplication::translate("qdesigner_internal::PreviewWidget", "RadioButton3", nullptr)); + qdesigner_internal__PreviewWidget->setWindowTitle(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "Preview Window", nullptr)); + LineEdit1->setText(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "LineEdit", nullptr)); + ComboBox1->setItemText(0, QCoreApplication::translate("qdesigner_internal::PreviewWidget", "ComboBox", nullptr)); + + PushButton1->setText(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "PushButton", nullptr)); + ButtonGroup2->setTitle(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "ButtonGroup2", nullptr)); + CheckBox1->setText(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "CheckBox1", nullptr)); + CheckBox2->setText(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "CheckBox2", nullptr)); + ButtonGroup1->setTitle(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "ButtonGroup", nullptr)); + RadioButton1->setText(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "RadioButton1", nullptr)); + RadioButton2->setText(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "RadioButton2", nullptr)); + RadioButton3->setText(QCoreApplication::translate("qdesigner_internal::PreviewWidget", "RadioButton3", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/proxy.ui.h b/tests/auto/tools/uic/baseline/proxy.ui.h index a1bc287190..1ecea389f3 100644 --- a/tests/auto/tools/uic/baseline/proxy.ui.h +++ b/tests/auto/tools/uic/baseline/proxy.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'proxy.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -87,11 +87,11 @@ public: void retranslateUi(QDialog *ProxyDialog) { - ProxyDialog->setWindowTitle(QApplication::translate("ProxyDialog", "Proxy Authentication", nullptr)); - iconLabel->setText(QApplication::translate("ProxyDialog", "ICON", nullptr)); - introLabel->setText(QApplication::translate("ProxyDialog", "Connect to proxy", nullptr)); - usernameLabel->setText(QApplication::translate("ProxyDialog", "Username:", nullptr)); - passwordLabel->setText(QApplication::translate("ProxyDialog", "Password:", nullptr)); + ProxyDialog->setWindowTitle(QCoreApplication::translate("ProxyDialog", "Proxy Authentication", nullptr)); + iconLabel->setText(QCoreApplication::translate("ProxyDialog", "ICON", nullptr)); + introLabel->setText(QCoreApplication::translate("ProxyDialog", "Connect to proxy", nullptr)); + usernameLabel->setText(QCoreApplication::translate("ProxyDialog", "Username:", nullptr)); + passwordLabel->setText(QCoreApplication::translate("ProxyDialog", "Password:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qfiledialog.ui.h b/tests/auto/tools/uic/baseline/qfiledialog.ui.h index 53607db449..9e51ee6a7c 100644 --- a/tests/auto/tools/uic/baseline/qfiledialog.ui.h +++ b/tests/auto/tools/uic/baseline/qfiledialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qfiledialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -271,26 +271,26 @@ public: void retranslateUi(QDialog *QFileDialog) { - lookInLabel->setText(QApplication::translate("QFileDialog", "Look in:", nullptr)); -#ifndef QT_NO_TOOLTIP - backButton->setToolTip(QApplication::translate("QFileDialog", "Back", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - forwardButton->setToolTip(QApplication::translate("QFileDialog", "Forward", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - toParentButton->setToolTip(QApplication::translate("QFileDialog", "Parent Directory", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - newFolderButton->setToolTip(QApplication::translate("QFileDialog", "Create New Folder", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - listModeButton->setToolTip(QApplication::translate("QFileDialog", "List View", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - detailModeButton->setToolTip(QApplication::translate("QFileDialog", "Detail View", nullptr)); -#endif // QT_NO_TOOLTIP - fileTypeLabel->setText(QApplication::translate("QFileDialog", "Files of type:", nullptr)); + lookInLabel->setText(QCoreApplication::translate("QFileDialog", "Look in:", nullptr)); +#if QT_CONFIG(tooltip) + backButton->setToolTip(QCoreApplication::translate("QFileDialog", "Back", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + forwardButton->setToolTip(QCoreApplication::translate("QFileDialog", "Forward", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + toParentButton->setToolTip(QCoreApplication::translate("QFileDialog", "Parent Directory", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + newFolderButton->setToolTip(QCoreApplication::translate("QFileDialog", "Create New Folder", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + listModeButton->setToolTip(QCoreApplication::translate("QFileDialog", "List View", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + detailModeButton->setToolTip(QCoreApplication::translate("QFileDialog", "Detail View", nullptr)); +#endif // QT_CONFIG(tooltip) + fileTypeLabel->setText(QCoreApplication::translate("QFileDialog", "Files of type:", nullptr)); Q_UNUSED(QFileDialog); } // retranslateUi diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h index a5379bc468..d21d6da972 100644 --- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h +++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h @@ -290,12 +290,12 @@ public: gridLayout_3->addItem(verticalSpacer, 6, 0, 1, 1); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) pageSizeLabel->setBuddy(pageSizeCombo); widthLabel->setBuddy(pageWidth); heightLabel->setBuddy(pageHeight); paperSourceLabel->setBuddy(paperSource); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(QPageSetupWidget); @@ -304,45 +304,45 @@ public: void retranslateUi(QWidget *QPageSetupWidget) { - QPageSetupWidget->setWindowTitle(QApplication::translate("QPageSetupWidget", "Form", nullptr)); - groupBox_2->setTitle(QApplication::translate("QPageSetupWidget", "Paper", nullptr)); - pageSizeLabel->setText(QApplication::translate("QPageSetupWidget", "Page size:", nullptr)); - widthLabel->setText(QApplication::translate("QPageSetupWidget", "Width:", nullptr)); - heightLabel->setText(QApplication::translate("QPageSetupWidget", "Height:", nullptr)); - paperSourceLabel->setText(QApplication::translate("QPageSetupWidget", "Paper source:", nullptr)); - groupBox_3->setTitle(QApplication::translate("QPageSetupWidget", "Orientation", nullptr)); - portrait->setText(QApplication::translate("QPageSetupWidget", "Portrait", nullptr)); - landscape->setText(QApplication::translate("QPageSetupWidget", "Landscape", nullptr)); - reverseLandscape->setText(QApplication::translate("QPageSetupWidget", "Reverse landscape", nullptr)); - reversePortrait->setText(QApplication::translate("QPageSetupWidget", "Reverse portrait", nullptr)); - groupBox->setTitle(QApplication::translate("QPageSetupWidget", "Margins", nullptr)); -#ifndef QT_NO_TOOLTIP - topMargin->setToolTip(QApplication::translate("QPageSetupWidget", "top margin", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_ACCESSIBILITY - topMargin->setAccessibleName(QApplication::translate("QPageSetupWidget", "top margin", nullptr)); -#endif // QT_NO_ACCESSIBILITY -#ifndef QT_NO_TOOLTIP - leftMargin->setToolTip(QApplication::translate("QPageSetupWidget", "left margin", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_ACCESSIBILITY - leftMargin->setAccessibleName(QApplication::translate("QPageSetupWidget", "left margin", nullptr)); -#endif // QT_NO_ACCESSIBILITY -#ifndef QT_NO_TOOLTIP - rightMargin->setToolTip(QApplication::translate("QPageSetupWidget", "right margin", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_ACCESSIBILITY - rightMargin->setAccessibleName(QApplication::translate("QPageSetupWidget", "right margin", nullptr)); -#endif // QT_NO_ACCESSIBILITY -#ifndef QT_NO_TOOLTIP - bottomMargin->setToolTip(QApplication::translate("QPageSetupWidget", "bottom margin", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_ACCESSIBILITY - bottomMargin->setAccessibleName(QApplication::translate("QPageSetupWidget", "bottom margin", nullptr)); -#endif // QT_NO_ACCESSIBILITY - pagesPerSheetButtonGroup->setTitle(QApplication::translate("QPageSetupWidget", "Page Layout", nullptr)); - label->setText(QApplication::translate("QPageSetupWidget", "Page order:", nullptr)); - label_2->setText(QApplication::translate("QPageSetupWidget", "Pages per sheet:", nullptr)); + QPageSetupWidget->setWindowTitle(QCoreApplication::translate("QPageSetupWidget", "Form", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("QPageSetupWidget", "Paper", nullptr)); + pageSizeLabel->setText(QCoreApplication::translate("QPageSetupWidget", "Page size:", nullptr)); + widthLabel->setText(QCoreApplication::translate("QPageSetupWidget", "Width:", nullptr)); + heightLabel->setText(QCoreApplication::translate("QPageSetupWidget", "Height:", nullptr)); + paperSourceLabel->setText(QCoreApplication::translate("QPageSetupWidget", "Paper source:", nullptr)); + groupBox_3->setTitle(QCoreApplication::translate("QPageSetupWidget", "Orientation", nullptr)); + portrait->setText(QCoreApplication::translate("QPageSetupWidget", "Portrait", nullptr)); + landscape->setText(QCoreApplication::translate("QPageSetupWidget", "Landscape", nullptr)); + reverseLandscape->setText(QCoreApplication::translate("QPageSetupWidget", "Reverse landscape", nullptr)); + reversePortrait->setText(QCoreApplication::translate("QPageSetupWidget", "Reverse portrait", nullptr)); + groupBox->setTitle(QCoreApplication::translate("QPageSetupWidget", "Margins", nullptr)); +#if QT_CONFIG(tooltip) + topMargin->setToolTip(QCoreApplication::translate("QPageSetupWidget", "top margin", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(accessibility) + topMargin->setAccessibleName(QCoreApplication::translate("QPageSetupWidget", "top margin", nullptr)); +#endif // QT_CONFIG(accessibility) +#if QT_CONFIG(tooltip) + leftMargin->setToolTip(QCoreApplication::translate("QPageSetupWidget", "left margin", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(accessibility) + leftMargin->setAccessibleName(QCoreApplication::translate("QPageSetupWidget", "left margin", nullptr)); +#endif // QT_CONFIG(accessibility) +#if QT_CONFIG(tooltip) + rightMargin->setToolTip(QCoreApplication::translate("QPageSetupWidget", "right margin", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(accessibility) + rightMargin->setAccessibleName(QCoreApplication::translate("QPageSetupWidget", "right margin", nullptr)); +#endif // QT_CONFIG(accessibility) +#if QT_CONFIG(tooltip) + bottomMargin->setToolTip(QCoreApplication::translate("QPageSetupWidget", "bottom margin", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(accessibility) + bottomMargin->setAccessibleName(QCoreApplication::translate("QPageSetupWidget", "bottom margin", nullptr)); +#endif // QT_CONFIG(accessibility) + pagesPerSheetButtonGroup->setTitle(QCoreApplication::translate("QPageSetupWidget", "Page Layout", nullptr)); + label->setText(QCoreApplication::translate("QPageSetupWidget", "Page order:", nullptr)); + label_2->setText(QCoreApplication::translate("QPageSetupWidget", "Pages per sheet:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h b/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h index 8626a9fc3c..f0e06548b5 100644 --- a/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h +++ b/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qprintpropertieswidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -79,9 +79,9 @@ public: void retranslateUi(QWidget *QPrintPropertiesWidget) { - QPrintPropertiesWidget->setWindowTitle(QApplication::translate("QPrintPropertiesWidget", "Form", nullptr)); - tabs->setTabText(tabs->indexOf(tabPage), QApplication::translate("QPrintPropertiesWidget", "Page", nullptr)); - tabs->setTabText(tabs->indexOf(cupsPropertiesPage), QApplication::translate("QPrintPropertiesWidget", "Advanced", nullptr)); + QPrintPropertiesWidget->setWindowTitle(QCoreApplication::translate("QPrintPropertiesWidget", "Form", nullptr)); + tabs->setTabText(tabs->indexOf(tabPage), QCoreApplication::translate("QPrintPropertiesWidget", "Page", nullptr)); + tabs->setTabText(tabs->indexOf(cupsPropertiesPage), QCoreApplication::translate("QPrintPropertiesWidget", "Advanced", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h b/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h index 656b5f9deb..3d37a55548 100644 --- a/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h +++ b/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qprintsettingsoutput.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -260,9 +260,9 @@ public: horizontalLayout_2->addWidget(tabs); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(copies); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(QPrintSettingsOutput); QObject::connect(printRange, SIGNAL(toggled(bool)), from, SLOT(setEnabled(bool))); @@ -276,25 +276,25 @@ public: void retranslateUi(QWidget *QPrintSettingsOutput) { - QPrintSettingsOutput->setWindowTitle(QApplication::translate("QPrintSettingsOutput", "Form", nullptr)); - gbPrintRange->setTitle(QApplication::translate("QPrintSettingsOutput", "Print range", nullptr)); - printAll->setText(QApplication::translate("QPrintSettingsOutput", "Print all", nullptr)); - printRange->setText(QApplication::translate("QPrintSettingsOutput", "Pages from", nullptr)); - label_3->setText(QApplication::translate("QPrintSettingsOutput", "to", nullptr)); - printSelection->setText(QApplication::translate("QPrintSettingsOutput", "Selection", nullptr)); - groupBox->setTitle(QApplication::translate("QPrintSettingsOutput", "Output Settings", nullptr)); - label->setText(QApplication::translate("QPrintSettingsOutput", "Copies:", nullptr)); - collate->setText(QApplication::translate("QPrintSettingsOutput", "Collate", nullptr)); - reverse->setText(QApplication::translate("QPrintSettingsOutput", "Reverse", nullptr)); - tabs->setTabText(tabs->indexOf(copiesTab), QApplication::translate("QPrintSettingsOutput", "Copies", nullptr)); - colorMode->setTitle(QApplication::translate("QPrintSettingsOutput", "Color Mode", nullptr)); - color->setText(QApplication::translate("QPrintSettingsOutput", "Color", nullptr)); - grayscale->setText(QApplication::translate("QPrintSettingsOutput", "Grayscale", nullptr)); - duplex->setTitle(QApplication::translate("QPrintSettingsOutput", "Duplex Printing", nullptr)); - noDuplex->setText(QApplication::translate("QPrintSettingsOutput", "None", nullptr)); - duplexLong->setText(QApplication::translate("QPrintSettingsOutput", "Long side", nullptr)); - duplexShort->setText(QApplication::translate("QPrintSettingsOutput", "Short side", nullptr)); - tabs->setTabText(tabs->indexOf(optionsTab), QApplication::translate("QPrintSettingsOutput", "Options", nullptr)); + QPrintSettingsOutput->setWindowTitle(QCoreApplication::translate("QPrintSettingsOutput", "Form", nullptr)); + gbPrintRange->setTitle(QCoreApplication::translate("QPrintSettingsOutput", "Print range", nullptr)); + printAll->setText(QCoreApplication::translate("QPrintSettingsOutput", "Print all", nullptr)); + printRange->setText(QCoreApplication::translate("QPrintSettingsOutput", "Pages from", nullptr)); + label_3->setText(QCoreApplication::translate("QPrintSettingsOutput", "to", nullptr)); + printSelection->setText(QCoreApplication::translate("QPrintSettingsOutput", "Selection", nullptr)); + groupBox->setTitle(QCoreApplication::translate("QPrintSettingsOutput", "Output Settings", nullptr)); + label->setText(QCoreApplication::translate("QPrintSettingsOutput", "Copies:", nullptr)); + collate->setText(QCoreApplication::translate("QPrintSettingsOutput", "Collate", nullptr)); + reverse->setText(QCoreApplication::translate("QPrintSettingsOutput", "Reverse", nullptr)); + tabs->setTabText(tabs->indexOf(copiesTab), QCoreApplication::translate("QPrintSettingsOutput", "Copies", nullptr)); + colorMode->setTitle(QCoreApplication::translate("QPrintSettingsOutput", "Color Mode", nullptr)); + color->setText(QCoreApplication::translate("QPrintSettingsOutput", "Color", nullptr)); + grayscale->setText(QCoreApplication::translate("QPrintSettingsOutput", "Grayscale", nullptr)); + duplex->setTitle(QCoreApplication::translate("QPrintSettingsOutput", "Duplex Printing", nullptr)); + noDuplex->setText(QCoreApplication::translate("QPrintSettingsOutput", "None", nullptr)); + duplexLong->setText(QCoreApplication::translate("QPrintSettingsOutput", "Long side", nullptr)); + duplexShort->setText(QCoreApplication::translate("QPrintSettingsOutput", "Short side", nullptr)); + tabs->setTabText(tabs->indexOf(optionsTab), QCoreApplication::translate("QPrintSettingsOutput", "Options", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qprintwidget.ui.h b/tests/auto/tools/uic/baseline/qprintwidget.ui.h index 04b05143c6..5b1d921173 100644 --- a/tests/auto/tools/uic/baseline/qprintwidget.ui.h +++ b/tests/auto/tools/uic/baseline/qprintwidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qprintwidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -128,10 +128,10 @@ public: horizontalLayout_2->addWidget(printerGroup); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(printers); lOutput->setBuddy(filename); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(QPrintWidget); @@ -140,15 +140,15 @@ public: void retranslateUi(QWidget *QPrintWidget) { - QPrintWidget->setWindowTitle(QApplication::translate("QPrintWidget", "Form", nullptr)); - printerGroup->setTitle(QApplication::translate("QPrintWidget", "Printer", nullptr)); - label->setText(QApplication::translate("QPrintWidget", "&Name:", nullptr)); - properties->setText(QApplication::translate("QPrintWidget", "P&roperties", nullptr)); - label_2->setText(QApplication::translate("QPrintWidget", "Location:", nullptr)); - preview->setText(QApplication::translate("QPrintWidget", "Preview", nullptr)); - label_3->setText(QApplication::translate("QPrintWidget", "Type:", nullptr)); - lOutput->setText(QApplication::translate("QPrintWidget", "Output &file:", nullptr)); - fileBrowser->setText(QApplication::translate("QPrintWidget", "...", nullptr)); + QPrintWidget->setWindowTitle(QCoreApplication::translate("QPrintWidget", "Form", nullptr)); + printerGroup->setTitle(QCoreApplication::translate("QPrintWidget", "Printer", nullptr)); + label->setText(QCoreApplication::translate("QPrintWidget", "&Name:", nullptr)); + properties->setText(QCoreApplication::translate("QPrintWidget", "P&roperties", nullptr)); + label_2->setText(QCoreApplication::translate("QPrintWidget", "Location:", nullptr)); + preview->setText(QCoreApplication::translate("QPrintWidget", "Preview", nullptr)); + label_3->setText(QCoreApplication::translate("QPrintWidget", "Type:", nullptr)); + lOutput->setText(QCoreApplication::translate("QPrintWidget", "Output &file:", nullptr)); + fileBrowser->setText(QCoreApplication::translate("QPrintWidget", "...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h b/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h index 2131bc6d9b..681c1f97da 100644 --- a/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h +++ b/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qsqlconnectiondialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -179,14 +179,14 @@ public: vboxLayout->addLayout(hboxLayout1); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) textLabel4->setBuddy(editUsername); textLabel2->setBuddy(comboDriver); textLabel3->setBuddy(editDatabase); textLabel5->setBuddy(editHostname); textLabel5_2->setBuddy(portSpinBox); textLabel4_2->setBuddy(editPassword); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(comboDriver, editDatabase); QWidget::setTabOrder(editDatabase, editUsername); QWidget::setTabOrder(editUsername, editPassword); @@ -206,18 +206,18 @@ public: void retranslateUi(QDialog *QSqlConnectionDialogUi) { - QSqlConnectionDialogUi->setWindowTitle(QApplication::translate("QSqlConnectionDialogUi", "Connect...", nullptr)); - connGroupBox->setTitle(QApplication::translate("QSqlConnectionDialogUi", "Connection settings", nullptr)); - textLabel4->setText(QApplication::translate("QSqlConnectionDialogUi", "&Username:", nullptr)); - textLabel2->setText(QApplication::translate("QSqlConnectionDialogUi", "D&river", nullptr)); - portSpinBox->setSpecialValueText(QApplication::translate("QSqlConnectionDialogUi", "Default", nullptr)); - textLabel3->setText(QApplication::translate("QSqlConnectionDialogUi", "Database Name:", nullptr)); - textLabel5->setText(QApplication::translate("QSqlConnectionDialogUi", "&Hostname:", nullptr)); - textLabel5_2->setText(QApplication::translate("QSqlConnectionDialogUi", "P&ort:", nullptr)); - textLabel4_2->setText(QApplication::translate("QSqlConnectionDialogUi", "&Password:", nullptr)); - dbCheckBox->setText(QApplication::translate("QSqlConnectionDialogUi", "Us&e predefined in-memory database", nullptr)); - okButton->setText(QApplication::translate("QSqlConnectionDialogUi", "&OK", nullptr)); - cancelButton->setText(QApplication::translate("QSqlConnectionDialogUi", "&Cancel", nullptr)); + QSqlConnectionDialogUi->setWindowTitle(QCoreApplication::translate("QSqlConnectionDialogUi", "Connect...", nullptr)); + connGroupBox->setTitle(QCoreApplication::translate("QSqlConnectionDialogUi", "Connection settings", nullptr)); + textLabel4->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "&Username:", nullptr)); + textLabel2->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "D&river", nullptr)); + portSpinBox->setSpecialValueText(QCoreApplication::translate("QSqlConnectionDialogUi", "Default", nullptr)); + textLabel3->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "Database Name:", nullptr)); + textLabel5->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "&Hostname:", nullptr)); + textLabel5_2->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "P&ort:", nullptr)); + textLabel4_2->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "&Password:", nullptr)); + dbCheckBox->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "Us&e predefined in-memory database", nullptr)); + okButton->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "&OK", nullptr)); + cancelButton->setText(QCoreApplication::translate("QSqlConnectionDialogUi", "&Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h index 805f70e60d..5c09962572 100644 --- a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qtgradientdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -89,7 +89,7 @@ public: void retranslateUi(QDialog *QtGradientDialog) { - QtGradientDialog->setWindowTitle(QApplication::translate("QtGradientDialog", "Edit Gradient", nullptr)); + QtGradientDialog->setWindowTitle(QCoreApplication::translate("QtGradientDialog", "Edit Gradient", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h index 9db07f35ac..7ca14d6ef4 100644 --- a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h @@ -583,119 +583,119 @@ public: void retranslateUi(QWidget *QtGradientEditor) { - QtGradientEditor->setWindowTitle(QApplication::translate("QtGradientEditor", "Form", nullptr)); -#ifndef QT_NO_TOOLTIP - gradientWidget->setToolTip(QApplication::translate("QtGradientEditor", "Gradient Editor", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - gradientWidget->setWhatsThis(QApplication::translate("QtGradientEditor", "This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop.", nullptr)); -#endif // QT_NO_WHATSTHIS - label1->setText(QApplication::translate("QtGradientEditor", "1", nullptr)); - label2->setText(QApplication::translate("QtGradientEditor", "2", nullptr)); - label3->setText(QApplication::translate("QtGradientEditor", "3", nullptr)); - label4->setText(QApplication::translate("QtGradientEditor", "4", nullptr)); - label5->setText(QApplication::translate("QtGradientEditor", "5", nullptr)); -#ifndef QT_NO_TOOLTIP - gradientStopsWidget->setToolTip(QApplication::translate("QtGradientEditor", "Gradient Stops Editor", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_WHATSTHIS - gradientStopsWidget->setWhatsThis(QApplication::translate("QtGradientEditor", "This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions.", nullptr)); -#endif // QT_NO_WHATSTHIS - zoomLabel->setText(QApplication::translate("QtGradientEditor", "Zoom", nullptr)); -#ifndef QT_NO_TOOLTIP - zoomAllButton->setToolTip(QApplication::translate("QtGradientEditor", "Reset Zoom", nullptr)); -#endif // QT_NO_TOOLTIP - zoomAllButton->setText(QApplication::translate("QtGradientEditor", "Reset Zoom", nullptr)); - positionLabel->setText(QApplication::translate("QtGradientEditor", "Position", nullptr)); -#ifndef QT_NO_TOOLTIP - hLabel->setToolTip(QApplication::translate("QtGradientEditor", "Hue", nullptr)); -#endif // QT_NO_TOOLTIP - hLabel->setText(QApplication::translate("QtGradientEditor", "H", nullptr)); -#ifndef QT_NO_TOOLTIP - hueColorLine->setToolTip(QApplication::translate("QtGradientEditor", "Hue", nullptr)); -#endif // QT_NO_TOOLTIP - hueLabel->setText(QApplication::translate("QtGradientEditor", "Hue", nullptr)); -#ifndef QT_NO_TOOLTIP - sLabel->setToolTip(QApplication::translate("QtGradientEditor", "Saturation", nullptr)); -#endif // QT_NO_TOOLTIP - sLabel->setText(QApplication::translate("QtGradientEditor", "S", nullptr)); -#ifndef QT_NO_TOOLTIP - saturationColorLine->setToolTip(QApplication::translate("QtGradientEditor", "Saturation", nullptr)); -#endif // QT_NO_TOOLTIP - saturationLabel->setText(QApplication::translate("QtGradientEditor", "Sat", nullptr)); -#ifndef QT_NO_TOOLTIP - vLabel->setToolTip(QApplication::translate("QtGradientEditor", "Value", nullptr)); -#endif // QT_NO_TOOLTIP - vLabel->setText(QApplication::translate("QtGradientEditor", "V", nullptr)); -#ifndef QT_NO_TOOLTIP - valueColorLine->setToolTip(QApplication::translate("QtGradientEditor", "Value", nullptr)); -#endif // QT_NO_TOOLTIP - valueLabel->setText(QApplication::translate("QtGradientEditor", "Val", nullptr)); -#ifndef QT_NO_TOOLTIP - aLabel->setToolTip(QApplication::translate("QtGradientEditor", "Alpha", nullptr)); -#endif // QT_NO_TOOLTIP - aLabel->setText(QApplication::translate("QtGradientEditor", "A", nullptr)); -#ifndef QT_NO_TOOLTIP - alphaColorLine->setToolTip(QApplication::translate("QtGradientEditor", "Alpha", nullptr)); -#endif // QT_NO_TOOLTIP - alphaLabel->setText(QApplication::translate("QtGradientEditor", "Alpha", nullptr)); -#ifndef QT_NO_TOOLTIP - typeComboBox->setToolTip(QApplication::translate("QtGradientEditor", "Type", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - spreadComboBox->setToolTip(QApplication::translate("QtGradientEditor", "Spread", nullptr)); -#endif // QT_NO_TOOLTIP - colorLabel->setText(QApplication::translate("QtGradientEditor", "Color", nullptr)); -#ifndef QT_NO_TOOLTIP - colorButton->setToolTip(QApplication::translate("QtGradientEditor", "Current stop's color", nullptr)); -#endif // QT_NO_TOOLTIP + QtGradientEditor->setWindowTitle(QCoreApplication::translate("QtGradientEditor", "Form", nullptr)); +#if QT_CONFIG(tooltip) + gradientWidget->setToolTip(QCoreApplication::translate("QtGradientEditor", "Gradient Editor", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + gradientWidget->setWhatsThis(QCoreApplication::translate("QtGradientEditor", "This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop.", nullptr)); +#endif // QT_CONFIG(whatsthis) + label1->setText(QCoreApplication::translate("QtGradientEditor", "1", nullptr)); + label2->setText(QCoreApplication::translate("QtGradientEditor", "2", nullptr)); + label3->setText(QCoreApplication::translate("QtGradientEditor", "3", nullptr)); + label4->setText(QCoreApplication::translate("QtGradientEditor", "4", nullptr)); + label5->setText(QCoreApplication::translate("QtGradientEditor", "5", nullptr)); +#if QT_CONFIG(tooltip) + gradientStopsWidget->setToolTip(QCoreApplication::translate("QtGradientEditor", "Gradient Stops Editor", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(whatsthis) + gradientStopsWidget->setWhatsThis(QCoreApplication::translate("QtGradientEditor", "This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions.", nullptr)); +#endif // QT_CONFIG(whatsthis) + zoomLabel->setText(QCoreApplication::translate("QtGradientEditor", "Zoom", nullptr)); +#if QT_CONFIG(tooltip) + zoomAllButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Reset Zoom", nullptr)); +#endif // QT_CONFIG(tooltip) + zoomAllButton->setText(QCoreApplication::translate("QtGradientEditor", "Reset Zoom", nullptr)); + positionLabel->setText(QCoreApplication::translate("QtGradientEditor", "Position", nullptr)); +#if QT_CONFIG(tooltip) + hLabel->setToolTip(QCoreApplication::translate("QtGradientEditor", "Hue", nullptr)); +#endif // QT_CONFIG(tooltip) + hLabel->setText(QCoreApplication::translate("QtGradientEditor", "H", nullptr)); +#if QT_CONFIG(tooltip) + hueColorLine->setToolTip(QCoreApplication::translate("QtGradientEditor", "Hue", nullptr)); +#endif // QT_CONFIG(tooltip) + hueLabel->setText(QCoreApplication::translate("QtGradientEditor", "Hue", nullptr)); +#if QT_CONFIG(tooltip) + sLabel->setToolTip(QCoreApplication::translate("QtGradientEditor", "Saturation", nullptr)); +#endif // QT_CONFIG(tooltip) + sLabel->setText(QCoreApplication::translate("QtGradientEditor", "S", nullptr)); +#if QT_CONFIG(tooltip) + saturationColorLine->setToolTip(QCoreApplication::translate("QtGradientEditor", "Saturation", nullptr)); +#endif // QT_CONFIG(tooltip) + saturationLabel->setText(QCoreApplication::translate("QtGradientEditor", "Sat", nullptr)); +#if QT_CONFIG(tooltip) + vLabel->setToolTip(QCoreApplication::translate("QtGradientEditor", "Value", nullptr)); +#endif // QT_CONFIG(tooltip) + vLabel->setText(QCoreApplication::translate("QtGradientEditor", "V", nullptr)); +#if QT_CONFIG(tooltip) + valueColorLine->setToolTip(QCoreApplication::translate("QtGradientEditor", "Value", nullptr)); +#endif // QT_CONFIG(tooltip) + valueLabel->setText(QCoreApplication::translate("QtGradientEditor", "Val", nullptr)); +#if QT_CONFIG(tooltip) + aLabel->setToolTip(QCoreApplication::translate("QtGradientEditor", "Alpha", nullptr)); +#endif // QT_CONFIG(tooltip) + aLabel->setText(QCoreApplication::translate("QtGradientEditor", "A", nullptr)); +#if QT_CONFIG(tooltip) + alphaColorLine->setToolTip(QCoreApplication::translate("QtGradientEditor", "Alpha", nullptr)); +#endif // QT_CONFIG(tooltip) + alphaLabel->setText(QCoreApplication::translate("QtGradientEditor", "Alpha", nullptr)); +#if QT_CONFIG(tooltip) + typeComboBox->setToolTip(QCoreApplication::translate("QtGradientEditor", "Type", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + spreadComboBox->setToolTip(QCoreApplication::translate("QtGradientEditor", "Spread", nullptr)); +#endif // QT_CONFIG(tooltip) + colorLabel->setText(QCoreApplication::translate("QtGradientEditor", "Color", nullptr)); +#if QT_CONFIG(tooltip) + colorButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Current stop's color", nullptr)); +#endif // QT_CONFIG(tooltip) colorButton->setText(QString()); -#ifndef QT_NO_TOOLTIP - hsvRadioButton->setToolTip(QApplication::translate("QtGradientEditor", "Show HSV specification", nullptr)); -#endif // QT_NO_TOOLTIP - hsvRadioButton->setText(QApplication::translate("QtGradientEditor", "HSV", nullptr)); -#ifndef QT_NO_TOOLTIP - rgbRadioButton->setToolTip(QApplication::translate("QtGradientEditor", "Show RGB specification", nullptr)); -#endif // QT_NO_TOOLTIP - rgbRadioButton->setText(QApplication::translate("QtGradientEditor", "RGB", nullptr)); -#ifndef QT_NO_TOOLTIP - positionSpinBox->setToolTip(QApplication::translate("QtGradientEditor", "Current stop's position", nullptr)); -#endif // QT_NO_TOOLTIP - zoomSpinBox->setSuffix(QApplication::translate("QtGradientEditor", "%", nullptr)); -#ifndef QT_NO_TOOLTIP - zoomInButton->setToolTip(QApplication::translate("QtGradientEditor", "Zoom In", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - zoomOutButton->setToolTip(QApplication::translate("QtGradientEditor", "Zoom Out", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - detailsButton->setToolTip(QApplication::translate("QtGradientEditor", "Toggle details extension", nullptr)); -#endif // QT_NO_TOOLTIP - detailsButton->setText(QApplication::translate("QtGradientEditor", ">", nullptr)); -#ifndef QT_NO_TOOLTIP - linearButton->setToolTip(QApplication::translate("QtGradientEditor", "Linear Type", nullptr)); -#endif // QT_NO_TOOLTIP - linearButton->setText(QApplication::translate("QtGradientEditor", "...", nullptr)); -#ifndef QT_NO_TOOLTIP - radialButton->setToolTip(QApplication::translate("QtGradientEditor", "Radial Type", nullptr)); -#endif // QT_NO_TOOLTIP - radialButton->setText(QApplication::translate("QtGradientEditor", "...", nullptr)); -#ifndef QT_NO_TOOLTIP - conicalButton->setToolTip(QApplication::translate("QtGradientEditor", "Conical Type", nullptr)); -#endif // QT_NO_TOOLTIP - conicalButton->setText(QApplication::translate("QtGradientEditor", "...", nullptr)); -#ifndef QT_NO_TOOLTIP - padButton->setToolTip(QApplication::translate("QtGradientEditor", "Pad Spread", nullptr)); -#endif // QT_NO_TOOLTIP - padButton->setText(QApplication::translate("QtGradientEditor", "...", nullptr)); -#ifndef QT_NO_TOOLTIP - repeatButton->setToolTip(QApplication::translate("QtGradientEditor", "Repeat Spread", nullptr)); -#endif // QT_NO_TOOLTIP - repeatButton->setText(QApplication::translate("QtGradientEditor", "...", nullptr)); -#ifndef QT_NO_TOOLTIP - reflectButton->setToolTip(QApplication::translate("QtGradientEditor", "Reflect Spread", nullptr)); -#endif // QT_NO_TOOLTIP - reflectButton->setText(QApplication::translate("QtGradientEditor", "...", nullptr)); +#if QT_CONFIG(tooltip) + hsvRadioButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Show HSV specification", nullptr)); +#endif // QT_CONFIG(tooltip) + hsvRadioButton->setText(QCoreApplication::translate("QtGradientEditor", "HSV", nullptr)); +#if QT_CONFIG(tooltip) + rgbRadioButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Show RGB specification", nullptr)); +#endif // QT_CONFIG(tooltip) + rgbRadioButton->setText(QCoreApplication::translate("QtGradientEditor", "RGB", nullptr)); +#if QT_CONFIG(tooltip) + positionSpinBox->setToolTip(QCoreApplication::translate("QtGradientEditor", "Current stop's position", nullptr)); +#endif // QT_CONFIG(tooltip) + zoomSpinBox->setSuffix(QCoreApplication::translate("QtGradientEditor", "%", nullptr)); +#if QT_CONFIG(tooltip) + zoomInButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Zoom In", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + zoomOutButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Zoom Out", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + detailsButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Toggle details extension", nullptr)); +#endif // QT_CONFIG(tooltip) + detailsButton->setText(QCoreApplication::translate("QtGradientEditor", ">", nullptr)); +#if QT_CONFIG(tooltip) + linearButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Linear Type", nullptr)); +#endif // QT_CONFIG(tooltip) + linearButton->setText(QCoreApplication::translate("QtGradientEditor", "...", nullptr)); +#if QT_CONFIG(tooltip) + radialButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Radial Type", nullptr)); +#endif // QT_CONFIG(tooltip) + radialButton->setText(QCoreApplication::translate("QtGradientEditor", "...", nullptr)); +#if QT_CONFIG(tooltip) + conicalButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Conical Type", nullptr)); +#endif // QT_CONFIG(tooltip) + conicalButton->setText(QCoreApplication::translate("QtGradientEditor", "...", nullptr)); +#if QT_CONFIG(tooltip) + padButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Pad Spread", nullptr)); +#endif // QT_CONFIG(tooltip) + padButton->setText(QCoreApplication::translate("QtGradientEditor", "...", nullptr)); +#if QT_CONFIG(tooltip) + repeatButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Repeat Spread", nullptr)); +#endif // QT_CONFIG(tooltip) + repeatButton->setText(QCoreApplication::translate("QtGradientEditor", "...", nullptr)); +#if QT_CONFIG(tooltip) + reflectButton->setToolTip(QCoreApplication::translate("QtGradientEditor", "Reflect Spread", nullptr)); +#endif // QT_CONFIG(tooltip) + reflectButton->setText(QCoreApplication::translate("QtGradientEditor", "...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qtgradientview.ui.h b/tests/auto/tools/uic/baseline/qtgradientview.ui.h index aa3c03b02f..494324b00f 100644 --- a/tests/auto/tools/uic/baseline/qtgradientview.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradientview.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qtgradientview.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -105,11 +105,11 @@ public: void retranslateUi(QWidget *QtGradientView) { - QtGradientView->setWindowTitle(QApplication::translate("QtGradientView", "Gradient View", nullptr)); - newButton->setText(QApplication::translate("QtGradientView", "New...", nullptr)); - editButton->setText(QApplication::translate("QtGradientView", "Edit...", nullptr)); - renameButton->setText(QApplication::translate("QtGradientView", "Rename", nullptr)); - removeButton->setText(QApplication::translate("QtGradientView", "Remove", nullptr)); + QtGradientView->setWindowTitle(QCoreApplication::translate("QtGradientView", "Gradient View", nullptr)); + newButton->setText(QCoreApplication::translate("QtGradientView", "New...", nullptr)); + editButton->setText(QCoreApplication::translate("QtGradientView", "Edit...", nullptr)); + renameButton->setText(QCoreApplication::translate("QtGradientView", "Rename", nullptr)); + removeButton->setText(QCoreApplication::translate("QtGradientView", "Remove", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h index e6d98ed4f0..f6369c8c5f 100644 --- a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qtgradientviewdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -89,7 +89,7 @@ public: void retranslateUi(QDialog *QtGradientViewDialog) { - QtGradientViewDialog->setWindowTitle(QApplication::translate("QtGradientViewDialog", "Select Gradient", nullptr)); + QtGradientViewDialog->setWindowTitle(QCoreApplication::translate("QtGradientViewDialog", "Select Gradient", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h b/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h index 6a8c9c7172..7428778a9c 100644 --- a/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h +++ b/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qtresourceeditordialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -141,25 +141,25 @@ public: void retranslateUi(QDialog *QtResourceEditorDialog) { - QtResourceEditorDialog->setWindowTitle(QApplication::translate("QtResourceEditorDialog", "Dialog", nullptr)); -#ifndef QT_NO_TOOLTIP - newQrcButton->setToolTip(QApplication::translate("QtResourceEditorDialog", "New File", nullptr)); -#endif // QT_NO_TOOLTIP - newQrcButton->setText(QApplication::translate("QtResourceEditorDialog", "N", nullptr)); -#ifndef QT_NO_TOOLTIP - removeQrcButton->setToolTip(QApplication::translate("QtResourceEditorDialog", "Remove File", nullptr)); -#endif // QT_NO_TOOLTIP - removeQrcButton->setText(QApplication::translate("QtResourceEditorDialog", "R", nullptr)); - importQrcButton->setText(QApplication::translate("QtResourceEditorDialog", "I", nullptr)); -#ifndef QT_NO_TOOLTIP - newResourceButton->setToolTip(QApplication::translate("QtResourceEditorDialog", "New Resource", nullptr)); -#endif // QT_NO_TOOLTIP - newResourceButton->setText(QApplication::translate("QtResourceEditorDialog", "N", nullptr)); - addResourceButton->setText(QApplication::translate("QtResourceEditorDialog", "A", nullptr)); -#ifndef QT_NO_TOOLTIP - removeResourceButton->setToolTip(QApplication::translate("QtResourceEditorDialog", "Remove Resource or File", nullptr)); -#endif // QT_NO_TOOLTIP - removeResourceButton->setText(QApplication::translate("QtResourceEditorDialog", "R", nullptr)); + QtResourceEditorDialog->setWindowTitle(QCoreApplication::translate("QtResourceEditorDialog", "Dialog", nullptr)); +#if QT_CONFIG(tooltip) + newQrcButton->setToolTip(QCoreApplication::translate("QtResourceEditorDialog", "New File", nullptr)); +#endif // QT_CONFIG(tooltip) + newQrcButton->setText(QCoreApplication::translate("QtResourceEditorDialog", "N", nullptr)); +#if QT_CONFIG(tooltip) + removeQrcButton->setToolTip(QCoreApplication::translate("QtResourceEditorDialog", "Remove File", nullptr)); +#endif // QT_CONFIG(tooltip) + removeQrcButton->setText(QCoreApplication::translate("QtResourceEditorDialog", "R", nullptr)); + importQrcButton->setText(QCoreApplication::translate("QtResourceEditorDialog", "I", nullptr)); +#if QT_CONFIG(tooltip) + newResourceButton->setToolTip(QCoreApplication::translate("QtResourceEditorDialog", "New Resource", nullptr)); +#endif // QT_CONFIG(tooltip) + newResourceButton->setText(QCoreApplication::translate("QtResourceEditorDialog", "N", nullptr)); + addResourceButton->setText(QCoreApplication::translate("QtResourceEditorDialog", "A", nullptr)); +#if QT_CONFIG(tooltip) + removeResourceButton->setToolTip(QCoreApplication::translate("QtResourceEditorDialog", "Remove Resource or File", nullptr)); +#endif // QT_CONFIG(tooltip) + removeResourceButton->setText(QCoreApplication::translate("QtResourceEditorDialog", "R", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h b/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h index e893386d9b..bfaeb99af2 100644 --- a/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h +++ b/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'qttoolbardialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -178,40 +178,40 @@ public: void retranslateUi(QDialog *QtToolBarDialog) { - QtToolBarDialog->setWindowTitle(QApplication::translate("QtToolBarDialog", "Customize Toolbars", nullptr)); + QtToolBarDialog->setWindowTitle(QCoreApplication::translate("QtToolBarDialog", "Customize Toolbars", nullptr)); QTreeWidgetItem *___qtreewidgetitem = actionTree->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("QtToolBarDialog", "1", nullptr)); - label->setText(QApplication::translate("QtToolBarDialog", "Actions", nullptr)); - label_2->setText(QApplication::translate("QtToolBarDialog", "Toolbars", nullptr)); -#ifndef QT_NO_TOOLTIP - newButton->setToolTip(QApplication::translate("QtToolBarDialog", "Add new toolbar", nullptr)); -#endif // QT_NO_TOOLTIP - newButton->setText(QApplication::translate("QtToolBarDialog", "New", nullptr)); -#ifndef QT_NO_TOOLTIP - removeButton->setToolTip(QApplication::translate("QtToolBarDialog", "Remove selected toolbar", nullptr)); -#endif // QT_NO_TOOLTIP - removeButton->setText(QApplication::translate("QtToolBarDialog", "Remove", nullptr)); -#ifndef QT_NO_TOOLTIP - renameButton->setToolTip(QApplication::translate("QtToolBarDialog", "Rename toolbar", nullptr)); -#endif // QT_NO_TOOLTIP - renameButton->setText(QApplication::translate("QtToolBarDialog", "Rename", nullptr)); -#ifndef QT_NO_TOOLTIP - upButton->setToolTip(QApplication::translate("QtToolBarDialog", "Move action up", nullptr)); -#endif // QT_NO_TOOLTIP - upButton->setText(QApplication::translate("QtToolBarDialog", "Up", nullptr)); -#ifndef QT_NO_TOOLTIP - leftButton->setToolTip(QApplication::translate("QtToolBarDialog", "Remove action from toolbar", nullptr)); -#endif // QT_NO_TOOLTIP - leftButton->setText(QApplication::translate("QtToolBarDialog", "<-", nullptr)); -#ifndef QT_NO_TOOLTIP - rightButton->setToolTip(QApplication::translate("QtToolBarDialog", "Add action to toolbar", nullptr)); -#endif // QT_NO_TOOLTIP - rightButton->setText(QApplication::translate("QtToolBarDialog", "->", nullptr)); -#ifndef QT_NO_TOOLTIP - downButton->setToolTip(QApplication::translate("QtToolBarDialog", "Move action down", nullptr)); -#endif // QT_NO_TOOLTIP - downButton->setText(QApplication::translate("QtToolBarDialog", "Down", nullptr)); - label_3->setText(QApplication::translate("QtToolBarDialog", "Current Toolbar Actions", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("QtToolBarDialog", "1", nullptr)); + label->setText(QCoreApplication::translate("QtToolBarDialog", "Actions", nullptr)); + label_2->setText(QCoreApplication::translate("QtToolBarDialog", "Toolbars", nullptr)); +#if QT_CONFIG(tooltip) + newButton->setToolTip(QCoreApplication::translate("QtToolBarDialog", "Add new toolbar", nullptr)); +#endif // QT_CONFIG(tooltip) + newButton->setText(QCoreApplication::translate("QtToolBarDialog", "New", nullptr)); +#if QT_CONFIG(tooltip) + removeButton->setToolTip(QCoreApplication::translate("QtToolBarDialog", "Remove selected toolbar", nullptr)); +#endif // QT_CONFIG(tooltip) + removeButton->setText(QCoreApplication::translate("QtToolBarDialog", "Remove", nullptr)); +#if QT_CONFIG(tooltip) + renameButton->setToolTip(QCoreApplication::translate("QtToolBarDialog", "Rename toolbar", nullptr)); +#endif // QT_CONFIG(tooltip) + renameButton->setText(QCoreApplication::translate("QtToolBarDialog", "Rename", nullptr)); +#if QT_CONFIG(tooltip) + upButton->setToolTip(QCoreApplication::translate("QtToolBarDialog", "Move action up", nullptr)); +#endif // QT_CONFIG(tooltip) + upButton->setText(QCoreApplication::translate("QtToolBarDialog", "Up", nullptr)); +#if QT_CONFIG(tooltip) + leftButton->setToolTip(QCoreApplication::translate("QtToolBarDialog", "Remove action from toolbar", nullptr)); +#endif // QT_CONFIG(tooltip) + leftButton->setText(QCoreApplication::translate("QtToolBarDialog", "<-", nullptr)); +#if QT_CONFIG(tooltip) + rightButton->setToolTip(QCoreApplication::translate("QtToolBarDialog", "Add action to toolbar", nullptr)); +#endif // QT_CONFIG(tooltip) + rightButton->setText(QCoreApplication::translate("QtToolBarDialog", "->", nullptr)); +#if QT_CONFIG(tooltip) + downButton->setToolTip(QCoreApplication::translate("QtToolBarDialog", "Move action down", nullptr)); +#endif // QT_CONFIG(tooltip) + downButton->setText(QCoreApplication::translate("QtToolBarDialog", "Down", nullptr)); + label_3->setText(QCoreApplication::translate("QtToolBarDialog", "Current Toolbar Actions", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/querywidget.ui.h b/tests/auto/tools/uic/baseline/querywidget.ui.h index 81516722d5..a92c60f4fe 100644 --- a/tests/auto/tools/uic/baseline/querywidget.ui.h +++ b/tests/auto/tools/uic/baseline/querywidget.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'querywidget.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -153,10 +153,10 @@ public: void retranslateUi(QMainWindow *QueryWidget) { - QueryWidget->setWindowTitle(QApplication::translate("QueryWidget", "Recipes XQuery Example", nullptr)); - inputGroupBox->setTitle(QApplication::translate("QueryWidget", "Input Document", nullptr)); - queryGroupBox->setTitle(QApplication::translate("QueryWidget", "Select your query:", nullptr)); - outputGroupBox->setTitle(QApplication::translate("QueryWidget", "Output Document", nullptr)); + QueryWidget->setWindowTitle(QCoreApplication::translate("QueryWidget", "Recipes XQuery Example", nullptr)); + inputGroupBox->setTitle(QCoreApplication::translate("QueryWidget", "Input Document", nullptr)); + queryGroupBox->setTitle(QCoreApplication::translate("QueryWidget", "Select your query:", nullptr)); + outputGroupBox->setTitle(QCoreApplication::translate("QueryWidget", "Output Document", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/remotecontrol.ui.h b/tests/auto/tools/uic/baseline/remotecontrol.ui.h index 5893ff42af..5b7c6c42c2 100644 --- a/tests/auto/tools/uic/baseline/remotecontrol.ui.h +++ b/tests/auto/tools/uic/baseline/remotecontrol.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'remotecontrol.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -222,22 +222,22 @@ public: void retranslateUi(QMainWindow *RemoteControlClass) { - RemoteControlClass->setWindowTitle(QApplication::translate("RemoteControlClass", "RemoteControl", nullptr)); - actionQuit->setText(QApplication::translate("RemoteControlClass", "Quit", nullptr)); - label->setText(QApplication::translate("RemoteControlClass", "Start URL:", nullptr)); - launchButton->setText(QApplication::translate("RemoteControlClass", "Launch Qt HelpViewer", nullptr)); - actionGroupBox->setTitle(QApplication::translate("RemoteControlClass", "Actions", nullptr)); - label_2->setText(QApplication::translate("RemoteControlClass", "Search in Index:", nullptr)); + RemoteControlClass->setWindowTitle(QCoreApplication::translate("RemoteControlClass", "RemoteControl", nullptr)); + actionQuit->setText(QCoreApplication::translate("RemoteControlClass", "Quit", nullptr)); + label->setText(QCoreApplication::translate("RemoteControlClass", "Start URL:", nullptr)); + launchButton->setText(QCoreApplication::translate("RemoteControlClass", "Launch Qt HelpViewer", nullptr)); + actionGroupBox->setTitle(QCoreApplication::translate("RemoteControlClass", "Actions", nullptr)); + label_2->setText(QCoreApplication::translate("RemoteControlClass", "Search in Index:", nullptr)); indexButton->setText(QString()); - label_4->setText(QApplication::translate("RemoteControlClass", "Identifier:", nullptr)); + label_4->setText(QCoreApplication::translate("RemoteControlClass", "Identifier:", nullptr)); identifierButton->setText(QString()); - label_3->setText(QApplication::translate("RemoteControlClass", "Show URL:", nullptr)); + label_3->setText(QCoreApplication::translate("RemoteControlClass", "Show URL:", nullptr)); urlButton->setText(QString()); - syncContentsButton->setText(QApplication::translate("RemoteControlClass", "Sync Contents", nullptr)); - contentsCheckBox->setText(QApplication::translate("RemoteControlClass", "Show Contents", nullptr)); - indexCheckBox->setText(QApplication::translate("RemoteControlClass", "Show Index", nullptr)); - bookmarksCheckBox->setText(QApplication::translate("RemoteControlClass", "Show Bookmarks", nullptr)); - menuFile->setTitle(QApplication::translate("RemoteControlClass", "File", nullptr)); + syncContentsButton->setText(QCoreApplication::translate("RemoteControlClass", "Sync Contents", nullptr)); + contentsCheckBox->setText(QCoreApplication::translate("RemoteControlClass", "Show Contents", nullptr)); + indexCheckBox->setText(QCoreApplication::translate("RemoteControlClass", "Show Index", nullptr)); + bookmarksCheckBox->setText(QCoreApplication::translate("RemoteControlClass", "Show Bookmarks", nullptr)); + menuFile->setTitle(QCoreApplication::translate("RemoteControlClass", "File", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h index 9ef6eedb4c..6829958463 100644 --- a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h +++ b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'saveformastemplate.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -117,10 +117,10 @@ public: vboxLayout->addWidget(buttonBox); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(templateNameEdit); label_2->setBuddy(categoryCombo); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(SaveFormAsTemplate); QObject::connect(buttonBox, SIGNAL(accepted()), SaveFormAsTemplate, SLOT(accept())); @@ -131,10 +131,10 @@ public: void retranslateUi(QDialog *SaveFormAsTemplate) { - SaveFormAsTemplate->setWindowTitle(QApplication::translate("SaveFormAsTemplate", "Save Form As Template", nullptr)); - label->setText(QApplication::translate("SaveFormAsTemplate", "&Name:", nullptr)); + SaveFormAsTemplate->setWindowTitle(QCoreApplication::translate("SaveFormAsTemplate", "Save Form As Template", nullptr)); + label->setText(QCoreApplication::translate("SaveFormAsTemplate", "&Name:", nullptr)); templateNameEdit->setText(QString()); - label_2->setText(QApplication::translate("SaveFormAsTemplate", "&Category:", nullptr)); + label_2->setText(QCoreApplication::translate("SaveFormAsTemplate", "&Category:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/settings.ui.h b/tests/auto/tools/uic/baseline/settings.ui.h index cc680c8033..6a1adb2d2c 100644 --- a/tests/auto/tools/uic/baseline/settings.ui.h +++ b/tests/auto/tools/uic/baseline/settings.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'settings.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -182,13 +182,13 @@ public: void retranslateUi(QDialog *Dialog) { - Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", nullptr)); - label->setText(QApplication::translate("Dialog", "Audio device:", nullptr)); - label_6->setText(QApplication::translate("Dialog", "Audio effect:", nullptr)); - crossFadeLabel->setText(QApplication::translate("Dialog", "Cross fade:", nullptr)); - label_3->setText(QApplication::translate("Dialog", "-10 Sec", nullptr)); - label_5->setText(QApplication::translate("Dialog", "0", nullptr)); - label_4->setText(QApplication::translate("Dialog", "10 Sec", nullptr)); + Dialog->setWindowTitle(QCoreApplication::translate("Dialog", "Dialog", nullptr)); + label->setText(QCoreApplication::translate("Dialog", "Audio device:", nullptr)); + label_6->setText(QCoreApplication::translate("Dialog", "Audio effect:", nullptr)); + crossFadeLabel->setText(QCoreApplication::translate("Dialog", "Cross fade:", nullptr)); + label_3->setText(QCoreApplication::translate("Dialog", "-10 Sec", nullptr)); + label_5->setText(QCoreApplication::translate("Dialog", "0", nullptr)); + label_4->setText(QCoreApplication::translate("Dialog", "10 Sec", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/signalslotdialog.ui.h b/tests/auto/tools/uic/baseline/signalslotdialog.ui.h index 5833a25a8b..143e281a24 100644 --- a/tests/auto/tools/uic/baseline/signalslotdialog.ui.h +++ b/tests/auto/tools/uic/baseline/signalslotdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'signalslotdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -133,25 +133,25 @@ public: void retranslateUi(QDialog *SignalSlotDialogClass) { - SignalSlotDialogClass->setWindowTitle(QApplication::translate("SignalSlotDialogClass", "Signals and slots", nullptr)); - slotGroupBox->setTitle(QApplication::translate("SignalSlotDialogClass", "Slots", nullptr)); -#ifndef QT_NO_TOOLTIP - addSlotButton->setToolTip(QApplication::translate("SignalSlotDialogClass", "Add", nullptr)); -#endif // QT_NO_TOOLTIP - addSlotButton->setText(QApplication::translate("SignalSlotDialogClass", "...", nullptr)); -#ifndef QT_NO_TOOLTIP - removeSlotButton->setToolTip(QApplication::translate("SignalSlotDialogClass", "Delete", nullptr)); -#endif // QT_NO_TOOLTIP - removeSlotButton->setText(QApplication::translate("SignalSlotDialogClass", "...", nullptr)); - signalGroupBox->setTitle(QApplication::translate("SignalSlotDialogClass", "Signals", nullptr)); -#ifndef QT_NO_TOOLTIP - addSignalButton->setToolTip(QApplication::translate("SignalSlotDialogClass", "Add", nullptr)); -#endif // QT_NO_TOOLTIP - addSignalButton->setText(QApplication::translate("SignalSlotDialogClass", "...", nullptr)); -#ifndef QT_NO_TOOLTIP - removeSignalButton->setToolTip(QApplication::translate("SignalSlotDialogClass", "Delete", nullptr)); -#endif // QT_NO_TOOLTIP - removeSignalButton->setText(QApplication::translate("SignalSlotDialogClass", "...", nullptr)); + SignalSlotDialogClass->setWindowTitle(QCoreApplication::translate("SignalSlotDialogClass", "Signals and slots", nullptr)); + slotGroupBox->setTitle(QCoreApplication::translate("SignalSlotDialogClass", "Slots", nullptr)); +#if QT_CONFIG(tooltip) + addSlotButton->setToolTip(QCoreApplication::translate("SignalSlotDialogClass", "Add", nullptr)); +#endif // QT_CONFIG(tooltip) + addSlotButton->setText(QCoreApplication::translate("SignalSlotDialogClass", "...", nullptr)); +#if QT_CONFIG(tooltip) + removeSlotButton->setToolTip(QCoreApplication::translate("SignalSlotDialogClass", "Delete", nullptr)); +#endif // QT_CONFIG(tooltip) + removeSlotButton->setText(QCoreApplication::translate("SignalSlotDialogClass", "...", nullptr)); + signalGroupBox->setTitle(QCoreApplication::translate("SignalSlotDialogClass", "Signals", nullptr)); +#if QT_CONFIG(tooltip) + addSignalButton->setToolTip(QCoreApplication::translate("SignalSlotDialogClass", "Add", nullptr)); +#endif // QT_CONFIG(tooltip) + addSignalButton->setText(QCoreApplication::translate("SignalSlotDialogClass", "...", nullptr)); +#if QT_CONFIG(tooltip) + removeSignalButton->setToolTip(QCoreApplication::translate("SignalSlotDialogClass", "Delete", nullptr)); +#endif // QT_CONFIG(tooltip) + removeSignalButton->setText(QCoreApplication::translate("SignalSlotDialogClass", "...", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/sslclient.ui.h b/tests/auto/tools/uic/baseline/sslclient.ui.h index 382889648e..755ea7827b 100644 --- a/tests/auto/tools/uic/baseline/sslclient.ui.h +++ b/tests/auto/tools/uic/baseline/sslclient.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'sslclient.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -155,20 +155,20 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Secure Socket Client", nullptr)); - hostNameLabel->setText(QApplication::translate("Form", "Host name:", nullptr)); - hostNameEdit->setText(QApplication::translate("Form", "imap.example.com", nullptr)); - portLabel->setText(QApplication::translate("Form", "Port:", nullptr)); - connectButton->setText(QApplication::translate("Form", "Connect to host", nullptr)); - sessionBox->setTitle(QApplication::translate("Form", "Active session", nullptr)); - cipherText->setText(QApplication::translate("Form", "Cryptographic Cipher:", nullptr)); - cipherLabel->setText(QApplication::translate("Form", "<none>", nullptr)); - sessionOutput->setHtml(QApplication::translate("Form", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" + Form->setWindowTitle(QCoreApplication::translate("Form", "Secure Socket Client", nullptr)); + hostNameLabel->setText(QCoreApplication::translate("Form", "Host name:", nullptr)); + hostNameEdit->setText(QCoreApplication::translate("Form", "imap.example.com", nullptr)); + portLabel->setText(QCoreApplication::translate("Form", "Port:", nullptr)); + connectButton->setText(QCoreApplication::translate("Form", "Connect to host", nullptr)); + sessionBox->setTitle(QCoreApplication::translate("Form", "Active session", nullptr)); + cipherText->setText(QCoreApplication::translate("Form", "Cryptographic Cipher:", nullptr)); + cipherLabel->setText(QCoreApplication::translate("Form", "<none>", nullptr)); + sessionOutput->setHtml(QCoreApplication::translate("Form", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;\">\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p></body></html>", nullptr)); - sessionInputLabel->setText(QApplication::translate("Form", "Input:", nullptr)); - sendButton->setText(QApplication::translate("Form", "&Send", nullptr)); + sessionInputLabel->setText(QCoreApplication::translate("Form", "Input:", nullptr)); + sendButton->setText(QCoreApplication::translate("Form", "&Send", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/sslerrors.ui.h b/tests/auto/tools/uic/baseline/sslerrors.ui.h index 04f21ded43..ac40fe8244 100644 --- a/tests/auto/tools/uic/baseline/sslerrors.ui.h +++ b/tests/auto/tools/uic/baseline/sslerrors.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'sslerrors.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -86,14 +86,14 @@ public: void retranslateUi(QDialog *SslErrors) { - SslErrors->setWindowTitle(QApplication::translate("SslErrors", "Unable To Validate The Connection", nullptr)); - label->setText(QApplication::translate("SslErrors", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" + SslErrors->setWindowTitle(QCoreApplication::translate("SslErrors", "Unable To Validate The Connection", nullptr)); + label->setText(QCoreApplication::translate("SslErrors", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600; color:#ff0000;\">Warning</span><span style=\" color:#ff0000;\">:</span><span style=\" color:#000000;\"> One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click </span><span style=\" color:#000000;\">Ignore</span><span style=\" color:#000000;\"> to continue, or </span><span style=\" color:#000000;\">Cancel</span><span style=\" color:#000000;\"> to abort the connection.</span></p></body></html>", nullptr)); - certificateChainButton->setText(QApplication::translate("SslErrors", "View Certificate Chain", nullptr)); - pushButton->setText(QApplication::translate("SslErrors", "Ignore", nullptr)); - pushButton_2->setText(QApplication::translate("SslErrors", "Cancel", nullptr)); + certificateChainButton->setText(QCoreApplication::translate("SslErrors", "View Certificate Chain", nullptr)); + pushButton->setText(QCoreApplication::translate("SslErrors", "Ignore", nullptr)); + pushButton_2->setText(QCoreApplication::translate("SslErrors", "Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/statistics.ui.h b/tests/auto/tools/uic/baseline/statistics.ui.h index 0b508836f2..6bbb6dbc32 100644 --- a/tests/auto/tools/uic/baseline/statistics.ui.h +++ b/tests/auto/tools/uic/baseline/statistics.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'statistics.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -179,19 +179,19 @@ public: void retranslateUi(QDialog *Statistics) { - Statistics->setWindowTitle(QApplication::translate("Statistics", "Statistics", nullptr)); - closeBtn->setText(QApplication::translate("Statistics", "&Close", nullptr)); - textLabel4->setText(QApplication::translate("Statistics", "Translation", nullptr)); - textLabel5->setText(QApplication::translate("Statistics", "Source", nullptr)); - untrWords->setText(QApplication::translate("Statistics", "0", nullptr)); - trWords->setText(QApplication::translate("Statistics", "0", nullptr)); - textLabel1->setText(QApplication::translate("Statistics", "Words:", nullptr)); - trChars->setText(QApplication::translate("Statistics", "0", nullptr)); - untrChars->setText(QApplication::translate("Statistics", "0", nullptr)); - textLabel3->setText(QApplication::translate("Statistics", "Characters:", nullptr)); - textLabel6->setText(QApplication::translate("Statistics", "Characters (with spaces):", nullptr)); - trCharsSpc->setText(QApplication::translate("Statistics", "0", nullptr)); - untrCharsSpc->setText(QApplication::translate("Statistics", "0", nullptr)); + Statistics->setWindowTitle(QCoreApplication::translate("Statistics", "Statistics", nullptr)); + closeBtn->setText(QCoreApplication::translate("Statistics", "&Close", nullptr)); + textLabel4->setText(QCoreApplication::translate("Statistics", "Translation", nullptr)); + textLabel5->setText(QCoreApplication::translate("Statistics", "Source", nullptr)); + untrWords->setText(QCoreApplication::translate("Statistics", "0", nullptr)); + trWords->setText(QCoreApplication::translate("Statistics", "0", nullptr)); + textLabel1->setText(QCoreApplication::translate("Statistics", "Words:", nullptr)); + trChars->setText(QCoreApplication::translate("Statistics", "0", nullptr)); + untrChars->setText(QCoreApplication::translate("Statistics", "0", nullptr)); + textLabel3->setText(QCoreApplication::translate("Statistics", "Characters:", nullptr)); + textLabel6->setText(QCoreApplication::translate("Statistics", "Characters (with spaces):", nullptr)); + trCharsSpc->setText(QCoreApplication::translate("Statistics", "0", nullptr)); + untrCharsSpc->setText(QCoreApplication::translate("Statistics", "0", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h index fd78ce91c1..91e7198793 100644 --- a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h +++ b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'stringlisteditor.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -201,9 +201,9 @@ public: vboxLayout->addWidget(buttonBox); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(valueEdit); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(qdesigner_internal__Dialog); QObject::connect(buttonBox, SIGNAL(accepted()), qdesigner_internal__Dialog, SLOT(accept())); @@ -214,25 +214,25 @@ public: void retranslateUi(QDialog *qdesigner_internal__Dialog) { - qdesigner_internal__Dialog->setWindowTitle(QApplication::translate("qdesigner_internal::Dialog", "Dialog", nullptr)); - groupBox->setTitle(QApplication::translate("qdesigner_internal::Dialog", "StringList", nullptr)); -#ifndef QT_NO_TOOLTIP - newButton->setToolTip(QApplication::translate("qdesigner_internal::Dialog", "New String", nullptr)); -#endif // QT_NO_TOOLTIP - newButton->setText(QApplication::translate("qdesigner_internal::Dialog", "&New", nullptr)); -#ifndef QT_NO_TOOLTIP - deleteButton->setToolTip(QApplication::translate("qdesigner_internal::Dialog", "Delete String", nullptr)); -#endif // QT_NO_TOOLTIP - deleteButton->setText(QApplication::translate("qdesigner_internal::Dialog", "&Delete", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::Dialog", "&Value:", nullptr)); -#ifndef QT_NO_TOOLTIP - upButton->setToolTip(QApplication::translate("qdesigner_internal::Dialog", "Move String Up", nullptr)); -#endif // QT_NO_TOOLTIP - upButton->setText(QApplication::translate("qdesigner_internal::Dialog", "Up", nullptr)); -#ifndef QT_NO_TOOLTIP - downButton->setToolTip(QApplication::translate("qdesigner_internal::Dialog", "Move String Down", nullptr)); -#endif // QT_NO_TOOLTIP - downButton->setText(QApplication::translate("qdesigner_internal::Dialog", "Down", nullptr)); + qdesigner_internal__Dialog->setWindowTitle(QCoreApplication::translate("qdesigner_internal::Dialog", "Dialog", nullptr)); + groupBox->setTitle(QCoreApplication::translate("qdesigner_internal::Dialog", "StringList", nullptr)); +#if QT_CONFIG(tooltip) + newButton->setToolTip(QCoreApplication::translate("qdesigner_internal::Dialog", "New String", nullptr)); +#endif // QT_CONFIG(tooltip) + newButton->setText(QCoreApplication::translate("qdesigner_internal::Dialog", "&New", nullptr)); +#if QT_CONFIG(tooltip) + deleteButton->setToolTip(QCoreApplication::translate("qdesigner_internal::Dialog", "Delete String", nullptr)); +#endif // QT_CONFIG(tooltip) + deleteButton->setText(QCoreApplication::translate("qdesigner_internal::Dialog", "&Delete", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::Dialog", "&Value:", nullptr)); +#if QT_CONFIG(tooltip) + upButton->setToolTip(QCoreApplication::translate("qdesigner_internal::Dialog", "Move String Up", nullptr)); +#endif // QT_CONFIG(tooltip) + upButton->setText(QCoreApplication::translate("qdesigner_internal::Dialog", "Up", nullptr)); +#if QT_CONFIG(tooltip) + downButton->setToolTip(QCoreApplication::translate("qdesigner_internal::Dialog", "Move String Down", nullptr)); +#endif // QT_CONFIG(tooltip) + downButton->setText(QCoreApplication::translate("qdesigner_internal::Dialog", "Down", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h index 5ae254ebab..2e73926c0c 100644 --- a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'stylesheeteditor.ui' ** -** Created by: Qt User Interface Compiler version 5.10.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -130,14 +130,14 @@ public: void retranslateUi(QWidget *StyleSheetEditor) { - StyleSheetEditor->setWindowTitle(QApplication::translate("StyleSheetEditor", "Style Editor", nullptr)); - styleSheetCombo->setItemText(0, QApplication::translate("StyleSheetEditor", "Default", nullptr)); - styleSheetCombo->setItemText(1, QApplication::translate("StyleSheetEditor", "Coffee", nullptr)); - styleSheetCombo->setItemText(2, QApplication::translate("StyleSheetEditor", "Pagefold", nullptr)); - - label_7->setText(QApplication::translate("StyleSheetEditor", "Style:", nullptr)); - applyButton->setText(QApplication::translate("StyleSheetEditor", "&Apply", nullptr)); - label_8->setText(QApplication::translate("StyleSheetEditor", "Style Sheet:", nullptr)); + StyleSheetEditor->setWindowTitle(QCoreApplication::translate("StyleSheetEditor", "Style Editor", nullptr)); + styleSheetCombo->setItemText(0, QCoreApplication::translate("StyleSheetEditor", "Default", nullptr)); + styleSheetCombo->setItemText(1, QCoreApplication::translate("StyleSheetEditor", "Coffee", nullptr)); + styleSheetCombo->setItemText(2, QCoreApplication::translate("StyleSheetEditor", "Pagefold", nullptr)); + + label_7->setText(QCoreApplication::translate("StyleSheetEditor", "Style:", nullptr)); + applyButton->setText(QCoreApplication::translate("StyleSheetEditor", "&Apply", nullptr)); + label_8->setText(QCoreApplication::translate("StyleSheetEditor", "Style Sheet:", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h index 09b230f5df..18a62df44a 100644 --- a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h +++ b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'tabbedbrowser.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -181,14 +181,14 @@ public: void retranslateUi(QWidget *TabbedBrowser) { - TabbedBrowser->setWindowTitle(QApplication::translate("TabbedBrowser", "TabbedBrowser", nullptr)); - tab->setTabText(tab->indexOf(frontpage), QApplication::translate("TabbedBrowser", "Untitled", nullptr)); + TabbedBrowser->setWindowTitle(QCoreApplication::translate("TabbedBrowser", "TabbedBrowser", nullptr)); + tab->setTabText(tab->indexOf(frontpage), QCoreApplication::translate("TabbedBrowser", "Untitled", nullptr)); toolClose->setText(QString()); - toolPrevious->setText(QApplication::translate("TabbedBrowser", "Previous", nullptr)); - toolNext->setText(QApplication::translate("TabbedBrowser", "Next", nullptr)); - checkCase->setText(QApplication::translate("TabbedBrowser", "Case Sensitive", nullptr)); - checkWholeWords->setText(QApplication::translate("TabbedBrowser", "Whole words", nullptr)); - labelWrapped->setText(QApplication::translate("TabbedBrowser", "<img src=\":/qt-project.org/assistant/images/wrap.png\"> Search wrapped", nullptr)); + toolPrevious->setText(QCoreApplication::translate("TabbedBrowser", "Previous", nullptr)); + toolNext->setText(QCoreApplication::translate("TabbedBrowser", "Next", nullptr)); + checkCase->setText(QCoreApplication::translate("TabbedBrowser", "Case Sensitive", nullptr)); + checkWholeWords->setText(QCoreApplication::translate("TabbedBrowser", "Whole words", nullptr)); + labelWrapped->setText(QCoreApplication::translate("TabbedBrowser", "<img src=\":/qt-project.org/assistant/images/wrap.png\"> Search wrapped", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h index e3ba00095e..4559bd910b 100644 --- a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'tablewidgeteditor.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -311,54 +311,54 @@ public: void retranslateUi(QDialog *qdesigner_internal__TableWidgetEditor) { - qdesigner_internal__TableWidgetEditor->setWindowTitle(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Edit Table Widget", nullptr)); - itemsBox->setTitle(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Items", nullptr)); -#ifndef QT_NO_TOOLTIP - tableWidget->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Items", nullptr)); -#endif // QT_NO_TOOLTIP - label_3->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Icon", nullptr)); - columnsBox->setTitle(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Columns", nullptr)); -#ifndef QT_NO_TOOLTIP - columnsListWidget->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Columns", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - newColumnButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "New Column", nullptr)); -#endif // QT_NO_TOOLTIP - newColumnButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "New", nullptr)); -#ifndef QT_NO_TOOLTIP - deleteColumnButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete Column", nullptr)); -#endif // QT_NO_TOOLTIP - deleteColumnButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete", nullptr)); -#ifndef QT_NO_TOOLTIP - moveColumnUpButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Column Up", nullptr)); -#endif // QT_NO_TOOLTIP - moveColumnUpButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "U", nullptr)); -#ifndef QT_NO_TOOLTIP - moveColumnDownButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Column Down", nullptr)); -#endif // QT_NO_TOOLTIP - moveColumnDownButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "D", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Icon", nullptr)); - rowsBox->setTitle(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Rows", nullptr)); -#ifndef QT_NO_TOOLTIP - rowsListWidget->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Rows", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - newRowButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "New Row", nullptr)); -#endif // QT_NO_TOOLTIP - newRowButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "New", nullptr)); -#ifndef QT_NO_TOOLTIP - deleteRowButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete Row", nullptr)); -#endif // QT_NO_TOOLTIP - deleteRowButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete", nullptr)); -#ifndef QT_NO_TOOLTIP - moveRowUpButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Row Up", nullptr)); -#endif // QT_NO_TOOLTIP - moveRowUpButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "U", nullptr)); -#ifndef QT_NO_TOOLTIP - moveRowDownButton->setToolTip(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Row Down", nullptr)); -#endif // QT_NO_TOOLTIP - moveRowDownButton->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "D", nullptr)); - label_2->setText(QApplication::translate("qdesigner_internal::TableWidgetEditor", "Icon", nullptr)); + qdesigner_internal__TableWidgetEditor->setWindowTitle(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Edit Table Widget", nullptr)); + itemsBox->setTitle(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Items", nullptr)); +#if QT_CONFIG(tooltip) + tableWidget->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Items", nullptr)); +#endif // QT_CONFIG(tooltip) + label_3->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Icon", nullptr)); + columnsBox->setTitle(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Columns", nullptr)); +#if QT_CONFIG(tooltip) + columnsListWidget->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Columns", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + newColumnButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "New Column", nullptr)); +#endif // QT_CONFIG(tooltip) + newColumnButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "New", nullptr)); +#if QT_CONFIG(tooltip) + deleteColumnButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete Column", nullptr)); +#endif // QT_CONFIG(tooltip) + deleteColumnButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete", nullptr)); +#if QT_CONFIG(tooltip) + moveColumnUpButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Column Up", nullptr)); +#endif // QT_CONFIG(tooltip) + moveColumnUpButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "U", nullptr)); +#if QT_CONFIG(tooltip) + moveColumnDownButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Column Down", nullptr)); +#endif // QT_CONFIG(tooltip) + moveColumnDownButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "D", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Icon", nullptr)); + rowsBox->setTitle(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Rows", nullptr)); +#if QT_CONFIG(tooltip) + rowsListWidget->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Table Rows", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + newRowButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "New Row", nullptr)); +#endif // QT_CONFIG(tooltip) + newRowButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "New", nullptr)); +#if QT_CONFIG(tooltip) + deleteRowButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete Row", nullptr)); +#endif // QT_CONFIG(tooltip) + deleteRowButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Delete", nullptr)); +#if QT_CONFIG(tooltip) + moveRowUpButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Row Up", nullptr)); +#endif // QT_CONFIG(tooltip) + moveRowUpButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "U", nullptr)); +#if QT_CONFIG(tooltip) + moveRowDownButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Move Row Down", nullptr)); +#endif // QT_CONFIG(tooltip) + moveRowDownButton->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "D", nullptr)); + label_2->setText(QCoreApplication::translate("qdesigner_internal::TableWidgetEditor", "Icon", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/tetrixwindow.ui.h b/tests/auto/tools/uic/baseline/tetrixwindow.ui.h index dc1033ce3a..340acbd9f2 100644 --- a/tests/auto/tools/uic/baseline/tetrixwindow.ui.h +++ b/tests/auto/tools/uic/baseline/tetrixwindow.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'tetrixwindow.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -147,15 +147,15 @@ public: void retranslateUi(QWidget *TetrixWindow) { - TetrixWindow->setWindowTitle(QApplication::translate("TetrixWindow", "Tetrix", nullptr)); - startButton->setText(QApplication::translate("TetrixWindow", "&Start", nullptr)); - linesRemovedLabel->setText(QApplication::translate("TetrixWindow", "LINES REMOVED", nullptr)); - pauseButton->setText(QApplication::translate("TetrixWindow", "&Pause", nullptr)); - levelLabel->setText(QApplication::translate("TetrixWindow", "LEVEL", nullptr)); - nextLabel->setText(QApplication::translate("TetrixWindow", "NEXT", nullptr)); - scoreLabel->setText(QApplication::translate("TetrixWindow", "SCORE", nullptr)); + TetrixWindow->setWindowTitle(QCoreApplication::translate("TetrixWindow", "Tetrix", nullptr)); + startButton->setText(QCoreApplication::translate("TetrixWindow", "&Start", nullptr)); + linesRemovedLabel->setText(QCoreApplication::translate("TetrixWindow", "LINES REMOVED", nullptr)); + pauseButton->setText(QCoreApplication::translate("TetrixWindow", "&Pause", nullptr)); + levelLabel->setText(QCoreApplication::translate("TetrixWindow", "LEVEL", nullptr)); + nextLabel->setText(QCoreApplication::translate("TetrixWindow", "NEXT", nullptr)); + scoreLabel->setText(QCoreApplication::translate("TetrixWindow", "SCORE", nullptr)); nextPieceLabel->setText(QString()); - quitButton->setText(QApplication::translate("TetrixWindow", "&Quit", nullptr)); + quitButton->setText(QCoreApplication::translate("TetrixWindow", "&Quit", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/textfinder.ui.h b/tests/auto/tools/uic/baseline/textfinder.ui.h index 2f6bfebf98..38bdf756c2 100644 --- a/tests/auto/tools/uic/baseline/textfinder.ui.h +++ b/tests/auto/tools/uic/baseline/textfinder.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'textfinder.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -81,9 +81,9 @@ public: vboxLayout->addItem(spacerItem); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) searchLabel->setBuddy(lineEdit); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(Form); QObject::connect(lineEdit, SIGNAL(returnPressed()), findButton, SLOT(animateClick())); @@ -93,9 +93,9 @@ public: void retranslateUi(QWidget *Form) { - Form->setWindowTitle(QApplication::translate("Form", "Find Text", nullptr)); - searchLabel->setText(QApplication::translate("Form", "&Keyword:", nullptr)); - findButton->setText(QApplication::translate("Form", "&Find", nullptr)); + Form->setWindowTitle(QCoreApplication::translate("Form", "Find Text", nullptr)); + searchLabel->setText(QCoreApplication::translate("Form", "&Keyword:", nullptr)); + findButton->setText(QCoreApplication::translate("Form", "&Find", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/topicchooser.ui.h b/tests/auto/tools/uic/baseline/topicchooser.ui.h index 90ec485e39..a89f62c4b5 100644 --- a/tests/auto/tools/uic/baseline/topicchooser.ui.h +++ b/tests/auto/tools/uic/baseline/topicchooser.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'topicchooser.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -86,9 +86,9 @@ public: vboxLayout->addWidget(Layout16); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(listWidget); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(TopicChooser); @@ -100,10 +100,10 @@ public: void retranslateUi(QDialog *TopicChooser) { - TopicChooser->setWindowTitle(QApplication::translate("TopicChooser", "Choose Topic", nullptr)); - label->setText(QApplication::translate("TopicChooser", "&Topics", nullptr)); - buttonDisplay->setText(QApplication::translate("TopicChooser", "&Display", nullptr)); - buttonCancel->setText(QApplication::translate("TopicChooser", "&Close", nullptr)); + TopicChooser->setWindowTitle(QCoreApplication::translate("TopicChooser", "Choose Topic", nullptr)); + label->setText(QCoreApplication::translate("TopicChooser", "&Topics", nullptr)); + buttonDisplay->setText(QCoreApplication::translate("TopicChooser", "&Display", nullptr)); + buttonCancel->setText(QCoreApplication::translate("TopicChooser", "&Close", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/translatedialog.ui.h b/tests/auto/tools/uic/baseline/translatedialog.ui.h index 5bea11f9f2..10390c62df 100644 --- a/tests/auto/tools/uic/baseline/translatedialog.ui.h +++ b/tests/auto/tools/uic/baseline/translatedialog.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'translatedialog.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -182,10 +182,10 @@ public: hboxLayout->addLayout(vboxLayout2); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) findWhat->setBuddy(ledFindWhat); translateTo->setBuddy(ledTranslateTo); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) QWidget::setTabOrder(ledFindWhat, ledTranslateTo); QWidget::setTabOrder(ledTranslateTo, findNxt); QWidget::setTabOrder(findNxt, translate); @@ -205,34 +205,34 @@ public: void retranslateUi(QDialog *TranslateDialog) { - TranslateDialog->setWindowTitle(QApplication::translate("TranslateDialog", "Qt Linguist", nullptr)); -#ifndef QT_NO_WHATSTHIS - TranslateDialog->setWhatsThis(QApplication::translate("TranslateDialog", "This window allows you to search for some text in the translation source file.", nullptr)); -#endif // QT_NO_WHATSTHIS -#ifndef QT_NO_WHATSTHIS - ledTranslateTo->setWhatsThis(QApplication::translate("TranslateDialog", "Type in the text to search for.", nullptr)); -#endif // QT_NO_WHATSTHIS - findWhat->setText(QApplication::translate("TranslateDialog", "Find &source text:", nullptr)); - translateTo->setText(QApplication::translate("TranslateDialog", "&Translate to:", nullptr)); -#ifndef QT_NO_WHATSTHIS - ledFindWhat->setWhatsThis(QApplication::translate("TranslateDialog", "Type in the text to search for.", nullptr)); -#endif // QT_NO_WHATSTHIS - groupBox->setTitle(QApplication::translate("TranslateDialog", "Search options", nullptr)); -#ifndef QT_NO_WHATSTHIS - ckMatchCase->setWhatsThis(QApplication::translate("TranslateDialog", "Texts such as 'TeX' and 'tex' are considered as different when checked.", nullptr)); -#endif // QT_NO_WHATSTHIS - ckMatchCase->setText(QApplication::translate("TranslateDialog", "Match &case", nullptr)); - ckMarkFinished->setText(QApplication::translate("TranslateDialog", "Mark new translation as &finished", nullptr)); -#ifndef QT_NO_WHATSTHIS - findNxt->setWhatsThis(QApplication::translate("TranslateDialog", "Click here to find the next occurrence of the text you typed in.", nullptr)); -#endif // QT_NO_WHATSTHIS - findNxt->setText(QApplication::translate("TranslateDialog", "Find Next", nullptr)); - translate->setText(QApplication::translate("TranslateDialog", "Translate", nullptr)); - translateAll->setText(QApplication::translate("TranslateDialog", "Translate All", nullptr)); -#ifndef QT_NO_WHATSTHIS - cancel->setWhatsThis(QApplication::translate("TranslateDialog", "Click here to close this window.", nullptr)); -#endif // QT_NO_WHATSTHIS - cancel->setText(QApplication::translate("TranslateDialog", "Cancel", nullptr)); + TranslateDialog->setWindowTitle(QCoreApplication::translate("TranslateDialog", "Qt Linguist", nullptr)); +#if QT_CONFIG(whatsthis) + TranslateDialog->setWhatsThis(QCoreApplication::translate("TranslateDialog", "This window allows you to search for some text in the translation source file.", nullptr)); +#endif // QT_CONFIG(whatsthis) +#if QT_CONFIG(whatsthis) + ledTranslateTo->setWhatsThis(QCoreApplication::translate("TranslateDialog", "Type in the text to search for.", nullptr)); +#endif // QT_CONFIG(whatsthis) + findWhat->setText(QCoreApplication::translate("TranslateDialog", "Find &source text:", nullptr)); + translateTo->setText(QCoreApplication::translate("TranslateDialog", "&Translate to:", nullptr)); +#if QT_CONFIG(whatsthis) + ledFindWhat->setWhatsThis(QCoreApplication::translate("TranslateDialog", "Type in the text to search for.", nullptr)); +#endif // QT_CONFIG(whatsthis) + groupBox->setTitle(QCoreApplication::translate("TranslateDialog", "Search options", nullptr)); +#if QT_CONFIG(whatsthis) + ckMatchCase->setWhatsThis(QCoreApplication::translate("TranslateDialog", "Texts such as 'TeX' and 'tex' are considered as different when checked.", nullptr)); +#endif // QT_CONFIG(whatsthis) + ckMatchCase->setText(QCoreApplication::translate("TranslateDialog", "Match &case", nullptr)); + ckMarkFinished->setText(QCoreApplication::translate("TranslateDialog", "Mark new translation as &finished", nullptr)); +#if QT_CONFIG(whatsthis) + findNxt->setWhatsThis(QCoreApplication::translate("TranslateDialog", "Click here to find the next occurrence of the text you typed in.", nullptr)); +#endif // QT_CONFIG(whatsthis) + findNxt->setText(QCoreApplication::translate("TranslateDialog", "Find Next", nullptr)); + translate->setText(QCoreApplication::translate("TranslateDialog", "Translate", nullptr)); + translateAll->setText(QCoreApplication::translate("TranslateDialog", "Translate All", nullptr)); +#if QT_CONFIG(whatsthis) + cancel->setWhatsThis(QCoreApplication::translate("TranslateDialog", "Click here to close this window.", nullptr)); +#endif // QT_CONFIG(whatsthis) + cancel->setText(QCoreApplication::translate("TranslateDialog", "Cancel", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/translationsettings.ui.h b/tests/auto/tools/uic/baseline/translationsettings.ui.h index 764e3a85b6..5e0f1520a0 100644 --- a/tests/auto/tools/uic/baseline/translationsettings.ui.h +++ b/tests/auto/tools/uic/baseline/translationsettings.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'translationsettings.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -86,9 +86,9 @@ public: vboxLayout->addWidget(buttonBox); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) label->setBuddy(cbLanguageList); -#endif // QT_NO_SHORTCUT +#endif // QT_CONFIG(shortcut) retranslateUi(TranslationSettings); QObject::connect(buttonBox, SIGNAL(accepted()), TranslationSettings, SLOT(accept())); @@ -99,10 +99,10 @@ public: void retranslateUi(QDialog *TranslationSettings) { - TranslationSettings->setWindowTitle(QApplication::translate("TranslationSettings", "Qt Linguist - Translation file settings", nullptr)); - groupBox->setTitle(QApplication::translate("TranslationSettings", "Target language", nullptr)); - label->setText(QApplication::translate("TranslationSettings", "Language", nullptr)); - lblCountry->setText(QApplication::translate("TranslationSettings", "Country/Region", nullptr)); + TranslationSettings->setWindowTitle(QCoreApplication::translate("TranslationSettings", "Qt Linguist - Translation file settings", nullptr)); + groupBox->setTitle(QCoreApplication::translate("TranslationSettings", "Target language", nullptr)); + label->setText(QCoreApplication::translate("TranslationSettings", "Language", nullptr)); + lblCountry->setText(QCoreApplication::translate("TranslationSettings", "Country/Region", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h index d432195648..395d66a999 100644 --- a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'treewidgeteditor.ui' ** -** Created by: Qt User Interface Compiler version 5.0.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -276,63 +276,63 @@ public: void retranslateUi(QDialog *qdesigner_internal__TreeWidgetEditor) { - qdesigner_internal__TreeWidgetEditor->setWindowTitle(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Edit Tree Widget", nullptr)); - itemsBox->setTitle(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Tree Items", nullptr)); + qdesigner_internal__TreeWidgetEditor->setWindowTitle(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Edit Tree Widget", nullptr)); + itemsBox->setTitle(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Tree Items", nullptr)); QTreeWidgetItem *___qtreewidgetitem = treeWidget->headerItem(); - ___qtreewidgetitem->setText(0, QApplication::translate("qdesigner_internal::TreeWidgetEditor", "1", nullptr)); -#ifndef QT_NO_TOOLTIP - treeWidget->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Tree Items", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - newItemButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "New Item", nullptr)); -#endif // QT_NO_TOOLTIP - newItemButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "&New", nullptr)); -#ifndef QT_NO_TOOLTIP - newSubItemButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "New Subitem", nullptr)); -#endif // QT_NO_TOOLTIP - newSubItemButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "New &Subitem", nullptr)); -#ifndef QT_NO_TOOLTIP - deleteItemButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Delete Item", nullptr)); -#endif // QT_NO_TOOLTIP - deleteItemButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "&Delete", nullptr)); -#ifndef QT_NO_TOOLTIP - moveItemLeftButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Left (before Parent Item)", nullptr)); -#endif // QT_NO_TOOLTIP - moveItemLeftButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "L", nullptr)); -#ifndef QT_NO_TOOLTIP - moveItemRightButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Right (as a First Subitem of the Next Sibling Item)", nullptr)); -#endif // QT_NO_TOOLTIP - moveItemRightButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "R", nullptr)); -#ifndef QT_NO_TOOLTIP - moveItemUpButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Up", nullptr)); -#endif // QT_NO_TOOLTIP - moveItemUpButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "U", nullptr)); -#ifndef QT_NO_TOOLTIP - moveItemDownButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Down", nullptr)); -#endif // QT_NO_TOOLTIP - moveItemDownButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "D", nullptr)); - label_2->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Icon", nullptr)); - columnsBox->setTitle(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Columns", nullptr)); -#ifndef QT_NO_TOOLTIP - listWidget->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Tree Columns", nullptr)); -#endif // QT_NO_TOOLTIP -#ifndef QT_NO_TOOLTIP - newColumnButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "New Column", nullptr)); -#endif // QT_NO_TOOLTIP - newColumnButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "New", nullptr)); -#ifndef QT_NO_TOOLTIP - deleteColumnButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Delete Column", nullptr)); -#endif // QT_NO_TOOLTIP - deleteColumnButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Delete", nullptr)); -#ifndef QT_NO_TOOLTIP - moveColumnUpButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Column Up", nullptr)); -#endif // QT_NO_TOOLTIP - moveColumnUpButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "U", nullptr)); -#ifndef QT_NO_TOOLTIP - moveColumnDownButton->setToolTip(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Column Down", nullptr)); -#endif // QT_NO_TOOLTIP - moveColumnDownButton->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "D", nullptr)); - label->setText(QApplication::translate("qdesigner_internal::TreeWidgetEditor", "Icon", nullptr)); + ___qtreewidgetitem->setText(0, QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "1", nullptr)); +#if QT_CONFIG(tooltip) + treeWidget->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Tree Items", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + newItemButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "New Item", nullptr)); +#endif // QT_CONFIG(tooltip) + newItemButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "&New", nullptr)); +#if QT_CONFIG(tooltip) + newSubItemButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "New Subitem", nullptr)); +#endif // QT_CONFIG(tooltip) + newSubItemButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "New &Subitem", nullptr)); +#if QT_CONFIG(tooltip) + deleteItemButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Delete Item", nullptr)); +#endif // QT_CONFIG(tooltip) + deleteItemButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "&Delete", nullptr)); +#if QT_CONFIG(tooltip) + moveItemLeftButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Left (before Parent Item)", nullptr)); +#endif // QT_CONFIG(tooltip) + moveItemLeftButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "L", nullptr)); +#if QT_CONFIG(tooltip) + moveItemRightButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Right (as a First Subitem of the Next Sibling Item)", nullptr)); +#endif // QT_CONFIG(tooltip) + moveItemRightButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "R", nullptr)); +#if QT_CONFIG(tooltip) + moveItemUpButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Up", nullptr)); +#endif // QT_CONFIG(tooltip) + moveItemUpButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "U", nullptr)); +#if QT_CONFIG(tooltip) + moveItemDownButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Item Down", nullptr)); +#endif // QT_CONFIG(tooltip) + moveItemDownButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "D", nullptr)); + label_2->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Icon", nullptr)); + columnsBox->setTitle(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Columns", nullptr)); +#if QT_CONFIG(tooltip) + listWidget->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Tree Columns", nullptr)); +#endif // QT_CONFIG(tooltip) +#if QT_CONFIG(tooltip) + newColumnButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "New Column", nullptr)); +#endif // QT_CONFIG(tooltip) + newColumnButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "New", nullptr)); +#if QT_CONFIG(tooltip) + deleteColumnButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Delete Column", nullptr)); +#endif // QT_CONFIG(tooltip) + deleteColumnButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Delete", nullptr)); +#if QT_CONFIG(tooltip) + moveColumnUpButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Column Up", nullptr)); +#endif // QT_CONFIG(tooltip) + moveColumnUpButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "U", nullptr)); +#if QT_CONFIG(tooltip) + moveColumnDownButton->setToolTip(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Move Column Down", nullptr)); +#endif // QT_CONFIG(tooltip) + moveColumnDownButton->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "D", nullptr)); + label->setText(QCoreApplication::translate("qdesigner_internal::TreeWidgetEditor", "Icon", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h index 3fbf125a1f..95ebed0f6f 100644 --- a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h +++ b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h @@ -31,7 +31,7 @@ /******************************************************************************** ** Form generated from reading UI file 'trpreviewtool.ui' ** -** Created by: Qt User Interface Compiler version 5.9.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -162,21 +162,21 @@ public: void retranslateUi(QMainWindow *TrPreviewToolClass) { - TrPreviewToolClass->setWindowTitle(QApplication::translate("TrPreviewToolClass", "Qt Translation Preview Tool", nullptr)); - actionOpenForm->setText(QApplication::translate("TrPreviewToolClass", "&Open Form...", nullptr)); - actionLoadTranslation->setText(QApplication::translate("TrPreviewToolClass", "&Load Translation...", nullptr)); - actionReloadTranslations->setText(QApplication::translate("TrPreviewToolClass", "&Reload Translations", nullptr)); -#ifndef QT_NO_SHORTCUT - actionReloadTranslations->setShortcut(QApplication::translate("TrPreviewToolClass", "F5", nullptr)); -#endif // QT_NO_SHORTCUT - actionClose->setText(QApplication::translate("TrPreviewToolClass", "&Close", nullptr)); - actionAbout->setText(QApplication::translate("TrPreviewToolClass", "About", nullptr)); - actionAbout_Qt->setText(QApplication::translate("TrPreviewToolClass", "About Qt", nullptr)); - menuView->setTitle(QApplication::translate("TrPreviewToolClass", "&View", nullptr)); - menuViewViews->setTitle(QApplication::translate("TrPreviewToolClass", "&Views", nullptr)); - menuHelp->setTitle(QApplication::translate("TrPreviewToolClass", "&Help", nullptr)); - menuFile->setTitle(QApplication::translate("TrPreviewToolClass", "&File", nullptr)); - dwForms->setWindowTitle(QApplication::translate("TrPreviewToolClass", "Forms", nullptr)); + TrPreviewToolClass->setWindowTitle(QCoreApplication::translate("TrPreviewToolClass", "Qt Translation Preview Tool", nullptr)); + actionOpenForm->setText(QCoreApplication::translate("TrPreviewToolClass", "&Open Form...", nullptr)); + actionLoadTranslation->setText(QCoreApplication::translate("TrPreviewToolClass", "&Load Translation...", nullptr)); + actionReloadTranslations->setText(QCoreApplication::translate("TrPreviewToolClass", "&Reload Translations", nullptr)); +#if QT_CONFIG(shortcut) + actionReloadTranslations->setShortcut(QCoreApplication::translate("TrPreviewToolClass", "F5", nullptr)); +#endif // QT_CONFIG(shortcut) + actionClose->setText(QCoreApplication::translate("TrPreviewToolClass", "&Close", nullptr)); + actionAbout->setText(QCoreApplication::translate("TrPreviewToolClass", "About", nullptr)); + actionAbout_Qt->setText(QCoreApplication::translate("TrPreviewToolClass", "About Qt", nullptr)); + menuView->setTitle(QCoreApplication::translate("TrPreviewToolClass", "&View", nullptr)); + menuViewViews->setTitle(QCoreApplication::translate("TrPreviewToolClass", "&Views", nullptr)); + menuHelp->setTitle(QCoreApplication::translate("TrPreviewToolClass", "&Help", nullptr)); + menuFile->setTitle(QCoreApplication::translate("TrPreviewToolClass", "&File", nullptr)); + dwForms->setWindowTitle(QCoreApplication::translate("TrPreviewToolClass", "Forms", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/validators.ui.h b/tests/auto/tools/uic/baseline/validators.ui.h index d0ae777f65..45d9c5aac6 100644 --- a/tests/auto/tools/uic/baseline/validators.ui.h +++ b/tests/auto/tools/uic/baseline/validators.ui.h @@ -375,22 +375,22 @@ public: void retranslateUi(QWidget *ValidatorsForm) { - ValidatorsForm->setWindowTitle(QApplication::translate("ValidatorsForm", "Form", nullptr)); - groupBox->setTitle(QApplication::translate("ValidatorsForm", "QIntValidator", nullptr)); - label->setText(QApplication::translate("ValidatorsForm", "Min:", nullptr)); - label_2->setText(QApplication::translate("ValidatorsForm", "Max:", nullptr)); - label_7->setText(QApplication::translate("ValidatorsForm", "editingFinished()", nullptr)); - groupBox_2->setTitle(QApplication::translate("ValidatorsForm", "QDoubleValidator", nullptr)); - label_3->setText(QApplication::translate("ValidatorsForm", "Min:", nullptr)); - label_5->setText(QApplication::translate("ValidatorsForm", "Format:", nullptr)); - doubleFormat->setItemText(0, QApplication::translate("ValidatorsForm", "Standard", nullptr)); - doubleFormat->setItemText(1, QApplication::translate("ValidatorsForm", "Scientific", nullptr)); - - label_4->setText(QApplication::translate("ValidatorsForm", "Max:", nullptr)); - label_6->setText(QApplication::translate("ValidatorsForm", "Decimals:", nullptr)); + ValidatorsForm->setWindowTitle(QCoreApplication::translate("ValidatorsForm", "Form", nullptr)); + groupBox->setTitle(QCoreApplication::translate("ValidatorsForm", "QIntValidator", nullptr)); + label->setText(QCoreApplication::translate("ValidatorsForm", "Min:", nullptr)); + label_2->setText(QCoreApplication::translate("ValidatorsForm", "Max:", nullptr)); + label_7->setText(QCoreApplication::translate("ValidatorsForm", "editingFinished()", nullptr)); + groupBox_2->setTitle(QCoreApplication::translate("ValidatorsForm", "QDoubleValidator", nullptr)); + label_3->setText(QCoreApplication::translate("ValidatorsForm", "Min:", nullptr)); + label_5->setText(QCoreApplication::translate("ValidatorsForm", "Format:", nullptr)); + doubleFormat->setItemText(0, QCoreApplication::translate("ValidatorsForm", "Standard", nullptr)); + doubleFormat->setItemText(1, QCoreApplication::translate("ValidatorsForm", "Scientific", nullptr)); + + label_4->setText(QCoreApplication::translate("ValidatorsForm", "Max:", nullptr)); + label_6->setText(QCoreApplication::translate("ValidatorsForm", "Decimals:", nullptr)); doubleLedWidget->setText(QString()); - label_8->setText(QApplication::translate("ValidatorsForm", "editingFinished()", nullptr)); - pushButton->setText(QApplication::translate("ValidatorsForm", "Quit", nullptr)); + label_8->setText(QCoreApplication::translate("ValidatorsForm", "editingFinished()", nullptr)); + pushButton->setText(QCoreApplication::translate("ValidatorsForm", "Quit", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h index d6f7ff5526..aa005593c0 100644 --- a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h +++ b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h @@ -1,7 +1,7 @@ /******************************************************************************** ** Form generated from reading UI file 'wateringconfigdialog.ui' ** -** Created by: Qt User Interface Compiler version 5.10.0 +** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ @@ -250,34 +250,34 @@ public: void retranslateUi(QDialog *WateringConfigDialog) { - WateringConfigDialog->setWindowTitle(QApplication::translate("WateringConfigDialog", "Watering Configuration", nullptr)); - label_3->setText(QApplication::translate("WateringConfigDialog", "Plant:", nullptr)); - plantComboBox->setItemText(0, QApplication::translate("WateringConfigDialog", "Squash", nullptr)); - plantComboBox->setItemText(1, QApplication::translate("WateringConfigDialog", "Bean", nullptr)); - plantComboBox->setItemText(2, QApplication::translate("WateringConfigDialog", "Carrot", nullptr)); - plantComboBox->setItemText(3, QApplication::translate("WateringConfigDialog", "Strawberry", nullptr)); - plantComboBox->setItemText(4, QApplication::translate("WateringConfigDialog", "Raspberry", nullptr)); - plantComboBox->setItemText(5, QApplication::translate("WateringConfigDialog", "Blueberry", nullptr)); - - label_2->setText(QApplication::translate("WateringConfigDialog", "Water when:", nullptr)); - temperatureCheckBox->setText(QApplication::translate("WateringConfigDialog", "Temperature is higher than:", nullptr)); + WateringConfigDialog->setWindowTitle(QCoreApplication::translate("WateringConfigDialog", "Watering Configuration", nullptr)); + label_3->setText(QCoreApplication::translate("WateringConfigDialog", "Plant:", nullptr)); + plantComboBox->setItemText(0, QCoreApplication::translate("WateringConfigDialog", "Squash", nullptr)); + plantComboBox->setItemText(1, QCoreApplication::translate("WateringConfigDialog", "Bean", nullptr)); + plantComboBox->setItemText(2, QCoreApplication::translate("WateringConfigDialog", "Carrot", nullptr)); + plantComboBox->setItemText(3, QCoreApplication::translate("WateringConfigDialog", "Strawberry", nullptr)); + plantComboBox->setItemText(4, QCoreApplication::translate("WateringConfigDialog", "Raspberry", nullptr)); + plantComboBox->setItemText(5, QCoreApplication::translate("WateringConfigDialog", "Blueberry", nullptr)); + + label_2->setText(QCoreApplication::translate("WateringConfigDialog", "Water when:", nullptr)); + temperatureCheckBox->setText(QCoreApplication::translate("WateringConfigDialog", "Temperature is higher than:", nullptr)); temperatureSpinBox->setSpecialValueText(QString()); - temperatureSpinBox->setSuffix(QApplication::translate("WateringConfigDialog", "C", nullptr)); - rainCheckBox->setText(QApplication::translate("WateringConfigDialog", "Rain less than:", nullptr)); + temperatureSpinBox->setSuffix(QCoreApplication::translate("WateringConfigDialog", "C", nullptr)); + rainCheckBox->setText(QCoreApplication::translate("WateringConfigDialog", "Rain less than:", nullptr)); rainSpinBox->setSpecialValueText(QString()); - rainSpinBox->setSuffix(QApplication::translate("WateringConfigDialog", "mm", nullptr)); - label->setText(QApplication::translate("WateringConfigDialog", "Starting Time:", nullptr)); - label_4->setText(QApplication::translate("WateringConfigDialog", "Amount:", nullptr)); - amountSpinBox->setSuffix(QApplication::translate("WateringConfigDialog", "l", nullptr)); - label_5->setText(QApplication::translate("WateringConfigDialog", "Source:", nullptr)); - sourceComboBox->setItemText(0, QApplication::translate("WateringConfigDialog", "Foundain", nullptr)); - sourceComboBox->setItemText(1, QApplication::translate("WateringConfigDialog", "River", nullptr)); - sourceComboBox->setItemText(2, QApplication::translate("WateringConfigDialog", "Lake", nullptr)); - sourceComboBox->setItemText(3, QApplication::translate("WateringConfigDialog", "Public Water System", nullptr)); - - label_6->setText(QApplication::translate("WateringConfigDialog", "Filter:", nullptr)); + rainSpinBox->setSuffix(QCoreApplication::translate("WateringConfigDialog", "mm", nullptr)); + label->setText(QCoreApplication::translate("WateringConfigDialog", "Starting Time:", nullptr)); + label_4->setText(QCoreApplication::translate("WateringConfigDialog", "Amount:", nullptr)); + amountSpinBox->setSuffix(QCoreApplication::translate("WateringConfigDialog", "l", nullptr)); + label_5->setText(QCoreApplication::translate("WateringConfigDialog", "Source:", nullptr)); + sourceComboBox->setItemText(0, QCoreApplication::translate("WateringConfigDialog", "Foundain", nullptr)); + sourceComboBox->setItemText(1, QCoreApplication::translate("WateringConfigDialog", "River", nullptr)); + sourceComboBox->setItemText(2, QCoreApplication::translate("WateringConfigDialog", "Lake", nullptr)); + sourceComboBox->setItemText(3, QCoreApplication::translate("WateringConfigDialog", "Public Water System", nullptr)); + + label_6->setText(QCoreApplication::translate("WateringConfigDialog", "Filter:", nullptr)); filterCheckBox->setText(QString()); - helpLabel->setText(QApplication::translate("WateringConfigDialog", "<a href=\"test\">Show Details</a>", nullptr)); + helpLabel->setText(QCoreApplication::translate("WateringConfigDialog", "<a href=\"test\">Show Details</a>", nullptr)); } // retranslateUi }; diff --git a/tests/auto/tools/uic/tst_uic.cpp b/tests/auto/tools/uic/tst_uic.cpp index 85668c96d4..f9553028fe 100644 --- a/tests/auto/tools/uic/tst_uic.cpp +++ b/tests/auto/tools/uic/tst_uic.cpp @@ -37,6 +37,11 @@ #include <QtCore/QRegularExpression> #include <QtCore/QStandardPaths> +#include <cstdio> + +static const char keepEnvVar[] = "UIC_KEEP_GENERATED_FILES"; +static const char diffToStderrEnvVar[] = "UIC_STDERR_DIFF"; + class tst_uic : public QObject { Q_OBJECT @@ -69,7 +74,7 @@ private: tst_uic::tst_uic() : m_command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic")) - , m_versionRegexp(QLatin1String("\\*\\* Created by: Qt User Interface Compiler version \\d{1,2}\\.\\d{1,2}\\.\\d{1,2}")) + , m_versionRegexp(QLatin1String(R"(\*\* Created by: Qt User Interface Compiler version \d{1,2}\.\d{1,2}\.\d{1,2})")) { } @@ -103,14 +108,19 @@ void tst_uic::initTestCase() qDebug("%s", qPrintable(msg)); } +static const char helpFormat[] = R"( +Note: The environment variable '%s' can be set to keep the temporary files +for error analysis. +The environment variable '%s' can be set to redirect the diff output to +stderr.)"; + void tst_uic::cleanupTestCase() { - static const char envVar[] = "UIC_KEEP_GENERATED_FILES"; - if (qgetenv(envVar).isEmpty()) { - qDebug("Note: The environment variable '%s' can be set to keep the temporary files for error analysis.", envVar); - } else { + if (qEnvironmentVariableIsSet(keepEnvVar)) { m_generated.setAutoRemove(false); qDebug("Keeping generated files in '%s'", qPrintable(QDir::toNativeSeparators(m_generated.path()))); + } else { + qDebug(helpFormat, keepEnvVar, diffToStderrEnvVar); } } @@ -152,7 +162,7 @@ void tst_uic::run() QVERIFY(process.waitForFinished()); QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); - QCOMPARE(QFileInfo(generatedFile).exists(), true); + QVERIFY(QFileInfo::exists(generatedFile)); } void tst_uic::run_data() const @@ -212,6 +222,16 @@ static QByteArray msgCannotReadFile(const QFile &file) return result.toLocal8Bit(); } +static void outputDiff(const QString &diff) +{ + // Use patch -p3 < diff to apply the obtained diff output in the baseline directory. + static const bool diffToStderr = qEnvironmentVariableIsSet(diffToStderrEnvVar); + if (diffToStderr) + std::fputs(qPrintable(diff), stderr); + else + qWarning("Difference:\n%s", qPrintable(diff)); +} + void tst_uic::compare() { QFETCH(QString, originalFile); @@ -233,7 +253,7 @@ void tst_uic::compare() if (generatedFileContents != originalFileContents) { const QString diff = generateDiff(originalFile, generatedFile); if (!diff.isEmpty()) - qWarning().noquote().nospace() << "Difference:\n" << diff; + outputDiff(diff); } QCOMPARE(generatedFileContents, originalFileContents); @@ -274,7 +294,7 @@ void tst_uic::runTranslation() QVERIFY(process.waitForFinished()); QCOMPARE(process.exitStatus(), QProcess::NormalExit); QCOMPARE(process.exitCode(), 0); - QCOMPARE(QFileInfo(generatedFile).exists(), true); + QVERIFY(QFileInfo::exists(generatedFile)); } @@ -301,7 +321,7 @@ void tst_uic::runCompare() if (generatedFileContents != originalFileContents) { const QString diff = generateDiff(originalFile, generatedFile); if (!diff.isEmpty()) - qWarning().noquote().nospace() << "Difference:\n" << diff; + outputDiff(diff); } QCOMPARE(generatedFileContents, originalFileContents); diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index b6932d4892..9d3770064f 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -253,11 +253,12 @@ protected: void calculateAndCheck(int cppline, const int precalced_comparedata[]); void testMinMaxSectionSize(bool stretchLastSection); - QWidget *topLevel; - QHeaderView *view; - QStandardItemModel *model; - QTableView *m_tableview; - bool m_using_reset_model; + QWidget *topLevel = nullptr; + QHeaderView *view = nullptr; + QStandardItemModel *model = nullptr; + QTableView *m_tableview = nullptr; + bool m_using_reset_model = false; + bool m_special_prepare = false; QElapsedTimer timer; }; @@ -614,6 +615,27 @@ void tst_QHeaderView::hidden() view->setSectionHidden(1, false); QCOMPARE(view->isSectionHidden(0), false); QCOMPARE(view->sectionSize(0), view->defaultSectionSize()); + + // d->hiddenSectionSize could go out of sync when a new model + // was set which has fewer sections than before and some of them + // were hidden + QStandardItemModel model2(model->rowCount() - 1, model->columnCount()); + + for (int i = 0; i < model->rowCount(); ++i) + view->setSectionHidden(i, true); + view->setModel(&model2); + QVERIFY(view->sectionsHidden()); + for (int i = 0; i < model2.rowCount(); ++i) { + QVERIFY(view->isSectionHidden(i)); + } + + view->setModel(model); + for (int i = 0; i < model2.rowCount(); ++i) { + QVERIFY(view->isSectionHidden(i)); + } + QCOMPARE(view->isSectionHidden(model->rowCount() - 1), false); + for (int i = 0; i < model->rowCount(); ++i) + view->setSectionHidden(i, false); } void tst_QHeaderView::stretch() @@ -2822,6 +2844,7 @@ void tst_QHeaderView::additionalInit() QFETCH(bool, reset_model); m_using_reset_model = reset_model; + m_special_prepare = special_prepare; if (m_using_reset_model) { XResetModel *m = new XResetModel(); @@ -3035,18 +3058,34 @@ void tst_QHeaderView::mixedTests() view->moveSection(0, 5); for (int u = model->rowCount(); u >= 0; --u) { - if (u % 5 != 0) + if (u % 5 != 0) { view->hideSection(u); - if (u % 3 != 0) + QVERIFY(view->isSectionHidden(u)); + } + if (u % 3 != 0) { view->showSection(u); + QVERIFY(!view->isSectionHidden(u)); + } } model->insertRows(3, 7); model->removeRows(8, 3); model->setRowCount(model->rowCount() - 10); + // the upper is not visible (when m_using_reset_model is true) + // the lower 11 are modified due to insert/removeRows + for (int u = model->rowCount() - 1; u >= 11; --u) { + // when using reset, the hidden rows will *not* move + const int calcMod = m_using_reset_model ? u : u - 4; // 7 added, 3 removed + if (calcMod % 5 != 0 && calcMod % 3 == 0) { + QVERIFY(view->isSectionHidden(u)); + } + if (calcMod % 3 != 0) { + QVERIFY(!view->isSectionHidden(u)); + } + } if (m_using_reset_model) { - const int precalced_results[] = { 898296472, 337096378, -543340640, 1, -1251526424, -568618976, 9250 }; + const int precalced_results[] = { 898296472, 337096378, -543340640, -1964432121, -1251526424, -568618976, 9250 }; calculateAndCheck(__LINE__, precalced_results); } else { const int precalced_results[] = { 1911338224, 1693514365, -613398968, -1912534953, 1582159424, -1851079000, 9300 }; diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp index a8f6906056..adedace8b2 100644 --- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp @@ -1215,7 +1215,7 @@ void tst_QItemDelegate::editorEvent() option.checkState = Qt::CheckState(checkState); const int checkMargin = qApp->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1; - QPoint pos = inCheck ? qApp->style()->subElementRect(QStyle::SE_ViewItemCheckIndicator, &option, 0).center() + QPoint(checkMargin, 0) : QPoint(200,200); + QPoint pos = inCheck ? qApp->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &option, 0).center() + QPoint(checkMargin, 0) : QPoint(200,200); QEvent *event = new QMouseEvent((QEvent::Type)type, pos, @@ -1371,7 +1371,7 @@ void tst_QItemDelegate::QTBUG4435_keepSelectionOnCheck() option.features = QStyleOptionViewItem::HasDisplay | QStyleOptionViewItem::HasCheckIndicator; option.checkState = Qt::CheckState(model.index(0, 0).data(Qt::CheckStateRole).toInt()); const int checkMargin = qApp->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1; - QPoint pos = qApp->style()->subElementRect(QStyle::SE_ViewItemCheckIndicator, &option, 0).center() + QPoint pos = qApp->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &option, 0).center() + QPoint(checkMargin, 0); QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, pos); QTRY_VERIFY(view.selectionModel()->isColumnSelected(0, QModelIndex())); diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp index bbdaac5c6f..071665a5e3 100644 --- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp +++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp @@ -249,7 +249,7 @@ void tst_QItemView::populate() for (int y = 0; y < treeModel->columnCount(); ++y) { QModelIndex index = treeModel->index(x, y, parent); treeModel->setData(index, xS + QLatin1Char('_') + QString::number(y) + QLatin1Char('_') + iS); - treeModel->setData(index, QVariant(QColor(Qt::blue)), Qt::TextColorRole); + treeModel->setData(index, QVariant(QColor(Qt::blue)), Qt::ForegroundRole); } } } diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index 5227db64ec..433b9e55e1 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -873,6 +873,10 @@ void tst_QListView::setCurrentIndex() } } } + while (model.rowCount()) { + view.setCurrentIndex(model.index(model.rowCount() - 1, 0)); + model.removeRow(model.rowCount() - 1); + } } class PublicListView : public QListView diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp index 98b44fe8aa..0c1b20d61a 100644 --- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp @@ -31,6 +31,7 @@ #include <QtGui/QtGui> #include <QtWidgets/QtWidgets> #include <qlist.h> +#include <QSignalSpy> #include <qlistwidget.h> #include <private/qlistwidget_p.h> @@ -116,6 +117,14 @@ private slots: void QTBUG14363_completerWithAnyKeyPressedEditTriggers(); void mimeData(); void QTBUG50891_ensureSelectionModelSignalConnectionsAreSet(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + void clearItemData(); +#endif + + void moveRows_data(); + void moveRows(); + void moveRowsInvalid_data(); + void moveRowsInvalid(); protected slots: void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last) @@ -148,6 +157,108 @@ private: }; +void tst_QListWidget::moveRowsInvalid_data() +{ + QTest::addColumn<QListWidget*>("baseWidget"); + QTest::addColumn<QModelIndex>("startParent"); + QTest::addColumn<int>("startRow"); + QTest::addColumn<int>("count"); + QTest::addColumn<QModelIndex>("destinationParent"); + QTest::addColumn<int>("destination"); + + const auto createWidget = []() -> QListWidget* { + QListWidget* result = new QListWidget; + result->addItems(QStringList{"A", "B", "C", "D", "E", "F"}); + return result; + }; + + QTest::addRow("destination_equal_source") << createWidget() << QModelIndex() << 0 << 1 << QModelIndex() << 1; + QTest::addRow("count_equal_0") << createWidget() << QModelIndex() << 0 << 0 << QModelIndex() << 2; + QListWidget* tempWidget = createWidget(); + QTest::addRow("move_child") << tempWidget << tempWidget->model()->index(0, 0) << 0 << 1 << QModelIndex() << 2; + tempWidget = createWidget(); + QTest::addRow("move_to_child") << tempWidget << QModelIndex() << 0 << 1 << tempWidget->model()->index(0, 0) << 2; + QTest::addRow("negative_count") << createWidget() << QModelIndex() << 0 << -1 << QModelIndex() << 2; + QTest::addRow("negative_source_row") << createWidget() << QModelIndex() << -1 << 1 << QModelIndex() << 2; + QTest::addRow("negative_destination_row") << createWidget() << QModelIndex() << 0 << 1 << QModelIndex() << -1; + QTest::addRow("source_row_equal_rowCount") << createWidget() << QModelIndex() << 6 << 1 << QModelIndex() << 1; + QTest::addRow("destination_row_greater_rowCount") << createWidget() << QModelIndex() << 0 << 1 << QModelIndex() << 6 + 1; + QTest::addRow("move_row_within_source_range") << createWidget() << QModelIndex() << 0 << 3 << QModelIndex() << 2; + QTest::addRow("destination_row_before_0") << createWidget() << QModelIndex() << 1 << 1 << QModelIndex() << 0; +} + +void tst_QListWidget::moveRowsInvalid() +{ + QFETCH(QListWidget* const, baseWidget); + QFETCH(const QModelIndex, startParent); + QFETCH(const int, startRow); + QFETCH(const int, count); + QFETCH(const QModelIndex, destinationParent); + QFETCH(const int, destination); + QAbstractItemModel *baseModel = baseWidget->model(); + QSignalSpy rowMovedSpy(baseModel, &QAbstractItemModel::rowsMoved); + QSignalSpy rowAboutMovedSpy(baseModel, &QAbstractItemModel::rowsAboutToBeMoved); + QVERIFY(rowMovedSpy.isValid()); + QVERIFY(rowAboutMovedSpy.isValid()); + QVERIFY(!baseModel->moveRows(startParent, startRow, count, destinationParent, destination)); + QCOMPARE(rowMovedSpy.size(), 0); + QCOMPARE(rowAboutMovedSpy.size(), 0); + delete baseWidget; +} + +void tst_QListWidget::moveRows_data() +{ + QTest::addColumn<int>("startRow"); + QTest::addColumn<int>("count"); + QTest::addColumn<int>("destination"); + QTest::addColumn<QStringList>("expected"); + + QTest::newRow("1_Item_from_top_to_middle") << 0 << 1 << 3 << QStringList{"B", "C", "A", "D", "E", "F"}; + QTest::newRow("1_Item_from_top_to_bottom") << 0 << 1 << 6 << QStringList{"B", "C", "D", "E", "F", "A"}; + QTest::newRow("1_Item_from_middle_to_top") << 2 << 1 << 1 << QStringList{"C", "A", "B", "D", "E", "F"}; + QTest::newRow("1_Item_from_bottom_to_middle") << 5 << 1 << 3 << QStringList{"A", "B", "F", "C", "D", "E"}; + QTest::newRow("1_Item_from_bottom to_top") << 5 << 1 << 1 << QStringList{"F", "A", "B", "C", "D", "E"}; + QTest::newRow("1_Item_from_middle_to_bottom") << 2 << 1 << 6 << QStringList{"A", "B", "D", "E", "F", "C"}; + QTest::newRow("1_Item_from_middle_to_middle_before") << 2 << 1 << 1 << QStringList{"C", "A", "B", "D", "E", "F"}; + QTest::newRow("1_Item_from_middle_to_middle_after") << 2 << 1 << 4 << QStringList{"A", "B", "D", "C", "E", "F"}; + + QTest::newRow("2_Items_from_top_to_middle") << 0 << 2 << 3 << QStringList{"C", "A", "B", "D", "E", "F"}; + QTest::newRow("2_Items_from_top_to_bottom") << 0 << 2 << 6 << QStringList{"C", "D", "E", "F", "A", "B"}; + QTest::newRow("2_Items_from_middle_to_top") << 2 << 2 << 1 << QStringList{"C", "D", "A", "B", "E", "F"}; + QTest::newRow("2_Items_from_bottom_to_middle") << 4 << 2 << 3 << QStringList{"A", "B", "E", "F", "C", "D"}; + QTest::newRow("2_Items_from_bottom_to_top") << 4 << 2 << 1 << QStringList{"E", "F", "A", "B", "C", "D"}; + QTest::newRow("2_Items_from_middle_to_bottom") << 2 << 2 << 6 << QStringList{"A", "B", "E", "F", "C", "D"}; + QTest::newRow("2_Items_from_middle_to_middle_before") << 3 << 2 << 2 << QStringList{"A", "D", "E", "B", "C", "F"}; + QTest::newRow("2_Items_from_middle_to_middle_after") << 1 << 2 << 5 << QStringList{"A", "D", "E", "B", "C", "F"}; +} + +void tst_QListWidget::moveRows() +{ + QFETCH(const int, startRow); + QFETCH(const int, count); + QFETCH(const int, destination); + QFETCH(const QStringList, expected); + QListWidget baseWidget; + baseWidget.addItems(QStringList{"A", "B", "C", "D", "E", "F"}); + QAbstractItemModel *baseModel = baseWidget.model(); + QSignalSpy rowMovedSpy(baseModel, &QAbstractItemModel::rowsMoved); + QSignalSpy rowAboutMovedSpy(baseModel, &QAbstractItemModel::rowsAboutToBeMoved); + QVERIFY(baseModel->moveRows(QModelIndex(), startRow, count, QModelIndex(), destination)); + QCOMPARE(baseModel->rowCount(), expected.size()); + for (int i = 0; i < expected.size(); ++i) + QCOMPARE(baseModel->index(i, 0).data().toString(), expected.at(i)); + QCOMPARE(rowMovedSpy.size(), 1); + QCOMPARE(rowAboutMovedSpy.size(), 1); + for (const QList<QVariant> &signalArgs : {rowMovedSpy.first(), rowAboutMovedSpy.first()}){ + QVERIFY(!signalArgs.at(0).value<QModelIndex>().isValid()); + QCOMPARE(signalArgs.at(1).toInt(), startRow); + QCOMPARE(signalArgs.at(2).toInt(), startRow + count - 1); + QVERIFY(!signalArgs.at(3).value<QModelIndex>().isValid()); + QCOMPARE(signalArgs.at(4).toInt(), destination); + } +} + + typedef QList<int> IntList; tst_QListWidget::tst_QListWidget(): testWidget(0), rcParent(8), rcFirst(8,0), rcLast(8,0) @@ -233,7 +344,7 @@ void tst_QListWidget::addItem2() testWidget->addItem(item); QCOMPARE(testWidget->count(), ++count); QCOMPARE(testWidget->item(testWidget->count()-1), item); - QCOMPARE(testWidget->isItemHidden(item), false); + QCOMPARE(item->isHidden(), false); } void tst_QListWidget::addItems() @@ -291,9 +402,11 @@ void tst_QListWidget::closePersistentEditor() void tst_QListWidget::setItemHidden() { +#if QT_DEPRECATED_SINCE(5, 13) // Boundary checking testWidget->setItemHidden(0, true); testWidget->setItemHidden(0, false); +#endif int totalHidden = 0; for (int i = 0; i < testWidget->model()->rowCount(); ++i) @@ -310,27 +423,27 @@ void tst_QListWidget::setItemHidden() newTotal++; QCOMPARE(newTotal, totalHidden); - testWidget->setItemHidden(item, true); - QCOMPARE(testWidget->isItemHidden(item), true); + item->setHidden(true); + QCOMPARE(item->isHidden(), true); // Check that nothing else changed newTotal = 0; for (int i = 0; i < testWidget->model()->rowCount(); ++i) - if (testWidget->isItemHidden(testWidget->item(i))) + if (testWidget->item(i)->isHidden()) newTotal++; QCOMPARE(newTotal, totalHidden + 1); - testWidget->setItemHidden(item, false); - QCOMPARE(testWidget->isItemHidden(item), false); + item->setHidden(false); + QCOMPARE(item->isHidden(), false); // Check that nothing else changed newTotal = 0; for (int i = 0; i < testWidget->model()->rowCount(); ++i) - if (testWidget->isItemHidden(testWidget->item(i))) + if (testWidget->item(i)->isHidden()) newTotal++; QCOMPARE(newTotal, totalHidden); - testWidget->setItemHidden(item, true); + item->setHidden(true); } void tst_QListWidget::setCurrentItem_data() @@ -736,7 +849,7 @@ void tst_QListWidget::selectedItems() testWidget->setSelectionMode(QListWidget::SingleSelection); for (int i=0; i<itemCount; ++i) { QListWidgetItem *item = testWidget->item(i); - testWidget->setItemSelected(item, true); + item->setSelected(true); QVERIFY(item->isSelected()); QCOMPARE(testWidget->selectedItems().count(), 1); } @@ -749,10 +862,10 @@ void tst_QListWidget::selectedItems() QCOMPARE(testWidget->count(), itemCount); // hide items foreach (int row, hiddenRows) - testWidget->setItemHidden(testWidget->item(row), true); + testWidget->item(row)->setHidden(true); // select items foreach (int row, selectedRows) - testWidget->setItemSelected(testWidget->item(row), true); + testWidget->item(row)->setSelected(true); // check that the correct number of items and the expected items are there QList<QListWidgetItem *> selectedItems = testWidget->selectedItems(); @@ -763,7 +876,7 @@ void tst_QListWidget::selectedItems() //check that isSelected agrees with selectedItems for (int i=0; i<itemCount; ++i) { QListWidgetItem *item = testWidget->item(i); - if (testWidget->isItemSelected(item)) + if (item->isSelected()) QVERIFY(selectedItems.contains(item)); } } @@ -1743,5 +1856,27 @@ void tst_QListWidget::QTBUG50891_ensureSelectionModelSignalConnectionsAreSet() } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +void tst_QListWidget::clearItemData() +{ + QListWidget list; + for (int i = 0 ; i < 4; ++i) + new QListWidgetItem(QString::number(i), &list); + QSignalSpy dataChangeSpy(list.model(), &QAbstractItemModel::dataChanged); + QVERIFY(dataChangeSpy.isValid()); + QVERIFY(!list.model()->clearItemData(QModelIndex())); + QCOMPARE(dataChangeSpy.size(), 0); + QVERIFY(list.model()->clearItemData(list.model()->index(0, 0))); + QVERIFY(!list.model()->index(0, 0).data().isValid()); + QCOMPARE(dataChangeSpy.size(), 1); + const QList<QVariant> dataChangeArgs = dataChangeSpy.takeFirst(); + QCOMPARE(dataChangeArgs.at(0).value<QModelIndex>(), list.model()->index(0, 0)); + QCOMPARE(dataChangeArgs.at(1).value<QModelIndex>(), list.model()->index(0, 0)); + QVERIFY(dataChangeArgs.at(2).value<QVector<int>>().isEmpty()); + QVERIFY(list.model()->clearItemData(list.model()->index(0, 0))); + QCOMPARE(dataChangeSpy.size(), 0); +} +#endif + QTEST_MAIN(tst_QListWidget) #include "tst_qlistwidget.moc" diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index ab746dfee8..228d03350a 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -2506,7 +2506,6 @@ void tst_QTableView::columnViewportPosition() view.horizontalScrollBar()->setValue(horizontalScrollValue); #ifdef Q_OS_WINRT - QEXPECT_FAIL("column 1, scroll per item, 1", "Fails on WinRT - QTBUG-68297", Abort); QEXPECT_FAIL("column 5, scroll per item, 5", "Fails on WinRT - QTBUG-68297", Abort); QEXPECT_FAIL("column 9, scroll per item, 5", "Fails on WinRT - QTBUG-68297", Abort); QEXPECT_FAIL("column 1, scroll per pixel 1", "Fails on WinRT - QTBUG-68297", Abort); diff --git a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp index 4155ff1ec6..2e8f262c85 100644 --- a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp +++ b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp @@ -83,12 +83,17 @@ private slots: void setItemData(); void cellWidget(); void cellWidgetGeometry(); + void sizeHint_data(); + void sizeHint(); void task231094(); void task219380_removeLastRow(); void task262056_sortDuplicate(); void itemWithHeaderItems(); void mimeData(); void selectedRowAfterSorting(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + void clearItemData(); +#endif private: QTableWidget *testWidget; @@ -191,10 +196,10 @@ void tst_QTableWidget::clear() { QTableWidgetItem *item = new QTableWidgetItem("foo"); testWidget->setItem(0, 0, item); - testWidget->setItemSelected(item, true); + item->setSelected(true); QVERIFY(testWidget->item(0, 0) == item); - QVERIFY(testWidget->isItemSelected(item)); + QVERIFY(item->isSelected()); QPointer<QObjectTableItem> bla = new QObjectTableItem(); @@ -578,7 +583,7 @@ void tst_QTableWidget::selectedItems() continue; QTableWidgetItem *item = testWidget->item(row, column); - if (item && testWidget->isItemSelected(item)) + if (item && item->isSelected()) QVERIFY(selectedItems.contains(item)); } } @@ -1454,6 +1459,56 @@ void tst_QTableWidget::cellWidgetGeometry() QCOMPARE(tw.visualItemRect(item).top(), le->geometry().top()); } +void tst_QTableWidget::sizeHint_data() +{ + QTest::addColumn<int>("scrollBarPolicy"); + QTest::addColumn<QSize>("viewSize"); + QTest::newRow("ScrollBarAlwaysOn") << static_cast<int>(Qt::ScrollBarAlwaysOn) << QSize(); + QTest::newRow("ScrollBarAlwaysOff") << static_cast<int>(Qt::ScrollBarAlwaysOff) << QSize(); + // make sure the scrollbars are shown by resizing the view to 40x40 + QTest::newRow("ScrollBarAsNeeded (40x40)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(40, 40); + QTest::newRow("ScrollBarAsNeeded (1000x1000)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(1000, 1000); +} + +void tst_QTableWidget::sizeHint() +{ + QFETCH(int, scrollBarPolicy); + QFETCH(QSize, viewSize); + + QTableWidget view(2, 2); + view.setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); + view.setVerticalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy)); + view.setHorizontalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy)); + for (int r = 0 ; r < view.rowCount(); ++r) + for (int c = 0 ; c < view.columnCount(); ++c) + view.setItem(r, c, new QTableWidgetItem(QString("%1/%2").arg(r).arg(c))); + + view.show(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + if (viewSize.isValid()) { + view.resize(viewSize); + view.setColumnWidth(0, 100); + view.setRowHeight(0, 100); + QTRY_COMPARE(view.size(), viewSize); + } + + auto sizeHint = view.sizeHint(); + view.hide(); + QCOMPARE(view.sizeHint(), sizeHint); + + view.horizontalHeader()->hide(); + view.show(); + sizeHint = view.sizeHint(); + view.hide(); + QCOMPARE(view.sizeHint(), sizeHint); + + view.verticalHeader()->hide(); + view.show(); + sizeHint = view.sizeHint(); + view.hide(); + QCOMPARE(view.sizeHint(), sizeHint); +} + void tst_QTableWidget::task231094() { QTableWidget tw(5, 3); @@ -1617,5 +1672,28 @@ void tst_QTableWidget::selectedRowAfterSorting() } } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +void tst_QTableWidget::clearItemData() +{ + QTableWidget table(3,3); + for (int r = 0; r < 3; r++) + for (int c = 0; c < 3; c++) + table.setItem(r,c,new QTableWidgetItem(QStringLiteral("0"))); + QSignalSpy dataChangeSpy(table.model(), &QAbstractItemModel::dataChanged); + QVERIFY(dataChangeSpy.isValid()); + QVERIFY(!table.model()->clearItemData(QModelIndex())); + QCOMPARE(dataChangeSpy.size(), 0); + QVERIFY(table.model()->clearItemData(table.model()->index(0, 0))); + QVERIFY(!table.model()->index(0, 0).data().isValid()); + QCOMPARE(dataChangeSpy.size(), 1); + const QList<QVariant> dataChangeArgs = dataChangeSpy.takeFirst(); + QCOMPARE(dataChangeArgs.at(0).value<QModelIndex>(), table.model()->index(0, 0)); + QCOMPARE(dataChangeArgs.at(1).value<QModelIndex>(), table.model()->index(0, 0)); + QVERIFY(dataChangeArgs.at(2).value<QVector<int>>().isEmpty()); + QVERIFY(table.model()->clearItemData(table.model()->index(0, 0))); + QCOMPARE(dataChangeSpy.size(), 0); +} +#endif + QTEST_MAIN(tst_QTableWidget) #include "tst_qtablewidget.moc" diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index 8f9afeea4d..e452efff07 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -69,6 +69,7 @@ public slots: void selectionOrderTest(); private slots: + void initTestCase() { QApplication::setKeyboardInputInterval(100); } void getSetCheck(); // one test per QTreeView property @@ -1647,50 +1648,96 @@ void tst_QTreeView::expandAndCollapse() } } +static void checkExpandState(const QAbstractItemModel &model, const QTreeView &view, + const QModelIndex &startIdx, bool bIsExpanded, int *count) +{ + *count = 0; + QStack<QModelIndex> parents; + parents.push(startIdx); + if (startIdx.isValid()) { + QCOMPARE(view.isExpanded(startIdx), bIsExpanded); + *count += 1; + } + while (!parents.isEmpty()) { + const QModelIndex p = parents.pop(); + const int rows = model.rowCount(p); + for (int r = 0; r < rows; ++r) { + const QModelIndex c = model.index(r, 0, p); + QCOMPARE(view.isExpanded(c), bIsExpanded); + parents.push(c); + } + *count += rows; + } +} + void tst_QTreeView::expandAndCollapseAll() { - QtTestModel model(3, 2); - model.levels = 2; + QStandardItemModel model; + // QtTestModel has a broken parent/child handling which will break the test + for (int i1 = 0; i1 < 3; ++i1) { + QStandardItem *s1 = new QStandardItem; + s1->setText(QString::number(i1)); + model.appendRow(s1); + for (int i2 = 0; i2 < 3; ++i2) { + QStandardItem *s2 = new QStandardItem; + s2->setText(QStringLiteral("%1 - %2").arg(i1).arg(i2)); + s1->appendRow(s2); + for (int i3 = 0; i3 < 3; ++i3) { + QStandardItem *s3 = new QStandardItem; + s3->setText(QStringLiteral("%1 - %2 - %3").arg(i1).arg(i2).arg(i3)); + s2->appendRow(s3); + } + } + } QTreeView view; view.setUniformRowHeights(true); view.setModel(&model); + view.show(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); - QSignalSpy expandedSpy(&view, SIGNAL(expanded(QModelIndex))); - QSignalSpy collapsedSpy(&view, SIGNAL(collapsed(QModelIndex))); + QSignalSpy expandedSpy(&view, &QTreeView::expanded); + QSignalSpy collapsedSpy(&view, &QTreeView::collapsed); + int count; view.expandAll(); - view.show(); - + checkExpandState(model, view, QModelIndex(), true, &count); QCOMPARE(collapsedSpy.count(), 0); + QCOMPARE(expandedSpy.count(), 39); // == 3 (first) + 9 (second) + 27 (third level) + QCOMPARE(count, 39); - QStack<QModelIndex> parents; - parents.push(QModelIndex()); - int count = 0; - while (!parents.isEmpty()) { - QModelIndex p = parents.pop(); - int rows = model.rowCount(p); - for (int r = 0; r < rows; ++r) - QVERIFY(view.isExpanded(model.index(r, 0, p))); - count += rows; - for (int r = 0; r < rows; ++r) - parents.push(model.index(r, 0, p)); - } - QCOMPARE(expandedSpy.count(), 12); // == (3+1)*(2+1) from QtTestModel model(3, 2); - + collapsedSpy.clear(); + expandedSpy.clear(); view.collapseAll(); - - parents.push(QModelIndex()); - count = 0; - while (!parents.isEmpty()) { - QModelIndex p = parents.pop(); - int rows = model.rowCount(p); - for (int r = 0; r < rows; ++r) - QVERIFY(!view.isExpanded(model.index(r, 0, p))); - count += rows; - for (int r = 0; r < rows; ++r) - parents.push(model.index(r, 0, p)); - } - QCOMPARE(collapsedSpy.count(), 12); + checkExpandState(model, view, QModelIndex(), false, &count); + QCOMPARE(collapsedSpy.count(), 39); + QCOMPARE(expandedSpy.count(), 0); + QCOMPARE(count, 39); + + collapsedSpy.clear(); + expandedSpy.clear(); + view.expandRecursively(model.index(0, 0)); + QCOMPARE(expandedSpy.count(), 13); // 1 + 3 + 9 + + checkExpandState(model, view, model.index(0, 0), true, &count); + QCOMPARE(count, 13); + checkExpandState(model, view, model.index(1, 0), false, &count); + QCOMPARE(count, 13); + checkExpandState(model, view, model.index(2, 0), false, &count); + QCOMPARE(count, 13); + + expandedSpy.clear(); + view.collapseAll(); + view.expandRecursively(model.index(0, 0), 1); + QCOMPARE(expandedSpy.count(), 4); // 1 + 3 + view.expandRecursively(model.index(0, 0), 2); + QCOMPARE(expandedSpy.count(), 13); // (1 + 3) + 9 + + checkExpandState(model, view, model.index(0, 0), true, &count); + QCOMPARE(count, 13); + checkExpandState(model, view, model.index(1, 0), false, &count); + QCOMPARE(count, 13); + checkExpandState(model, view, model.index(2, 0), false, &count); + QCOMPARE(count, 13); } void tst_QTreeView::expandWithNoChildren() @@ -2435,6 +2482,8 @@ void tst_QTreeView::selection() for (int i = 0;i < 10; ++i) m.setData(m.index(i, 0), i); treeView.setModel(&m); + treeView.show(); + QVERIFY(QTest::qWaitForWindowExposed(&treeView)); treeView.setSelectionBehavior(QAbstractItemView::SelectRows); treeView.setSelectionMode(QAbstractItemView::ExtendedSelection); @@ -2446,6 +2495,13 @@ void tst_QTreeView::selection() QTest::mousePress(treeView.viewport(), Qt::LeftButton, 0, treeView.visualRect(m.index(1, 0)).center()); QTest::keyPress(treeView.viewport(), Qt::Key_Down); + auto selectedRows = treeView.selectionModel()->selectedRows(); + QCOMPARE(selectedRows.size(), 1); + QCOMPARE(selectedRows.first(), m.index(2, 0, QModelIndex())); + QTest::keyPress(treeView.viewport(), Qt::Key_5); + selectedRows = treeView.selectionModel()->selectedRows(); + QCOMPARE(selectedRows.size(), 1); + QCOMPARE(selectedRows.first(), m.index(5, 0, QModelIndex())); } //From task 151686 QTreeView ExtendedSelection selects hidden rows @@ -2737,7 +2793,7 @@ void tst_QTreeView::sortByColumn() view.setSortingEnabled(sortingEnabled); view.setModel(&model); - view.sortByColumn(1); + view.sortByColumn(1, Qt::DescendingOrder); QCOMPARE(view.header()->sortIndicatorSection(), 1); QCOMPARE(view.model()->data(view.model()->index(0,1)).toString(), QString::fromLatin1("h")); QCOMPARE(view.model()->data(view.model()->index(1,1)).toString(), QString::fromLatin1("g")); @@ -3047,7 +3103,7 @@ void tst_QTreeView::evilModel() view.resizeColumnToContents(1); model.change(); - view.sortByColumn(1); + view.sortByColumn(1, Qt::DescendingOrder); model.change(); view.selectAll(); @@ -3891,7 +3947,7 @@ void tst_QTreeView::task254234_proxySort() model.setItem(2,1,new QStandardItem("h")); model.setItem(3,1,new QStandardItem("f")); - view.sortByColumn(1); + view.sortByColumn(1, Qt::DescendingOrder); view.setSortingEnabled(true); QSortFilterProxyModel proxy; diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp index 8c93df9073..ccae4ad626 100644 --- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp @@ -115,6 +115,8 @@ private slots: void changeDataWithSorting(); void changeDataWithStableSorting_data(); void changeDataWithStableSorting(); + void sizeHint_data(); + void sizeHint(); void sortedIndexOfChild_data(); void sortedIndexOfChild(); @@ -138,6 +140,7 @@ private slots: void expandAndCallapse(); void itemData(); void setDisabled(); + void setSpanned(); void removeSelectedItem(); void removeCurrentItem(); void removeCurrentItem_task186451(); @@ -161,6 +164,9 @@ private slots: void getMimeDataWithInvalidItem(); void testVisualItemRect(); void reparentHiddenItem(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + void clearItemData(); +#endif public slots: void itemSelectionChanged(); @@ -603,31 +609,31 @@ void tst_QTreeWidget::setItemHidden() QVERIFY(testWidget->visualItemRect(child).isValid() && testWidget->viewport()->rect().intersects(testWidget->visualItemRect(child))); - QVERIFY(!testWidget->isItemHidden(parent)); - QVERIFY(!testWidget->isItemHidden(child)); + QVERIFY(!parent->isHidden()); + QVERIFY(!child->isHidden()); - testWidget->setItemHidden(parent, true); + parent->setHidden(true); QVERIFY(!(testWidget->visualItemRect(parent).isValid() && testWidget->viewport()->rect().intersects(testWidget->visualItemRect(parent)))); QVERIFY(!(testWidget->visualItemRect(child).isValid() && testWidget->viewport()->rect().intersects(testWidget->visualItemRect(child)))); - QVERIFY(testWidget->isItemHidden(parent)); - QVERIFY(!testWidget->isItemHidden(child)); + QVERIFY(parent->isHidden()); + QVERIFY(!child->isHidden()); // From task 78670 (This caused an core dump) // Check if we can set an item visible if it already is visible. - testWidget->setItemHidden(parent, false); - testWidget->setItemHidden(parent, false); - QVERIFY(!testWidget->isItemHidden(parent)); + parent->setHidden(false); + parent->setHidden(false); + QVERIFY(!parent->isHidden()); // hide, hide and then unhide. - testWidget->setItemHidden(parent, true); - testWidget->setItemHidden(parent, true); - testWidget->setItemHidden(parent, false); - QVERIFY(!testWidget->isItemHidden(parent)); + parent->setHidden(true); + parent->setHidden(true); + parent->setHidden(false); + QVERIFY(!parent->isHidden()); } @@ -653,7 +659,7 @@ void tst_QTreeWidget::setItemHidden2() if (testWidget->topLevelItemCount() > 0) { top = testWidget->topLevelItem(0); - testWidget->setItemExpanded(top, true); + top->setExpanded(true); } if (testWidget->topLevelItemCount() > 0) { @@ -661,8 +667,8 @@ void tst_QTreeWidget::setItemHidden2() for (int i = 0; i < top->childCount(); i++) { leaf = top->child(i); if (leaf->text(0).toInt() % 2 == 0) { - if (!testWidget->isItemHidden(leaf)) { - testWidget->setItemHidden(leaf, true); + if (!leaf->isHidden()) { + leaf->setHidden(true); } } } @@ -816,7 +822,7 @@ void tst_QTreeWidget::selectedItems() else item = item->child(index); } - testWidget->setItemSelected(item, true); + item->setSelected(true); } // hide rows @@ -828,7 +834,7 @@ void tst_QTreeWidget::selectedItems() else item = item->child(index); } - testWidget->setItemHidden(item, true); + item->setHidden(true); } // open/close toplevel @@ -857,18 +863,20 @@ void tst_QTreeWidget::selectedItems() // compare isSelected for (int t=0; t<testWidget->topLevelItemCount(); ++t) { QTreeWidgetItem *top = testWidget->topLevelItem(t); - if (testWidget->isItemSelected(top) && !testWidget->isItemHidden(top)) + if (top->isSelected() && !top->isHidden()) QVERIFY(sel.contains(top)); for (int c=0; c<top->childCount(); ++c) { QTreeWidgetItem *child = top->child(c); - if (testWidget->isItemSelected(child) && !testWidget->isItemHidden(child)) + if (child->isSelected() && !child->isHidden()) QVERIFY(sel.contains(child)); } } +#if QT_DEPRECATED_SINCE(5, 13) // Possible to select null without crashing? testWidget->setItemSelected(0, true); QVERIFY(!testWidget->isItemSelected(0)); +#endif // unselect foreach (IntList itemPath, selectedItems) { @@ -879,7 +887,7 @@ void tst_QTreeWidget::selectedItems() else item = item->child(index); } - testWidget->setItemSelected(item, false); + item->setSelected(false); } QCOMPARE(testWidget->selectedItems().count(), 0); } @@ -1005,21 +1013,21 @@ void tst_QTreeWidget::expand() QTreeWidgetItem *topLevelItem = testWidget->topLevelItem(topLevelIndex); QTreeWidgetItem *childItem = topLevelItem->child(childIndex); - QVERIFY(!testWidget->isItemExpanded(topLevelItem)); - testWidget->setItemExpanded(topLevelItem, true); - QVERIFY(testWidget->isItemExpanded(topLevelItem)); + QVERIFY(!topLevelItem->isExpanded()); + topLevelItem->setExpanded(true); + QVERIFY(topLevelItem->isExpanded()); - QVERIFY(!testWidget->isItemExpanded(childItem)); - testWidget->setItemExpanded(childItem, true); - QVERIFY(testWidget->isItemExpanded(childItem)); + QVERIFY(!childItem->isExpanded()); + childItem->setExpanded(true); + QVERIFY(childItem->isExpanded()); - QVERIFY(testWidget->isItemExpanded(topLevelItem)); - testWidget->setItemExpanded(topLevelItem, false); - QVERIFY(!testWidget->isItemExpanded(topLevelItem)); + QVERIFY(topLevelItem->isExpanded()); + topLevelItem->setExpanded(false); + QVERIFY(!topLevelItem->isExpanded()); - QVERIFY(testWidget->isItemExpanded(childItem)); - testWidget->setItemExpanded(childItem, false); - QVERIFY(!testWidget->isItemExpanded(childItem)); + QVERIFY(childItem->isExpanded()); + childItem->setExpanded(false); + QVERIFY(!childItem->isExpanded()); } void tst_QTreeWidget::checkState_data() @@ -1520,7 +1528,7 @@ void tst_QTreeWidget::keyboardNavigation() } break; case Qt::Key_Down: - if (testWidget->isItemExpanded(item)) { + if (item->isExpanded()) { row = 0; item = item->child(row); } else { @@ -1533,7 +1541,7 @@ void tst_QTreeWidget::keyboardNavigation() break; case Qt::Key_Left: if (checkScroll) { - QVERIFY(testWidget->isItemExpanded(item)); + QVERIFY(item->isExpanded()); QCOMPARE(scrollBar->value(), valueBeforeClick - scrollBar->singleStep()); } // windows style right will walk to the parent @@ -1592,9 +1600,9 @@ void tst_QTreeWidget::scrollToItem() QCOMPARE(search->text(0), QLatin1String("111")); QTreeWidgetItem *par = search->parent(); - QVERIFY(testWidget->isItemExpanded(par)); + QVERIFY(par->isExpanded()); par = par->parent(); - QVERIFY(testWidget->isItemExpanded(par)); + QVERIFY(par->isExpanded()); } // From task #85413 @@ -1880,9 +1888,8 @@ void tst_QTreeWidget::setData() QCOMPARE(qvariant_cast<QSize>(item->data(j, Qt::SizeHintRole)), sizeHint); QCOMPARE(qvariant_cast<QFont>(item->data(j, Qt::FontRole)), font); QCOMPARE(qvariant_cast<int>(item->data(j, Qt::TextAlignmentRole)), int(textAlignment)); - QCOMPARE(qvariant_cast<QBrush>(item->data(j, Qt::BackgroundColorRole)), QBrush(backgroundColor)); QCOMPARE(qvariant_cast<QBrush>(item->data(j, Qt::BackgroundRole)), QBrush(backgroundColor)); - QCOMPARE(qvariant_cast<QColor>(item->data(j, Qt::TextColorRole)), textColor); + QCOMPARE(qvariant_cast<QColor>(item->data(j, Qt::ForegroundRole)), textColor); QCOMPARE(qvariant_cast<int>(item->data(j, Qt::CheckStateRole)), int(checkState)); item->setBackground(j, pixmap); @@ -1902,8 +1909,8 @@ void tst_QTreeWidget::setData() item->setData(j, Qt::SizeHintRole, QVariant()); item->setData(j, Qt::FontRole, QVariant()); item->setData(j, Qt::TextAlignmentRole, QVariant()); - item->setData(j, Qt::BackgroundColorRole, QVariant()); - item->setData(j, Qt::TextColorRole, QVariant()); + item->setData(j, Qt::BackgroundRole, QVariant()); + item->setData(j, Qt::ForegroundRole, QVariant()); item->setData(j, Qt::CheckStateRole, QVariant()); QCOMPARE(itemChangedSpy.count(), 11); itemChangedSpy.clear(); @@ -1916,9 +1923,8 @@ void tst_QTreeWidget::setData() QCOMPARE(item->data(j, Qt::SizeHintRole), QVariant()); QCOMPARE(item->data(j, Qt::FontRole), QVariant()); QCOMPARE(item->data(j, Qt::TextAlignmentRole), QVariant()); - QCOMPARE(item->data(j, Qt::BackgroundColorRole), QVariant()); QCOMPARE(item->data(j, Qt::BackgroundRole), QVariant()); - QCOMPARE(item->data(j, Qt::TextColorRole), QVariant()); + QCOMPARE(item->data(j, Qt::ForegroundRole), QVariant()); QCOMPARE(item->data(j, Qt::CheckStateRole), QVariant()); } } @@ -2618,6 +2624,50 @@ void tst_QTreeWidget::changeDataWithStableSorting() QCOMPARE(layoutChangedSpy.count(), reorderingExpected ? 1 : 0); } +void tst_QTreeWidget::sizeHint_data() +{ + QTest::addColumn<int>("scrollBarPolicy"); + QTest::addColumn<QSize>("viewSize"); + QTest::newRow("ScrollBarAlwaysOn") << static_cast<int>(Qt::ScrollBarAlwaysOn) << QSize(); + QTest::newRow("ScrollBarAlwaysOff") << static_cast<int>(Qt::ScrollBarAlwaysOff) << QSize(); + // make sure the scrollbars are shown by resizing the view to 40x40 + QTest::newRow("ScrollBarAsNeeded (40x40)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(40, 40); + QTest::newRow("ScrollBarAsNeeded (1000x1000)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(1000, 1000); +} + +void tst_QTreeWidget::sizeHint() +{ + QFETCH(int, scrollBarPolicy); + QFETCH(QSize, viewSize); + + QTreeWidget view; + view.setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); + view.setVerticalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy)); + view.setHorizontalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy)); + view.setColumnCount(2); + for (int i = 0 ; i < view.columnCount(); ++i) + view.addTopLevelItem(new QTreeWidgetItem(QStringList{"foo","bar"})); + + view.show(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + + if (viewSize.isValid()) { + view.resize(viewSize); + view.setColumnWidth(0, 100); + QTRY_COMPARE(view.size(), viewSize); + } + + auto sizeHint = view.sizeHint(); + view.hide(); + QCOMPARE(view.sizeHint(), sizeHint); + + view.header()->hide(); + view.show(); + sizeHint = view.sizeHint(); + view.hide(); + QCOMPARE(view.sizeHint(), sizeHint); +} + void tst_QTreeWidget::itemOperatorLessThan() { QTreeWidget tw; @@ -2769,6 +2819,28 @@ void tst_QTreeWidget::setDisabled() QCOMPARE(takenChildren.items[1]->isDisabled(), false); } +void tst_QTreeWidget::setSpanned() +{ + QTreeWidget w; + QTreeWidgetItem *i1 = new QTreeWidgetItem(); + QScopedPointer<QTreeWidgetItem> i2(new QTreeWidgetItem()); + + QTreeWidgetItem *top = new QTreeWidgetItem(&w); + top->addChild(i1); + + top->setFirstColumnSpanned(true); + QCOMPARE(top->isFirstColumnSpanned(), true); + QCOMPARE(i1->isFirstColumnSpanned(), false); + QCOMPARE(i2->isFirstColumnSpanned(), false); + + top->setFirstColumnSpanned(false); + i1->setFirstColumnSpanned(true); + i2->setFirstColumnSpanned(true); + QCOMPARE(top->isFirstColumnSpanned(), false); + QCOMPARE(i1->isFirstColumnSpanned(), true); + QCOMPARE(i2->isFirstColumnSpanned(), false); +} + void tst_QTreeWidget::removeSelectedItem() { const QScopedPointer <QTreeWidget> w(new QTreeWidget); @@ -2870,14 +2942,14 @@ void tst_QTreeWidget::randomExpand() QTreeWidgetItem *newItem1 = 0; for (int i = 0; i < 100; i++) { newItem1 = new QTreeWidgetItem(&tree, item1); - tree.setItemExpanded(newItem1, true); - QCOMPARE(tree.isItemExpanded(newItem1), true); + newItem1->setExpanded(true); + QCOMPARE(newItem1->isExpanded(), true); QTreeWidgetItem *x = new QTreeWidgetItem(); - QCOMPARE(tree.isItemExpanded(newItem1), true); + QCOMPARE(newItem1->isExpanded(), true); newItem1->addChild(x); - QCOMPARE(tree.isItemExpanded(newItem1), true); + QCOMPARE(newItem1->isExpanded(), true); } } @@ -2890,19 +2962,19 @@ void tst_QTreeWidget::crashTest() QTreeWidgetItem *item1 = new QTreeWidgetItem(tree); item1->setText(0, "item1"); - tree->setItemExpanded(item1, true); + item1->setExpanded(true); QTreeWidgetItem *item2 = new QTreeWidgetItem(item1); item2->setText(0, "item2"); QTreeWidgetItem *item3 = new QTreeWidgetItem(tree, item1); item3->setText(0, "item3"); - tree->setItemExpanded(item3, true); + item3->setExpanded(true); QTreeWidgetItem *item4 = new QTreeWidgetItem(item3); item4->setText(0, "item4"); QTreeWidgetItem *item5 = new QTreeWidgetItem(tree, item3); item5->setText(0, "item5"); - tree->setItemExpanded(item5, true); + item5->setExpanded(true); QTreeWidgetItem *item6 = new QTreeWidgetItem(item5); item6->setText(0, "item6"); @@ -3004,7 +3076,7 @@ void tst_QTreeWidget::task191552_rtl() opt.features = QStyleOptionViewItem::HasDisplay | QStyleOptionViewItem::HasCheckIndicator; opt.checkState = Qt::Checked; opt.widget = &tw; - const QRect checkRect = tw.style()->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, &tw); + const QRect checkRect = tw.style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &opt, &tw); QTest::mouseClick(tw.viewport(), Qt::LeftButton, Qt::NoModifier, checkRect.center()); QCOMPARE(item->checkState(0), Qt::Unchecked); @@ -3218,7 +3290,7 @@ void tst_QTreeWidget::nonEditableTristate() option.checkState = item->checkState(0); const int checkMargin = qApp->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1; - QPoint pos = qApp->style()->subElementRect(QStyle::SE_ViewItemCheckIndicator, &option, 0).center() + QPoint(checkMargin, 0); + QPoint pos = qApp->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &option, 0).center() + QPoint(checkMargin, 0); QTest::mouseClick(tree->viewport(), Qt::LeftButton, Qt::NoModifier, pos); QCOMPARE(int(item->checkState(0)), int(Qt::Checked)); @@ -3529,5 +3601,43 @@ void tst_QTreeWidget::reparentHiddenItem() QVERIFY(grandChild->isHidden()); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +void tst_QTreeWidget::clearItemData() +{ + QTreeWidget tree; + QAbstractItemModel* model = tree.model(); + QVERIFY(model->insertColumn(0)); + QVERIFY(model->insertRow(0)); + const QModelIndex parentIdx = model->index(0, 0); + QVERIFY(model->insertColumn(0, parentIdx)); + QVERIFY(model->insertRow(0, parentIdx)); + const QModelIndex childIdx = model->index(0, 0, parentIdx); + model->setData(parentIdx, QStringLiteral("parent")); + model->setData(parentIdx, QStringLiteral("parent"), Qt::UserRole); + model->setData(childIdx, QStringLiteral("child")); + QSignalSpy dataChangeSpy(model, &QAbstractItemModel::dataChanged); + QVERIFY(dataChangeSpy.isValid()); + QVERIFY(!model->clearItemData(QModelIndex())); + QCOMPARE(dataChangeSpy.size(), 0); + QVERIFY(model->clearItemData(parentIdx)); + QVERIFY(!model->data(parentIdx).isValid()); + QVERIFY(!model->data(parentIdx, Qt::UserRole).isValid()); + QCOMPARE(dataChangeSpy.size(), 1); + QList<QVariant> dataChangeArgs = dataChangeSpy.takeFirst(); + QCOMPARE(dataChangeArgs.at(0).value<QModelIndex>(), parentIdx); + QCOMPARE(dataChangeArgs.at(1).value<QModelIndex>(), parentIdx); + QVERIFY(dataChangeArgs.at(2).value<QVector<int>>().isEmpty()); + QVERIFY(model->clearItemData(parentIdx)); + QCOMPARE(dataChangeSpy.size(), 0); + QVERIFY(model->clearItemData(childIdx)); + QVERIFY(!model->data(childIdx).isValid()); + QCOMPARE(dataChangeSpy.size(), 1); + dataChangeArgs = dataChangeSpy.takeFirst(); + QCOMPARE(dataChangeArgs.at(0).value<QModelIndex>(), childIdx); + QCOMPARE(dataChangeArgs.at(1).value<QModelIndex>(), childIdx); + QVERIFY(dataChangeArgs.at(2).value<QVector<int>>().isEmpty()); +} +#endif + QTEST_MAIN(tst_QTreeWidget) #include "tst_qtreewidget.moc" diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp index c2c02f3766..76ca148d3f 100644 --- a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp +++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp @@ -95,11 +95,11 @@ void tst_QTreeWidgetItemIterator::initTestCase() const QString topS = QLatin1String("top") + QString::number(i); top->setText(0, topS); switch (i) { - case 0: testWidget->setItemHidden(top, true);break; - case 1: testWidget->setItemHidden(top, false);break; + case 0: top->setHidden(true);break; + case 1: top->setHidden(false);break; - case 2: testWidget->setItemSelected(top, true);break; - case 3: testWidget->setItemSelected(top, false);break; + case 2: top->setSelected(true);break; + case 3: top->setSelected(false);break; case 4: top->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);break; case 5: top->setFlags(Qt::ItemIsEnabled);break; @@ -126,11 +126,11 @@ void tst_QTreeWidgetItemIterator::initTestCase() QTreeWidgetItem *child = new QTreeWidgetItem(top); child->setText(0, topS + QLatin1String(",child") + QString::number(j)); switch (j) { - case 0: testWidget->setItemHidden(child, true);break; - case 1: testWidget->setItemHidden(child, false);break; + case 0: child->setHidden(true);break; + case 1: child->setHidden(false);break; - case 2: testWidget->setItemSelected(child, true);break; - case 3: testWidget->setItemSelected(child, false);break; + case 2: child->setSelected(true);break; + case 3: child->setSelected(false);break; case 4: child->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);break; case 5: child->setFlags(Qt::ItemIsEnabled);break; diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index d2a244b762..e2ef5635c2 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -240,6 +240,7 @@ void tst_QApplication::staticSetup() QVERIFY(style); QApplication::setStyle(style); + bool palette_changed = false; QPalette pal; QApplication::setPalette(pal); @@ -247,7 +248,11 @@ void tst_QApplication::staticSetup() QApplication::setFont(font);*/ int argc = 0; - QApplication app(argc, 0); + QApplication app(argc, nullptr); + QObject::connect(&app, &QApplication::paletteChanged, [&palette_changed]{ palette_changed = true; }); + QVERIFY(!palette_changed); + qApp->setPalette(QPalette(Qt::red)); + QVERIFY(palette_changed); } @@ -355,8 +360,8 @@ void tst_QApplication::setFont_data() int cnt = 0; QFontDatabase fdb; QStringList families = fdb.families(); - for (QStringList::const_iterator itr = families.begin(); - itr != families.end(); + for (QStringList::const_iterator itr = families.cbegin(); + itr != families.cend(); ++itr) { if (cnt < 3) { QString family = *itr; diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 360e6986f6..648c63b637 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -7655,9 +7655,6 @@ void tst_QWidget::updateWhileMinimized() // Restore window. widget.showNormal(); - QTest::qWait(30); - if (m_platform == QStringLiteral("xcb")) - QSKIP("QTBUG-26424"); QTRY_COMPARE(widget.numPaintEvents, 1); QCOMPARE(widget.paintedRegion, QRegion(0, 0, 50, 50)); } @@ -9425,7 +9422,7 @@ QWidgetBackingStore* backingStore(QWidget &widget) void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { #ifndef QT_NO_CURSOR - QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs + QGuiApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs #endif QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; @@ -9462,7 +9459,7 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779() QTRY_COMPARE(mainPixmap.toImage().convertToFormat(QImage::Format_RGB32), correct.toImage().convertToFormat(QImage::Format_RGB32)); #ifndef QT_NO_CURSOR - QApplication::restoreOverrideCursor(); + QGuiApplication::restoreOverrideCursor(); #endif } diff --git a/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp b/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp index 077e8de328..06522b2bd3 100644 --- a/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp +++ b/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp @@ -41,6 +41,8 @@ public: private slots: void metaObject(); + void saveAndLoadBuiltin_data(); + void saveAndLoadBuiltin(); }; class CustomWidget : public QWidget @@ -68,5 +70,50 @@ void tst_QWidgetMetaType::metaObject() QCOMPARE(QMetaType::metaObjectForType(qMetaTypeId<QSizePolicy>()), &QSizePolicy::staticMetaObject); } +template <typename T> +struct StreamingTraits +{ + // Streamable by default, as currently all widgets built-in types are streamable + enum { isStreamable = 1 }; +}; + +void tst_QWidgetMetaType::saveAndLoadBuiltin_data() +{ + QTest::addColumn<int>("type"); + QTest::addColumn<bool>("isStreamable"); + +#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \ + QTest::newRow(#RealType) << MetaTypeId << bool(StreamingTraits<RealType>::isStreamable); + QT_FOR_EACH_STATIC_WIDGETS_CLASS(ADD_METATYPE_TEST_ROW) +#undef ADD_METATYPE_TEST_ROW +} + +void tst_QWidgetMetaType::saveAndLoadBuiltin() +{ + QFETCH(int, type); + QFETCH(bool, isStreamable); + + void *value = QMetaType::create(type); + + QByteArray ba; + QDataStream stream(&ba, QIODevice::ReadWrite); + QCOMPARE(QMetaType::save(stream, type, value), isStreamable); + QCOMPARE(stream.status(), QDataStream::Ok); + + if (isStreamable) + QVERIFY(QMetaType::load(stream, type, value)); + + stream.device()->seek(0); + stream.resetStatus(); + QCOMPARE(QMetaType::load(stream, type, value), isStreamable); + QCOMPARE(stream.status(), QDataStream::Ok); + + if (isStreamable) + QVERIFY(QMetaType::load(stream, type, value)); + + QMetaType::destroy(type, value); +} + + QTEST_MAIN(tst_QWidgetMetaType) #include "tst_qwidgetmetatype.moc" diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index 03f24ba151..8f1f8590cb 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -159,7 +159,7 @@ void tst_QStyleSheetStyle::numinstances() QCOMPARE(QStyleSheetStyle::numinstances, 0); qApp->setStyleSheet("* { color: red; }"); QCOMPARE(QStyleSheetStyle::numinstances, 1); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QCOMPARE(QStyleSheetStyle::numinstances, 0); // set and unset application stylesheet+widget @@ -168,9 +168,9 @@ void tst_QStyleSheetStyle::numinstances() QCOMPARE(QStyleSheetStyle::numinstances, 2); w.setStyle(style); QCOMPARE(QStyleSheetStyle::numinstances, 2); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QCOMPARE(QStyleSheetStyle::numinstances, 1); - w.setStyleSheet(""); + w.setStyleSheet(QString()); QCOMPARE(QStyleSheetStyle::numinstances, 0); // set and unset widget stylesheet @@ -179,7 +179,7 @@ void tst_QStyleSheetStyle::numinstances() QCOMPARE(QStyleSheetStyle::numinstances, 1); c.setStyle(style); QCOMPARE(QStyleSheetStyle::numinstances, 2); - w.setStyleSheet(""); + w.setStyleSheet(QString()); QCOMPARE(QStyleSheetStyle::numinstances, 0); } @@ -192,9 +192,9 @@ void tst_QStyleSheetStyle::widgetsBeforeAppStyleSheet() QCOMPARE(COLOR(w1), red); w1.setStyleSheet("color: white"); QCOMPARE(COLOR(w1), white); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QCOMPARE(COLOR(w1), white); - w1.setStyleSheet(""); + w1.setStyleSheet(QString()); QCOMPARE(COLOR(w1), APPCOLOR(w1)); } @@ -217,17 +217,17 @@ void tst_QStyleSheetStyle::widgetsAfterAppStyleSheet() QCOMPARE(COLOR(w1), white); QCOMPARE(COLOR(spin), red); QCOMPARE(COLOR(*spin.lineEdit()), red); - w1.setStyleSheet(""); + w1.setStyleSheet(QString()); QCOMPARE(COLOR(w1), red); QCOMPARE(COLOR(spin), red); QCOMPARE(COLOR(*spin.lineEdit()), red); w1.setStyleSheet("color: white"); QCOMPARE(COLOR(w1), white); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QCOMPARE(COLOR(w1), white); QCOMPARE(COLOR(spin), APPCOLOR(spin)); QCOMPARE(COLOR(*spin.lineEdit()), APPCOLOR(*spin.lineEdit())); - w1.setStyleSheet(""); + w1.setStyleSheet(QString()); QCOMPARE(COLOR(w1), APPCOLOR(w1)); // QCOMPARE(FONTSIZE(w1), APPFONTSIZE(w1)); //### task 244261 QCOMPARE(FONTSIZE(spin), APPFONTSIZE(spin)); @@ -243,7 +243,7 @@ void tst_QStyleSheetStyle::applicationStyleSheet() QCOMPARE(COLOR(w1), red); qApp->setStyleSheet("* { color: white; }"); QCOMPARE(COLOR(w1), white); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QCOMPARE(COLOR(w1), APPCOLOR(w1)); qApp->setStyleSheet("* { color: red }"); QCOMPARE(COLOR(w1), red); @@ -254,21 +254,21 @@ void tst_QStyleSheetStyle::windowStyleSheet() const QColor red(Qt::red); const QColor white(Qt::white); QPushButton w1; - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); w1.setStyleSheet("* { color: red; }"); QCOMPARE(COLOR(w1), red); w1.setStyleSheet("* { color: white; }"); QCOMPARE(COLOR(w1), white); - w1.setStyleSheet(""); + w1.setStyleSheet(QString()); QCOMPARE(COLOR(w1), APPCOLOR(w1)); w1.setStyleSheet("* { color: red }"); QCOMPARE(COLOR(w1), red); qApp->setStyleSheet("* { color: green }"); QCOMPARE(COLOR(w1), red); - w1.setStyleSheet(""); + w1.setStyleSheet(QString()); QCOMPARE(COLOR(w1), QColor("green")); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QCOMPARE(COLOR(w1), APPCOLOR(w1)); } @@ -281,7 +281,7 @@ void tst_QStyleSheetStyle::widgetStyleSheet() QPushButton *pb = new QPushButton(&w1); QPushButton &w2 = *pb; - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); w1.setStyleSheet("* { color: red }"); QCOMPARE(COLOR(w1), red); QCOMPARE(COLOR(w2), red); @@ -293,11 +293,11 @@ void tst_QStyleSheetStyle::widgetStyleSheet() QCOMPARE(COLOR(w1), blue); QCOMPARE(COLOR(w2), white); - w1.setStyleSheet(""); + w1.setStyleSheet(QString()); QCOMPARE(COLOR(w1), APPCOLOR(w1)); QCOMPARE(COLOR(w2), white); - w2.setStyleSheet(""); + w2.setStyleSheet(QString()); QCOMPARE(COLOR(w1), APPCOLOR(w1)); QCOMPARE(COLOR(w2), APPCOLOR(w2)); } @@ -311,7 +311,7 @@ void tst_QStyleSheetStyle::reparentWithNoChildStyleSheet() QPushButton *pb = new QPushButton(&p1); QPushButton &c1 = *pb; // child with no stylesheet - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); p1.setStyleSheet("* { color: red }"); QCOMPARE(COLOR(c1), red); c1.setParent(&p2); @@ -333,7 +333,7 @@ void tst_QStyleSheetStyle::reparentWithChildStyleSheet() { const QColor gray("gray"); const QColor white(Qt::white); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QPushButton p1, p2; QPushButton *pb = new QPushButton(&p1); QPushButton &c1 = *pb; @@ -353,7 +353,7 @@ void tst_QStyleSheetStyle::repolish() { const QColor red(Qt::red); const QColor white(Qt::white); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QPushButton p1; p1.setStyleSheet("color: red; background: white"); QCOMPARE(BACKGROUND(p1), white); @@ -362,14 +362,14 @@ void tst_QStyleSheetStyle::repolish() p1.setStyleSheet("color: red"); QCOMPARE(COLOR(p1), red); QCOMPARE(BACKGROUND(p1), APPBACKGROUND(p1)); - p1.setStyleSheet(""); + p1.setStyleSheet(QString()); QCOMPARE(COLOR(p1), APPCOLOR(p1)); QCOMPARE(BACKGROUND(p1), APPBACKGROUND(p1)); } void tst_QStyleSheetStyle::widgetStyle() { - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QWidget *window1 = new QWidget; window1->setObjectName("window1"); @@ -429,7 +429,7 @@ void tst_QStyleSheetStyle::widgetStyle() // Remove the stylesheet proxy = (QStyleSheetStyle *)window1->style(); - window1->setStyleSheet(""); + window1->setStyleSheet(QString()); QVERIFY(proxy.isNull()); // should have disappeared QCOMPARE(window1->style(), style1.data()); // its restored @@ -457,7 +457,7 @@ void tst_QStyleSheetStyle::widgetStyle() QCOMPARE(proxy->baseStyle(), style1.data()); // Style Sheet propagation on a child widget with a custom style already set - window2->setStyleSheet(""); + window2->setStyleSheet(QString()); QCOMPARE(window2->style(), style2.data()); QCOMPARE(widget2->style(), style1.data()); widget2->setStyle(0); @@ -470,9 +470,9 @@ void tst_QStyleSheetStyle::widgetStyle() // clean everything out window1->setStyle(0); - window1->setStyleSheet(""); + window1->setStyleSheet(QString()); window2->setStyle(0); - window2->setStyleSheet(""); + window2->setStyleSheet(QString()); qApp->setStyle(0); qApp->setStyleSheet("may_insanity_prevail { }"); // app has stylesheet @@ -489,14 +489,14 @@ void tst_QStyleSheetStyle::widgetStyle() QCOMPARE(proxy->baseStyle(), newStyle); // magic ;) the widget still follows the application QCOMPARE(static_cast<QStyle *>(proxy), widget1->style()); // child still follows... - window1->setStyleSheet(""); // remove stylesheet + window1->setStyleSheet(QString()); // remove stylesheet QCOMPARE(window1->style(), qApp->style()); // is this cool or what QCOMPARE(widget1->style(), qApp->style()); // annoying child follows... QScopedPointer<QStyle> wndStyle(QStyleFactory::create("Windows")); window1->setStyle(wndStyle.data()); QCOMPARE(window1->style()->metaObject()->className(), "QStyleSheetStyle"); // auto wraps it QCOMPARE(widget1->style(), window1->style()); // and auto propagates to child - qApp->setStyleSheet(""); // remove the app stylesheet + qApp->setStyleSheet(QString()); // remove the app stylesheet QCOMPARE(window1->style(), wndStyle.data()); // auto dewrap QCOMPARE(widget1->style(), qApp->style()); // and child state is restored window1->setStyle(0); // let sanity prevail @@ -511,7 +511,7 @@ void tst_QStyleSheetStyle::widgetStyle() void tst_QStyleSheetStyle::appStyle() { - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); // qApp style can never be 0 QVERIFY(QApplication::style() != 0); QPointer<QStyle> style1 = QStyleFactory::create("Windows"); @@ -544,11 +544,11 @@ void tst_QStyleSheetStyle::appStyle() QCOMPARE(sss->baseStyle(), style1.data()); // Revert the stylesheet - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QVERIFY(sss.isNull()); // should have disappeared QCOMPARE(QApplication::style(), style1.data()); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QCOMPARE(QApplication::style(), style1.data()); } @@ -744,7 +744,7 @@ void tst_QStyleSheetStyle::fontPropagation() window.setStyleSheet("* { font-size: 10pt }"); pb.setParent(&window); QCOMPARE(FONTSIZE(pb), 10); - window.setStyleSheet(""); + window.setStyleSheet(QString()); QCOMPARE(FONTSIZE(pb), buttonFontSize); QTabWidget tw; @@ -757,7 +757,7 @@ void tst_QStyleSheetStyle::fontPropagation() void tst_QStyleSheetStyle::onWidgetDestroyed() { - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); QLabel *l = new QLabel; l->setStyleSheet("QLabel { color: red }"); QPointer<QStyleSheetStyle> ss = (QStyleSheetStyle *) l->style(); @@ -778,14 +778,14 @@ void tst_QStyleSheetStyle::fontPrecedence() font.setPointSize(16); edit.setFont(font); QCOMPARE(FONTSIZE(edit), 22); - edit.setStyleSheet(""); + edit.setStyleSheet(QString()); QCOMPARE(FONTSIZE(edit), 16); font.setPointSize(18); edit.setFont(font); QCOMPARE(FONTSIZE(edit), 18); edit.setStyleSheet("QLineEdit { font-size: 20pt; }"); QCOMPARE(FONTSIZE(edit), 20); - edit.setStyleSheet(""); + edit.setStyleSheet(QString()); QCOMPARE(FONTSIZE(edit), 18); edit.hide(); @@ -1189,7 +1189,7 @@ void tst_QStyleSheetStyle::transparent() QPushButton *p3=new QPushButton(&w); p1->setStyleSheet("background:transparent"); p2->setStyleSheet("background-color:transparent"); - p3->setStyleSheet("background:rgb(0,0,0,0)"); + p3->setStyleSheet("background:rgba(0,0,0,0)"); QCOMPARE(BACKGROUND(*p1) , QColor(0,0,0,0)); QCOMPARE(BACKGROUND(*p2) , QColor(0,0,0,0)); QCOMPARE(BACKGROUND(*p3) , QColor(0,0,0,0)); @@ -2051,7 +2051,7 @@ void tst_QStyleSheetStyle::styleSheetTargetAttribute() QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), true); QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), false); - qApp->setStyleSheet(""); + qApp->setStyleSheet(QString()); gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished(); QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), false); @@ -2066,7 +2066,7 @@ void tst_QStyleSheetStyle::unpolish() w.setStyleSheet("QWidget { min-width: 100; }"); w.ensurePolished(); QCOMPARE(w.minimumWidth(), 100); - w.setStyleSheet(""); + w.setStyleSheet(QString()); QCOMPARE(w.minimumWidth(), 0); } diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp index 6cc19051d2..67b79e3faf 100644 --- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp @@ -1689,14 +1689,16 @@ void tst_QMdiArea::tileSubWindows() workspace.setActiveSubWindow(0); QVERIFY(workspace.viewport()->childrenRect() != workspace.viewport()->rect()); - // Make sure the active window is placed in top left corner regardless + // Make sure the active window does not move position after a tile regardless // of whether we have any windows with staysOnTopHint or not. + workspace.tileSubWindows(); windows.at(3)->setWindowFlags(windows.at(3)->windowFlags() | Qt::WindowStaysOnTopHint); QMdiSubWindow *activeSubWindow = windows.at(6); workspace.setActiveSubWindow(activeSubWindow); QCOMPARE(workspace.activeSubWindow(), activeSubWindow); + QPoint pos = activeSubWindow->geometry().topLeft(); workspace.tileSubWindows(); - QCOMPARE(activeSubWindow->geometry().topLeft(), QPoint(0, 0)); + QCOMPARE(activeSubWindow->geometry().topLeft(), pos); // Verify that we try to resize the area such that all sub-windows are visible. // It's important that tiled windows are NOT overlapping. @@ -1713,6 +1715,8 @@ void tst_QMdiArea::tileSubWindows() // Prevent scrollbars from messing up the expected viewport calculation below workspace.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); workspace.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + QCOMPARE(workspace.horizontalScrollBarPolicy(), Qt::ScrollBarAlwaysOff); + QCOMPARE(workspace.verticalScrollBarPolicy(), Qt::ScrollBarAlwaysOff); workspace.tileSubWindows(); // The sub-windows are now tiled like this: @@ -1731,9 +1735,11 @@ void tst_QMdiArea::tileSubWindows() const QSize expectedViewportSize(3 * minSize.width() + spacing, 3 * minSize.height() + spacing); QTRY_COMPARE(workspace.viewport()->rect().size(), expectedViewportSize); - // Restore original scrollbar behavior for test below + // Enable scroll bar for test below (default property for QMdiArea is Qt::ScrollBarAlwaysOff) workspace.setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); workspace.setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + QCOMPARE(workspace.horizontalScrollBarPolicy(), Qt::ScrollBarAsNeeded); + QCOMPARE(workspace.verticalScrollBarPolicy(), Qt::ScrollBarAsNeeded); // Not enough space for all sub-windows to be visible -> provide scroll bars. workspace.resize(160, 150); @@ -1754,13 +1760,16 @@ void tst_QMdiArea::tileSubWindows() QCOMPARE(vBar->value(), 0); QCOMPARE(vBar->minimum(), 0); + // Tile windows with scroll bars enabled. workspace.tileSubWindows(); QVERIFY(QTest::qWaitForWindowExposed(&workspace)); qApp->processEvents(); - QTRY_VERIFY(workspace.size() != QSize(150, 150)); - QTRY_VERIFY(!vBar->isVisible()); - QTRY_VERIFY(!hBar->isVisible()); + // Workspace should not have changed size after tile. + QTRY_VERIFY(workspace.size() == QSize(160, 150)); + // Scroll bars should be visible. + QTRY_VERIFY(vBar->isVisible()); + QTRY_VERIFY(hBar->isVisible()); } void tst_QMdiArea::cascadeAndTileSubWindows() @@ -2180,7 +2189,7 @@ void tst_QMdiArea::setActivationOrder_data() list << 2 << 1 << 0 << 1 << 2 << 3 << 4; list2 << 0 << 1 << 2 << 3 << 4; - list3 << 1 << 4 << 3 << 1 << 2 << 0; + list3 << 4 << 3 << 2 << 4 << 1 << 0; // Most recently created window is in top-left position QTest::newRow("CreationOrder") << QMdiArea::CreationOrder << 5 << 3 << 1 << list << list2 << list3; list = QList<int>(); @@ -2188,7 +2197,7 @@ void tst_QMdiArea::setActivationOrder_data() list2 = QList<int>(); list2 << 0 << 2 << 4 << 1 << 3; list3 = QList<int>(); - list3 << 1 << 3 << 4 << 1 << 2 << 0; + list3 << 3 << 1 << 4 << 3 << 2 << 0; // Window with "stays-on-top" flag set will be in the top-left position QTest::newRow("StackingOrder") << QMdiArea::StackingOrder << 5 << 3 << 1 << list << list2 << list3; list = QList<int>(); diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index a88fd8d19c..634e258250 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -1143,8 +1143,16 @@ void tst_QMenu::QTBUG7411_submenus_activate() QTRY_VERIFY(sub1.isVisible()); } +static bool isPlatformWayland() +{ + return !QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive); +} + void tst_QMenu::QTBUG30595_rtl_submenu() { + if (isPlatformWayland()) + QSKIP("Creating xdg_popups on Wayland requires real input events. Positions would be off."); + QMenu menu("Test Menu"); menu.setLayoutDirection(Qt::RightToLeft); QMenu sub("&sub"); @@ -1179,6 +1187,9 @@ void tst_QMenu::QTBUG20403_nested_popup_on_shortcut_trigger() #ifndef Q_OS_MACOS void tst_QMenu::click_while_dismissing_submenu() { + if (isPlatformWayland()) + QSKIP("Wayland: Creating (grabbing) popups requires real mouse events."); + QMenu menu("Test Menu"); QAction *action = menu.addAction("action"); QMenu sub("&sub"); diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp index cfa2ddc4cc..be19cbc9d1 100644 --- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp @@ -140,6 +140,11 @@ private slots: void findBackwardWithRegExp(); void findWithRegExpReturnsFalseIfNoMoreResults(); #endif +#if QT_CONFIG(regularexpression) + void findWithRegularExpression(); + void findBackwardWithRegularExpression(); + void findWithRegularExpressionReturnsFalseIfNoMoreResults(); +#endif void layoutAfterMultiLineRemove(); void undoCommandRemovesAndReinsertsBlock(); void taskQTBUG_43562_lineCountCrash(); @@ -147,6 +152,9 @@ private slots: void contextMenu(); #endif void inputMethodCursorRect(); +#if QT_CONFIG(scrollbar) + void updateAfterChangeCenterOnScroll(); +#endif private: void createSelection(); @@ -1579,6 +1587,45 @@ void tst_QPlainTextEdit::findWithRegExpReturnsFalseIfNoMoreResults() } #endif +#if QT_CONFIG(regularexpression) +void tst_QPlainTextEdit::findWithRegularExpression() +{ + ed->setPlainText(QStringLiteral("arbitrary text")); + QRegularExpression rx("\\w{2}xt"); + + bool found = ed->find(rx); + + QVERIFY(found); + QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text")); +} + +void tst_QPlainTextEdit::findBackwardWithRegularExpression() +{ + ed->setPlainText(QStringLiteral("arbitrary text")); + QTextCursor cursor = ed->textCursor(); + cursor.movePosition(QTextCursor::End); + ed->setTextCursor(cursor); + QRegularExpression rx("a\\w*t"); + + bool found = ed->find(rx, QTextDocument::FindBackward); + + QVERIFY(found); + QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit")); +} + +void tst_QPlainTextEdit::findWithRegularExpressionReturnsFalseIfNoMoreResults() +{ + ed->setPlainText(QStringLiteral("arbitrary text")); + QRegularExpression rx("t.xt"); + ed->find(rx); + + bool found = ed->find(rx); + + QVERIFY(!found); + QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text")); +} +#endif + void tst_QPlainTextEdit::layoutAfterMultiLineRemove() { ed->setVisible(true); // The widget must be visible to reproduce this bug. @@ -1727,5 +1774,20 @@ void tst_QPlainTextEdit::inputMethodCursorRect() QCOMPARE(cursorRectV.toRect(), cursorRect.toRect()); } +#if QT_CONFIG(scrollbar) +// QTBUG-64730: Verify that the scrollbar is updated after center on scroll was set +void tst_QPlainTextEdit::updateAfterChangeCenterOnScroll() +{ + ed->setPlainText("Line1\nLine2Line3\nLine3"); + ed->show(); + ed->setCenterOnScroll(true); + const int maxWithCenterOnScroll = ed->verticalScrollBar()->maximum(); + ed->setCenterOnScroll(false); + const int maxWithoutCenterOnScroll = ed->verticalScrollBar()->maximum(); + QVERIFY(maxWithCenterOnScroll > maxWithoutCenterOnScroll); +} + +#endif + QTEST_MAIN(tst_QPlainTextEdit) #include "tst_qplaintextedit.moc" diff --git a/tests/auto/widgets/widgets/qsplitter/BLACKLIST b/tests/auto/widgets/widgets/qsplitter/BLACKLIST deleted file mode 100644 index 1352805cd7..0000000000 --- a/tests/auto/widgets/widgets/qsplitter/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -[replaceWidget:visible, not collapsed] -xcb diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 6a2ae4951b..5f5cd78215 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -199,6 +199,12 @@ private slots: void findWithRegExpReturnsFalseIfNoMoreResults(); #endif +#if QT_CONFIG(regularexpression) + void findWithRegularExpression(); + void findBackwardWithRegularExpression(); + void findWithRegularExpressionReturnsFalseIfNoMoreResults(); +#endif + #if QT_CONFIG(wheelevent) void wheelEvent(); #endif @@ -2572,6 +2578,45 @@ void tst_QTextEdit::findWithRegExpReturnsFalseIfNoMoreResults() } #endif +#if QT_CONFIG(regularexpression) +void tst_QTextEdit::findWithRegularExpression() +{ + ed->setHtml(QStringLiteral("arbitrary te<span style=\"color:#ff0000\">xt</span>")); + QRegularExpression rx("\\w{2}xt"); + + bool found = ed->find(rx); + + QVERIFY(found); + QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text")); +} + +void tst_QTextEdit::findBackwardWithRegularExpression() +{ + ed->setPlainText(QStringLiteral("arbitrary text")); + QTextCursor cursor = ed->textCursor(); + cursor.movePosition(QTextCursor::End); + ed->setTextCursor(cursor); + QRegularExpression rx("a\\w*t"); + + bool found = ed->find(rx, QTextDocument::FindBackward); + + QVERIFY(found); + QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit")); +} + +void tst_QTextEdit::findWithRegularExpressionReturnsFalseIfNoMoreResults() +{ + ed->setPlainText(QStringLiteral("arbitrary text")); + QRegularExpression rx("t.xt"); + ed->find(rx); + + bool found = ed->find(rx); + + QVERIFY(!found); + QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text")); +} +#endif + #if QT_CONFIG(wheelevent) class TextEdit : public QTextEdit diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/main.cpp index 5180e7c29e..104c01d118 100644 --- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp +++ b/tests/benchmarks/corelib/io/qfileinfo/main.cpp @@ -94,7 +94,9 @@ void qfileinfo::symLinkTargetPerformanceMounpoint() QString rootVolume = QString::fromWCharArray(buffer); QString mountpoint = "mountpoint"; rootVolume.replace("\\\\?\\","\\??\\"); - FileSystem::createNtfsJunction(rootVolume, mountpoint); + QString errorMessage; + QVERIFY2(FileSystem::createNtfsJunction(rootVolume, mountpoint, &errorMessage) == ERROR_SUCCESS, + qPrintable(errorMessage)); QFileInfo info(mountpoint); info.setCaching(false); diff --git a/tests/benchmarks/corelib/io/qtextstream/qtextstream.pro b/tests/benchmarks/corelib/io/qtextstream/qtextstream.pro index 758930c139..e8170319f2 100644 --- a/tests/benchmarks/corelib/io/qtextstream/qtextstream.pro +++ b/tests/benchmarks/corelib/io/qtextstream/qtextstream.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = tst_bench_qtemporaryfile +TARGET = tst_bench_qtextstream QT = core testlib diff --git a/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp b/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp index 704119b921..1b432f3b3e 100644 --- a/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp +++ b/tests/benchmarks/corelib/mimetypes/qmimedatabase/main.cpp @@ -35,6 +35,7 @@ class tst_QMimeDatabase: public QObject private slots: void inheritsPerformance(); + void benchMimeTypeForName(); }; void tst_QMimeDatabase::inheritsPerformance() @@ -70,5 +71,15 @@ void tst_QMimeDatabase::inheritsPerformance() // parsing XML, and then keeps being around 4.5 MB for all the in-memory hashes. } +void tst_QMimeDatabase::benchMimeTypeForName() +{ + QMimeDatabase db; + + QBENCHMARK { + const auto s = db.mimeTypeForName(QStringLiteral("text/plain")); + QVERIFY(s.isValid()); + } +} + QTEST_MAIN(tst_QMimeDatabase) #include "main.moc" diff --git a/tests/benchmarks/corelib/tools/qmap/qmap.pro b/tests/benchmarks/corelib/tools/qmap/qmap.pro index 6a0c8d62bd..6c9bf5e8d6 100644 --- a/tests/benchmarks/corelib/tools/qmap/qmap.pro +++ b/tests/benchmarks/corelib/tools/qmap/qmap.pro @@ -1,4 +1,4 @@ -TARGET = tst_qmap +TARGET = tst_bench_qmap QT = core testlib INCLUDEPATH += . SOURCES += main.cpp diff --git a/tests/benchmarks/widgets/itemviews/itemviews.pro b/tests/benchmarks/widgets/itemviews/itemviews.pro index a23cdf7b97..0c3256f307 100644 --- a/tests/benchmarks/widgets/itemviews/itemviews.pro +++ b/tests/benchmarks/widgets/itemviews/itemviews.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs SUBDIRS = \ qtableview \ - qheaderview + qheaderview \ + qlistview diff --git a/tests/benchmarks/widgets/itemviews/qlistview/qlistview.pro b/tests/benchmarks/widgets/itemviews/qlistview/qlistview.pro new file mode 100644 index 0000000000..68537d09ea --- /dev/null +++ b/tests/benchmarks/widgets/itemviews/qlistview/qlistview.pro @@ -0,0 +1,7 @@ +QT += widgets testlib + +TEMPLATE = app +TARGET = tst_bench_qlistview + +SOURCES += tst_qlistview.cpp + diff --git a/tests/benchmarks/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/benchmarks/widgets/itemviews/qlistview/tst_qlistview.cpp new file mode 100644 index 0000000000..01496743c2 --- /dev/null +++ b/tests/benchmarks/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qtest.h> +#include <QListView> +#include <QStandardItemModel> + + +class tst_QListView : public QObject +{ + Q_OBJECT + +public: + tst_QListView() = default; + virtual ~tst_QListView() = default; + +private slots: + void benchSetCurrentIndex(); +}; + +void tst_QListView::benchSetCurrentIndex() +{ + QStandardItemModel sm(50000, 1); + QListView lv; + lv.setModel(&sm); + const int rc = lv.model()->rowCount(); + for (int i = 0; i < rc; i+= 100) + lv.setRowHidden(i, true); + lv.setCurrentIndex(lv.model()->index(0, 0, QModelIndex())); + lv.show(); + QVERIFY(QTest::qWaitForWindowExposed(&lv)); + + QBENCHMARK_ONCE { + while (lv.currentIndex().row() < rc - 20) + lv.setCurrentIndex(lv.model()->index(lv.currentIndex().row() + 17, + lv.currentIndex().column(), + QModelIndex())); + } +} + + +QTEST_MAIN(tst_QListView) +#include "tst_qlistview.moc" diff --git a/tests/manual/foreignwindows/main.cpp b/tests/manual/foreignwindows/main.cpp index 74c6d8c376..44aff54773 100644 --- a/tests/manual/foreignwindows/main.cpp +++ b/tests/manual/foreignwindows/main.cpp @@ -195,6 +195,9 @@ static QString description(const QString &appName) "tests embedding foreign windows into Qt.\n\nUse cases:\n\n" << appName << " -a Dump a list of all native window ids.\n" << appName << " <winid> Dump information on the window.\n" + << appName << " -m <winid> Move window to top left corner\n" + << QByteArray(appName.size(), ' ') + << " (recover lost windows after changing monitor setups).\n" << appName << " -c <winid> Dump information on the window continuously.\n" << appName << " -e <winid> Embed window into a Qt widget.\n" << "\nOn Windows, class names of well known controls (EDIT, BUTTON...) can be\n" @@ -245,6 +248,10 @@ int main(int argc, char *argv[]) parser.addOption(outputAllOption); QCommandLineOption continuousOption(QStringList() << QStringLiteral("c") << QStringLiteral("continuous"), QStringLiteral("Output continuously.")); + parser.addOption(outputAllOption); + QCommandLineOption moveOption(QStringList() << QStringLiteral("m") << QStringLiteral("move"), + QStringLiteral("Move window to top left corner.")); + parser.addOption(moveOption); parser.addOption(continuousOption); QCommandLineOption embedOption(QStringList() << QStringLiteral("e") << QStringLiteral("embed"), QStringLiteral("Embed a foreign window into a Qt widget.")); @@ -274,8 +281,12 @@ int main(int argc, char *argv[]) return -1; } QWindow *foreignWindow = QWindow::fromWinId(wid); + if (!foreignWindow) + return -1; foreignWindow->setObjectName("ForeignWindow" + QString::number(wid, 16)); windows.append(foreignWindow); + if (parser.isSet(moveOption)) + foreignWindow->setFramePosition(QGuiApplication::primaryScreen()->availableGeometry().topLeft()); } if (windows.isEmpty()) diff --git a/tests/manual/qcursor/grab_override/mainwindow.cpp b/tests/manual/qcursor/grab_override/mainwindow.cpp index d2b7311846..087ee8d1d8 100644 --- a/tests/manual/qcursor/grab_override/mainwindow.cpp +++ b/tests/manual/qcursor/grab_override/mainwindow.cpp @@ -79,10 +79,10 @@ void MainWindow::toggleOverrideCursor() { switch (override) { case 0: - QApplication::setOverrideCursor(Qt::BusyCursor); + QGuiApplication::setOverrideCursor(Qt::BusyCursor); break; case 1: - QApplication::restoreOverrideCursor(); + QGuiApplication::restoreOverrideCursor(); break; case 2: ui->label->grabMouse(Qt::ForbiddenCursor); diff --git a/tests/manual/widgets/itemviews/itemviews.pro b/tests/manual/widgets/itemviews/itemviews.pro index 53f658d54d..8884cc3aae 100644 --- a/tests/manual/widgets/itemviews/itemviews.pro +++ b/tests/manual/widgets/itemviews/itemviews.pro @@ -1,2 +1,8 @@ TEMPLATE = subdirs -SUBDIRS = delegate qheaderview qtreeview qtreewidget tableview-span-navigation +SUBDIRS = delegate \ + qconcatenatetablesproxymodel \ + qheaderview \ + qtreeview \ + qtreewidget \ + tableview-span-navigation \ + diff --git a/tests/manual/widgets/itemviews/qconcatenatetablesproxymodel/main.cpp b/tests/manual/widgets/itemviews/qconcatenatetablesproxymodel/main.cpp new file mode 100644 index 0000000000..2c1825f29f --- /dev/null +++ b/tests/manual/widgets/itemviews/qconcatenatetablesproxymodel/main.cpp @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com> +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include <QConcatenateTablesProxyModel> +#include <QStandardItemModel> +#include <QTableView> +#include <QTreeView> + +static void prepareModel(const QString &prefix, QStandardItemModel *model) +{ + for (int row = 0; row < model->rowCount(); ++row) { + for (int column = 0; column < model->columnCount(); ++column) { + QStandardItem *item = new QStandardItem(prefix + QString(" %1,%2").arg(row).arg(column)); + item->setDragEnabled(true); + item->setDropEnabled(true); + model->setItem(row, column, item); + } + } +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QStandardItemModel firstModel(4, 4); + prepareModel("First", &firstModel); + QStandardItemModel secondModel(2, 2); + + QConcatenateTablesProxyModel proxy; + proxy.addSourceModel(&firstModel); + proxy.addSourceModel(&secondModel); + + prepareModel("Second", &secondModel); + + QTableView tableView; + tableView.setWindowTitle("concat proxy, in QTableView"); + tableView.setDragDropMode(QAbstractItemView::DragDrop); + tableView.setModel(&proxy); + tableView.show(); + + QTreeView treeView; + treeView.setWindowTitle("concat proxy, in QTreeView"); + treeView.setDragDropMode(QAbstractItemView::DragDrop); + treeView.setModel(&proxy); + treeView.show(); + + // For comparison, views on top on QStandardItemModel + + QTableView tableViewTest; + tableViewTest.setWindowTitle("first model, in QTableView"); + tableViewTest.setDragDropMode(QAbstractItemView::DragDrop); + tableViewTest.setModel(&firstModel); + tableViewTest.show(); + + QTreeView treeViewTest; + treeViewTest.setWindowTitle("first model, in QTreeView"); + treeViewTest.setDragDropMode(QAbstractItemView::DragDrop); + treeViewTest.setModel(&firstModel); + treeViewTest.show(); + + return app.exec(); +} diff --git a/tests/manual/widgets/itemviews/qconcatenatetablesproxymodel/qconcatenatetablesproxymodel.pro b/tests/manual/widgets/itemviews/qconcatenatetablesproxymodel/qconcatenatetablesproxymodel.pro new file mode 100644 index 0000000000..19904212a7 --- /dev/null +++ b/tests/manual/widgets/itemviews/qconcatenatetablesproxymodel/qconcatenatetablesproxymodel.pro @@ -0,0 +1,8 @@ + +TEMPLATE = app +TARGET = qconcatenatetablesproxymodel +INCLUDEPATH += . + +QT += widgets + +SOURCES += main.cpp diff --git a/tests/shared/filesystem.h b/tests/shared/filesystem.h index 73d7d6523c..9f4527a992 100644 --- a/tests/shared/filesystem.h +++ b/tests/shared/filesystem.h @@ -80,7 +80,7 @@ public: } #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) - static void createNtfsJunction(QString target, QString linkName) + static DWORD createNtfsJunction(QString target, QString linkName, QString *errorMessage) { typedef struct { DWORD ReparseTag; @@ -97,14 +97,22 @@ public: DWORD returnedLength; wchar_t fileSystem[MAX_PATH] = L""; PREPARSE_MOUNTPOINT_DATA_BUFFER reparseInfo = (PREPARSE_MOUNTPOINT_DATA_BUFFER) reparseBuffer; + DWORD result = ERROR_SUCCESS; QFileInfo junctionInfo(linkName); linkName = QDir::toNativeSeparators(junctionInfo.absoluteFilePath()); - - GetVolumeInformationW( (wchar_t*)linkName.left(3).utf16(), NULL, 0, NULL, NULL, NULL, - fileSystem, sizeof(fileSystem)/sizeof(WCHAR)); - if(QString().fromWCharArray(fileSystem) != "NTFS") - QSKIP("This seems not to be an NTFS volume. Junctions are not allowed."); + const QString drive = linkName.left(3); + if (GetVolumeInformationW(reinterpret_cast<const wchar_t *>(drive.utf16()), + NULL, 0, NULL, NULL, NULL, + fileSystem, sizeof(fileSystem)/sizeof(WCHAR)) == FALSE) { + result = GetLastError(); + *errorMessage = "GetVolumeInformationW() failed: " + qt_error_string(int(result)); + return result; + } + if (QString::fromWCharArray(fileSystem) != "NTFS") { + *errorMessage = "This seems not to be an NTFS volume. Junctions are not allowed."; + return ERROR_NOT_SUPPORTED; + } if (!target.startsWith("\\??\\") && !target.startsWith("\\\\?\\")) { QFileInfo targetInfo(target); @@ -116,7 +124,11 @@ public: QDir().mkdir(linkName); hFile = CreateFileW( (wchar_t*)linkName.utf16(), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL ); - QVERIFY(hFile != INVALID_HANDLE_VALUE ); + if (hFile == INVALID_HANDLE_VALUE) { + result = GetLastError(); + *errorMessage = "CreateFileW(" + linkName + ") failed: " + qt_error_string(int(result)); + return result; + } memset( reparseInfo, 0, sizeof( *reparseInfo )); reparseInfo->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; @@ -128,8 +140,12 @@ public: bool ioc = DeviceIoControl(hFile, FSCTL_SET_REPARSE_POINT, reparseInfo, reparseInfo->ReparseDataLength + REPARSE_MOUNTPOINT_HEADER_SIZE, NULL, 0, &returnedLength, NULL); + if (!ioc) { + result = GetLastError(); + *errorMessage = "DeviceIoControl() failed: " + qt_error_string(int(result)); + } CloseHandle( hFile ); - QVERIFY(ioc); + return result; } #endif diff --git a/tests/testserver/danted/danted.sh b/tests/testserver/danted/danted.sh index bf3d154f33..97e2142401 100755 --- a/tests/testserver/danted/danted.sh +++ b/tests/testserver/danted/danted.sh @@ -39,6 +39,25 @@ useradd -d /dev/null -s /bin/false qsockstest; echo "qsockstest:$PASS" | chpassw # install configurations and test data cp $TESTDATA/danted{,-authenticating}.conf /etc/ +# Use the input environment variables to overwrite the default value of internal interfaces. +if [ "$danted_internal" -a "$danted_internal" != eth0 ] +then sed -i "s,internal: eth0 port = 1080,internal: $danted_internal port = 1080," /etc/danted.conf +fi + +if [ "$danted_auth_internal" -a "$danted_auth_internal" != eth0 ] +then sed -i "s,internal: eth0 port = 1081,internal: $danted_auth_internal port = 1081," \ + /etc/danted-authenticating.conf +fi + +# Use the input environment variables to overwrite the default value of external interfaces. +if [ "$danted_external" -a "$danted_external" != eth0 ] +then sed -i "s,external: eth0,external: $danted_external," /etc/danted.conf +fi + +if [ "$danted_auth_external" -a "$danted_auth_external" != eth0 ] +then sed -i "s,external: eth0,external: $danted_auth_external," /etc/danted-authenticating.conf +fi + # enable service with installed configurations service danted start service danted-authenticating start diff --git a/tests/testserver/docker-compose-for-macOS.yml b/tests/testserver/docker-compose-for-macOS.yml new file mode 100644 index 0000000000..fcf0f73c7e --- /dev/null +++ b/tests/testserver/docker-compose-for-macOS.yml @@ -0,0 +1,80 @@ +version: '3.4' + +# The tag of images is used by docker compose file to launch the corresponding +# docker containers. The value of tag comes from the provisioning script +# (coin/provisioning/.../testserver/docker_testserver.sh). The script gets SHA-1 +# of each server context as the tag of docker images. If one of the server +# contexts gets changes, please make sure to update this compose file as well. +# You can run command 'docker images' to list all the tags of test server images. +# For example: +# REPOSITORY TAG IMAGE ID +# qt-test-server-apache2 cc9ea678b92bdda33acb9fa0159bb4ad0f3cd947 2ad5c8720317 + +services: + apache2: + image: qt-test-server-apache2:537fe302f61851d1663f41495230d8e3554a4a13 + container_name: qt-test-server-apache2 + domainname: test-net.qt.local + volumes: + - ./common:/common:ro + - ./apache2:/service:ro + entrypoint: common/startup.sh + command: [common/ssl.sh, service/apache2.sh] + network_mode: "host" + + squid: + image: qt-test-server-squid:9c32f41b19aca3d778733c4d8fb0ecc5955e893c + container_name: qt-test-server-squid + domainname: test-net.qt.local + depends_on: + - apache2 + volumes: + - ./common:/common:ro + - ./squid:/service:ro + entrypoint: common/startup.sh + command: service/squid.sh + network_mode: "host" + + vsftpd: + image: qt-test-server-vsftpd:f3a9c8d793a77cc007c0e4e481bec01f9e3eeb7e + container_name: qt-test-server-vsftpd + domainname: test-net.qt.local + volumes: + - ./common:/common:ro + - ./vsftpd:/service:ro + entrypoint: common/startup.sh + command: service/vsftpd.sh + network_mode: "host" + + ftp-proxy: + image: qt-test-server-ftp-proxy:d7de8b28392d173db512a558ccc84ead8bece2ae + container_name: qt-test-server-ftp-proxy + domainname: test-net.qt.local + depends_on: + - vsftpd + volumes: + - ./common:/common:ro + - ./ftp-proxy:/service:ro + entrypoint: common/startup.sh + command: service/ftp-proxy.sh + network_mode: "host" + + danted: + image: qt-test-server-danted:35607f9b790524cf9690c7d12a9a401696b7b6b5 + container_name: qt-test-server-danted + domainname: test-net.qt.local + depends_on: + - apache2 + - vsftpd + - ftp-proxy + volumes: + - ./common:/common:ro + - ./danted:/service:ro + entrypoint: common/startup.sh + command: service/danted.sh + network_mode: "host" + environment: + - danted_internal=${MACHINE_IP:-eth0} + - danted_external=${MACHINE_IP:-eth0} + - danted_auth_internal=${MACHINE_IP:-eth0} + - danted_auth_external=${MACHINE_IP:-eth0} diff --git a/tests/testserver/docker-compose.yml b/tests/testserver/docker-compose.yml index a151d6bfb0..50f56bbe4d 100644 --- a/tests/testserver/docker-compose.yml +++ b/tests/testserver/docker-compose.yml @@ -12,7 +12,7 @@ version: '3.4' services: apache2: - image: qt-test-server-apache2:cc9ea678b92bdda33acb9fa0159bb4ad0f3cd947 + image: qt-test-server-apache2:537fe302f61851d1663f41495230d8e3554a4a13 container_name: qt-test-server-apache2 domainname: test-net.qt.local hostname: apache2 @@ -23,7 +23,7 @@ services: command: [common/ssl.sh, service/apache2.sh] squid: - image: qt-test-server-squid:577d99307eea9a8cccfec944d25be2bce2fe99cc + image: qt-test-server-squid:9c32f41b19aca3d778733c4d8fb0ecc5955e893c container_name: qt-test-server-squid domainname: test-net.qt.local hostname: squid @@ -38,7 +38,7 @@ services: command: service/squid.sh vsftpd: - image: qt-test-server-vsftpd:18896604c7e90b543e56d80c8a8aabdb65a590d0 + image: qt-test-server-vsftpd:f3a9c8d793a77cc007c0e4e481bec01f9e3eeb7e container_name: qt-test-server-vsftpd domainname: test-net.qt.local hostname: vsftpd @@ -49,7 +49,7 @@ services: command: service/vsftpd.sh ftp-proxy: - image: qt-test-server-ftp-proxy:2c6c8f1ab6a364b540c43d705fb6f15a585cb2af + image: qt-test-server-ftp-proxy:d7de8b28392d173db512a558ccc84ead8bece2ae container_name: qt-test-server-ftp-proxy domainname: test-net.qt.local hostname: ftp-proxy @@ -64,7 +64,7 @@ services: command: service/ftp-proxy.sh danted: - image: qt-test-server-danted:327dd56c3c35db85b26fac93213a5a1918475bc7 + image: qt-test-server-danted:35607f9b790524cf9690c7d12a9a401696b7b6b5 container_name: qt-test-server-danted domainname: test-net.qt.local hostname: danted diff --git a/tests/testserver/vsftpd/vsftpd.sh b/tests/testserver/vsftpd/vsftpd.sh index 1ba1a8c347..845c576534 100755 --- a/tests/testserver/vsftpd/vsftpd.sh +++ b/tests/testserver/vsftpd/vsftpd.sh @@ -43,7 +43,7 @@ cp $TESTDATA/vsftpd.{conf,user_list} /etc/ # Resolve error message "vsftpd failed - probably invalid config" during boot command='start-stop-daemon --start --background -m --oknodo --pidfile /var/run/vsftpd/vsftpd.pid' command+=' --exec ${DAEMON}' -sed -i "s,$command.*$,$command; sleep 1," /etc/init.d/vsftpd +sed -i "s,$command.*$,$command; sleep 10," /etc/init.d/vsftpd # Populate the FTP sites: su $USER -c "cp -r $TESTDATA/ftp ~/ftp" |