mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-02 01:50:42 +00:00
Mark favorites in radar site dialog
- No effect currently - Does not persist through application restart
This commit is contained in:
parent
e721633629
commit
9d673af291
6 changed files with 114 additions and 34 deletions
|
|
@ -70,9 +70,22 @@ RadarSiteDialog::RadarSiteDialog(QWidget* parent) :
|
|||
p->proxyModel_,
|
||||
&QSortFilterProxyModel::setFilterWildcard);
|
||||
connect(ui->radarSiteView,
|
||||
&QTreeView::doubleClicked,
|
||||
&QAbstractItemView::doubleClicked,
|
||||
this,
|
||||
[this]() { Q_EMIT accept(); });
|
||||
connect(ui->radarSiteView,
|
||||
&QAbstractItemView::pressed,
|
||||
this,
|
||||
[this](const QModelIndex& index)
|
||||
{
|
||||
QModelIndex selectedIndex = p->proxyModel_->mapToSource(index);
|
||||
|
||||
if (selectedIndex.column() ==
|
||||
static_cast<int>(model::RadarSiteModel::Column::Favorite))
|
||||
{
|
||||
p->radarSiteModel_->ToggleFavorite(selectedIndex.row());
|
||||
}
|
||||
});
|
||||
connect(
|
||||
ui->radarSiteView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>576</width>
|
||||
<width>627</width>
|
||||
<height>550</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -16,6 +16,9 @@
|
|||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTreeView" name="radarSiteView">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::CurrentChanged|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue