| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #pragma once
- #include <QWidget>
- #include <QComboBox>
- #include <QPushButton>
- #include <QHBoxLayout>
- #include <QGroupBox>
- #include <QVariant>
- class CaptureSourceWidget : public QWidget
- {
- Q_OBJECT
- public:
- explicit CaptureSourceWidget(QWidget* parent = nullptr);
- ~CaptureSourceWidget() = default;
- // 获取当前选中的捕获源索引
- int getCurrentIndex() const;
-
- // 获取当前选中的捕获源数据
- QVariant getCurrentData() const;
-
- // 获取当前选中的文本
- QString getCurrentText() const;
-
- // 设置启用状态
- void setEnabled(bool enabled);
-
- // 刷新捕获源列表
- void updateCaptureList();
- signals:
- // 捕获源文本改变信号
- void captureSourceTextChanged(const QString& text);
-
- // 捕获源索引改变信号
- void captureSourceIndexChanged(int index);
-
- // 刷新按钮点击信号
- void refreshRequested();
- private slots:
- void onComboBoxTextChanged(const QString& text);
- void onComboBoxIndexChanged(int index);
- void onRefreshButtonClicked();
- private:
- void setupUi();
-
- QComboBox* m_captureComboBox;
- QPushButton* m_updateListBtn;
- QGroupBox* m_captureGroup;
- QHBoxLayout* m_layout;
- };
|