summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfontcombobox/tst_qfontcombobox.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-07 08:01:21 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-07 08:01:21 (GMT)
commit4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0 (patch)
tree46395e49ab1c372ca5af7fc3bc4e8ea7595a013c /tests/auto/qfontcombobox/tst_qfontcombobox.cpp
parent134dad4c6a996045397098498eaf0afca889b6f9 (diff)
downloadQt-4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0.zip
Qt-4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0.tar.gz
Qt-4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0.tar.bz2
QFontComboBox: used to emit currentFontChanged twice when setting it.
Setting the current font would change the current font and then it would try to select the right model index and get the font only from the text of the combobox. This was resetting the point size of the font, resulting in emitting the signal a second time. In the case of the user, it was also causing signals to be called in a loop. Task-number: 229731
Diffstat (limited to 'tests/auto/qfontcombobox/tst_qfontcombobox.cpp')
-rw-r--r--tests/auto/qfontcombobox/tst_qfontcombobox.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp
index 62bfdf7..e2515ae 100644
--- a/tests/auto/qfontcombobox/tst_qfontcombobox.cpp
+++ b/tests/auto/qfontcombobox/tst_qfontcombobox.cpp
@@ -122,7 +122,10 @@ void tst_QFontComboBox::currentFont_data()
{
QTest::addColumn<QFont>("currentFont");
// Normalize the names
- QTest::newRow("default") << QFont(QFontInfo(QFont()).family());
+ QFont defaultFont;
+ QTest::newRow("default") << defaultFont;
+ defaultFont.setPointSize(defaultFont.pointSize() + 10);
+ QTest::newRow("default") << defaultFont;
QFontDatabase db;
QStringList list = db.families();
for (int i = 0; i < list.count(); ++i) {
@@ -141,6 +144,7 @@ void tst_QFontComboBox::currentFont()
QFont oldCurrentFont = box.currentFont();
box.setCurrentFont(currentFont);
+ QCOMPARE(box.currentFont(), currentFont);
QString boxFontFamily = QFontInfo(box.currentFont()).family();
QRegExp foundry(" \\[.*\\]");
if (!currentFont.family().contains(foundry))