mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:20:06 +00:00
Additional placefile view/add enhancements
This commit is contained in:
parent
0064733679
commit
18c05b3a63
6 changed files with 119 additions and 22 deletions
|
|
@ -90,14 +90,14 @@ QVariant PlacefileModel::data(const QModelIndex& index, int role) const
|
|||
case static_cast<int>(Column::Enabled):
|
||||
if (role == types::ItemDataRole::SortRole)
|
||||
{
|
||||
return true; // TODO
|
||||
return p->placefileManager_->PlacefileEnabled(placefileName);
|
||||
}
|
||||
break;
|
||||
|
||||
case static_cast<int>(Column::Thresholds):
|
||||
if (role == types::ItemDataRole::SortRole)
|
||||
{
|
||||
return true; // TODO
|
||||
return p->placefileManager_->PlacefileThresholded(placefileName);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -105,7 +105,14 @@ QVariant PlacefileModel::data(const QModelIndex& index, int role) const
|
|||
return QString::fromStdString(placefileName);
|
||||
|
||||
case static_cast<int>(Column::Description):
|
||||
{
|
||||
auto placefile = p->placefileManager_->Placefile(placefileName);
|
||||
if (placefile != nullptr)
|
||||
{
|
||||
return QString::fromStdString(placefile->title());
|
||||
}
|
||||
return QString {};
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
@ -116,10 +123,10 @@ QVariant PlacefileModel::data(const QModelIndex& index, int role) const
|
|||
switch (index.column())
|
||||
{
|
||||
case static_cast<int>(Column::Enabled):
|
||||
return true; // TODO
|
||||
return p->placefileManager_->PlacefileEnabled(placefileName);
|
||||
|
||||
case static_cast<int>(Column::Thresholds):
|
||||
return true; // TODO
|
||||
return p->placefileManager_->PlacefileThresholded(placefileName);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
@ -133,7 +140,7 @@ QVariant PlacefileModel::headerData(int section,
|
|||
Qt::Orientation orientation,
|
||||
int role) const
|
||||
{
|
||||
if (role == Qt::DisplayRole)
|
||||
if (role == Qt::ItemDataRole::DisplayRole)
|
||||
{
|
||||
if (orientation == Qt::Horizontal)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue