#ifndef WIDGET_H #define WIDGET_H #include "DatabaseManager.h" #include "FocusWindow.h" #include QT_BEGIN_NAMESPACE namespace Ui { class Menu; } QT_END_NAMESPACE class Menu : public QWidget, public FW::FocusWindow { Q_OBJECT public: Menu(QWidget* parent = nullptr); ~Menu(); void show(); void setChannelSelectVisible(bool visible); DatabaseManager::Channel getCurPlayChannel(); public slots: void move(Direction direction); void confirm(); void clickPreOrNext(QString type); void onAppendOneVideo(QString channelName); signals: void btnHdmi1Checked(); void btnHdmi2Checked(); void btnVga1Checked(); void btnVga2Checked(); void btnVideoClicked(QString name); protected: // 重写父类的方法,以获取当前界面的所有可以获取焦点的控件 QList getAllFocusabelWidget() override; private: Ui::Menu* ui; // 视频名数组列表 QList contentList; DatabaseManager* db; QString curPlayFilename; // 当前正在回放的文件名 bool channelSelectVisible = false; // 是否显示通道选择,单通道回放显示、双通道不显示 DatabaseManager::Channel curSelectChannel; // 当前选择的通道 DatabaseManager::Channel curPlayChannel; // 当前回放的通道 private: void getContents(); void renderContents(); void renderComboBoxYear(); void renderComboBoxMonth(); void renderComboBoxDay(); }; #endif // WIDGET_H