QT 第二天(作业)

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "QMouseEvent"
#include 
#include 
#include 
#include 
#include 
class MainWindow : public QMainWindow
{
    Q_OBJECT
signals:
    void jump();
public slots:
    void on_okbtn_clicked();
public:
    void mousePressEvent(QMouseEvent *ev);
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
};
#endif // MAINWINDOW_H
#ifndef SECOND_H
#define SECOND_H
#include "mainwindow.h"
#include 
 
  
namespace Ui {
class second;
}
 
  
class second : public QWidget
{
    Q_OBJECT
public slots:
    void jump_slot();
public:
    explicit second(QWidget *parent = nullptr);
    ~second();
 
  
private:
    Ui::second *ui;
};
 
  
#endif // SECOND_H
#include "mainwindow.h"
 
  
#include 
 
  
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    second secd;
    w.show();
   QObject::connect(&w,&MainWindow::jump,&secd,&second::jump_slot);
    return a.exec();
}
#include "second.h"
#include "ui_second.h"
 
  
second::second(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::second)
{
    ui->setupUi(this);
}
void second::jump_slot()
{
    this->show();
}
second::~second()
{
    delete ui;
}
 
 

你可能感兴趣的:(qt,数据库,java)