widget.cpp 814 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "widget.h"
  2. #include "./ui_widget.h"
  3. #include <QTimer>
  4. #include <QFileDialog>
  5. #include "spdlog/spdlog.h"
  6. // #include "fmtlog.h"
  7. // #include "VideoPlayer1.h"
  8. Widget::Widget(QWidget *parent)
  9. : QWidget(parent)
  10. , ui(new Ui::Widget)
  11. {
  12. ui->setupUi(this);
  13. m_videoPlayer = std::make_shared<PlayerGLWidget>(ui->widget_display);
  14. m_videoPlayer->resize(1280, 720);
  15. // m_videoPlayer1 = std::make_shared<VideoPlayer1>();
  16. // m_videoPlayer1->setParent(ui->widget_display);
  17. SPDLOG_INFO("***** Qt Library *****");
  18. /* 显示预览图片 */
  19. QString imagePath = QApplication::applicationDirPath() + "/0.jpg";
  20. QImage image(imagePath);
  21. image = image.scaled(1280, 720);
  22. ui->label->setPixmap(QPixmap::fromImage(image));
  23. }
  24. Widget::~Widget()
  25. {
  26. delete ui;
  27. }