81 lines
2.1 KiB
C++
81 lines
2.1 KiB
C++
#ifndef IMAGERESLISTVIEW_H
|
|
#define IMAGERESLISTVIEW_H
|
|
|
|
#include <QWidget>
|
|
#include <QLineEdit>
|
|
#include <QListWidget>
|
|
#include <QEvent>
|
|
#include <QMouseEvent>
|
|
#include <QGraphicsSceneMouseEvent>
|
|
#include <QGraphicsPixmapItem>
|
|
#include <QCalendarWidget>
|
|
#include <QFont>
|
|
#include <QColor>
|
|
#include <QString>
|
|
|
|
#pragma execution_character_set("utf-8") //能够正常显示中文字符串
|
|
class QImageView;
|
|
class QImageWidget;
|
|
class ImageResListView :public QWidget {
|
|
Q_OBJECT
|
|
private:
|
|
|
|
QStringList SavePath; //原图结果图路径
|
|
QString currPath;
|
|
QFont m_Font;
|
|
QListWidget* m_result_List = nullptr; //检测数据列表
|
|
|
|
QLineEdit* up_label = nullptr;
|
|
QLineEdit* down_label = nullptr;
|
|
QString ok_str = QString::fromUtf8("OK");
|
|
|
|
QString SN;
|
|
QStringList str_resultList; //检索图片列表
|
|
QColor ok_color = QColor(180, 165, 130);
|
|
QColor ng_color = QColor(202, 120, 83);
|
|
|
|
int search_start = 0;
|
|
int show_index=0;//记录上次显示图片
|
|
public:
|
|
explicit ImageResListView(QWidget* parent = nullptr);
|
|
~ImageResListView();
|
|
|
|
void initwidget();
|
|
void my_SetFont(const QFont& afont) { m_Font = afont; };
|
|
void setPath(QString path) { currPath = path; initwidget(); }
|
|
void setSavePath(const QStringList& path);//设置检测结果存储路径
|
|
void clearAll();
|
|
int getSearch();// 获取检索状态
|
|
void stopSearch();//设置检索状态
|
|
|
|
void upListview(const QStringList list);
|
|
void showText(const QString result);
|
|
|
|
public slots:
|
|
void getCodeSN(const QString res);
|
|
|
|
|
|
private:
|
|
QPointF mainItemOriPos;
|
|
QGraphicsScene* qgraphicsScene = nullptr;
|
|
QImageWidget* m_pImage = nullptr;
|
|
QImageView* m_view = nullptr;
|
|
QScopedPointer<QLineEdit> labptr;
|
|
QScopedPointer<QLineEdit> label_ptr;
|
|
|
|
|
|
signals:
|
|
void waitSearch(bool isok = true);//搜索开始/结束
|
|
void GetShow(const QString result);
|
|
protected:
|
|
|
|
void addSN(const QString sn);
|
|
void changeRowList(int row);
|
|
void ShowImage(QImage* image);
|
|
void mouseMoveEvent(QMouseEvent* event)override;
|
|
|
|
};
|
|
|
|
|
|
#endif // IMAGERESLISTVIEW_H
|