#ifndef HWNDUNIT_H #define HWNDUNIT_H #include #include #include #include #include "QHalconWindow.h" #include "showunit_global.h" #include "Util.h" #include "MyStream.h" //#pragma execution_character_set("utf-8") class SHOWUNITSHARED_EXPORT HWndUnit: public QWidget { Q_OBJECT public: explicit HWndUnit(QWidget *parent = nullptr); QHalconWindow *getHWndCtrl(void){ return m_pImageWindow; } void setWndTitle(const QString &title); void ShowImage(HImage image); //void ShowObj(HObject obj, QString strColor, int nLinsWhite = 1, bool bFillRawing = false); void ShowObj(HObject obj, QColor color = qRgb(255, 0, 0), int nLinsWhite = 1); void ShowObj(HObject obj, bool bFillRawing = false, int nLinsWhite = 1, int nModes = 0); void ShowMsg(HTuple msg, QColor color = qRgb(0, 255, 0), int nX = 10, int nY = 10, int nSize = 5); /// /// 根据参数,决定是否实时刷新 /// /// void Refresh(bool isRealTime = false); public slots: void on_MousePosMessage(const QString &message); void onTimer(); protected: void resizeEvent(QResizeEvent* ) override; void RefreshWindow(); private: QLabel * m_plabelStatus; QLabel * m_plabelTitle; QHalconWindow * m_pImageWindow; QWidget* m_paren; QTimer* m_pTimer; bool m_bUpdate; }; #endif // HWNDUNIT_H