123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- #ifndef ONEITEM_H
- #define ONEITEM_H
- #include <QWidget>
- #include <QTimer>
- #include <QUuid>
- #include "TransmitterSwitchInfo.h"
- namespace Ui {
- class OneItem;
- }
- class OneItem : public QWidget
- {
- Q_OBJECT
- public:
- explicit OneItem(QWidget *parent = nullptr, bool isSpecial = false);
- explicit OneItem(bool isSpecial = false);
- ~OneItem();
-
- void init();
-
- QUuid getUUID() { return m_uuid; }
-
- void setWeekDay(int week) { m_weekDay = week; }
-
- int getWeekDay() { return m_weekDay; }
-
- void setNum(int num);
-
- int getNum();
-
- void setDate(const QDate& date);
-
- QDate getDate();
-
- void setExecTime(const QTime& time);
-
- QTime getExecTime();
-
- void setDevName(const QString& dev);
-
- QString getDevName();
-
- void addActions();
-
- QString getActionName();
-
- int getActionNum();
-
- void addDevice();
-
- bool getDateType();
-
- void setWarningText(QString str,int ms = 3000);
-
- void hideWarn();
-
- QPoint getExecTimePos();
-
- QPoint getExecDatePos();
-
- QSize getExecTimeSize();
-
- QSize getExecDateSize();
- signals:
-
- void signal_OneItemDelete(int week, int num);
-
- void signal_dateClicked(QDate date);
-
- void signal_execTimeClicked(QTime time);
-
- void signal_devChanged();
- private slots:
-
- void do_devChanged(QString devName);
-
- void do_actionChanged(QString action);
-
- void do_pBtn_execTime_clicked();
-
- void do_pBtn_execDate_clicked();
-
- void do_pBtn_close_clicked();
- private:
-
- void layoutInit();
- protected:
-
- bool eventFilter(QObject *watched, QEvent *event);
- private:
- Ui::OneItem *ui;
- QUuid m_uuid;
- bool m_isSpecial = false;
- QTimer m_warnTimer;
- DeviceInfo m_devInfo;
-
- int m_weekDay = -1;
- int m_num = -1;
- QTime m_time;
- QDate m_date;
- };
- #endif
|