Open Source Snapmatic picture and Savegame viewer/editor for GTA V https://gta5view.syping.de/
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.

UiModLabel.cpp 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*****************************************************************************
  2. * gta5view Grand Theft Auto V Profile Viewer
  3. * Copyright (C) 2016-2017 Syping
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *****************************************************************************/
  18. #include "UiModLabel.h"
  19. #include <QPaintEvent>
  20. #include <QMouseEvent>
  21. UiModLabel::UiModLabel(const QString &text, QWidget *parent) : QLabel(parent)
  22. {
  23. setText(text);
  24. }
  25. UiModLabel::UiModLabel(QWidget *parent, const QString &text) : QLabel(parent)
  26. {
  27. setText(text);
  28. }
  29. UiModLabel::UiModLabel(QWidget *parent) : QLabel(parent)
  30. {
  31. }
  32. UiModLabel::~UiModLabel()
  33. {
  34. }
  35. void UiModLabel::paintEvent(QPaintEvent *ev)
  36. {
  37. QLabel::paintEvent(ev);
  38. emit labelPainted();
  39. }
  40. void UiModLabel::mouseMoveEvent(QMouseEvent *ev)
  41. {
  42. QLabel::mouseMoveEvent(ev);
  43. emit mouseMoved();
  44. }
  45. void UiModLabel::mousePressEvent(QMouseEvent *ev)
  46. {
  47. QLabel::mousePressEvent(ev);
  48. emit mousePressed(ev->button());
  49. }
  50. void UiModLabel::mouseReleaseEvent(QMouseEvent *ev)
  51. {
  52. QLabel::mouseReleaseEvent(ev);
  53. emit mouseReleased(ev->button());
  54. }
  55. void UiModLabel::mouseDoubleClickEvent(QMouseEvent *ev)
  56. {
  57. QLabel::mouseDoubleClickEvent(ev);
  58. emit mouseDoubleClicked(ev->button());
  59. }
  60. void UiModLabel::resizeEvent(QResizeEvent *ev)
  61. {
  62. QLabel::resizeEvent(ev);
  63. emit resized(ev->size());
  64. }