void VideoSurface::paintEvent(QPaintEvent *event) { Q_UNUSED(event); //WARNING: This might trigger unnecessary refreshes from MLT's producer, but without this, // as soon as monitor is covered by a popup menu or another window, image is corrupted. emit refreshMonitor(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); room[1] = "房间1"; room[2] = "房间2"; room[3] = "房间3"; room[4] = "房间4"; room[5] = "房间5"; //根据状态信息给room1~room5赋值,我这里是特别简单的直接赋值 看一下可读状态信息赋值后分别显示 ui->textBrowser_room1->setText(room[1]+"\n\n关机");//显示文本一内容,可设置参数为房间状态文本, ui->textBrowser_room2->setText(room[2]+"\n\n关机"); ui->textBrowser_room3->setText(room[3]+"\n\n关机"); ui->textBrowser_room4->setText(room[4]+"\n\n关机"); ui->textBrowser_room5->setText(room[5]+"\n\n关机"); setupsocket(); port = 6666; //新建一个QTimer对象 timer = new QTimer(); //设置定时器每个多少毫秒发送一个timeout()信号 timer->setInterval(60000/quick); //启动定时器 timer->start(); //信号和槽 connect(timer, SIGNAL(timeout()), this, SLOT(refreshMonitor())); }