Typica is a free program for professional coffee roasters. https://typica.us
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

draglabel.cpp 505B

1234567891011121314151617181920212223242526272829
  1. /*1054:*/
  2. #line 33 "./scales.w"
  3. #include "draglabel.h"
  4. #include <QDrag>
  5. #include <QMouseEvent>
  6. DragLabel::DragLabel(const QString&labelText,QWidget*parent):
  7. QLabel(labelText,parent)
  8. {
  9. QFont labelFont= font();
  10. labelFont.setPointSize(14);
  11. setFont(labelFont);
  12. }
  13. void DragLabel::mousePressEvent(QMouseEvent*event)
  14. {
  15. if(event->button()==Qt::LeftButton)
  16. {
  17. QDrag*drag= new QDrag(this);
  18. QMimeData*mimeData= new QMimeData;
  19. mimeData->setText(text());
  20. drag->setMimeData(mimeData);
  21. drag->exec();
  22. }
  23. }
  24. /*:1054*/