draglabel.h 582 B

123456789101112131415161718192021222324252627
  1. #ifndef DRAGLABEL_H
  2. #define DRAGLABEL_H
  3. #include <QLabel>
  4. #include <QTableWidgetItem>
  5. class QDragEnterEvent;
  6. class QDragMoveEvent;
  7. class QFrame;
  8. class DragLabel : public QTableWidgetItem
  9. {
  10. public:
  11. DragLabel(const QString &text, QTableWidgetItem *parent=NULL);
  12. QString labelText() const;
  13. QLinearGradient gradient;
  14. protected:
  15. void dragEnterEvent(QDragEnterEvent *event);
  16. void dragMoveEvent(QDragMoveEvent *event);
  17. void dropEvent(QDropEvent *event);
  18. void mousePressEvent(QMouseEvent *event);
  19. private:
  20. QString m_labelText;
  21. };
  22. #endif // DRAGLABEL_H