2024-10-10 16:59:51 +08:00
|
|
|
#include "mainWindow.h"
|
2024-10-12 10:01:20 +08:00
|
|
|
#include "./ui_mainWindow.h"
|
2024-10-10 16:59:51 +08:00
|
|
|
|
|
|
|
|
#include "functionNavigationBar.h"
|
|
|
|
|
#include "dvieMainWindow.h"
|
|
|
|
|
#include "tccMainWindow.h"
|
|
|
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget *parent)
|
|
|
|
|
: QMainWindow(parent)
|
|
|
|
|
, ui(new Ui::MainWindow)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
|
|
initialize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::initialize()
|
|
|
|
|
{
|
|
|
|
|
m_pDvieMainWindow = new DvieMainWindow(this);
|
|
|
|
|
ui->hLayout_DVIE->addWidget(m_pDvieMainWindow);
|
|
|
|
|
m_pTccMainWindow = new TccMainWindow(this);
|
|
|
|
|
ui->hLayout_TCC->addWidget(m_pTccMainWindow);
|
|
|
|
|
ui->stackedWidget->setCurrentIndex(0);
|
|
|
|
|
|
|
|
|
|
m_funNavigationBar = new FunctionNavigationBar(this);
|
|
|
|
|
connect(m_funNavigationBar, SIGNAL(sgl_funBtnClicke(QString)), this, SLOT(onSignal_funBtnClicked(QString)));
|
|
|
|
|
// QPoint originPoint = mapToGlobal(QPoint(0, 0)); 只有dialog需要做此计算
|
|
|
|
|
int nWidth = m_funNavigationBar->width();
|
|
|
|
|
int nY = (this->height() - m_funNavigationBar->height()) * 0.5;
|
|
|
|
|
m_funNavigationBar->setGeometry(0, nY, nWidth, m_funNavigationBar->height());
|
|
|
|
|
m_funNavigationBar->raise();
|
|
|
|
|
m_funNavigationBar->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MainWindow::event(QEvent* event)
|
|
|
|
|
{
|
|
|
|
|
//qDebug() << event->type();
|
|
|
|
|
if(event->type() == QEvent::Resize || event->type() == QEvent::Move)
|
|
|
|
|
{
|
|
|
|
|
//int nHeight = this->height() * 0.8;
|
|
|
|
|
int nY = (this->height() - m_funNavigationBar->height()) * 0.5;
|
|
|
|
|
m_funNavigationBar->setGeometry(0, nY, m_funNavigationBar->width(), m_funNavigationBar->height());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return QMainWindow::event(event);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::onSignal_funBtnClicked(QString strFun)
|
|
|
|
|
{
|
|
|
|
|
if(strFun == "DVIE")
|
|
|
|
|
ui->stackedWidget->setCurrentIndex(0);
|
|
|
|
|
else if(strFun == "TCC")
|
|
|
|
|
ui->stackedWidget->setCurrentIndex(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|