MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
p.
setColor(QPalette::Background, Qt
::lightGray);
this->setAutoFillBackground(true);
this->setPalette(p);
this->resize(1000,500);
this
->setWindowTitle
(QApplication::translate("toplevel",
"CCTV"));
mplayer_wrapper *wrapper = new mplayer_wrapper(this);
vlayout->addWidget(wrapper);
vlayout->addWidget(button1);
vlayout->addWidget(button2);
vlayout->addWidget(button3);
vlayout->addWidget(label);
ui->centralWidget->setLayout(vlayout);
connect(button1, &QPushButton::clicked,wrapper,&mplayer_wrapper::stop_mplayer);
connect(button2, &QPushButton::clicked,wrapper,&mplayer_wrapper::start_mplayer);
//connect(button3, &QPushButton::clicked,this, &MainWindow::show_time);
connect(Timer,&QTimer::timeout,this,&MainWindow::show_time);
//ui->widget->
Timer->start();
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QPalette p(palette());
p.setColor(QPalette::Background, Qt::lightGray);
this->setAutoFillBackground(true);
this->setPalette(p);
this->resize(1000,500);
this->setWindowTitle(QApplication::translate("toplevel", "CCTV"));
mplayer_wrapper *wrapper = new mplayer_wrapper(this);
label = new QLabel(this);
Timer = new QTimer(this);
button1 = new QPushButton("Stop State");
button2 = new QPushButton("Start Stream");
button3 = new QPushButton("Time");
vlayout = new QVBoxLayout();
vlayout->addWidget(wrapper);
vlayout->addWidget(button1);
vlayout->addWidget(button2);
vlayout->addWidget(button3);
vlayout->addWidget(label);
ui->centralWidget->setLayout(vlayout);
connect(button1, &QPushButton::clicked,wrapper,&mplayer_wrapper::stop_mplayer);
connect(button2, &QPushButton::clicked,wrapper,&mplayer_wrapper::start_mplayer);
//connect(button3, &QPushButton::clicked,this, &MainWindow::show_time);
connect(Timer,&QTimer::timeout,this,&MainWindow::show_time);
//ui->widget->
Timer->start();
}
To copy to clipboard, switch view to plain text mode
Bookmarks