mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T717, model browser
This commit is contained in:
committed by
Mat Sutcliffe
parent
838e41051c
commit
af1b933e5c
@@ -8,6 +8,22 @@
|
||||
|
||||
#include "modelbrowsercomponent.h"
|
||||
#include "ui_modelbrowsercomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackcore/context/contextownaircraft.h"
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
#include "blackmisc/aviation/heading.h"
|
||||
#include "blackmisc/pq/angle.h"
|
||||
#include "blackmisc/pq/speed.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackGui::Editors;
|
||||
using namespace BlackGui::Views;
|
||||
using namespace BlackCore;
|
||||
using namespace BlackCore::Context;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -18,11 +34,177 @@ namespace BlackGui
|
||||
ui(new Ui::CModelBrowserComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->tw_Tab->setCurrentIndex(0);
|
||||
ui->tvp_AircraftModels->acceptClickSelection(false);
|
||||
ui->tvp_AircraftModels->acceptDoubleClickSelection(true);
|
||||
|
||||
const CLength relDistance(40.0, CLengthUnit::m());
|
||||
ui->editor_RelativePosition->setDistance(relDistance);
|
||||
|
||||
connect(ui->pb_SetRelativePosition, &QPushButton::released, this, &CModelBrowserComponent::onSetRelativePosition, Qt::QueuedConnection);
|
||||
connect(ui->pb_LoadModelSet, &QPushButton::released, this, &CModelBrowserComponent::loadModelSet, Qt::QueuedConnection);
|
||||
connect(ui->pb_Display, &QPushButton::released, this, &CModelBrowserComponent::display, Qt::QueuedConnection);
|
||||
connect(ui->pb_Parts, &QPushButton::released, this, &CModelBrowserComponent::selectTabParts);
|
||||
connect(ui->pb_Remove, &QPushButton::released, this, &CModelBrowserComponent::remove, Qt::QueuedConnection);
|
||||
connect(ui->editor_Coordinate, &CCoordinateForm::changedCoordinate, this, &CModelBrowserComponent::onSetAbsolutePosition, Qt::QueuedConnection);
|
||||
connect(ui->editor_Pbh, &CPbhsForm::changeValues, this, &CModelBrowserComponent::onSetPBH, Qt::QueuedConnection);
|
||||
connect(ui->editor_AircraftParts, &CAircraftPartsForm::changeAircraftParts, this, &CModelBrowserComponent::onSetParts, Qt::QueuedConnection);
|
||||
connect(ui->tvp_AircraftModels, &CAircraftModelView::objectDoubleClicked, this, &CModelBrowserComponent::onModelDblClicked, Qt::QueuedConnection);
|
||||
|
||||
connect(ui->cb_OverrideCG, &QCheckBox::clicked, this, &CModelBrowserComponent::onCGChecked);
|
||||
connect(ui->cb_UseCG, &QCheckBox::clicked, this, &CModelBrowserComponent::onCGChecked);
|
||||
|
||||
this->loadModelSet();
|
||||
this->onSetRelativePosition();
|
||||
}
|
||||
|
||||
CModelBrowserComponent::~CModelBrowserComponent()
|
||||
{
|
||||
// void
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::close()
|
||||
{
|
||||
this->remove();
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::onSetRelativePosition()
|
||||
{
|
||||
if (!this->hasContexts()) { return; }
|
||||
const CAircraftSituation s = sGui->getIContextOwnAircraft()->getOwnAircraftSituation();
|
||||
ui->editor_RelativePosition->setOriginCoordinate(s);
|
||||
const CCoordinateGeodetic rel = ui->editor_RelativePosition->getRelativeCoordinate(s.getHeading());
|
||||
ui->editor_RelativePosition->displayInfo(rel);
|
||||
m_situation.setPosition(rel);
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::onSetAbsolutePosition()
|
||||
{
|
||||
m_situation.setPosition(ui->editor_Coordinate->getCoordinate());
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::onSetPBH()
|
||||
{
|
||||
ui->cb_UsePBH->setChecked(true);
|
||||
if (!this->hasContexts()) { return; }
|
||||
this->updatePartsAndPBH(true, false);
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::onSetParts()
|
||||
{
|
||||
ui->cb_UseParts->setChecked(true);
|
||||
if (!this->hasContexts()) { return; }
|
||||
this->updatePartsAndPBH(false, true);
|
||||
}
|
||||
|
||||
CAircraftParts CModelBrowserComponent::getParts() const
|
||||
{
|
||||
return ui->editor_AircraftParts->getAircraftPartsFromGui();
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::updatePartsAndPBH(bool setPbh, bool setParts)
|
||||
{
|
||||
if (!this->hasContexts()) { return; }
|
||||
CAircraftParts parts = CAircraftParts::null();
|
||||
if (setParts) { parts = this->getParts(); }
|
||||
|
||||
if (setPbh)
|
||||
{
|
||||
ui->editor_Pbh->updateSituation(m_situation);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_situation.setZeroPBHandGs();
|
||||
}
|
||||
|
||||
sGui->getISimulator()->testSendSituationAndParts(ISimulator::getTestCallsign(), m_situation, parts);
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::onModelDblClicked(const CVariant &object)
|
||||
{
|
||||
Q_UNUSED(object);
|
||||
this->display();
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::display()
|
||||
{
|
||||
if (!this->hasContexts()) { return; }
|
||||
CAircraftModel model = ui->tvp_AircraftModels->selectedObject();
|
||||
if (!model.hasModelString()) { return; }
|
||||
|
||||
this->remove(); // only 1 model at a time
|
||||
|
||||
if (ui->cb_OverrideCG->isChecked())
|
||||
{
|
||||
CLength cg;
|
||||
cg.parseFromString(ui->le_CG->text(), CPqString::SeparatorBestGuess);
|
||||
if (!cg.isNull()) { model.setCG(cg); }
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->le_CG->setText(model.getCG().valueRoundedWithUnit(CLengthUnit::ft(), 1));
|
||||
}
|
||||
|
||||
m_situation.setZeroPBHandGs();
|
||||
if (ui->cb_UsePBH->isChecked())
|
||||
{
|
||||
ui->editor_Pbh->updateSituation(m_situation);
|
||||
}
|
||||
|
||||
if (ui->cb_UseParts->isChecked())
|
||||
{
|
||||
const CAircraftParts parts = ui->editor_AircraftParts->getAircraftPartsFromGui();
|
||||
if (!parts.isNull()) { m_aircraft.setParts(parts); }
|
||||
}
|
||||
|
||||
m_aircraft.setModel(model);
|
||||
m_aircraft.setCallsign(ISimulator::getTestCallsign());
|
||||
m_aircraft.setSituation(m_situation);
|
||||
|
||||
ui->le_ModelInfo->setText(model.getModelStringAndDbKey());
|
||||
ui->le_Info->setText(m_situation.toQString(true));
|
||||
|
||||
sGui->getIContextSimulator()->testRemoteAircraft(m_aircraft, true);
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::remove()
|
||||
{
|
||||
ui->le_ModelInfo->clear();
|
||||
ui->le_Info->clear();
|
||||
|
||||
if (!this->hasContexts()) { return; }
|
||||
if (!m_aircraft.hasCallsign()) { return; }
|
||||
sGui->getIContextSimulator()->testRemoteAircraft(m_aircraft, false);
|
||||
m_aircraft = CSimulatedAircraft(); // reset
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::loadModelSet()
|
||||
{
|
||||
if (!this->hasContexts()) { return; }
|
||||
|
||||
const CAircraftModelList modelSet = sGui->getIContextSimulator()->getModelSet();
|
||||
ui->tvp_AircraftModels->updateContainerMaybeAsync(modelSet);
|
||||
const QString sim = sGui->getIContextSimulator()->getSimulatorPluginInfo().getSimulatorInfo().toQString(true);
|
||||
ui->lbl_ModelSetInfo->setText(QStringLiteral("'%1' model set with %2 models").arg(sim).arg(modelSet.sizeInt()));
|
||||
}
|
||||
|
||||
bool CModelBrowserComponent::hasContexts() const
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return false; }
|
||||
if (!sGui->getIContextOwnAircraft()) { return false; }
|
||||
if (!sGui->getIContextSimulator()) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::selectTabParts()
|
||||
{
|
||||
ui->tw_Tab->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
void CModelBrowserComponent::onCGChecked(bool checked)
|
||||
{
|
||||
if (ui->cb_OverrideCG->isChecked() != checked) { ui->cb_OverrideCG->setChecked(true); }
|
||||
if (ui->cb_UseCG->isChecked() != checked) { ui->cb_UseCG->setChecked(true); }
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
namespace Ui { class CModelBrowserComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -31,8 +35,29 @@ namespace BlackGui
|
||||
//! Destructor
|
||||
virtual ~CModelBrowserComponent() override;
|
||||
|
||||
//! Browser has been closed
|
||||
void close();
|
||||
|
||||
private:
|
||||
void onSetRelativePosition();
|
||||
void onSetAbsolutePosition();
|
||||
void onSetPBH();
|
||||
void onSetParts();
|
||||
void onModelDblClicked(const BlackMisc::CVariant &object);
|
||||
|
||||
BlackMisc::Aviation::CAircraftParts getParts() const;
|
||||
|
||||
void display();
|
||||
void remove();
|
||||
void loadModelSet();
|
||||
bool hasContexts() const;
|
||||
void selectTabParts();
|
||||
void onCGChecked(bool checked);
|
||||
void updatePartsAndPBH(bool setPbh, bool setParts);
|
||||
|
||||
QScopedPointer <Ui::CModelBrowserComponent> ui;
|
||||
BlackMisc::Aviation::CAircraftSituation m_situation;
|
||||
BlackMisc::Simulation::CSimulatedAircraft m_aircraft;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -6,14 +6,339 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>480</height>
|
||||
<width>343</width>
|
||||
<height>523</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Model browser</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_ModelBrowser" stretch="0,0">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tw_Tab">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tb_ModelAndPosition">
|
||||
<attribute name="title">
|
||||
<string>Model and position</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_Position">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_Model">
|
||||
<property name="title">
|
||||
<string>Model</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="BlackGui::Views::CAircraftModelView" name="tvp_AircraftModels">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="wi_LoadModels" native="true">
|
||||
<layout class="QHBoxLayout" name="hl_LoadModels">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbl_ModelSetInfo">
|
||||
<property name="text">
|
||||
<string>Model set info</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QPushButton" name="pb_LoadModelSet">
|
||||
<property name="text">
|
||||
<string>load model set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_Parts">
|
||||
<property name="title">
|
||||
<string>Use</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="cb_UseParts">
|
||||
<property name="text">
|
||||
<string>use parts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="cb_UsePBH">
|
||||
<property name="text">
|
||||
<string>use PBH</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="cb_UseCG">
|
||||
<property name="text">
|
||||
<string>use CG (vert.offset)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pb_Parts">
|
||||
<property name="text">
|
||||
<string>parts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_RelativePosition">
|
||||
<property name="title">
|
||||
<string>Relative position</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="BlackGui::Editors::CRelativeAircraftPosition" name="editor_RelativePosition"/>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QPushButton" name="pb_SetRelativePosition">
|
||||
<property name="text">
|
||||
<string>set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_AbsolutePosition">
|
||||
<property name="title">
|
||||
<string>Absolute position</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="BlackGui::Editors::CCoordinateForm" name="editor_Coordinate">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_PartsAndMisc">
|
||||
<attribute name="title">
|
||||
<string>PBH/Parts/CG</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_PartsAndMisc">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_Pbh">
|
||||
<property name="title">
|
||||
<string>PBH</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_Pbh">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Editors::CPbhsForm" name="editor_Pbh">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Parts</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="BlackGui::Editors::CAircraftPartsForm" name="editor_AircraftParts">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>125</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_CG">
|
||||
<property name="title">
|
||||
<string>CG/vertical offset</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="le_CG"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_OverrideCG">
|
||||
<property name="text">
|
||||
<string>override CG</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="wi_DisplayAndInfo" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="le_Info">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="le_ModelInfo">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_Remove">
|
||||
<property name="text">
|
||||
<string>remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pb_Display">
|
||||
<property name="text">
|
||||
<string>display</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CRelativeAircraftPosition</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/relativeaircraftposition.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CCoordinateForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/coordinateform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Views::CAircraftModelView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/aircraftmodelview.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CAircraftPartsForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/aircraftpartsform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Editors::CPbhsForm</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/editors/pbhsform.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tw_Tab</tabstop>
|
||||
<tabstop>tvp_AircraftModels</tabstop>
|
||||
<tabstop>pb_LoadModelSet</tabstop>
|
||||
<tabstop>cb_UseParts</tabstop>
|
||||
<tabstop>cb_UsePBH</tabstop>
|
||||
<tabstop>cb_UseCG</tabstop>
|
||||
<tabstop>pb_SetRelativePosition</tabstop>
|
||||
<tabstop>le_Info</tabstop>
|
||||
<tabstop>le_ModelInfo</tabstop>
|
||||
<tabstop>pb_Remove</tabstop>
|
||||
<tabstop>pb_Display</tabstop>
|
||||
<tabstop>le_CG</tabstop>
|
||||
<tabstop>cb_OverrideCG</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "modelbrowserdialog.h"
|
||||
#include "ui_modelbrowserdialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -24,5 +25,18 @@ namespace BlackGui
|
||||
{
|
||||
// void;
|
||||
}
|
||||
|
||||
bool CModelBrowserDialog::event(QEvent *event)
|
||||
{
|
||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
||||
return QDialog::event(event);
|
||||
}
|
||||
|
||||
void CModelBrowserDialog::done(int r)
|
||||
{
|
||||
ui->comp_ModelBrowser->close();
|
||||
QDialog::done(r);
|
||||
}
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -32,6 +32,13 @@ namespace BlackGui
|
||||
//! Destructor
|
||||
virtual ~CModelBrowserDialog() override;
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
//! \copydoc QDialog::closeEvent
|
||||
virtual void done(int r) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CModelBrowserDialog> ui;
|
||||
};
|
||||
|
||||
@@ -6,14 +6,32 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>640</width>
|
||||
<height>480</height>
|
||||
<width>675</width>
|
||||
<height>675</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>600</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Model browser</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="vl_ModelBrowser">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CModelBrowserComponent" name="comp_ModelBrowser"/>
|
||||
</item>
|
||||
@@ -23,7 +41,7 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user