#ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QtGui>#include <QMainWindow>#include <test.h>#include <video.h>#include <author.h>#include <tematest.h>namespace Ui { class MainWindow;}class MainWindow : public QMainWindow{ Q_OBJECTpublic: explicit MainWindow(QWidget *parent = 0); ~MainWindow();private: Ui::MainWindow *ui; public slots: void viddeo(); };#endif // MAINWINDOW_H
#include "mainwindow.h"#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); t2=new video(); QPalette pal1; pal1.setBrush(ui->widget->backgroundRole(), QBrush(QPixmap("pic/NEWFON.png"))); ui->widget->setAutoFillBackground(true); ui->widget->setPalette(pal1); connect(ui->videouroki, SIGNAL(triggered()), this, SLOT(viddeo()));}MainWindow::~MainWindow(){ delete ui;}void MainWindow::viddeo(){ t2->resize(500,500); t2->show();}
#include <QtGui>#include <QApplication>#include "mainwindow.h"int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; w.show(); return a.exec();}