frmimgshow.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef FRMIMGSHOW_H
  2. #define FRMIMGSHOW_H
  3. #include <QWidget>
  4. #include <QPushButton>
  5. #include <QLabel>
  6. #include <QHBoxLayout>
  7. #include <QVBoxLayout>
  8. #include <QToolButton>
  9. #include <QSpacerItem>
  10. #include <QUrl>
  11. #include <QCheckBox>
  12. #include <QClipboard>
  13. #include <QApplication>
  14. #include <QGuiApplication>
  15. #include "tchttpservice.h"
  16. class FrmImgShow : public QWidget
  17. {
  18. Q_OBJECT
  19. public:
  20. explicit FrmImgShow(QWidget *parent = nullptr);
  21. void loadImage(const QUrl& imageUrl);
  22. void setImage(const QPixmap& pixmap);
  23. void setLoadingState(bool loading);
  24. void initSignalSlot();
  25. virtual QSize sizeHint();
  26. private:
  27. QLabel* labImg;
  28. // QLabel* labLoading;
  29. // QMovie* movieLoading;
  30. QPushButton* btnCopy;
  31. QPushButton* btnDelete;
  32. QSpacerItem* horizenSpacer;
  33. QHBoxLayout* hLayout;
  34. QCheckBox* ckbSelect;
  35. QVBoxLayout* vLayout;
  36. protected:
  37. virtual bool eventFilter(QObject* watched, QEvent* event);
  38. private slots:
  39. void onFinished(QNetworkReply *reply);
  40. private:
  41. void initForm();
  42. void initWidget();
  43. QString m_requestId;
  44. QUrl m_currentUrl;
  45. signals:
  46. void signal_imageSelected(QString);
  47. void signal_imageUnselected(QString);
  48. };
  49. #endif // FRMIMGSHOW_H