mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #587, form/component to modify multiple model properties
This commit is contained in:
43
src/blackgui/components/dbmodelmappingmodifycomponent.cpp
Normal file
43
src/blackgui/components/dbmodelmappingmodifycomponent.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/* Copyright (C) 2016
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "dbmodelmappingmodifycomponent.h"
|
||||
#include "ui_dbmodelmappingmodifycomponent.h"
|
||||
#include "dbmappingcomponent.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
CDbModelMappingModifyComponent::CDbModelMappingModifyComponent(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
CDbMappingComponentAware(parent),
|
||||
ui(new Ui::CDbModelMappingModifyComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
CDbModelMappingModifyComponent::~CDbModelMappingModifyComponent()
|
||||
{
|
||||
// void
|
||||
}
|
||||
|
||||
CPropertyIndexVariantMap CDbModelMappingModifyComponent::getValues() const
|
||||
{
|
||||
return (ui->editor_ModelMappingModify->getValues());
|
||||
}
|
||||
|
||||
void CDbModelMappingModifyComponent::setValue(const Simulation::CAircraftModel &model)
|
||||
{
|
||||
this->ui->editor_ModelMappingModify->setValue(model);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
55
src/blackgui/components/dbmodelmappingmodifycomponent.h
Normal file
55
src/blackgui/components/dbmodelmappingmodifycomponent.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* Copyright (C) 2016
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_COMPONENTS_DBMODELMAPPINGMODIFYCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_DBMODELMAPPINGMODIFYCOMPONENT_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "dbmappingcomponentaware.h"
|
||||
#include <QDialog>
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace Ui { class CDbModelMappingModifyComponent; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
/*!
|
||||
* Modify model fields as dialog
|
||||
*/
|
||||
class BLACKGUI_EXPORT CDbModelMappingModifyComponent :
|
||||
public QDialog,
|
||||
public CDbMappingComponentAware
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
explicit CDbModelMappingModifyComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CDbModelMappingModifyComponent();
|
||||
|
||||
//! Get the values
|
||||
BlackMisc::CPropertyIndexVariantMap getValues() const;
|
||||
|
||||
//! Set default values
|
||||
void setValue(const BlackMisc::Simulation::CAircraftModel &model);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbModelMappingModifyComponent> ui;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
#endif // guard
|
||||
107
src/blackgui/components/dbmodelmappingmodifycomponent.ui
Normal file
107
src/blackgui/components/dbmodelmappingmodifycomponent.ui
Normal file
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CDbModelMappingModifyComponent</class>
|
||||
<widget class="QDialog" name="CDbModelMappingModifyComponent">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>320</width>
|
||||
<height>200</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Model modify form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="BlackGui::Editors::CModelMappingModifyForm" name="editor_ModelMappingModify">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>75</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="vs_ModelMappingModify">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="bb_ModelMappingModiyForm">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CModelMappingModifyForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/modelmappingmodifyform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>bb_ModelMappingModiyForm</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>CDbModelMappingModifyComponent</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>bb_ModelMappingModiyForm</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>CDbModelMappingModifyComponent</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user