ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rlistwidget.h
Go to the documentation of this file.
1 #ifndef RLISTWIDGET_H
2 #define RLISTWIDGET_H
3 
4 #include <QListWidget>
5 #include <QTimer>
6 
7 // Reorderable list widget
8 
9 class RListWidget : public QListWidget
10 {
11  Q_OBJECT
12 public:
13  explicit RListWidget(QWidget *parent = 0);
14 
15 signals:
16  void orderChanged();
17 
18 private slots:
19  void timerTick();
20  void enter(QListWidgetItem* item);
21  void change(QListWidgetItem* item);
22 
23 private:
24  QVariant currentData;
25  QList<QVariant> previousItems;
26  QVariant dragged;
27  QTimer reorderTimer;
28 
29  const static int DATA_ROLE = Qt::UserRole + 100;
30 
31  void rescanItems();
32 };
33 
34 #endif // RLISTWIDGET_H
QVariant currentData
Definition: rlistwidget.h:24
void timerTick()
Definition: rlistwidget.cpp:18
QTimer reorderTimer
Definition: rlistwidget.h:27
void change(QListWidgetItem *item)
Definition: rlistwidget.cpp:54
void enter(QListWidgetItem *item)
Definition: rlistwidget.cpp:47
QVariant dragged
Definition: rlistwidget.h:26
RListWidget(QWidget *parent=0)
Definition: rlistwidget.cpp:4
QList< QVariant > previousItems
Definition: rlistwidget.h:25
void rescanItems()
Definition: rlistwidget.cpp:59
static const int DATA_ROLE
Definition: rlistwidget.h:29