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