-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSModelBee.cpp
More file actions
51 lines (43 loc) · 1.84 KB
/
SModelBee.cpp
File metadata and controls
51 lines (43 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "SModelBee.h"
#include "ui_SModelBee.h"
SModelBee::SModelBee(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::SModelBee){
ui->setupUi(this);
QObject::connect(ui->Pb00OpenStl,&QPushButton::clicked,this,&SModelBee::slot_openStl);
QObject::connect(this,&SModelBee::signal_loadStl,ui->QOGW00mian,&MyOldOpenGLWidget::slot_recieveStl);
QObject::connect(ui->Pb00Up,&QPushButton::clicked,ui->QOGW00mian,&MyOldOpenGLWidget::slot_moveUp);
QObject::connect(ui->Pb00Down,&QPushButton::clicked,ui->QOGW00mian,&MyOldOpenGLWidget::slot_moveDown);
QObject::connect(ui->Pb00Left,&QPushButton::clicked,ui->QOGW00mian,&MyOldOpenGLWidget::slot_moveLeft);
QObject::connect(ui->Pb00Right,&QPushButton::clicked,ui->QOGW00mian,&MyOldOpenGLWidget::slot_moveRight);
QObject::connect(ui->Ac00About,&QAction::triggered,this,&SModelBee::slotAbout);
}
SModelBee::~SModelBee(){
delete ui;
}
void SModelBee::slot_openStl(){
//加载一个stl文件 设置打开文件的过滤器
QString path;
path = QFileDialog::getOpenFileName(this,"open file dialog","../StlFile","STL files (*.stl)");
//然后将路径传递给 opengl,opengl里面在调用model->load
if(!path.isEmpty()){
emit signal_loadStl(path);
}
return;
}
void SModelBee::slotAbout(){
QImage *pImage = new QImage(":/back/Image/1.jpg");
*pImage = pImage->scaled(QSize(pImage->width()/3,pImage->height()/3));
QMessageBox box;
//box.setParent();
box.setWindowTitle("软件所有权");
box.setInformativeText("本软件为科研训练展示性软件\n作者:南京理工大学钱学森学院_916000710012宋子午\n指导老师:刘婷婷");
box.setIconPixmap(QPixmap::fromImage(*pImage));
box.move(QPoint(100,100));
box.show();
box.exec();
}
void SModelBee::openOutside(QString path){
emit signal_loadStl(path);
return;
}