summaryrefslogtreecommitdiffstats
path: root/tools/shared/qtpropertybrowser
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-09-10 18:04:39 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-09-10 18:04:39 (GMT)
commitb3981fd1f7b82742857c613af6dfbe41b5493577 (patch)
tree957b84d8f1792f9e5a43c879274469c4f07168ea /tools/shared/qtpropertybrowser
parente0ef11578048620b3f107b7a357fed3aade0d21e (diff)
parent72cc21e597f2d77ea1be3c1a3f7df36d8909d2fc (diff)
downloadQt-b3981fd1f7b82742857c613af6dfbe41b5493577.zip
Qt-b3981fd1f7b82742857c613af6dfbe41b5493577.tar.gz
Qt-b3981fd1f7b82742857c613af6dfbe41b5493577.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: bin/syncqt demos/declarative/snake/content/snake.js demos/declarative/snake/snake.qml doc/src/development/qmake-manual.qdoc src/corelib/plugin/plugin.pri src/gui/kernel/qapplication_win.cpp src/gui/kernel/qdesktopwidget_win.cpp src/gui/painting/qdrawhelper.cpp tests/auto/qdir/tst_qdir.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf
Diffstat (limited to 'tools/shared/qtpropertybrowser')
-rw-r--r--tools/shared/qtpropertybrowser/qtpropertymanager.cpp44
1 files changed, 26 insertions, 18 deletions
diff --git a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp
index d9ff10a..8c7835c 100644
--- a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp
+++ b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp
@@ -2399,15 +2399,23 @@ QString QtLocalePropertyManager::valueText(const QtProperty *property) const
if (it == d_ptr->m_values.constEnd())
return QString();
- QLocale loc = it.value();
+ const QLocale loc = it.value();
int langIdx = 0;
int countryIdx = 0;
- metaEnumProvider()->localeToIndex(loc.language(), loc.country(), &langIdx, &countryIdx);
- QString str = tr("%1, %2")
- .arg(metaEnumProvider()->languageEnumNames().at(langIdx))
- .arg(metaEnumProvider()->countryEnumNames(loc.language()).at(countryIdx));
- return str;
+ const QtMetaEnumProvider *me = metaEnumProvider();
+ me->localeToIndex(loc.language(), loc.country(), &langIdx, &countryIdx);
+ if (langIdx < 0) {
+ qWarning("QtLocalePropertyManager::valueText: Unknown language %d", loc.language());
+ return tr("<Invalid>");
+ }
+ const QString languageName = me->languageEnumNames().at(langIdx);
+ if (countryIdx < 0) {
+ qWarning("QtLocalePropertyManager::valueText: Unknown country %d for %s", loc.country(), qPrintable(languageName));
+ return languageName;
+ }
+ const QString countryName = me->countryEnumNames(loc.language()).at(countryIdx);
+ return tr("%1, %2").arg(languageName, countryName);
}
/*!
@@ -2635,8 +2643,8 @@ QString QtPointPropertyManager::valueText(const QtProperty *property) const
if (it == d_ptr->m_values.constEnd())
return QString();
const QPoint v = it.value();
- return QString(tr("(%1, %2)").arg(QString::number(v.x()))
- .arg(QString::number(v.y())));
+ return tr("(%1, %2)").arg(QString::number(v.x()))
+ .arg(QString::number(v.y()));
}
/*!
@@ -2876,8 +2884,8 @@ QString QtPointFPropertyManager::valueText(const QtProperty *property) const
return QString();
const QPointF v = it.value().val;
const int dec = it.value().decimals;
- return QString(tr("(%1, %2)").arg(QString::number(v.x(), 'f', dec))
- .arg(QString::number(v.y(), 'f', dec)));
+ return tr("(%1, %2)").arg(QString::number(v.x(), 'f', dec))
+ .arg(QString::number(v.y(), 'f', dec));
}
/*!
@@ -3196,8 +3204,8 @@ QString QtSizePropertyManager::valueText(const QtProperty *property) const
if (it == d_ptr->m_values.constEnd())
return QString();
const QSize v = it.value().val;
- return QString(tr("%1 x %2").arg(QString::number(v.width()))
- .arg(QString::number(v.height())));
+ return tr("%1 x %2").arg(QString::number(v.width()))
+ .arg(QString::number(v.height()));
}
/*!
@@ -3561,8 +3569,8 @@ QString QtSizeFPropertyManager::valueText(const QtProperty *property) const
return QString();
const QSizeF v = it.value().val;
const int dec = it.value().decimals;
- return QString(tr("%1 x %2").arg(QString::number(v.width(), 'f', dec))
- .arg(QString::number(v.height(), 'f', dec)));
+ return tr("%1 x %2").arg(QString::number(v.width(), 'f', dec))
+ .arg(QString::number(v.height(), 'f', dec));
}
/*!
@@ -3954,10 +3962,10 @@ QString QtRectPropertyManager::valueText(const QtProperty *property) const
if (it == d_ptr->m_values.constEnd())
return QString();
const QRect v = it.value().val;
- return QString(tr("[(%1, %2), %3 x %4]").arg(QString::number(v.x()))
- .arg(QString::number(v.y()))
- .arg(QString::number(v.width()))
- .arg(QString::number(v.height())));
+ return tr("[(%1, %2), %3 x %4]").arg(QString::number(v.x()))
+ .arg(QString::number(v.y()))
+ .arg(QString::number(v.width()))
+ .arg(QString::number(v.height()));
}
/*!