|
|
@ -57,6 +57,8 @@ MainWindow::MainWindow(QWidget *parent)
|
|
|
|
initNotifyMessageConnection();
|
|
|
|
initNotifyMessageConnection();
|
|
|
|
initChangeVideoLayoutConnection();
|
|
|
|
initChangeVideoLayoutConnection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initHideButton();
|
|
|
|
|
|
|
|
|
|
|
|
setSavedVideoDir();
|
|
|
|
setSavedVideoDir();
|
|
|
|
// ui->stackedWidget->setCurrentIndex(1);
|
|
|
|
// ui->stackedWidget->setCurrentIndex(1);
|
|
|
|
// ui->videoWidget1->play(list.at(0));
|
|
|
|
// ui->videoWidget1->play(list.at(0));
|
|
|
@ -85,6 +87,17 @@ bool MainWindow::nativeEvent(const QByteArray &eventType, void *message,
|
|
|
|
return QMainWindow::nativeEvent(eventType, message, result);
|
|
|
|
return QMainWindow::nativeEvent(eventType, message, result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::paintEvent(QPaintEvent *ev) {
|
|
|
|
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
if (ui->commandWidget->isHidden()) {
|
|
|
|
|
|
|
|
offset = hideCommandWidgetBtn->width() / 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hideCommandWidgetBtn->move(ui->stackedWidget->width() - offset,
|
|
|
|
|
|
|
|
ui->commandWidget->height() / 2);
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::initSignalConnection() {
|
|
|
|
void MainWindow::initSignalConnection() {
|
|
|
|
connect(ui->commandWidget, &CommandWidget::startConnectionSignal,
|
|
|
|
connect(ui->commandWidget, &CommandWidget::startConnectionSignal,
|
|
|
|
ui->videoWidget, &VideoWidget::udpPlay, Qt::UniqueConnection);
|
|
|
|
ui->videoWidget, &VideoWidget::udpPlay, Qt::UniqueConnection);
|
|
|
@ -140,6 +153,8 @@ void MainWindow::installWindowAgent() {
|
|
|
|
playBackAction->setIcon(QIcon(":/images/playback.png"));
|
|
|
|
playBackAction->setIcon(QIcon(":/images/playback.png"));
|
|
|
|
playBackAction->setIconText("回放");
|
|
|
|
playBackAction->setIconText("回放");
|
|
|
|
menuBar->addAction(playBackAction);
|
|
|
|
menuBar->addAction(playBackAction);
|
|
|
|
|
|
|
|
connect(playBackAction, &QAction::triggered, this,
|
|
|
|
|
|
|
|
&MainWindow::openSavedVideoDirSlot);
|
|
|
|
|
|
|
|
|
|
|
|
QAction *pushStreamAction = new QAction(this);
|
|
|
|
QAction *pushStreamAction = new QAction(this);
|
|
|
|
pushStreamAction->setIcon(QIcon(":/images/pushstream.png"));
|
|
|
|
pushStreamAction->setIcon(QIcon(":/images/pushstream.png"));
|
|
|
@ -266,6 +281,16 @@ void MainWindow::setSavedVideoDir() {
|
|
|
|
ui->videoWidget4->setVedioSaveFileDirPath("./video/video4");
|
|
|
|
ui->videoWidget4->setVedioSaveFileDirPath("./video/video4");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::initHideButton() {
|
|
|
|
|
|
|
|
hideCommandWidgetBtn = new QToolButton(this);
|
|
|
|
|
|
|
|
hideCommandWidgetBtn->setIcon(QIcon(":/images/right.png"));
|
|
|
|
|
|
|
|
hideCommandWidgetBtn->setIconSize(QSize(24, 24));
|
|
|
|
|
|
|
|
hideCommandWidgetBtn->setFixedSize(30, 30);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(hideCommandWidgetBtn, &QToolButton::clicked, this,
|
|
|
|
|
|
|
|
&MainWindow::hideCommandWidgetSlot);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::showSettingDlgSlot() {
|
|
|
|
void MainWindow::showSettingDlgSlot() {
|
|
|
|
settingDlg.exec();
|
|
|
|
settingDlg.exec();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -274,4 +299,17 @@ void MainWindow::showStreamSettingsDlgSlot() {
|
|
|
|
streamAddrSettingsDlg.exec();
|
|
|
|
streamAddrSettingsDlg.exec();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::changeVideoLayout(int index) {}
|
|
|
|
void MainWindow::hideCommandWidgetSlot() {
|
|
|
|
|
|
|
|
if (ui->commandWidget->isHidden()) {
|
|
|
|
|
|
|
|
ui->commandWidget->show();
|
|
|
|
|
|
|
|
hideCommandWidgetBtn->setIcon(QIcon(":/images/right.png"));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
ui->commandWidget->hide();
|
|
|
|
|
|
|
|
hideCommandWidgetBtn->setIcon(QIcon(":/images/left.png"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::openSavedVideoDirSlot() {
|
|
|
|
|
|
|
|
QDesktopServices::openUrl(
|
|
|
|
|
|
|
|
QUrl(QApplication::applicationDirPath() + "/video"));
|
|
|
|
|
|
|
|
}
|
|
|
|