97 lines
2.4 KiB
C++
97 lines
2.4 KiB
C++
#include "zongjunluo.h"
|
|
#include "ui_zongjunluo.h"
|
|
#include<QGraphicsDropShadowEffect>
|
|
|
|
extern bool save;//菌落计数手动矫正的判断
|
|
|
|
zongjunluo::zongjunluo(QWidget *parent)
|
|
: QWidget(parent)
|
|
, ui(new Ui::zongjunluo)
|
|
{
|
|
ui->setupUi(this);
|
|
m_junluo=new bacteria;
|
|
m_junjilu=new bachistoricalrecords;
|
|
// m_cammer=new cammer;
|
|
ui->gridLayout_2->addWidget(m_junluo);
|
|
ui->gridLayout_5->addWidget(m_junjilu);
|
|
connect(m_junluo,&bacteria::shuaxin,m_junjilu,&bachistoricalrecords::getshuaxin);
|
|
connect(this, SIGNAL(guan()), m_junluo, SLOT(getguan()));
|
|
connect(this, SIGNAL(kai()), m_junluo, SLOT(getkai()));
|
|
//connect(m_cammer,SIGNAL(xinhao(QPixmap)),this, SLOT(getxinhao(QPixmap)));
|
|
bool connected = QObject::connect(&m_cammer, SIGNAL(xinhao(QString)),
|
|
this, SLOT(getxinhao(QString)));
|
|
|
|
|
|
if (connected)
|
|
{
|
|
qDebug() << "连接成功";
|
|
}
|
|
else
|
|
{
|
|
qDebug() << "连接失败";
|
|
|
|
}
|
|
connect(this,SIGNAL(xinhao(QString)),m_junluo, SLOT(getxinhao(QString)));
|
|
QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
|
|
//设置阴影距离
|
|
shadow->setOffset(0, 0);
|
|
//设置阴影颜色
|
|
shadow->setColor(QColor(214, 214, 214));
|
|
//设置阴影圆角
|
|
shadow->setBlurRadius(30);
|
|
//给嵌套QWidget设置阴影
|
|
ui->widget_2->setFixedSize(145,907);
|
|
ui->widget_2->setGraphicsEffect(shadow);
|
|
QGraphicsDropShadowEffect *shadow2 = new QGraphicsDropShadowEffect(this);
|
|
//设置阴影距离
|
|
shadow2->setOffset(0, 0);
|
|
//设置阴影颜色
|
|
shadow2->setColor(QColor(214, 214, 214));
|
|
//设置阴影圆角
|
|
shadow2->setBlurRadius(30);
|
|
//给嵌套QWidget设置阴影
|
|
ui->stackedWidget->setFixedSize(1760,920);
|
|
//ui->stackedWidget->setGraphicsEffect(shadow2);
|
|
}
|
|
|
|
zongjunluo::~zongjunluo()
|
|
{
|
|
delete ui;
|
|
}
|
|
void zongjunluo::getxinhao(QString p)
|
|
{
|
|
qDebug()<<"cammergetxinhao";
|
|
emit xinhao(p);
|
|
}
|
|
void zongjunluo:: getguan()
|
|
{
|
|
emit guan();
|
|
emit guan2();
|
|
}
|
|
void zongjunluo:: getkai()
|
|
{
|
|
emit kai();
|
|
}
|
|
void zongjunluo::on_radioButton_clicked()
|
|
{
|
|
ui->stackedWidget->setCurrentIndex(0);
|
|
}
|
|
|
|
|
|
void zongjunluo::on_radioButton_2_clicked()
|
|
{
|
|
if(save==false)
|
|
{
|
|
int ok=QMessageBox::information(NULL,"保存","请先保存照片", QMessageBox::Ok | QMessageBox::Cancel);
|
|
if (ok == QMessageBox::Ok) {
|
|
|
|
|
|
|
|
}
|
|
}else{
|
|
|
|
ui->stackedWidget->setCurrentIndex(1);
|
|
}
|
|
}
|
|
|