Diffstat (limited to 'noncore/unsupported/mail2/listviewplus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/listviewplus.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/unsupported/mail2/listviewplus.cpp b/noncore/unsupported/mail2/listviewplus.cpp index ce5f35f..722b347 100644 --- a/noncore/unsupported/mail2/listviewplus.cpp +++ b/noncore/unsupported/mail2/listviewplus.cpp | |||
@@ -1,54 +1,54 @@ | |||
1 | #include <qpopupmenu.h> | 1 | #include <qpopupmenu.h> |
2 | #include <qtimer.h> | 2 | #include <qtimer.h> |
3 | 3 | ||
4 | #include "listviewplus.h" | 4 | #include "listviewplus.h" |
5 | 5 | ||
6 | ListViewPlus::ListViewPlus(QWidget *parent, const char *name, WFlags fl) | 6 | ListViewPlus::ListViewPlus(QWidget *parent, const char *name, WFlags fl) |
7 | : QListView(parent, name, fl) | 7 | : QListView(parent, name, fl) |
8 | { | 8 | { |
9 | 9 | ||
10 | } | 10 | } |
11 | 11 | ||
12 | void ListViewPlus::keyPressEvent(QKeyEvent *event) | 12 | void ListViewPlus::keyPressEvent(QKeyEvent *event) |
13 | { | 13 | { |
14 | switch(event->key()) { | 14 | switch(event->key()) { |
15 | case Qt::Key_Space: // FALLTHROUGH | 15 | case Qt::Key_Space: // FALLTHROUGH |
16 | case Qt::Key_Enter: | 16 | case Qt::Key_Enter: |
17 | if (currentItem() != 0) | 17 | if (currentItem() != 0) |
18 | emit clicked(currentItem()); | 18 | emit clicked(currentItem()); |
19 | break; | 19 | break; |
20 | default: break; | 20 | default: break; |
21 | } | 21 | } |
22 | 22 | ||
23 | QListView::keyPressEvent(event); | 23 | QListView::keyPressEvent(event); |
24 | } | 24 | } |
25 | 25 | ||
26 | void ListViewPlus::setPopup(QPopupMenu *popup, int delay) | 26 | void ListViewPlus::setPopup(QPopupMenu *popup, int delay) |
27 | { | 27 | { |
28 | _popup = popup; | 28 | _popup = popup; |
29 | _delay = delay; | 29 | _delay = delay; |
30 | 30 | ||
31 | connect(this, SIGNAL(pressed(QListViewItem *, const QPoint &, int)), SLOT(_initPopup(QListViewItem *, const QPoint &, int))); | 31 | connect(this, SIGNAL(pressed(QListViewItem*,const QPoint&,int)), SLOT(_initPopup(QListViewItem*,const QPoint&,int))); |
32 | connect(this, SIGNAL(clicked(QListViewItem *, const QPoint &, int)), SLOT(_cancelPopup(QListViewItem *, const QPoint &, int))); | 32 | connect(this, SIGNAL(clicked(QListViewItem*,const QPoint&,int)), SLOT(_cancelPopup(QListViewItem*,const QPoint&,int))); |
33 | } | 33 | } |
34 | 34 | ||
35 | void ListViewPlus::_initPopup(QListViewItem *, const QPoint &point, int) | 35 | void ListViewPlus::_initPopup(QListViewItem *, const QPoint &point, int) |
36 | { | 36 | { |
37 | _point = point; | 37 | _point = point; |
38 | 38 | ||
39 | _timer = new QTimer(); | 39 | _timer = new QTimer(); |
40 | _timer->start(_delay, true); | 40 | _timer->start(_delay, true); |
41 | 41 | ||
42 | connect(_timer, SIGNAL(timeout()), this, SLOT(_showPopup())); | 42 | connect(_timer, SIGNAL(timeout()), this, SLOT(_showPopup())); |
43 | } | 43 | } |
44 | 44 | ||
45 | void ListViewPlus::_cancelPopup(QListViewItem *, const QPoint &, int) | 45 | void ListViewPlus::_cancelPopup(QListViewItem *, const QPoint &, int) |
46 | { | 46 | { |
47 | delete _timer; | 47 | delete _timer; |
48 | } | 48 | } |
49 | 49 | ||
50 | void ListViewPlus::_showPopup() | 50 | void ListViewPlus::_showPopup() |
51 | { | 51 | { |
52 | _popup->popup(_point); | 52 | _popup->popup(_point); |
53 | } | 53 | } |
54 | 54 | ||