就是加了点功能,对前面的做了一些完善。
一、效果(只能上传5M以内的gif,所以减小了录制窗口大小)
二、实现
①ShowImg.h
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_ShowImg.h"
#include<iostream>
using namespace std;
#define INTERFACE_WIDTH 1600
#define INTERFACE_HEIGHT 900
class QPushButton;
class QLabel;
class QGroupBox;
class QVBoxLayout;
class QRadioButton;
class ShowImg : public QMainWindow
{
Q_OBJECT
public:
ShowImg(QWidget *parent = Q_NULLPTR);
private:
Ui::ShowImgClass ui;
private:
QLineEdit *showFilePath_lineedit;
QLabel *showImg_label;
QString filePath;
QList<QString> filePathList;
QString showfilePath;
QPixmap img_pix;
int img_index;
QTimer *timer_time;
QGroupBox *showModelbox_gbox;
QVBoxLayout *showModelbox_Vlayout;
QRadioButton * once_rbutton;
QRadioButton * loop_rbutton;
bool LOOP;
QGroupBox *buttonGroupBox_gbox;
QVBoxLayout *buttonGroupBox_Vlayout;
QPushButton *start_button;
QPushButton *stop_button;
QPushButton *exit_button;
public:
void initWindow();
void getFilesPath();
void findFiles(string path, vector<string>& files);
private slots:
void onceLoop();
void loopLoop();
void startViewImg()