5 #include <QDialogButtonBox>
17 /** A window with a list and menu actions (Maemo) or buttons (non-Maemo). */
18 class ListWindow: public QMainWindow
23 explicit ListWindow(QWidget *parent = 0);
25 /** Add a list view to the window. */
26 void addList(ListView *list);
29 * Add an action to the window: either a button, or, on Maemo, a top
31 * Activating the action invokes the slot with no parameters.
33 void addAction(const QString &title, QObject *receiver, const char *slot,
34 const QString &iconPath = QString(),
35 QDialogButtonBox::ButtonRole role = QDialogButtonBox::ActionRole);
38 * Add an action to the selected item in the list: either a button which is
39 * enabled when a list item is selected, or, on Maemo, a pop-up menu item
40 * which is displayed when a list item is long-pressed.
41 * Activating the action invokes the slot with no parameters.
43 void addItemAction(const QString &title, QObject *receiver,
52 void onSelectionChanged(const QItemSelection &selected,
53 const QItemSelection &deselected);
55 void onModelChanged();
57 void activateItemButtons();
62 bool eventFilter(QObject *obj, QEvent *event);
63 void closeEvent(QCloseEvent *event);
66 QDialogButtonBox *buttonBox;
67 QList<QPushButton *> itemButtons;
68 #endif // Q_WS_MAEMO_5
69 QBoxLayout *contentLayout;
73 #endif // LISTWINDOW_H