mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T529, model/views get sort order values
This commit is contained in:
committed by
Mat Sutcliffe
parent
f55db48cef
commit
b2ec28e3cd
@@ -116,6 +116,12 @@ namespace BlackGui
|
||||
return changedColumn || changedOrder;
|
||||
}
|
||||
|
||||
CPropertyIndex CListModelBaseNonTemplate::getSortProperty() const
|
||||
{
|
||||
if (!this->hasValidSortColumn()) { return CPropertyIndex::empty(); }
|
||||
return m_columns.at(m_sortColumn).getPropertyIndex();
|
||||
}
|
||||
|
||||
bool CListModelBaseNonTemplate::hasValidSortColumn() const
|
||||
{
|
||||
if (!(m_sortColumn >= 0 && m_sortColumn < m_columns.size())) { return false; }
|
||||
|
||||
@@ -90,6 +90,9 @@ namespace BlackGui
|
||||
//! Get sort column property index
|
||||
virtual int getSortColumn() const { return m_sortColumn; }
|
||||
|
||||
//! Sorted by property
|
||||
BlackMisc::CPropertyIndex getSortProperty() const;
|
||||
|
||||
//! Has valid sort column?
|
||||
virtual bool hasValidSortColumn() const;
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace BlackGui
|
||||
this->derivedModel()->adjustOrderColumn(messages);
|
||||
}
|
||||
|
||||
bool CStatusMessageView::isSortedByTimestampOrOrder() const
|
||||
{
|
||||
return this->derivedModel()->isSortedByTimestampOrOrder();
|
||||
}
|
||||
|
||||
void CStatusMessageView::addFilterDialog()
|
||||
{
|
||||
if (this->getFilterDialog()) { return; } // already existing
|
||||
|
||||
@@ -43,12 +43,15 @@ namespace BlackGui
|
||||
//! \copydoc BlackGui::Models::CStatusMessageListModel::adjustOrderColumn
|
||||
void adjustOrderColumn(const BlackMisc::CStatusMessageList &messages);
|
||||
|
||||
//! Add my own filter dialog
|
||||
void addFilterDialog();
|
||||
//! \copydoc BlackGui::Models::CStatusMessageListModel::isSortedByTimestampOrOrder
|
||||
bool isSortedByTimestampOrOrder() const;
|
||||
|
||||
//! \copydoc BlackMisc::CStatusMessageList::keepLatest
|
||||
void keepLatest(int desiredSize);
|
||||
|
||||
//! Add my own filter dialog
|
||||
void addFilterDialog();
|
||||
|
||||
//! Filter dialog if any
|
||||
Filters::CStatusMessageFilterDialog *getFilterDialog() const;
|
||||
};
|
||||
|
||||
@@ -177,6 +177,18 @@ namespace BlackGui
|
||||
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::setNoSorting
|
||||
virtual void setNoSorting() = 0;
|
||||
|
||||
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::getSortProperty
|
||||
virtual BlackMisc::CPropertyIndex getSortProperty() const = 0;
|
||||
|
||||
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::getSortColumn
|
||||
virtual int getSortColumn() const = 0;
|
||||
|
||||
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::hasValidSortColumn
|
||||
virtual bool hasValidSortColumn() const = 0;
|
||||
|
||||
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::getSortOrder
|
||||
virtual Qt::SortOrder getSortOrder() const = 0;
|
||||
|
||||
//! Allow to drag and/or drop value objects
|
||||
virtual void allowDragDrop(bool allowDrag, bool allowDrop, bool allowDropJsonFile = false) = 0;
|
||||
|
||||
@@ -719,6 +731,10 @@ namespace BlackGui
|
||||
virtual bool setSorting(const BlackMisc::CPropertyIndex &propertyIndex, Qt::SortOrder order = Qt::AscendingOrder) override;
|
||||
virtual void sortByPropertyIndex(const BlackMisc::CPropertyIndex &propertyIndex, Qt::SortOrder order = Qt::AscendingOrder) override;
|
||||
virtual void setNoSorting() override { m_model->setNoSorting(); }
|
||||
virtual BlackMisc::CPropertyIndex getSortProperty() const override { return m_model->getSortProperty(); }
|
||||
virtual int getSortColumn() const override { return m_model->getSortColumn(); }
|
||||
virtual bool hasValidSortColumn() const override { return m_model->hasValidSortColumn(); }
|
||||
virtual Qt::SortOrder getSortOrder() const override { return m_model->getSortOrder(); }
|
||||
//! @}
|
||||
|
||||
//! Column count
|
||||
|
||||
Reference in New Issue
Block a user