*/
void QAccessibleWidget::addControllingSignal(const QString &signal)
{
- QByteArray s = QMetaObject::normalizedSignature(signal.toAscii());
+ QByteArray s = QMetaObject::normalizedSignature(signal.toLatin1());
if (object()->metaObject()->indexOfSignal(s) < 0)
qWarning("Signal %s unknown in %s", s.constData(), object()->metaObject()->className());
d->primarySignals << QLatin1String(s);
QACConnectionObject *connectionSender = (QACConnectionObject*)sender;
QStringList senderPrimarySignals = static_cast<QAccessibleWidget*>(iface)->d->primarySignals;
for (int sig = 0; sig < senderPrimarySignals.count(); ++sig) {
- const QByteArray strSignal = senderPrimarySignals.at(sig).toAscii();
+ const QByteArray strSignal = senderPrimarySignals.at(sig).toLatin1();
if (connectionSender->isSender(object(), strSignal.constData()))
rels.append(qMakePair(iface, rel));
}
QObjectList allReceivers;
QACConnectionObject *connectionObject = (QACConnectionObject*)object();
for (int sig = 0; sig < d->primarySignals.count(); ++sig) {
- const QObjectList receivers = connectionObject->receiverList(d->primarySignals.at(sig).toAscii());
+ const QObjectList receivers = connectionObject->receiverList(d->primarySignals.at(sig).toLatin1());
allReceivers += receivers;
}
// Creates a bidirectional edge
#if defined(QT_DEBUG) && 0
qDebug("Graph::createEdge(): %s",
- qPrintable(QString::fromAscii("%1-%2")
+ qPrintable(QString::fromLatin1("%1-%2")
.arg(first->toString()).arg(second->toString())));
#endif
if (edgeData(first, second)) {
// Removes a bidirectional edge
#if defined(QT_DEBUG) && 0
qDebug("Graph::removeEdge(): %s",
- qPrintable(QString::fromAscii("%1-%2")
+ qPrintable(QString::fromLatin1("%1-%2")
.arg(first->toString()).arg(second->toString())));
#endif
EdgeData *data = edgeData(first, second);
{
#if defined(QT_DEBUG) && 0
qDebug("Graph::takeEdge(): %s",
- qPrintable(QString::fromAscii("%1-%2")
+ qPrintable(QString::fromLatin1("%1-%2")
.arg(first->toString()).arg(second->toString())));
#endif
// Removes a bidirectional edge
EdgeData *data = edgeData(v, v1);
bool forward = data->from == v;
if (forward) {
- edges += QString::fromAscii("\"%1\"->\"%2\" [label=\"[%3,%4,%5,%6,%7]\" color=\"#000000\"] \n")
+ edges += QString::fromLatin1("\"%1\"->\"%2\" [label=\"[%3,%4,%5,%6,%7]\" color=\"#000000\"] \n")
.arg(v->toString())
.arg(v1->toString())
.arg(data->minSize)
;
}
}
- strVertices += QString::fromAscii("\"%1\" [label=\"%2\"]\n").arg(v->toString()).arg(v->toString());
+ strVertices += QString::fromLatin1("\"%1\" [label=\"%2\"]\n").arg(v->toString()).arg(v->toString());
}
- return QString::fromAscii("%1\n%2\n").arg(strVertices).arg(edges);
+ return QString::fromLatin1("%1\n%2\n").arg(strVertices).arg(edges);
}
#endif
{
QString string(QLatin1String("Path: "));
foreach(AnchorData *edge, positives)
- string += QString::fromAscii(" (+++) %1").arg(edge->toString());
+ string += QString::fromLatin1(" (+++) %1").arg(edge->toString());
foreach(AnchorData *edge, negatives)
- string += QString::fromAscii(" (---) %1").arg(edge->toString());
+ string += QString::fromLatin1(" (---) %1").arg(edge->toString());
return string;
}
#if defined(QT_DEBUG) && 0
QString strVertices;
for (int i = 0; i < vertices.count(); ++i) {
- strVertices += QString::fromAscii("%1 - ").arg(vertices.at(i)->toString());
+ strVertices += QString::fromLatin1("%1 - ").arg(vertices.at(i)->toString());
}
- QString strPath = QString::fromAscii("%1 - %2%3").arg(before->toString(), strVertices, after->toString());
+ QString strPath = QString::fromLatin1("%1 - %2%3").arg(before->toString(), strVertices, after->toString());
qDebug("simplifying [%s] to [%s - %s]", qPrintable(strPath), qPrintable(before->toString()), qPrintable(after->toString()));
#endif
static int count = 0;
if (orientation == Horizontal) {
count++;
- dumpGraph(QString::fromAscii("%1-full").arg(count));
+ dumpGraph(QString::fromLatin1("%1-full").arg(count));
}
#endif
}
#if defined(QT_DEBUG) && 0
- dumpGraph(QString::fromAscii("%1-simplified-%2").arg(count).arg(
- QString::fromAscii(orientation == Horizontal ? "Horizontal" : "Vertical")));
+ dumpGraph(QString::fromLatin1("%1-simplified-%2").arg(count).arg(
+ QString::fromLatin1(orientation == Horizontal ? "Horizontal" : "Vertical")));
#endif
return true;
AnchorVertex *otherV = replaceVertex_helper(ad, oldV, newV);
#if defined(QT_DEBUG)
- ad->name = QString::fromAscii("%1 --to--> %2").arg(ad->from->toString()).arg(ad->to->toString());
+ ad->name = QString::fromLatin1("%1 --to--> %2").arg(ad->from->toString()).arg(ad->to->toString());
#endif
bool newFeasible;
data->from = v1;
data->to = v2;
#ifdef QT_DEBUG
- data->name = QString::fromAscii("%1 --to--> %2").arg(v1->toString()).arg(v2->toString());
+ data->name = QString::fromLatin1("%1 --to--> %2").arg(v1->toString()).arg(v2->toString());
#endif
// ### bit to track internal anchors, since inside AnchorData methods
// we don't have access to the 'q' pointer.
#ifdef QT_DEBUG
void QGraphicsAnchorLayoutPrivate::dumpGraph(const QString &name)
{
- QFile file(QString::fromAscii("anchorlayout.%1.dot").arg(name));
+ QFile file(QString::fromLatin1("anchorlayout.%1.dot").arg(name));
if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
qWarning("Could not write to %s", file.fileName().toLocal8Bit().constData());
- QString str = QString::fromAscii("digraph anchorlayout {\nnode [shape=\"rect\"]\n%1}");
+ QString str = QString::fromLatin1("digraph anchorlayout {\nnode [shape=\"rect\"]\n%1}");
QString dotContents = graph[0].serializeToDot();
dotContents += graph[1].serializeToDot();
file.write(str.arg(dotContents).toLocal8Bit());
#ifdef QT_DEBUG
inline QString AnchorData::toString() const
{
- return QString::fromAscii("Anchor(%1)").arg(name);
+ return QString::fromLatin1("Anchor(%1)").arg(name);
}
#endif
type = AnchorData::Sequential;
orientation = m_edges.at(0)->orientation;
#ifdef QT_DEBUG
- name = QString::fromAscii("%1 -- %2").arg(vertices.first()->toString(), vertices.last()->toString());
+ name = QString::fromLatin1("%1 -- %2").arg(vertices.first()->toString(), vertices.last()->toString());
#endif
}
from = first->from;
to = first->to;
#ifdef QT_DEBUG
- name = QString::fromAscii("%1 | %2").arg(first->toString(), second->toString());
+ name = QString::fromLatin1("%1 | %2").arg(first->toString(), second->toString());
#endif
}
return QLatin1String("NULL");
} else if (m_type == Pair) {
const AnchorVertexPair *vp = static_cast<const AnchorVertexPair *>(this);
- return QString::fromAscii("(%1, %2)").arg(vp->m_first->toString()).arg(vp->m_second->toString());
+ return QString::fromLatin1("(%1, %2)").arg(vp->m_first->toString()).arg(vp->m_second->toString());
} else if (!m_item) {
- return QString::fromAscii("NULL_%1").arg(quintptr(this));
+ return QString::fromLatin1("NULL_%1").arg(quintptr(this));
}
QString edge;
switch (m_edge) {
qWarning("Found a focus chain that is not circular, (next == 0)");
break;
}
- qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromAscii("focusItem:%1").arg(next->hasFocus() ? '1' : '0') << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0);
+ qDebug() << i++ << QString::number(uint(next), 16) << next->className() << next->data(0) << QString::fromLatin1("focusItem:%1").arg(next->hasFocus() ? '1' : '0') << QLatin1String("next:") << next->d_func()->focusNext->data(0) << QLatin1String("prev:") << next->d_func()->focusPrev->data(0);
if (visited.contains(next)) {
qWarning("Already visited this node. However, I expected to dump until I found myself.");
break;
QString message;
if (stretches.value(i).value() >= 0)
- message += QString::fromAscii(" stretch %1").arg(stretches.value(i).value());
+ message += QString::fromLatin1(" stretch %1").arg(stretches.value(i).value());
if (spacings.value(i).value() >= 0.0)
- message += QString::fromAscii(" spacing %1").arg(spacings.value(i).value());
+ message += QString::fromLatin1(" spacing %1").arg(spacings.value(i).value());
if (alignments.value(i) != 0)
- message += QString::fromAscii(" alignment %1").arg(int(alignments.value(i)), 16);
+ message += QString::fromLatin1(" alignment %1").arg(int(alignments.value(i)), 16);
if (!message.isEmpty() || boxes.value(i) != QGridLayoutBox()) {
qDebug("%*s Row %d:%s", indent, "", i, qPrintable(message));
QString str(QLatin1String(" "));
for (int j = 0; j < columns; ++j)
- str += QString::fromAscii(" <%1 >").arg(j, 2);
+ str += QString::fromLatin1(" <%1 >").arg(j, 2);
qDebug("%s", qPrintable(str));
for (int i = 0; i < rows; ++i) {
- str = QString::fromAscii("Row %1:").arg(i, 2);
+ str = QString::fromLatin1("Row %1:").arg(i, 2);
qreal *row = matrix + i * columns;
for (int j = 0; j < columns; ++j)
- str += QString::fromAscii("%1").arg(row[j], 7, 'f', 2);
+ str += QString::fromLatin1("%1").arg(row[j], 7, 'f', 2);
qDebug("%s", qPrintable(str));
}
qDebug("------------------------\n");
#ifdef QT_DEBUG
QString toString() {
QString result;
- result += QString::fromAscii("-- QSimplexConstraint %1 --").arg(quintptr(this), 0, 16);
+ result += QString::fromLatin1("-- QSimplexConstraint %1 --").arg(quintptr(this), 0, 16);
QHash<QSimplexVariable *, qreal>::const_iterator iter;
for (iter = variables.constBegin(); iter != variables.constEnd(); ++iter) {
- result += QString::fromAscii(" %1 x %2").arg(iter.value()).arg(quintptr(iter.key()), 0, 16);
+ result += QString::fromLatin1(" %1 x %2").arg(iter.value()).arg(quintptr(iter.key()), 0, 16);
}
switch (ratio) {
case LessOrEqual:
- result += QString::fromAscii(" (less) <= %1").arg(constant);
+ result += QString::fromLatin1(" (less) <= %1").arg(constant);
break;
case MoreOrEqual:
- result += QString::fromAscii(" (more) >= %1").arg(constant);
+ result += QString::fromLatin1(" (more) >= %1").arg(constant);
break;
default:
- result += QString::fromAscii(" (eqal) == %1").arg(constant);
+ result += QString::fromLatin1(" (eqal) == %1").arg(constant);
}
return result;
{
QList<QVariant> buttons;
for (int i = 0; i < layout.count(); i++) {
- int button = layout[i].toAscii();
+ int button = layout[i].toLatin1();
switch (button) {
case 'm':
buttons.append(PseudoElement_MdiMinButton);
switch (arg2.type()) {
case QVariant::Date:
Q_ASSERT_X(arg1.type() == QVariant::Date, "QAbstractSpinBoxPrivate::variantCompare",
- qPrintable(QString::fromAscii("Internal error 1 (%1)").
- arg(QString::fromAscii(arg1.typeName()))));
+ qPrintable(QString::fromLatin1("Internal error 1 (%1)").
+ arg(QString::fromLatin1(arg1.typeName()))));
if (arg1.toDate() == arg2.toDate()) {
return 0;
} else if (arg1.toDate() < arg2.toDate()) {
}
case QVariant::Time:
Q_ASSERT_X(arg1.type() == QVariant::Time, "QAbstractSpinBoxPrivate::variantCompare",
- qPrintable(QString::fromAscii("Internal error 2 (%1)").
- arg(QString::fromAscii(arg1.typeName()))));
+ qPrintable(QString::fromLatin1("Internal error 2 (%1)").
+ arg(QString::fromLatin1(arg1.typeName()))));
if (arg1.toTime() == arg2.toTime()) {
return 0;
} else if (arg1.toTime() < arg2.toTime()) {
return 0;
default:
Q_ASSERT_X(0, "QAbstractSpinBoxPrivate::variantCompare",
- qPrintable(QString::fromAscii("Internal error 3 (%1 %2)").
- arg(QString::fromAscii(arg1.typeName())).
- arg(QString::fromAscii(arg2.typeName()))));
+ qPrintable(QString::fromLatin1("Internal error 3 (%1 %2)").
+ arg(QString::fromLatin1(arg1.typeName())).
+ arg(QString::fromLatin1(arg2.typeName()))));
}
return -2;
}
currentSectionIndex = s;
Q_ASSERT_X(currentSectionIndex < sectionNodes.size(),
"QDateTimeEditPrivate::_q_editorCursorPositionChanged()",
- qPrintable(QString::fromAscii("Internal error (%1 %2)").
+ qPrintable(QString::fromLatin1("Internal error (%1 %2)").
arg(currentSectionIndex).
arg(sectionNodes.size())));
line.replace(QLatin1Char(' '), QString());
line = line.toUpper();
- splitter.restoreState(line.toAscii());
+ splitter.restoreState(line.toLatin1());
return ts;
}
// press 'keys' for the input
for (int i = 0; i < input.count(); ++i)
- QTest::keyPress(lineEdit, input[i].toAscii());
+ QTest::keyPress(lineEdit, input[i].toLatin1());
QStringList expectedFiles;
if (expected == -1) {
// - No another dir with same start
QString testDir;
foreach (const QString &entry, entryList) {
- if (entry.size() > 5 && QString(entry.toAscii()).compare(entry) == 0) {
+ if (entry.size() > 5 && QString(entry.toLatin1()).compare(entry) == 0) {
bool invalid = false;
for (int i = 0; i < 5; i++) {
if (!entry.at(i).isLetter()) {
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
//I love testlib :D
for (int i = 0; i < 5; i++)
- QTest::keyClick(edit, testDir.at(i).toLower().toAscii() - 'a' + Qt::Key_A);
+ QTest::keyClick(edit, testDir.at(i).toLower().toLatin1() - 'a' + Qt::Key_A);
#else
QTest::keyClick(edit, Qt::Key_E);
QTest::keyClick(edit, Qt::Key_T);
sbox->selectAll();
for (int i = 0; i < value.size(); ++i) {
const QChar valChar = value[i];
- _keyClick(static_cast<QWidget *>(sbox), valChar.toAscii()); // ### always guaranteed to work?
+ _keyClick(static_cast<QWidget *>(sbox), valChar.toLatin1()); // ### always guaranteed to work?
if (sbox->hasAcceptableInput())
QVERIFY(okButton->isEnabled());
else
ledit->selectAll();
for (int i = 0; i < value.size(); ++i) {
const QChar valChar = value[i];
- _keyClick(ledit, valChar.toAscii()); // ### always guaranteed to work?
+ _keyClick(ledit, valChar.toLatin1()); // ### always guaranteed to work?
QVERIFY(ledit->hasAcceptableInput());
QVERIFY(okButton->isEnabled());
}
{
setContentsMargins( 0,0,0,0 );
if (name.isEmpty())
- setData(0, QString::fromAscii("w%1").arg(quintptr(this)));
+ setData(0, QString::fromLatin1("w%1").arg(quintptr(this)));
else
setData(0, name);
}
// Create dummy widgets
QList<QGraphicsWidget *> widgets;
for (int i = 0; i < widgetCount; ++i) {
- TestWidget *w = new TestWidget(0, QString::fromAscii("W%1").arg(i));
+ TestWidget *w = new TestWidget(0, QString::fromLatin1("W%1").arg(i));
widgets << w;
}
int column = b;
int rowSpan = c;
int columnSpan = d;
- QString name = QString::fromAscii("(%1,%2,%3,%4").arg(a).arg(b).arg(c).arg(d);
+ QString name = QString::fromLatin1("(%1,%2,%3,%4").arg(a).arg(b).arg(c).arg(d);
Qt::Alignment alignment = Qt::AlignLeft;
QTest::newRow(name.toLatin1()) << row << column << rowSpan << columnSpan << alignment;
}}}}
if (i >= 0 && i < layout->count()) {
QVERIFY(layout->itemAt(i));
} else {
- QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::itemAt: invalid index %1").arg(i).toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, QString::fromLatin1("QGraphicsGridLayout::itemAt: invalid index %1").arg(i).toLatin1().constData());
QCOMPARE(layout->itemAt(i), static_cast<QGraphicsLayoutItem*>(0));
}
}
layout->removeAt(0);
QCOMPARE(item0->parentLayoutItem(), static_cast<QGraphicsLayoutItem *>(0));
QCOMPARE(layout->count(), 0);
- QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::removeAt: invalid index 0").toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, QString::fromLatin1("QGraphicsGridLayout::removeAt: invalid index 0").toLatin1().constData());
layout->removeAt(0);
QCOMPARE(layout->count(), 0);
delete widget;
QCOMPARE(l->count(), 4);
// Avoid crashing. Note that the warning message might change in the future.
- QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, QString::fromLatin1("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData());
l->removeItem(0);
QCOMPARE(l->count(), 4);
- QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData());
+ QTest::ignoreMessage(QtWarningMsg, QString::fromLatin1("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData());
l->removeItem(new QGraphicsWidget);
QCOMPARE(l->count(), 4);
}
for (i = 1; i < 4; ++i) {
QGraphicsWidget *wid = new QGraphicsWidget;
wid->setFocusPolicy(Qt::StrongFocus);
- wid->setData(0, QString::fromAscii("w%1").arg(i));
+ wid->setData(0, QString::fromLatin1("w%1").arg(i));
scene.addItem(wid);
if (i == 1)
w1 = wid;
for (i = 1; i < 5; ++i) {
QGraphicsWidget *wid = new QGraphicsWidget;
wid->setFocusPolicy(Qt::StrongFocus);
- wid->setData(0, QString::fromAscii("w%1").arg(i));
+ wid->setData(0, QString::fromLatin1("w%1").arg(i));
scene.addItem(wid);
if (i == 1)
w1 = wid;
return QVariant();
}
if (role == Qt::DisplayRole) {
- return QString::fromAscii("%1,%2").arg(index.row()).arg(index.column());
+ return QString::fromLatin1("%1,%2").arg(index.row()).arg(index.column());
}
return QVariant();
}
QStringListModel model(&lv);
QStringList list;
for (int i = 0; i < rowCount; ++i)
- list << QString::fromAscii("Item %1").arg(i);
+ list << QString::fromLatin1("Item %1").arg(i);
model.setStringList(list);
lv.setModel(&model);
QStringList list;
int i;
for (i = 0; i < rowCounts[r]; ++i)
- list << QString::fromAscii("Item %1").arg(i);
+ list << QString::fromLatin1("Item %1").arg(i);
model.setStringList(list);
QApplication::processEvents();
QStringList replacement;
for (i = 0; i < itemCount; ++i) {
- replacement << QString::fromAscii("Item %1").arg(i);
+ replacement << QString::fromLatin1("Item %1").arg(i);
}
model.setStringList(replacement);
QListWidgetItem *item = new QListWidgetItem();
item->setText(QString("Item %L1").arg(i));
lw.addItem(item);
- if (!item->text().contains(QString::fromAscii("1")))
+ if (!item->text().contains(QString::fromLatin1("1")))
item->setHidden(true);
}
lw.show();
for (int r = 0; r < model.rowCount(); ++r) {
for (int c = 0; c < model.columnCount(); ++c) {
QModelIndex idx = model.index(r, c);
- model.setData(idx, QString::fromAscii("%1,%2").arg(r).arg(c) );
+ model.setData(idx, QString::fromLatin1("%1,%2").arg(r).arg(c) );
model.insertColumns(0, 2, idx);
model.insertRows(0, 6, idx);
for (int i = 0; i < 6; ++i) {
for (int j = 0; j < 2 ; ++j) {
- model.setData(model.index(i, j, idx), QString::fromAscii("child%1%2").arg(i).arg(j));
+ model.setData(model.index(i, j, idx), QString::fromLatin1("child%1%2").arg(i).arg(j));
}
}
}
}
private:
void init(int numPixels = -1){
- setText(QString::fromAscii("(%1,%2)").arg(sh.width()).arg(sh.height()));
+ setText(QString::fromLatin1("(%1,%2)").arg(sh.width()).arg(sh.height()));
setFrameStyle(QFrame::Box | QFrame::Plain);
setNumberOfPixels(numPixels);
}
<< SizeInfo(QPoint(10, 10), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(10 + 100 + 1, 10), QSize( 90, 90))
);
- QTest::newRow("2x1 grid, extend to minimumSize, motif") << QString::fromAscii("motif") << 2 << 1
+ QTest::newRow("2x1 grid, extend to minimumSize, motif") << QString::fromLatin1("motif") << 2 << 1
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90))
);
- QTest::newRow("2x1 grid, extend to minimumSize, windows") << QString::fromAscii("windows") << 2 << 1
+ QTest::newRow("2x1 grid, extend to minimumSize, windows") << QString::fromLatin1("windows") << 2 << 1
<< int(QSizePolicy::Preferred) << QSize() << (SizeInfoList()
<< SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100))
<< SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90))
w->setLayout(layout);
int pw = up->sizeHint().width();
int ph = up->sizeHint().height();
- QByteArray testName = QString::fromAscii("arrowpad with %1 empty rows, %2 empty columns").arg(yoff).arg(xoff).toLatin1();
+ QByteArray testName = QString::fromLatin1("arrowpad with %1 empty rows, %2 empty columns").arg(yoff).arg(xoff).toLatin1();
QTest::newRow(testName.data())
<< w << (PointList()
<< QPoint(0 + pw + 5, 3)
k4 &= ~Qt::MODIFIER_MASK;
- if (k1 || c1.toAscii()) {
+ if (k1 || c1.toLatin1()) {
QString c(c1.unicode() == QChar::Null ? QString() : QString(c1));
QTest::sendKeyEvent(QTest::Press, w, static_cast<Qt::Key>(k1), c, b1);
QTest::sendKeyEvent(QTest::Release, w, static_cast<Qt::Key>(k1), c, b1);
}
- if (k2 || c2.toAscii()) {
+ if (k2 || c2.toLatin1()) {
QString c(c2.unicode() == QChar::Null ? QString() : QString(c2));
QTest::sendKeyEvent(QTest::Press, w, static_cast<Qt::Key>(k2), c, b2);
QTest::sendKeyEvent(QTest::Release, w, static_cast<Qt::Key>(k2), c, b2);
}
- if (k3 || c3.toAscii()) {
+ if (k3 || c3.toLatin1()) {
QString c(c3.unicode() == QChar::Null ? QString() : QString(c3));
QTest::sendKeyEvent(QTest::Press, w, static_cast<Qt::Key>(k3), c, b3);
QTest::sendKeyEvent(QTest::Release, w, static_cast<Qt::Key>(k3), c, b3);
}
- if (k4 || c4.toAscii()) {
+ if (k4 || c4.toLatin1()) {
QString c(c4.unicode() == QChar::Null ? QString() : QString(c4));
QTest::sendKeyEvent(QTest::Press, w, static_cast<Qt::Key>(k4), c, b4);
QTest::sendKeyEvent(QTest::Release, w, static_cast<Qt::Key>(k4), c, b4);
.arg(rect.y())
.arg(rect.width())
.arg(rect.height())
- .arg(windowFlag, 0, 16).toAscii())
+ .arg(windowFlag, 0, 16).toLatin1())
<< l
<< windowFlag;
}
for (int i = 0; i < step.length(); i++) {
int row = completer->currentRow();
- switch (step[i].toUpper().toAscii()) {
+ switch (step[i].toUpper().toLatin1()) {
case 'P': --row; break;
case 'N': ++row; break;
case 'L': row = completer->completionCount() - 1; break;
testWidget->addItem("first item");
testWidget->setCurrentIndex(0);
testWidget->insertItem(0, "second item");
- QCOMPARE(testWidget->lineEdit()->text(), QString::fromAscii("first item"));
+ QCOMPARE(testWidget->lineEdit()->text(), QString::fromLatin1("first item"));
}
void tst_QComboBox::textpixmapdata_data()
KeyList keyMovementList;
keyMovementList << Qt::Key_Down << Qt::Key_Down << Qt::Key_Down << Qt::Key_Down;
- QTest::newRow(testCase.toAscii() + "normal") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
+ QTest::newRow(testCase.toLatin1() + "normal") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
deselectFlagList.clear();
disableFlagList.clear();
deselectFlagList << 1 << 3;
- QTest::newRow(testCase.toAscii() + "non-selectable") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
+ QTest::newRow(testCase.toLatin1() + "non-selectable") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
deselectFlagList.clear();
disableFlagList.clear();
disableFlagList << 2;
- QTest::newRow(testCase.toAscii() + "disabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 5;
+ QTest::newRow(testCase.toLatin1() + "disabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 5;
deselectFlagList.clear();
disableFlagList.clear();
deselectFlagList << 1 << 3;
disableFlagList << 2 << 3;
- QTest::newRow(testCase.toAscii() + "mixed") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 6;
+ QTest::newRow(testCase.toLatin1() + "mixed") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 6;
deselectFlagList.clear();
disableFlagList.clear();
disableFlagList << 0 << 1 << 2 << 3 << 4 << 5 << 6;
- QTest::newRow(testCase.toAscii() + "nearly-empty") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 7;
+ QTest::newRow(testCase.toLatin1() + "nearly-empty") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 7;
deselectFlagList.clear();
disableFlagList.clear();
disableFlagList << 0 << 1 << 2 << 3 << 5 << 6 << 7;
keyMovementList.clear();
- QTest::newRow(testCase.toAscii() + "only one enabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
+ QTest::newRow(testCase.toLatin1() + "only one enabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
if (!editable) {
deselectFlagList.clear();
keyMovementList.clear();
disableFlagList << 0 << 2 << 3;
keyMovementList << Qt::Key_Down << Qt::Key_Home;
- QTest::newRow(testCase.toAscii() + "home-disabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 1;
+ QTest::newRow(testCase.toLatin1() + "home-disabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 1;
keyMovementList.clear();
keyMovementList << Qt::Key_End;
- QTest::newRow(testCase.toAscii() + "end-key") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 7;
+ QTest::newRow(testCase.toLatin1() + "end-key") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 7;
disableFlagList.clear();
disableFlagList << 1 ;
keyMovementList << Qt::Key_T;
- QTest::newRow(testCase.toAscii() + "keyboard-search") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
+ QTest::newRow(testCase.toLatin1() + "keyboard-search") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
itemList << "nine" << "ten";
keyMovementList << Qt::Key_T;
- QTest::newRow(testCase.toAscii() + "search same start letter") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 9;
+ QTest::newRow(testCase.toLatin1() + "search same start letter") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 9;
keyMovementList.clear();
keyMovementList << Qt::Key_T << Qt::Key_H;
- QTest::newRow(testCase.toAscii() + "keyboard search item") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
+ QTest::newRow(testCase.toLatin1() + "keyboard search item") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
disableFlagList.clear();
disableFlagList << 1 << 3 << 5 << 7 << 9;
keyMovementList.clear();
keyMovementList << Qt::Key_End << Qt::Key_Up << Qt::Key_Up << Qt::Key_PageDown << Qt::Key_PageUp << Qt::Key_PageUp << Qt::Key_Down;
- QTest::newRow(testCase.toAscii() + "all key combinations") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
+ QTest::newRow(testCase.toLatin1() + "all key combinations") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 4;
} else {
deselectFlagList.clear();
disableFlagList.clear();
disableFlagList << 1;
keyMovementList.clear();
keyMovementList << Qt::Key_T << Qt::Key_Enter;
- QTest::newRow(testCase.toAscii() + "disabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
- QTest::newRow(testCase.toAscii() + "broken autocompletion") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
+ QTest::newRow(testCase.toLatin1() + "disabled") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
+ QTest::newRow(testCase.toLatin1() + "broken autocompletion") << itemList << deselectFlagList << disableFlagList << keyMovementList << bool(editable) << 2;
}
}
}
{
if ( !qApp->style()->styleHint(QStyle::SH_MenuBar_AltKeyNavigation) ) {
QSKIP( QString( "this is not supposed to work in the %1 style. Skipping." ).
- arg( qApp->style()->objectName() ).toAscii());
+ arg( qApp->style()->objectName() ).toLatin1());
}
initSimpleMenubar();
ed->insertPlainText("Hello World");
ed->selectAll();
- QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString::fromAscii("foobar"));
+ QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString::fromLatin1("foobar"));
}
#endif
{
QTest::addColumn<QString>("stylename");
#if !defined(QT_NO_STYLE_MOTIF)
- QTest::newRow("motif") << QString::fromAscii("motif");
+ QTest::newRow("motif") << QString::fromLatin1("motif");
#endif
#if !defined(QT_NO_STYLE_CDE)
- QTest::newRow("cde") << QString::fromAscii("cde");
+ QTest::newRow("cde") << QString::fromLatin1("cde");
#endif
#if !defined(QT_NO_STYLE_WINDOWS)
- QTest::newRow("windows") << QString::fromAscii("windows");
+ QTest::newRow("windows") << QString::fromLatin1("windows");
#endif
#if !defined(QT_NO_STYLE_CLEANLOOKS)
- QTest::newRow("cleanlooks") << QString::fromAscii("cleanlooks");
+ QTest::newRow("cleanlooks") << QString::fromLatin1("cleanlooks");
#endif
#if !defined(QT_NO_STYLE_GTK)
- QTest::newRow("gtk") << QString::fromAscii("gtk");
+ QTest::newRow("gtk") << QString::fromLatin1("gtk");
#endif
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
- QTest::newRow("mac") << QString::fromAscii("mac");
+ QTest::newRow("mac") << QString::fromLatin1("mac");
#endif
#if !defined(QT_NO_STYLE_PLASTIQUE)
- QTest::newRow("plastique") << QString::fromAscii("plastique");
+ QTest::newRow("plastique") << QString::fromLatin1("plastique");
#endif
#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSXP)
- QTest::newRow("windowsxp") << QString::fromAscii("windowsxp");
+ QTest::newRow("windowsxp") << QString::fromLatin1("windowsxp");
#endif
#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA)
- QTest::newRow("windowsvista") << QString::fromAscii("windowsvista");
+ QTest::newRow("windowsvista") << QString::fromLatin1("windowsvista");
#endif
#if defined(Q_OS_WINCE) && !defined(QT_NO_STYLE_WINDOWSCE)
- QTest::newRow("windowsce") << QString::fromAscii("windowsce");
+ QTest::newRow("windowsce") << QString::fromLatin1("windowsce");
#endif
#if defined(Q_OS_WINCE_WM) && !defined(QT_NO_STYLE_WINDOWSCE)
- QTest::newRow("windowsmobile") << QString::fromAscii("windowsmobile");
+ QTest::newRow("windowsmobile") << QString::fromLatin1("windowsmobile");
#endif
}
ed->insertPlainText("Hello World");
ed->selectAll();
- QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString::fromAscii("foobar"));
+ QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString::fromLatin1("foobar"));
}
#endif
void tst_QTextEdit::asciiTab()