diff options
author | Stanislav Ionascu <stanislav.ionascu@nokia.com> | 2010-09-07 11:35:43 +0300 |
---|---|---|
committer | Stanislav Ionascu <stanislav.ionascu@nokia.com> | 2010-09-08 11:26:47 +0300 |
commit | 9ca67642ed3561ec3c1d3bfc633a12005eaf4708 (patch) | |
tree | 6506254108e634bdea29aca5f691e1ac36a2090f /demos/widgetsgallery | |
parent | fb92b466a135dceffa3a7a00cac40ba14fadac45 (diff) |
Changes: Update for widgetsgallery list page for new list index feature.
RevBy: Sergiy Dubovik
Details: The update shows how to use the automatic visibility feature
of the list index bar.
Diffstat (limited to 'demos/widgetsgallery')
-rw-r--r-- | demos/widgetsgallery/mlistpage.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/demos/widgetsgallery/mlistpage.cpp b/demos/widgetsgallery/mlistpage.cpp index a4132aa3..bf699ebb 100644 --- a/demos/widgetsgallery/mlistpage.cpp +++ b/demos/widgetsgallery/mlistpage.cpp @@ -445,12 +445,21 @@ void MListPage::changeSeparatorsMode(int index) void MListPage::changeListIndexVisibility(int index) { - Q_ASSERT(index >= 0 && index <= 1); - bool indexVisible = (index == 1); + Q_ASSERT(index >= 0 && index <= 2); - list->setIndexVisible(indexVisible); + switch (index) { + case 1: + list->setIndexDisplayMode(MList::Show); + break; + case 2: + list->setIndexDisplayMode(MList::Auto); + break; + default: + list->setIndexDisplayMode(MList::Hide); + break; + } - if (indexVisible) + if (index > 0) comboListMode->setCurrentIndex(Grouped); } @@ -587,7 +596,7 @@ void MListPage::showAdvancedConfigurationDialog() landscapePolicy->addItem(combo); QStringList listIndexModes; - listIndexModes << "Off" << "On"; + listIndexModes << "Off" << "On" << "Auto"; combo = createComboBoxLabelButton("List Index", listIndexModes, panel); connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeListIndexVisibility(int))); |