summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp4
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp6
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp10
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp4
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp2
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp8
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp2
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp2
13 files changed, 24 insertions, 24 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index cc321bb137..fbd368d077 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -956,7 +956,7 @@ void tst_QFiledialog::selectFiles()
QListView* listView = fd.findChild<QListView*>("listView");
QVERIFY(listView);
for (int i = 0; i < list.count(); ++i) {
- fd.selectFile(fd.directory().path() + "/" + list.at(i));
+ fd.selectFile(fd.directory().path() + QLatin1Char('/') + list.at(i));
QTRY_VERIFY(!listView->selectionModel()->selectedRows().isEmpty());
toSelect.append(listView->selectionModel()->selectedRows().last());
}
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index 7e6e5908ee..1e9cbe6578 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -514,7 +514,7 @@ protected:
path = parentIndex.child(source_row,0).data(Qt::DisplayRole).toString();
do {
- path = parentIndex.data(Qt::DisplayRole).toString() + "/" + path;
+ path = parentIndex.data(Qt::DisplayRole).toString() + QLatin1Char('/') + path;
parentIndex = parentIndex.parent();
} while(parentIndex.isValid());
@@ -897,7 +897,7 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
#else
QTest::qWait(500);
#endif
- QCOMPARE(fd2.selectedFiles().first(), current.absolutePath() + QChar('/') + QLatin1String("g"));
+ QCOMPARE(fd2.selectedFiles().first(), current.absolutePath() + QLatin1String("/g"));
QNonNativeFileDialog fd3(0, "This is a third file dialog", tempFile->fileName());
fd3.restoreState(fd.saveState());
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 0e7f760b4e..bbe027fbc6 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -1097,7 +1097,7 @@ void tst_QFileSystemModel::permissions() // checks QTBUG-20503
QFETCH(bool, readOnly);
const QString tmp = flatDirTestPath;
- const QString file = tmp + '/' + "f";
+ const QString file = tmp + QLatin1String("/f");
QVERIFY(createFiles(tmp, QStringList() << "f"));
QVERIFY(QFile::setPermissions(file, QFile::Permissions(permissions)));
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index 97cfec8171..fd78bd870b 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -606,7 +606,7 @@ void tst_QMessageBox::detailsButtonText()
QAbstractButton* btn = NULL;
foreach(btn, list) {
if (btn && (btn->inherits("QPushButton"))) {
- if (btn->text().remove("&") != QMessageBox::tr("OK")
+ if (btn->text().remove(QLatin1Char('&')) != QMessageBox::tr("OK")
&& btn->text() != QMessageBox::tr("Show Details...")) {
QFAIL(qPrintable(QString("Unexpected messagebox button text: %1").arg(btn->text())));
}
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index b2bdbac79a..5fddaf21ea 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -547,8 +547,8 @@ void tst_QWizard::setDefaultProperty()
// make sure the data structure is reasonable
for (int i = 0; i < 200000; ++i) {
- wizard.setDefaultProperty("QLineEdit", QByteArray("x" + QByteArray::number(i)).constData(), 0);
- wizard.setDefaultProperty("QLabel", QByteArray("y" + QByteArray::number(i)).constData(), 0);
+ wizard.setDefaultProperty("QLineEdit", QByteArray('x' + QByteArray::number(i)).constData(), 0);
+ wizard.setDefaultProperty("QLabel", QByteArray('y' + QByteArray::number(i)).constData(), 0);
}
}
@@ -2115,7 +2115,7 @@ void tst_QWizard::combinations()
}
if (minSizeTest)
- qDebug() << "minimum sizes" << reason.latin1() << ";" << wizard.minimumSizeHint()
+ qDebug() << "minimum sizes" << reason.latin1() << ';' << wizard.minimumSizeHint()
<< otor.latin1() << refMinSize;
if (imageTest)
diff --git a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
index f12876f745..63cf7b2751 100644
--- a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
@@ -416,14 +416,14 @@ void tst_QDirModel::rowsAboutToBeRemoved_data()
bool tst_QDirModel::rowsAboutToBeRemoved_init(const QString &test_path, const QStringList &initial_files)
{
- QString path = QDir::currentPath() + "/" + test_path;
+ QString path = QDir::currentPath() + QLatin1Char('/') + test_path;
if (!QDir::current().mkdir(test_path) && false) { // FIXME
qDebug() << "failed to create dir" << path;
return false;
}
for (int i = 0; i < initial_files.count(); ++i) {
- QFile file(path + "/" + initial_files.at(i));
+ QFile file(path + QLatin1Char('/') + initial_files.at(i));
if (!file.open(QIODevice::WriteOnly)) {
qDebug() << "failed to open file" << initial_files.at(i);
return false;
@@ -443,7 +443,7 @@ bool tst_QDirModel::rowsAboutToBeRemoved_init(const QString &test_path, const QS
bool tst_QDirModel::rowsAboutToBeRemoved_cleanup(const QString &test_path)
{
- QString path = QDir::currentPath() + "/" + test_path;
+ QString path = QDir::currentPath() + QLatin1Char('/') + test_path;
QDir dir(path, "*", QDir::SortFlags(QDir::Name|QDir::IgnoreCase), QDir::Files);
QStringList files = dir.entryList();
@@ -584,8 +584,8 @@ void tst_QDirModel::filePath()
QString path = SRCDIR;
#else
QString path = QFileInfo(SRCDIR).absoluteFilePath();
- if (!path.endsWith("/"))
- path += "/";
+ if (!path.endsWith(QLatin1Char('/')))
+ path += QLatin1Char('/');
#endif
QCOMPARE(model.filePath(index), path + QString( "test.lnk"));
model.setResolveSymlinks(true);
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 7e73c19539..6738ab60df 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -2492,7 +2492,7 @@ void tst_QHeaderView::calculateAndCheck(int cppline, const int precalced_compare
QString msg = "semantic problem at " + QString(__FILE__) + " (" + sline + ")";
msg += "\nThe *expected* result was : {" + istr(x[0]) + istr(x[1]) + istr(x[2]) + istr(x[3])
- + istr(x[4]) + istr(x[5]) + istr(x[6], false) + "}";
+ + istr(x[4]) + istr(x[5]) + istr(x[6], false) + QLatin1Char('}');
msg += "\nThe calculated result was : {";
msg += istr(chk_visual) + istr(chk_logical) + istr(chk_sizes) + istr(chk_hidden_size)
+ istr(chk_lookup_visual) + istr(chk_lookup_logical) + istr(header_lenght, false) + "};";
@@ -2570,7 +2570,7 @@ void tst_QHeaderView::additionalInit()
for (int i = 0; i < model->rowCount(); ++i) {
model->setData(model->index(i, 0), QVariant(i));
s.setNum(i);
- s += ".";
+ s += QLatin1Char('.');
s += 'a' + (i % 25);
model->setData(model->index(i, 1), QVariant(s));
}
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index fc671fdc9f..f066f526eb 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -2083,7 +2083,7 @@ void tst_QListView::taskQTBUG_12308_wrongFlowLayout()
QListWidgetItem *item = new QListWidgetItem();
item->setText(QString("Item %L1").arg(i));
lw.addItem(item);
- if (!item->text().contains(QString::fromLatin1("1")))
+ if (!item->text().contains(QLatin1Char('1')))
item->setHidden(true);
}
lw.show();
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 6d5f5a1c60..7c808b9655 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -4286,7 +4286,7 @@ void tst_QTreeView::testInitialFocus()
{
QTreeWidget treeWidget;
treeWidget.setColumnCount(5);
- new QTreeWidgetItem(&treeWidget, QStringList(QString("1;2;3;4;5").split(";")));
+ new QTreeWidgetItem(&treeWidget, QStringList(QString("1;2;3;4;5").split(QLatin1Char(';'))));
treeWidget.setTreePosition(2);
treeWidget.header()->hideSection(0); // make sure we skip hidden section(s)
treeWidget.header()->swapSections(1, 2); // make sure that we look for first visual index (and not first logical)
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index 117c53a2bb..afc61025ba 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -2007,7 +2007,7 @@ void tst_QTreeWidget::columnCount()
void tst_QTreeWidget::setHeaderLabels()
{
- QStringList list = QString("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z").split(",");
+ QStringList list = QString("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z").split(QLatin1Char(','));
testWidget->setHeaderLabels(list);
QCOMPARE(testWidget->header()->count(), list.count());
}
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 9f5b9b71f4..8f8b4313e2 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -502,7 +502,7 @@ static QString cstrings2QString( char **args )
while ( args[i] ) {
string += args[i];
if ( args[i+1] )
- string += " ";
+ string += QLatin1Char(' ');
++i;
}
return string;
@@ -1060,16 +1060,16 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
#ifdef Q_OS_UNIX
QByteArray validPath = QDir("/tmp").canonicalPath().toLatin1();
QByteArray nonExistentPath = "/nonexistent";
- QByteArray pluginPath = validPath + ":" + nonExistentPath;
+ QByteArray pluginPath = validPath + ':' + nonExistentPath;
#elif defined(Q_OS_WIN)
# ifdef Q_OS_WINCE
QByteArray validPath = "/Temp";
QByteArray nonExistentPath = "/nonexistent";
- QByteArray pluginPath = validPath + ";" + nonExistentPath;
+ QByteArray pluginPath = validPath + ';' + nonExistentPath;
# else
QByteArray validPath = "C:\\windows";
QByteArray nonExistentPath = "Z:\\nonexistent";
- QByteArray pluginPath = validPath + ";" + nonExistentPath;
+ QByteArray pluginPath = validPath + ';' + nonExistentPath;
# endif
#endif
diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
index 4d15ac9a93..5413b274d4 100644
--- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
+++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
@@ -195,7 +195,7 @@ void tst_QLayout::smartMaxSize()
int width = sz.width();
int expectedWidth = expectedWidths[expectedIndex];
if (width != expectedWidth) {
- qDebug() << "error at index" << expectedIndex << ":" << sizePolicy.horizontalPolicy() << align << minSize << sizeHint << maxSize << width;
+ qDebug() << "error at index" << expectedIndex << ':' << sizePolicy.horizontalPolicy() << align << minSize << sizeHint << maxSize << width;
++regressionCount;
}
++expectedIndex;
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index e8ac9aa5d2..e8369ef9bd 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -61,7 +61,7 @@ public:
protected:
QStringList splitPath(const QString &path) const {
- return csv ? path.split(",") : QCompleter::splitPath(path);
+ return csv ? path.split(QLatin1Char(',')) : QCompleter::splitPath(path);
}
private: