|
|
|
@ -36,6 +36,7 @@
|
|
|
|
|
#include "nmWxParaProperty.h"
|
|
|
|
|
|
|
|
|
|
#include "nmSubWndDemo.h"
|
|
|
|
|
#include "nmDataDemo.h"
|
|
|
|
|
|
|
|
|
|
#include "nmDataLogFile.h"
|
|
|
|
|
|
|
|
|
@ -58,6 +59,7 @@ nmSubWndDemo::nmSubWndDemo(QWidget *parent, QString sExt) :
|
|
|
|
|
m_pDataWell = zxCurWell;
|
|
|
|
|
}
|
|
|
|
|
m_sMdiWndType = s_MdiType_DataNum;
|
|
|
|
|
// m_analyzeData = new nmDataDemo();
|
|
|
|
|
setWindowTitle(tr("nmSubWndDemo"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -76,6 +78,7 @@ nmSubWndDemo::~nmSubWndDemo()
|
|
|
|
|
m_pWxDockTemp = NULL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
this->setTopDocksVisible(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmSubWndDemo::configWnd()
|
|
|
|
@ -205,20 +208,31 @@ void nmSubWndDemo::initUiDockPtys()
|
|
|
|
|
// 示例:演示增加Dock并且追加至程序主窗口
|
|
|
|
|
void nmSubWndDemo::initUiTop()
|
|
|
|
|
{
|
|
|
|
|
// TODO,不创建新的Dock
|
|
|
|
|
// 隐藏所有Dock
|
|
|
|
|
this->setTopDocksVisible(false);
|
|
|
|
|
// 创建新的Dock
|
|
|
|
|
iDockBaseWx* pDockWx = new iDockBaseWx(tr("TODO:Demo"));
|
|
|
|
|
Q_ASSERT (NULL != pDockWx);
|
|
|
|
|
QListWidget* pListWx = new QListWidget();
|
|
|
|
|
Q_ASSERT (NULL != pListWx);
|
|
|
|
|
pDockWx->setWidget(pListWx);
|
|
|
|
|
m_pListWxTemp = pListWx;
|
|
|
|
|
pDockWx->setMinimumWidth(_resoSizeW(200));
|
|
|
|
|
emit sigAppendDock2Main(pDockWx, Qt::LeftDockWidgetArea);
|
|
|
|
|
m_pWxDockTemp = pDockWx;
|
|
|
|
|
return;
|
|
|
|
|
// 基础参数Dock
|
|
|
|
|
{
|
|
|
|
|
iDockBaseWx* pDockWx = new iDockBaseWx(tr("TODO:Demo"));
|
|
|
|
|
Q_ASSERT (NULL != pDockWx);
|
|
|
|
|
QListWidget* pListWx = new QListWidget();
|
|
|
|
|
Q_ASSERT (NULL != pListWx);
|
|
|
|
|
pDockWx->setWidget(pListWx);
|
|
|
|
|
m_pListWxTemp = pListWx;
|
|
|
|
|
pDockWx->setMinimumWidth(_resoSizeW(200));
|
|
|
|
|
emit sigAppendDock2Main(pDockWx, Qt::LeftDockWidgetArea);
|
|
|
|
|
m_pWxDockTemp = pDockWx;
|
|
|
|
|
}
|
|
|
|
|
// {
|
|
|
|
|
// iDockBaseWx* pDockWx = new iDockBaseWx(tr("TODO:Demo"));
|
|
|
|
|
// Q_ASSERT (NULL != pDockWx);
|
|
|
|
|
// QListWidget* pListWx = new QListWidget();
|
|
|
|
|
// Q_ASSERT (NULL != pListWx);
|
|
|
|
|
// pDockWx->setWidget(pListWx);
|
|
|
|
|
// m_pListWxTemp = pListWx;
|
|
|
|
|
// pDockWx->setMinimumWidth(_resoSizeW(200));
|
|
|
|
|
// emit sigAppendDock2Main(pDockWx, Qt::LeftDockWidgetArea);
|
|
|
|
|
// m_pWxDockTemp = pDockWx;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
@ -305,13 +319,6 @@ void nmSubWndDemo::finalDeals()
|
|
|
|
|
void nmSubWndDemo::onActivated()
|
|
|
|
|
{
|
|
|
|
|
#ifdef QT_DEBUG
|
|
|
|
|
// TODO,主程序的Dock操作
|
|
|
|
|
// 获取所有 Dock 视图
|
|
|
|
|
QList<QDockWidget*> dockWidgets = m_pMainWindow->findChildren<QDockWidget*>();
|
|
|
|
|
// TODO,遍历所有 Dock 视图并移除位于左侧的
|
|
|
|
|
foreach (QDockWidget* dock, dockWidgets) {
|
|
|
|
|
dock->hide();
|
|
|
|
|
}
|
|
|
|
|
// 当前窗体激活时,可以做些事情,比如把隐藏的Dock显示出来
|
|
|
|
|
if (NULL != m_pWxDockTemp) {
|
|
|
|
|
if (!m_pWxDockTemp->isVisible()) {
|
|
|
|
@ -561,19 +568,43 @@ void nmSubWndDemo::geologicalMapImport()
|
|
|
|
|
// 打开文件对话框选择图片文件
|
|
|
|
|
QString filePath = QFileDialog::getOpenFileName(nullptr, "选择图片文件", "", "Images (*.png *.xpm *.jpg)");
|
|
|
|
|
if (!filePath.isEmpty()) {
|
|
|
|
|
// 加载图片
|
|
|
|
|
QPixmap pixmap(filePath);
|
|
|
|
|
// if (!pixmap.isNull()) {
|
|
|
|
|
// // 创建标签并显示图片
|
|
|
|
|
// QLabel label;
|
|
|
|
|
// label.setPixmap(pixmap);
|
|
|
|
|
// label.show();
|
|
|
|
|
// }
|
|
|
|
|
m_pWxPlot->setBackgroundImg(pixmap);
|
|
|
|
|
// 画布 设置背景,并自适应宽高
|
|
|
|
|
ZxPlot* pPlot = m_pWxPlot->m_pPlot;
|
|
|
|
|
pPlot->setBkImgFile(filePath);
|
|
|
|
|
// QImage* pBkImg = pPlot->getBkImg();
|
|
|
|
|
// Q_ASSERT (NULL != pBkImg);
|
|
|
|
|
// int w = pBkImg->width();
|
|
|
|
|
// int h = pBkImg->height();
|
|
|
|
|
// pPlot->getMainAxisX()->setRangeMinMax(0, w, true);
|
|
|
|
|
// pPlot->getMainAxisY()->setRangeMinMax(0, h, true);
|
|
|
|
|
nmDataLogFile::getInstance()->writeLog(filePath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmSubWndDemo::setTopDocksVisible(bool visible)
|
|
|
|
|
{
|
|
|
|
|
// 获取主程序所有 Dock 视图
|
|
|
|
|
QList<QDockWidget*> dockWidgets = m_pMainWindow->findChildren<QDockWidget*>();
|
|
|
|
|
// 遍历所有 Dock 视图并移除位于左侧的
|
|
|
|
|
foreach (QDockWidget* dock, dockWidgets) {
|
|
|
|
|
if (visible) {
|
|
|
|
|
dock->show();
|
|
|
|
|
} else {
|
|
|
|
|
dock->hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmSubWndDemo::setAnalyzeData(nmDataDemo *newAnalyzeData)
|
|
|
|
|
{
|
|
|
|
|
m_pAnalyzeData = newAnalyzeData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nmDataDemo *nmSubWndDemo::analyzeData() const
|
|
|
|
|
{
|
|
|
|
|
return m_pAnalyzeData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmSubWndDemo::onConfirmClosing()
|
|
|
|
|
{
|
|
|
|
|
return iSubWndBaseAF::onConfirmClosing();
|
|
|
|
|