diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-11-12 10:13:42 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-11-21 14:26:00 +0000 |
commit | f5a650735ea6658a53b3783cc52fe3dcdef40698 (patch) | |
tree | 430e879181c9625cadd48a0a15f17c4b822e43a8 /src/widgets/kernel/qlayout.cpp | |
parent | 1005b7a0dec049f200baa8c14066bd3bb1512d2f (diff) |
QtWidgets: use new qUtf16Printable() instead of qPrintable()
This is more efficient and works even with non-US-ASCII
QStrings.
Change-Id: I4ca19de60347ded03022ef8540a6708c563bc9d7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/kernel/qlayout.cpp')
-rw-r--r-- | src/widgets/kernel/qlayout.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index e74f17b6f7..b6d87dc17e 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -130,10 +130,10 @@ QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w) lay->addItem(this); } else if (w) { if (w->layout()) { - qWarning("QLayout: Attempting to add QLayout \"%s\" to %s \"%s\", which" + qWarning("QLayout: Attempting to add QLayout \"%ls\" to %s \"%ls\", which" " already has a layout", - qPrintable(QObject::objectName()), w->metaObject()->className(), - w->objectName().toLocal8Bit().data()); + qUtf16Printable(QObject::objectName()), w->metaObject()->className(), + qUtf16Printable(w->objectName())); setParent(0); } else { d->topLevel = true; @@ -777,8 +777,8 @@ QLayout::~QLayout() void QLayout::addChildLayout(QLayout *l) { if (l->parent()) { - qWarning("QLayout::addChildLayout: layout \"%s\" already has a parent", - l->objectName().toLocal8Bit().data()); + qWarning("QLayout::addChildLayout: layout \"%ls\" already has a parent", + qUtf16Printable(l->objectName())); return; } l->setParent(this); @@ -827,8 +827,8 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw) QWidget *pw = w->parentWidget(); #ifdef QT_DEBUG if (pw && pw != mw && layoutDebug()) { - qWarning("QLayout::addChildLayout: widget %s \"%s\" in wrong parent; moved to correct parent", - w->metaObject()->className(), w->objectName().toLocal8Bit().data()); + qWarning("QLayout::addChildLayout: widget %s \"%ls\" in wrong parent; moved to correct parent", + w->metaObject()->className(), qUtf16Printable(w->objectName())); } #endif bool needShow = mwVisible && !(w->isHidden() && w->testAttribute(Qt::WA_WState_ExplicitShowHide)); @@ -850,14 +850,14 @@ bool QLayoutPrivate::checkWidget(QWidget *widget) const { Q_Q(const QLayout); if (!widget) { - qWarning("QLayout: Cannot add a null widget to %s/%s", q->metaObject()->className(), - qPrintable(q->objectName())); + qWarning("QLayout: Cannot add a null widget to %s/%ls", q->metaObject()->className(), + qUtf16Printable(q->objectName())); return false; } if (widget == q->parentWidget()) { - qWarning("QLayout: Cannot add parent widget %s/%s to its child layout %s/%s", - widget->metaObject()->className(), qPrintable(widget->objectName()), - q->metaObject()->className(), qPrintable(q->objectName())); + qWarning("QLayout: Cannot add parent widget %s/%ls to its child layout %s/%ls", + widget->metaObject()->className(), qUtf16Printable(widget->objectName()), + q->metaObject()->className(), qUtf16Printable(q->objectName())); return false; } return true; @@ -871,13 +871,13 @@ bool QLayoutPrivate::checkLayout(QLayout *otherLayout) const { Q_Q(const QLayout); if (!otherLayout) { - qWarning("QLayout: Cannot add a null layout to %s/%s", q->metaObject()->className(), - qPrintable(q->objectName())); + qWarning("QLayout: Cannot add a null layout to %s/%ls", + q->metaObject()->className(), qUtf16Printable(q->objectName())); return false; } if (otherLayout == q) { - qWarning("QLayout: Cannot add layout %s/%s to itself", q->metaObject()->className(), - qPrintable(q->objectName())); + qWarning("QLayout: Cannot add layout %s/%ls to itself", + q->metaObject()->className(), qUtf16Printable(q->objectName())); return false; } return true; @@ -903,16 +903,16 @@ void QLayout::addChildWidget(QWidget *w) if (l && removeWidgetRecursively(l, w)) { #ifdef QT_DEBUG if (layoutDebug()) - qWarning("QLayout::addChildWidget: %s \"%s\" is already in a layout; moved to new layout", - w->metaObject()->className(), w->objectName().toLocal8Bit().data()); + qWarning("QLayout::addChildWidget: %s \"%ls\" is already in a layout; moved to new layout", + w->metaObject()->className(), qUtf16Printable(w->objectName())); #endif } } if (pw && mw && pw != mw) { #ifdef QT_DEBUG if (layoutDebug()) - qWarning("QLayout::addChildWidget: %s \"%s\" in wrong parent; moved to correct parent", - w->metaObject()->className(), w->objectName().toLocal8Bit().data()); + qWarning("QLayout::addChildWidget: %s \"%ls\" in wrong parent; moved to correct parent", + w->metaObject()->className(), qUtf16Printable(w->objectName())); #endif pw = 0; } @@ -1065,8 +1065,8 @@ bool QLayout::activate() return false; QWidget *mw = static_cast<QWidget*>(parent()); if (mw == 0) { - qWarning("QLayout::activate: %s \"%s\" does not have a main widget", - QObject::metaObject()->className(), QObject::objectName().toLocal8Bit().data()); + qWarning("QLayout::activate: %s \"%ls\" does not have a main widget", + metaObject()->className(), qUtf16Printable(objectName())); return false; } activateRecursiveHelper(this); |