/[qspeakers]/listdialog.h
ViewVC logotype

Contents of /listdialog.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations)
Sat Oct 11 19:34:58 2014 UTC (2 years, 8 months ago) by ben
File MIME type: text/plain
File size: 1029 byte(s)
implemented speaker selection from db search
1 #ifndef LISTDIALOG_H
2 #define LISTDIALOG_H
3
4 #include <QDialog>
5 #include <QAbstractListModel>
6
7 #include "speaker.h"
8
9 class SpeakerListModel : public QAbstractListModel
10 {
11 Q_OBJECT
12
13 public:
14 explicit SpeakerListModel(const QList<Speaker> &speakers, QWidget *parent = 0);
15 ~SpeakerListModel();
16
17 int rowCount(const QModelIndex &parent = QModelIndex()) const;
18 QVariant data(const QModelIndex &index, int role) const;
19 void clear(void);
20
21 private:
22 QList<Speaker> speakers;
23 };
24
25 namespace Ui {
26 class ListDialog;
27 }
28
29 class ListDialog : public QDialog
30 {
31 Q_OBJECT
32
33 public:
34 explicit ListDialog(const QList<Speaker>& speakers, QWidget *parent = 0);
35 ~ListDialog();
36
37 void setSpeakerItems(const QList<Speaker> &speakers);
38 void clear(void);
39
40 signals:
41 void speakerItemSelected(QString title, const Speaker &speaker);
42 void speakerItemCancelled();
43
44 private slots:
45 void onAccepted();
46 void onRejected();
47
48 private:
49 Ui::ListDialog *ui;
50 SpeakerListModel *model;
51 };
52
53 #endif // LISTDIALOG_H

  ViewVC Help
Powered by ViewVC 1.1.26