修改窗口布局,处理方法模块显示在窗口右侧,不是对话框弹窗
修改插件模块,双击进入插件后,获取插件里面的QAction控件显示在Plugin ToolBar
This commit is contained in:
parent
3b32c2ed8e
commit
0e4a8b664a
|
|
@ -113,6 +113,7 @@ public:
|
||||||
QScrollArea *m_pDialogLayout;
|
QScrollArea *m_pDialogLayout;
|
||||||
PaiPushButton *m_pbtnRun;
|
PaiPushButton *m_pbtnRun;
|
||||||
QString m_CurrentSLFFileName;
|
QString m_CurrentSLFFileName;
|
||||||
|
QToolBar *m_toolBar_plugin = NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,11 @@ BEGIN_OSGGRAPHICS_NAMESPACE;
|
||||||
//关闭事件
|
//关闭事件
|
||||||
void CModuleParamers::closeEvent(QCloseEvent *event)
|
void CModuleParamers::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
|
if (m_toolBar_plugin)
|
||||||
|
{
|
||||||
|
m_toolBar_plugin->clear();
|
||||||
|
m_toolBar_plugin->hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//构造函数
|
//构造函数
|
||||||
|
|
|
||||||
|
|
@ -1350,8 +1350,27 @@ void WorkflowSceneManager::slotAddModule(const QString& moduleName)
|
||||||
// pai::objectmodel::PaiWorkflowDataModel* pWorkflow = pModuleConsole->m_pWorkflowDataModel;
|
// pai::objectmodel::PaiWorkflowDataModel* pWorkflow = pModuleConsole->m_pWorkflowDataModel;
|
||||||
// ::GetWorkflowConsole()->GetWorkflowWidget()->SetWorkflow(pWorkflow);
|
// ::GetWorkflowConsole()->GetWorkflowWidget()->SetWorkflow(pWorkflow);
|
||||||
}
|
}
|
||||||
|
// Plugin ToolBar工具栏
|
||||||
|
if (pModuleParamers->m_toolBar_plugin)
|
||||||
|
pModuleParamers->m_toolBar_plugin->hide();
|
||||||
|
|
||||||
if(amodule&&amodule->parDialog) {
|
if(amodule&&amodule->parDialog) {
|
||||||
|
|
||||||
|
if (pModuleParamers->m_toolBar_plugin->isHidden())
|
||||||
|
{
|
||||||
|
// 从插件里获取QAction 显示在Plugin ToolBar工具栏
|
||||||
|
pModuleParamers->m_toolBar_plugin->clear();
|
||||||
|
for (int i = 0; i < amodule->m_listAct.size(); i++)
|
||||||
|
{
|
||||||
|
QAction* pAct = amodule->m_listAct.at(i);
|
||||||
|
QString sicon = pAct->property("icon_v").toString();
|
||||||
|
QIcon imIcon(::GetImagePath() + sicon);
|
||||||
|
pAct->setIcon(imIcon);
|
||||||
|
pModuleParamers->m_toolBar_plugin->addAction(pAct);
|
||||||
|
}
|
||||||
|
pModuleParamers->m_toolBar_plugin->show();
|
||||||
|
}
|
||||||
|
|
||||||
QRect rt=amodule->parDialog->geometry();
|
QRect rt=amodule->parDialog->geometry();
|
||||||
pModuleParamers->m_pParameterEditor->setVisible(false);
|
pModuleParamers->m_pParameterEditor->setVisible(false);
|
||||||
pModuleParamers->m_pDialogLayout->setVisible(true);
|
pModuleParamers->m_pDialogLayout->setVisible(true);
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@ public:
|
||||||
struct LogType *pLogType;
|
struct LogType *pLogType;
|
||||||
struct ErrorInf *errorinf;
|
struct ErrorInf *errorinf;
|
||||||
QDialog *parDialog;
|
QDialog *parDialog;
|
||||||
|
QList<QAction*> m_listAct;
|
||||||
QStringList OriginInNames;
|
QStringList OriginInNames;
|
||||||
QStringList OriginOutNames;
|
QStringList OriginOutNames;
|
||||||
bool InitModule(QWidget*p=NULL);
|
bool InitModule(QWidget*p=NULL);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
#include "ObjWelllogRound.h"
|
#include "ObjWelllogRound.h"
|
||||||
#include "ParameterItem.h"
|
#include "ParameterItem.h"
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
#include <QAction>
|
||||||
// void OSGFRAMEWORK_EXPORT AppendConsole(pai::log::Priority priority,const QString &output);
|
// void OSGFRAMEWORK_EXPORT AppendConsole(pai::log::Priority priority,const QString &output);
|
||||||
|
|
||||||
using namespace pai::module;
|
using namespace pai::module;
|
||||||
|
|
@ -1231,6 +1232,8 @@ bool PELibraryModule::validate()
|
||||||
bool PELibraryModule::InitModule(QWidget*pWidget)
|
bool PELibraryModule::InitModule(QWidget*pWidget)
|
||||||
{
|
{
|
||||||
typedef QDialog *(* LPDDIALOG)(QWidget*pWidget);
|
typedef QDialog *(* LPDDIALOG)(QWidget*pWidget);
|
||||||
|
typedef void* (*LPD_ACTION_FUNC)(int* count);
|
||||||
|
|
||||||
typedef int (* LPFNDLLFUNC)();
|
typedef int (* LPFNDLLFUNC)();
|
||||||
LPFNDLLFUNC lpfnDllFunc,lpfnInitDllFunc;
|
LPFNDLLFUNC lpfnDllFunc,lpfnInitDllFunc;
|
||||||
LPDDIALOG m_parDialog;
|
LPDDIALOG m_parDialog;
|
||||||
|
|
@ -1290,6 +1293,19 @@ bool PELibraryModule::InitModule(QWidget*pWidget)
|
||||||
if(m_parDialog) {
|
if(m_parDialog) {
|
||||||
if(errorinf) errorinf->ErrorNo=0;
|
if(errorinf) errorinf->ErrorNo=0;
|
||||||
parDialog=m_parDialog(pWidget);
|
parDialog=m_parDialog(pWidget);
|
||||||
|
|
||||||
|
LPD_ACTION_FUNC ACT_Func = (LPD_ACTION_FUNC)Methodlib.resolve("getAction_CApi");
|
||||||
|
if (ACT_Func)
|
||||||
|
{
|
||||||
|
int ncount = 0;
|
||||||
|
QAction** actArr = (QAction**)ACT_Func(&ncount);
|
||||||
|
for (int i = 0; i < ncount; i++)
|
||||||
|
{
|
||||||
|
QAction* pAct = actArr[i];
|
||||||
|
QString s = pAct->property("icon_v").toString();
|
||||||
|
m_listAct << actArr[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
if(errorinf) {
|
if(errorinf) {
|
||||||
if(errorinf->ErrorNo<0) {
|
if(errorinf->ErrorNo<0) {
|
||||||
if(parDialog) {
|
if(parDialog) {
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ SOURCES += \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
mainwindowcurve.cpp \
|
mainwindowcurve.cpp \
|
||||||
|
mainwindowsplitter.cpp \
|
||||||
newheaddialog.cpp \
|
newheaddialog.cpp \
|
||||||
preqtablewidget.cpp \
|
preqtablewidget.cpp \
|
||||||
qmycustomplot.cpp \
|
qmycustomplot.cpp \
|
||||||
|
|
@ -137,6 +138,7 @@ HEADERS += \
|
||||||
fracsel.h \
|
fracsel.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
mainwindowcurve.h \
|
mainwindowcurve.h \
|
||||||
|
mainwindowsplitter.h \
|
||||||
newheaddialog.h \
|
newheaddialog.h \
|
||||||
preqtablewidget.h \
|
preqtablewidget.h \
|
||||||
qmycustomplot.h \
|
qmycustomplot.h \
|
||||||
|
|
@ -166,6 +168,7 @@ FORMS += \
|
||||||
interfaceWidget.ui \
|
interfaceWidget.ui \
|
||||||
mainwindow.ui \
|
mainwindow.ui \
|
||||||
mainwindowcurve.ui \
|
mainwindowcurve.ui \
|
||||||
|
mainwindowsplitter.ui \
|
||||||
newheaddialog.ui \
|
newheaddialog.ui \
|
||||||
qtprojectwidgets.ui
|
qtprojectwidgets.ui
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@
|
||||||
#include "TxtEditorDlg.h"
|
#include "TxtEditorDlg.h"
|
||||||
#include "ObjWell.h"
|
#include "ObjWell.h"
|
||||||
#include "wellloginformation.h"
|
#include "wellloginformation.h"
|
||||||
|
#include "mainwindowsplitter.h"
|
||||||
|
|
||||||
using namespace pai::gui;
|
using namespace pai::gui;
|
||||||
//以下参数从配置文件读取
|
//以下参数从配置文件读取
|
||||||
int g_iIndex = 0;
|
int g_iIndex = 0;
|
||||||
|
|
@ -338,6 +340,11 @@ void MainWindow::s_Open()
|
||||||
|
|
||||||
void MainWindow::s_SaveProject()
|
void MainWindow::s_SaveProject()
|
||||||
{
|
{
|
||||||
|
QWidget * pMyWidget = CallPlugin::getInstance()->getPluginWidget(DEMO_PLUGIN, (QWidget *)this);
|
||||||
|
if (pMyWidget != nullptr)
|
||||||
|
{
|
||||||
|
pMyWidget->show();
|
||||||
|
}
|
||||||
// //加载插件显示
|
// //加载插件显示
|
||||||
// QWidget * pMyWidget = CallPlugin::getInstance()->getPluginWidget(PLUGINUNIT, (QWidget *)this);
|
// QWidget * pMyWidget = CallPlugin::getInstance()->getPluginWidget(PLUGINUNIT, (QWidget *)this);
|
||||||
// if (pMyWidget != nullptr)
|
// if (pMyWidget != nullptr)
|
||||||
|
|
@ -394,11 +401,14 @@ void MainWindow::s_showView()
|
||||||
tr("多井图文件(*.json)"));
|
tr("多井图文件(*.json)"));
|
||||||
if (fileFull.isEmpty())
|
if (fileFull.isEmpty())
|
||||||
{
|
{
|
||||||
|
MainWindowSplitter* mainSplitter = new MainWindowSplitter();
|
||||||
|
mainSplitter->setSplitterWidget(m_projectWidgets);
|
||||||
|
m_centerWidgets->addTab(mainSplitter, "解释视图");
|
||||||
//----
|
//----
|
||||||
MainWindowCurve *mainWindowCurve = new MainWindowCurve();//中间工作区
|
// MainWindowCurve *mainWindowCurve = new MainWindowCurve();//中间工作区
|
||||||
// 左侧树
|
// // 左侧树
|
||||||
mainWindowCurve->m_leftWidgets = m_projectWidgets;
|
// mainWindowCurve->m_leftWidgets = m_projectWidgets;
|
||||||
m_centerWidgets->addTab(mainWindowCurve, "解释视图");
|
// m_centerWidgets->addTab(mainWindowCurve, "解释视图");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -406,10 +416,16 @@ void MainWindow::s_showView()
|
||||||
QString fileName = fileInfo.fileName(); // 获取文件名
|
QString fileName = fileInfo.fileName(); // 获取文件名
|
||||||
|
|
||||||
//----
|
//----
|
||||||
MainWindowCurve *mainWindowCurve = new MainWindowCurve();//中间工作区
|
//MainWindowCurve *mainWindowCurve = new MainWindowCurve();//中间工作区
|
||||||
// 左侧树
|
//// 左侧树
|
||||||
mainWindowCurve->m_leftWidgets = m_projectWidgets;
|
//mainWindowCurve->m_leftWidgets = m_projectWidgets;
|
||||||
m_centerWidgets->addTab(mainWindowCurve, fileName);
|
//m_centerWidgets->addTab(mainWindowCurve, fileName);
|
||||||
|
|
||||||
|
MainWindowSplitter* mainSplitter = new MainWindowSplitter();
|
||||||
|
mainSplitter->setSplitterWidget(m_projectWidgets);
|
||||||
|
m_centerWidgets->addTab(mainSplitter, fileName);
|
||||||
|
|
||||||
|
MainWindowCurve *mainWindowCurve = mainSplitter->getMainWindowCurve();
|
||||||
mainWindowCurve->Open(fileFull);
|
mainWindowCurve->Open(fileFull);
|
||||||
|
|
||||||
//QFuture<void> future = QtConcurrent::run(std::bind(&MainWindowCurve::s_Open, mainWindowCurve, fileFull));
|
//QFuture<void> future = QtConcurrent::run(std::bind(&MainWindowCurve::s_Open, mainWindowCurve, fileFull));
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include "LogModuleParamers.h"
|
#include "LogModuleParamers.h"
|
||||||
#include "LogModuleConsole.h"
|
#include "LogModuleConsole.h"
|
||||||
#include "DepPairs.h"
|
#include "DepPairs.h"
|
||||||
|
#include "mainwindowsplitter.h"
|
||||||
|
|
||||||
extern int g_iOneWidth; //道宽
|
extern int g_iOneWidth; //道宽
|
||||||
extern QString g_prjname;
|
extern QString g_prjname;
|
||||||
|
|
@ -34,6 +35,8 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
m_pParentWin = qobject_cast<MainWindowSplitter*>(parent);
|
||||||
|
|
||||||
QtCommonClass *qtCommon = new QtCommonClass(this);
|
QtCommonClass *qtCommon = new QtCommonClass(this);
|
||||||
m_strUuid = qtCommon->getUUid();
|
m_strUuid = qtCommon->getUUid();
|
||||||
|
|
||||||
|
|
@ -41,6 +44,7 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
|
||||||
addToolBar(Qt::LeftToolBarArea, ui->toolBar);
|
addToolBar(Qt::LeftToolBarArea, ui->toolBar);
|
||||||
addToolBar(Qt::RightToolBarArea, ui->toolBar_2);
|
addToolBar(Qt::RightToolBarArea, ui->toolBar_2);
|
||||||
addToolBar(Qt::RightToolBarArea, ui->toolBar_3);
|
addToolBar(Qt::RightToolBarArea, ui->toolBar_3);
|
||||||
|
addToolBar(Qt::RightToolBarArea, ui->toolBar_plugin);
|
||||||
|
|
||||||
//初始化工具栏
|
//初始化工具栏
|
||||||
initMainToolBar();
|
initMainToolBar();
|
||||||
|
|
@ -51,7 +55,7 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
|
||||||
//拼接
|
//拼接
|
||||||
initToolBar_3();
|
initToolBar_3();
|
||||||
ui->toolBar_3->hide();
|
ui->toolBar_3->hide();
|
||||||
|
ui->toolBar_plugin->hide();
|
||||||
//加载样式
|
//加载样式
|
||||||
loadStyle(":/qrc/qss/flatgray.css");
|
loadStyle(":/qrc/qss/flatgray.css");
|
||||||
|
|
||||||
|
|
@ -158,6 +162,11 @@ MainWindowCurve::~MainWindowCurve()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QToolBar * MainWindowCurve::getPluginToolBar()
|
||||||
|
{
|
||||||
|
return ui->toolBar_plugin;
|
||||||
|
}
|
||||||
|
|
||||||
//鼠标滚动,通知可视解释窗口
|
//鼠标滚动,通知可视解释窗口
|
||||||
void MainWindowCurve::s_mouseWheel(QWheelEvent *event)
|
void MainWindowCurve::s_mouseWheel(QWheelEvent *event)
|
||||||
{
|
{
|
||||||
|
|
@ -220,6 +229,7 @@ void MainWindowCurve::initMainToolBar()
|
||||||
ui->mainToolBar->addAction(m_executeDepthShiftAc);
|
ui->mainToolBar->addAction(m_executeDepthShiftAc);
|
||||||
ui->mainToolBar->addAction(m_joindepthAc);
|
ui->mainToolBar->addAction(m_joindepthAc);
|
||||||
ui->mainToolBar->addAction(m_ModuleOpenAc);
|
ui->mainToolBar->addAction(m_ModuleOpenAc);
|
||||||
|
|
||||||
// ui->mainToolBar->addAction(m_runAc);
|
// ui->mainToolBar->addAction(m_runAc);
|
||||||
// ui->mainToolBar->addAction(m_debugAc);
|
// ui->mainToolBar->addAction(m_debugAc);
|
||||||
// ui->mainToolBar->addAction(m_loadAc);
|
// ui->mainToolBar->addAction(m_loadAc);
|
||||||
|
|
@ -2298,41 +2308,7 @@ void MainWindowCurve::s_ExecuteMerge()
|
||||||
|
|
||||||
void MainWindowCurve::s_ModuleOpen()
|
void MainWindowCurve::s_ModuleOpen()
|
||||||
{
|
{
|
||||||
QString strSlfName = "";
|
m_pParentWin->setModuleOpenOrClose();
|
||||||
QString strLeft = m_leftWidgets->getLeftTreeString();
|
|
||||||
if(strLeft.length() > 0)
|
|
||||||
{
|
|
||||||
QStringList list = strLeft.split("#@@#");//QString字符串分割函数
|
|
||||||
if (list.size() > 3)
|
|
||||||
{
|
|
||||||
strSlfName = list[0];
|
|
||||||
QString strWellName = list[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (strSlfName.isEmpty())
|
|
||||||
{
|
|
||||||
QMessageBox::information(nullptr, "提示", "请先选中待处理井次");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CModuleConsole* pModuleConsole = new pai::graphics::CModuleConsole();
|
|
||||||
CModuleParamers* pDialog = new CModuleParamers(pModuleConsole);//::CreatParamControlWidget();
|
|
||||||
SetWorkflowConsole(pModuleConsole);
|
|
||||||
pModuleConsole->g_mModuleParamers = pDialog;
|
|
||||||
pModuleConsole->m_pWorkflowDataModel = new CWellLogWorkflowDataModel();
|
|
||||||
pDialog->m_CurrentSLFFileName = strSlfName;
|
|
||||||
pDialog->CreatParamControlWidget();
|
|
||||||
|
|
||||||
QString subStr = strSlfName;
|
|
||||||
int startPos = strSlfName.indexOf("Logdata");
|
|
||||||
if (startPos>=0)
|
|
||||||
{
|
|
||||||
subStr = subStr.right(strSlfName.length() - startPos - 7);
|
|
||||||
}
|
|
||||||
pDialog->setWindowTitle(subStr);
|
|
||||||
|
|
||||||
pDialog->show();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//void MainWindowCurve::s_Open(QString fileFull)
|
//void MainWindowCurve::s_Open(QString fileFull)
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ struct SelectTableItem
|
||||||
QString m_strLineName="";
|
QString m_strLineName="";
|
||||||
QString m_strFormInfoType="";//类型:curve, wave
|
QString m_strFormInfoType="";//类型:curve, wave
|
||||||
};
|
};
|
||||||
|
class MainWindowSplitter;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindowCurve;
|
class MainWindowCurve;
|
||||||
|
|
@ -34,6 +35,7 @@ public:
|
||||||
explicit MainWindowCurve(QWidget *parent = nullptr);
|
explicit MainWindowCurve(QWidget *parent = nullptr);
|
||||||
~MainWindowCurve();
|
~MainWindowCurve();
|
||||||
|
|
||||||
|
QToolBar * getPluginToolBar();
|
||||||
private:
|
private:
|
||||||
Ui::MainWindowCurve *ui;
|
Ui::MainWindowCurve *ui;
|
||||||
|
|
||||||
|
|
@ -52,6 +54,8 @@ public slots:
|
||||||
void s_mouseWheel(QWheelEvent *event);
|
void s_mouseWheel(QWheelEvent *event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
MainWindowSplitter* m_pParentWin = NULL;
|
||||||
|
|
||||||
QString m_strUuid;
|
QString m_strUuid;
|
||||||
QStringList m_listWell;
|
QStringList m_listWell;
|
||||||
//当前选中数据表格
|
//当前选中数据表格
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
|
|
@ -30,7 +33,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>21</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
@ -79,6 +82,17 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QToolBar" name="toolBar_plugin">
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>toolBar_4</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>TopToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
||||||
76
logPlus/mainwindowsplitter.cpp
Normal file
76
logPlus/mainwindowsplitter.cpp
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
#include "mainwindowsplitter.h"
|
||||||
|
#include "ui_mainwindowsplitter.h"
|
||||||
|
#include "LogModuleParamers.h"
|
||||||
|
#include "LogModuleConsole.h"
|
||||||
|
|
||||||
|
MainWindowSplitter::MainWindowSplitter(QWidget *parent) :
|
||||||
|
QMainWindow(parent),
|
||||||
|
ui(new Ui::MainWindowSplitter)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindowSplitter::~MainWindowSplitter()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindowSplitter::setSplitterWidget(QtProjectWidgets *pWidgets)
|
||||||
|
{
|
||||||
|
m_mainWindowCurve = new MainWindowCurve(this);//中间工作区
|
||||||
|
// 左侧树
|
||||||
|
m_mainWindowCurve->m_leftWidgets = pWidgets;
|
||||||
|
m_PluginToolBar = m_mainWindowCurve->getPluginToolBar();
|
||||||
|
|
||||||
|
CModuleConsole* pModuleConsole = new pai::graphics::CModuleConsole();
|
||||||
|
CModuleParamers* pDialog = new CModuleParamers(pModuleConsole);//::CreatParamControlWidget();
|
||||||
|
SetWorkflowConsole(pModuleConsole);
|
||||||
|
pModuleConsole->g_mModuleParamers = pDialog;
|
||||||
|
pModuleConsole->m_pWorkflowDataModel = new CWellLogWorkflowDataModel();
|
||||||
|
//pDialog->m_CurrentSLFFileName = strSlfName;
|
||||||
|
pDialog->m_toolBar_plugin = m_PluginToolBar;
|
||||||
|
pDialog->CreatParamControlWidget();
|
||||||
|
|
||||||
|
//QString subStr = strSlfName;
|
||||||
|
//int startPos = strSlfName.indexOf("Logdata");
|
||||||
|
//if (startPos >= 0)
|
||||||
|
//{
|
||||||
|
// subStr = subStr.right(strSlfName.length() - startPos - 7);
|
||||||
|
//}
|
||||||
|
//pDialog->setWindowTitle(subStr);
|
||||||
|
|
||||||
|
//pDialog->show();
|
||||||
|
|
||||||
|
m_pVSplitter = new QSplitter(Qt::Horizontal);
|
||||||
|
|
||||||
|
m_pVSplitter->addWidget(m_mainWindowCurve);
|
||||||
|
m_pVSplitter->addWidget(pDialog);
|
||||||
|
|
||||||
|
setCentralWidget(m_pVSplitter);
|
||||||
|
|
||||||
|
QList<int> sizes;
|
||||||
|
sizes << this->width() << 0;
|
||||||
|
m_pVSplitter->setSizes(sizes);//默认隐藏左侧多井图窗口
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindowSplitter::setModuleOpenOrClose()
|
||||||
|
{
|
||||||
|
QList<int> sizes;
|
||||||
|
if (m_pVSplitter->widget(1)->width()) {
|
||||||
|
sizes << width() << 0;
|
||||||
|
if (m_PluginToolBar)
|
||||||
|
m_PluginToolBar->hide();
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sizes << width() - 450 << 450;
|
||||||
|
}
|
||||||
|
m_pVSplitter->setSizes(sizes);//默认隐藏左侧多井图窗口
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindowCurve* MainWindowSplitter::getMainWindowCurve()
|
||||||
|
{
|
||||||
|
return m_mainWindowCurve;
|
||||||
|
}
|
||||||
47
logPlus/mainwindowsplitter.h
Normal file
47
logPlus/mainwindowsplitter.h
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
#ifndef MainWindowSplitter_H
|
||||||
|
#define MainWindowSplitter_H
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include "mainwindowcurve.h"
|
||||||
|
#include "qtprojectwidgets.h"
|
||||||
|
|
||||||
|
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class MainWindowSplitter;
|
||||||
|
}
|
||||||
|
|
||||||
|
class MainWindowSplitter : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MainWindowSplitter(QWidget *parent = nullptr);
|
||||||
|
~MainWindowSplitter();
|
||||||
|
|
||||||
|
void setSplitterWidget(QtProjectWidgets *pWidgets);
|
||||||
|
|
||||||
|
void setModuleOpenOrClose();
|
||||||
|
|
||||||
|
MainWindowCurve* getMainWindowCurve();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::MainWindowSplitter *ui;
|
||||||
|
MainWindowCurve *m_mainWindowCurve = NULL;
|
||||||
|
QSplitter* m_pVSplitter = NULL;
|
||||||
|
QToolBar* m_PluginToolBar = NULL;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
QtProjectWidgets *m_leftWidgets = NULL; //左侧工程区
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MainWindowSplitter_H
|
||||||
22
logPlus/mainwindowsplitter.ui
Normal file
22
logPlus/mainwindowsplitter.ui
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindowSplitter</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindowSplitter">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<layout class="QGridLayout" name="gridLayout"/>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Loading…
Reference in New Issue
Block a user