Audio plugin host https://kx.studio/carla
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.

44 lines
1.5KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Clickable Label, a custom Qt4 widget
  4. # Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # For a full copy of the GNU General Public License see the GPL.txt file
  17. # ------------------------------------------------------------------------------------------------------------
  18. # Imports (Global)
  19. from PyQt4.QtCore import pyqtSlot, Qt, QTimer, SIGNAL, SLOT
  20. from PyQt4.QtGui import QLabel
  21. # ------------------------------------------------------------------------------------------------------------
  22. # Widget Class
  23. class ClickableLabel(QLabel):
  24. def __init__(self, parent):
  25. QLabel.__init__(self, parent)
  26. self.setCursor(Qt.PointingHandCursor)
  27. def mousePressEvent(self, event):
  28. self.emit(SIGNAL("clicked()"))
  29. # Use busy cursor for 2 secs
  30. self.setCursor(Qt.WaitCursor)
  31. QTimer.singleShot(2000, self, SLOT("slot_setNormalCursor()"))
  32. QLabel.mousePressEvent(self, event)
  33. @pyqtSlot()
  34. def slot_setNormalCursor(self):
  35. self.setCursor(Qt.PointingHandCursor)