mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
refs #638, allow to select model in own model set for forms (double click)
This commit is contained in:
@@ -73,6 +73,8 @@ namespace BlackGui
|
||||
connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, this, &CDbMappingComponent::ps_tabIndexChanged);
|
||||
connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, ui->comp_ModelMatcher , &CModelMatcherComponent::tabIndexChanged);
|
||||
|
||||
connect(ui->comp_OwnModelSet->view(), &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected);
|
||||
|
||||
// how to display forms
|
||||
ui->editor_AircraftIcao->setSelectOnly();
|
||||
ui->editor_Distributor->setSelectOnly();
|
||||
@@ -82,6 +84,10 @@ namespace BlackGui
|
||||
this->ui->tw_ModelsToBeMapped->setTabIcon(TabOwnModels, CIcons::appModels16());
|
||||
this->ui->comp_StashAircraft->view()->setCustomMenu(new CApplyDbDataMenu(this));
|
||||
|
||||
// custom menu
|
||||
this->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(this, &CDbMappingComponent::customContextMenuRequested, this, &CDbMappingComponent::ps_onCustomContextMenu);
|
||||
|
||||
// vPilot
|
||||
this->initVPilotLoading();
|
||||
}
|
||||
@@ -137,6 +143,8 @@ namespace BlackGui
|
||||
{
|
||||
if (!index.isValid()) { return CAircraftModel(); }
|
||||
const QObject *sender = QObject::sender();
|
||||
|
||||
// check if we have an explicit sender
|
||||
if (sender == this->ui->tvp_AircraftModelsForVPilot)
|
||||
{
|
||||
return this->ui->tvp_AircraftModelsForVPilot->at(index);
|
||||
@@ -149,6 +157,10 @@ namespace BlackGui
|
||||
{
|
||||
return this->ui->comp_StashAircraft->view()->at(index);
|
||||
}
|
||||
else if (sender == this->ui->comp_OwnModelSet->view())
|
||||
{
|
||||
return this->ui->comp_OwnModelSet->view()->at(index);
|
||||
}
|
||||
|
||||
// no sender, use current tab
|
||||
const CAircraftModelView *v = this->currentModelView();
|
||||
|
||||
@@ -37,6 +37,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSplitter" name="sp_MappingComponent">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user