summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-05-21 11:28:38 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-05-21 11:37:45 (GMT)
commitf1dc8ed5d852a02dcacafb79195d8ca17d4a20ea (patch)
treede1ab79ee9756461e8048bb8e438fdb38abb95fc
parent1c4846bc35613f388fda28841e19c3a9cbc8c11f (diff)
downloadQt-f1dc8ed5d852a02dcacafb79195d8ca17d4a20ea.zip
Qt-f1dc8ed5d852a02dcacafb79195d8ca17d4a20ea.tar.gz
Qt-f1dc8ed5d852a02dcacafb79195d8ca17d4a20ea.tar.bz2
QComboBox: Fix documentation and make auto-test pass.
Reviewed-by: Olivier
-rw-r--r--src/gui/widgets/qcombobox.cpp2
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 1504066..6cf24a6 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -1293,7 +1293,7 @@ QComboBox::~QComboBox()
By default, this property has a value of 10.
\note This property is ignored for non-editable comboboxes in styles that returns
- false for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style.
+ true for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style.
*/
int QComboBox::maxVisibleItems() const
{
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index 1fcea9e..aa821c2 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -2553,9 +2553,11 @@ void tst_QComboBox::maxVisibleItems()
QAbstractItemView *v = comboBox.view();
int itemHeight = v->visualRect(v->model()->index(0,0)).height();
- if (v->style()->styleHint(QStyle::SH_ComboBox_Popup))
+ QListView *lv = qobject_cast<QListView*>(v);
+ if (lv)
+ itemHeight += lv->spacing();
+ if (!v->style()->styleHint(QStyle::SH_ComboBox_Popup))
QCOMPARE(v->viewport()->height(), itemHeight * comboBox.maxVisibleItems());
- // QCombobox without a popup does not work, see QTBUG-760
}