aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Ionascu <stanislav.ionascu@nokia.com>2010-12-30 12:36:10 +0200
committerStanislav Ionascu <stanislav.ionascu@nokia.com>2010-12-30 12:55:15 +0200
commit506dc3a2e75a22dfa2cbb27c9cc1f3838d20f361 (patch)
treef88a8020346d8820991d9bab55a43951440754e1
parentcc5e7d9acb7ed3fc0e94a976d663406a8f6b0bfc (diff)
Changes: Add title to object menu display on list page.
RevBy: TrustMe.
-rw-r--r--demos/widgetsgallery/mlistpage.cpp11
-rw-r--r--demos/widgetsgallery/mlistpage.h1
2 files changed, 7 insertions, 5 deletions
diff --git a/demos/widgetsgallery/mlistpage.cpp b/demos/widgetsgallery/mlistpage.cpp
index ebfec3bf..722a55bc 100644
--- a/demos/widgetsgallery/mlistpage.cpp
+++ b/demos/widgetsgallery/mlistpage.cpp
@@ -375,17 +375,17 @@ void MListPage::createActions()
void MListPage::createObjectMenuActions()
{
+ objectMenu = new MObjectMenu(NULL);
+
//% "Remove"
MAction *action = new MAction(qtTrId("xx_listpage_list_remove"), this);
- objectMenuActions.append(action);
+ objectMenu->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(removeListItem()));
//% "Edit"
action = new MAction(qtTrId("xx_listpage_list_edit"), this);
- objectMenuActions.append(action);
+ objectMenu->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(editListItem()));
-
- objectMenu = new MObjectMenu(objectMenuActions);
}
void MListPage::scrollToBottom()
@@ -557,6 +557,9 @@ void MListPage::itemClick(const QModelIndex &index)
void MListPage::itemLongTapped(const QModelIndex &index, const QPointF &position)
{
objectMenu->setCursorPosition(position);
+
+ objectMenu->setTitle(index.data(PhoneBookModel::PhoneBookFilterRole).toString());
+
if (index.parent().isValid()) {
mDebug("MListPage::itemLongTapped") << "Row: " << index.row() << " Group: " << index.parent().row();
sceneManager()->appearSceneWindow(objectMenu);
diff --git a/demos/widgetsgallery/mlistpage.h b/demos/widgetsgallery/mlistpage.h
index 66737f92..e64188b8 100644
--- a/demos/widgetsgallery/mlistpage.h
+++ b/demos/widgetsgallery/mlistpage.h
@@ -114,7 +114,6 @@ private:
MComboBox *comboListMode;
MObjectMenu *objectMenu;
- QList<MAction *> objectMenuActions;
MAction *actionAdvancedConfiguration;
QPointer<MDialog> dialogAdvancedConfiguration;