5 #include <QDialogButtonBox>
16 /** A window with a list and menu actions (Maemo) or buttons (non-Maemo). */
17 class ListWindow: public QMainWindow
22 explicit ListWindow(QWidget *parent = 0);
24 /** Add a list view to the window. */
25 void addList(QListView *list);
28 * Add an action to the window: either a button, or, on Maemo, a top
30 * Activating the action invokes the slot with no parameters.
32 void addAction(const QString &title, QObject *receiver, const char *slot,
33 QDialogButtonBox::ButtonRole role = QDialogButtonBox::ActionRole);
36 * Add an action to the selected item in the list: either a button which is
37 * enabled when a list item is selected, or, on Maemo, a pop-up menu item
38 * which is displayed when a list item is long-pressed.
39 * Activating the action invokes the slot with no parameters.
41 void addItemAction(const QString &title, QObject *receiver,
45 void onSelectionChanged(const QItemSelection &selected,
46 const QItemSelection &deselected);
48 void activateItemButtons();
53 bool eventFilter(QObject *obj, QEvent *event);
54 void closeEvent(QCloseEvent *event);
57 QDialogButtonBox *buttonBox;
58 QList<QPushButton *> itemButtons;
60 QHBoxLayout *frameLayout;
64 #endif // LISTWINDOW_H