diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-03-08 16:32:24 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-03-08 16:32:24 (GMT) |
commit | 09fe2cd62df80373e602d47c570ae317a60a5293 (patch) | |
tree | 494689ed4f7ae7d75d938d851a18f382eb6ef464 /tests/manual | |
parent | dc2280dbcd27d3ff9cbcb230943cc1036e8a2761 (diff) | |
download | Qt-09fe2cd62df80373e602d47c570ae317a60a5293.zip Qt-09fe2cd62df80373e602d47c570ae317a60a5293.tar.gz Qt-09fe2cd62df80373e602d47c570ae317a60a5293.tar.bz2 |
Using list patterns to get a string from list in QLocale.
Reviewed-by: Denis Dzyubenko
Task-number: QTBUG-17097
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/qlocale/miscellaneous.cpp | 11 | ||||
-rw-r--r-- | tests/manual/qlocale/miscellaneous.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/manual/qlocale/miscellaneous.cpp b/tests/manual/qlocale/miscellaneous.cpp index 0b2250a..a9694bf 100644 --- a/tests/manual/qlocale/miscellaneous.cpp +++ b/tests/manual/qlocale/miscellaneous.cpp @@ -49,6 +49,7 @@ MiscWidget::MiscWidget() createLineEdit("Alternate quotes:", &alternateQuotedTextLabel, &alternateQuotedText); textToQuote->setText("some text"); createLineEdit("Text direction:", &textDirectionLabel, &textDirection); + createLineEdit("List to seperated string:", &listToSeparatedStringLabel, &listToSeparatedStringText); l->addWidget(textToQuoteLabel, 0, 0); l->addWidget(textToQuote, 0, 1); @@ -58,6 +59,8 @@ MiscWidget::MiscWidget() l->addWidget(alternateQuotedText, 1, 3); l->addWidget(textDirectionLabel, 2, 0); l->addWidget(textDirection, 2, 1, 1, 3); + l->addWidget(listToSeparatedStringLabel, 3, 0); + l->addWidget(listToSeparatedStringText, 3, 1, 1, 3); connect(textToQuote, SIGNAL(textChanged(QString)), this, SLOT(updateQuotedText(QString))); @@ -72,10 +75,18 @@ void MiscWidget::updateQuotedText(QString str) alternateQuotedText->setText(locale().quoteString(str, QLocale::AlternateQuotation)); } +void MiscWidget::updateListToSeparatedStringText() +{ + QStringList test; + test << "aaa" << "bbb" << "ccc" << "ddd"; + listToSeparatedStringText->setText(locale().createSeparatedList(test)); +} + void MiscWidget::localeChanged(QLocale locale) { setLocale(locale); updateQuotedText(textToQuote->text()); + updateListToSeparatedStringText(); textDirection->setText(locale.textDirection() == Qt::LeftToRight ? "Left To Right" : "Right To Left"); } diff --git a/tests/manual/qlocale/miscellaneous.h b/tests/manual/qlocale/miscellaneous.h index 33d8ef9..3b635b8 100644 --- a/tests/manual/qlocale/miscellaneous.h +++ b/tests/manual/qlocale/miscellaneous.h @@ -56,14 +56,17 @@ private: QLabel *standardQuotedTextLabel; QLabel *alternateQuotedTextLabel; QLabel *textDirectionLabel; + QLabel *listToSeparatedStringLabel; QLineEdit *textToQuote; QLineEdit *standardQuotedText; QLineEdit *alternateQuotedText; QLineEdit *textDirection; + QLineEdit *listToSeparatedStringText; private slots: void localeChanged(QLocale locale); void updateQuotedText(QString str); + void updateListToSeparatedStringText(); }; #endif // MISCELLANEOUS_H |