FEM: Abaqus writer pref ui, some changes proposed by werner
- ui class name matches with file name - class is not derived from ui but uses it as a private member - https://forum.freecadweb.org/viewtopic.php?f=10&t=25381
This commit is contained in:
committed by
Yorik van Havre
parent
a3a9ed66a2
commit
e94aa1ce78
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FemGui::DlgSettingsFemExportAbaqusImp</class>
|
||||
<widget class="QWidget" name="FemGui::DlgSettingsFemExportAbaqusImp">
|
||||
<class>FemGui::DlgSettingsFemExportAbaqus</class>
|
||||
<widget class="QWidget" name="FemGui::DlgSettingsFemExportAbaqus">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
||||
@@ -27,14 +27,15 @@
|
||||
|
||||
#include "Gui/Application.h"
|
||||
#include "DlgSettingsFemExportAbaqusImp.h"
|
||||
#include "ui_DlgSettingsFemExportAbaqus.h"
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace FemGui;
|
||||
|
||||
DlgSettingsFemExportAbaqusImp::DlgSettingsFemExportAbaqusImp( QWidget* parent )
|
||||
: PreferencePage( parent )
|
||||
: PreferencePage( parent ), ui(new Ui_DlgSettingsFemExportAbaqus)
|
||||
{
|
||||
this->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -43,26 +44,27 @@ DlgSettingsFemExportAbaqusImp::DlgSettingsFemExportAbaqusImp( QWidget* parent )
|
||||
DlgSettingsFemExportAbaqusImp::~DlgSettingsFemExportAbaqusImp()
|
||||
{
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DlgSettingsFemExportAbaqusImp::saveSettings()
|
||||
{
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus");
|
||||
hGrp->SetInt("AbaqusElementChoice", comboBoxElemChoiceParam->currentIndex());
|
||||
hGrp->SetInt("AbaqusElementChoice", ui->comboBoxElemChoiceParam->currentIndex());
|
||||
|
||||
comboBoxElemChoiceParam->onSave();
|
||||
checkBoxWriteGroups->onSave();
|
||||
ui->comboBoxElemChoiceParam->onSave();
|
||||
ui->checkBoxWriteGroups->onSave();
|
||||
}
|
||||
|
||||
void DlgSettingsFemExportAbaqusImp::loadSettings()
|
||||
{
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Fem/Abaqus");
|
||||
hGrp->SetInt("AbaqusElementChoice", comboBoxElemChoiceParam->currentIndex());
|
||||
hGrp->SetInt("AbaqusElementChoice", ui->comboBoxElemChoiceParam->currentIndex());
|
||||
|
||||
comboBoxElemChoiceParam->onRestore();
|
||||
checkBoxWriteGroups->onRestore();
|
||||
ui->comboBoxElemChoiceParam->onRestore();
|
||||
ui->checkBoxWriteGroups->onRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,9 +73,9 @@ void DlgSettingsFemExportAbaqusImp::loadSettings()
|
||||
void DlgSettingsFemExportAbaqusImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
int c_index = comboBoxElemChoiceParam->currentIndex();
|
||||
retranslateUi(this);
|
||||
comboBoxElemChoiceParam->setCurrentIndex(c_index);
|
||||
int c_index = ui->comboBoxElemChoiceParam->currentIndex();
|
||||
ui->retranslateUi(this);
|
||||
ui->comboBoxElemChoiceParam->setCurrentIndex(c_index);
|
||||
}
|
||||
else {
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
#ifndef FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
|
||||
#define FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
|
||||
|
||||
#include "ui_DlgSettingsFemExportAbaqus.h"
|
||||
#include <Gui/PropertyPage.h>
|
||||
|
||||
namespace FemGui {
|
||||
|
||||
class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsFemExportAbaqusImp
|
||||
class Ui_DlgSettingsFemExportAbaqus;
|
||||
class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -43,6 +43,9 @@ protected:
|
||||
void saveSettings();
|
||||
void loadSettings();
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui_DlgSettingsFemExportAbaqus* ui;
|
||||
};
|
||||
|
||||
} // namespace FemGui
|
||||
|
||||
Reference in New Issue
Block a user