frmimgshow.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <QGuiApplication>
  13. #include "tchttpservice.h"
  14. class FrmImgShow : public QWidget
  15. {
  16. Q_OBJECT
  17. public:
  18. explicit FrmImgShow(QWidget *parent = nullptr);
  19. void loadImage(const QUrl& imageUrl);
  20. void setImage(const QPixmap& pixmap);
  21. void setLoadingState(bool loading);
  22. QSize sizeHint();
  23. private:
  24. QLabel* labImg;
  25. // QLabel* labLoading;
  26. // QMovie* movieLoading;
  27. QPushButton* btnCopy;
  28. QPushButton* btnDelete;
  29. QSpacerItem* horizenSpacer;
  30. QHBoxLayout* hLayout;
  31. QCheckBox* ckbSelect;
  32. QVBoxLayout* vLayout;
  33. protected:
  34. virtual bool eventFilter(QObject* watched, QEvent* event);
  35. private slots:
  36. void onFinished(QNetworkReply *reply);
  37. private:
  38. void initForm();
  39. void initWidget();
  40. QString m_requestId;
  41. QUrl m_currentUrl;
  42. };
  43. #endif // FRMIMGSHOW_H