mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T362, utility function to display view count in tab
This commit is contained in:
@@ -1373,6 +1373,16 @@ namespace BlackGui
|
||||
this->addContainerTypesAsDropTypes(true, true);
|
||||
}
|
||||
|
||||
template<class ModelClass, class ContainerType, class ObjectType>
|
||||
void CViewBase<ModelClass, ContainerType, ObjectType>::setTabWidgetViewText(QTabWidget *tw, int index)
|
||||
{
|
||||
if (!tw) { return; }
|
||||
QString o = tw->tabText(index);
|
||||
const QString f = this->hasFilter() ? "F" : "";
|
||||
o = CGuiUtility::replaceTabCountValue(o, this->rowCount()) + f;
|
||||
tw->setTabText(index, o);
|
||||
}
|
||||
|
||||
template <class ModelClass, class ContainerType, class ObjectType>
|
||||
void CViewBase<ModelClass, ContainerType, ObjectType>::setSortIndicator()
|
||||
{
|
||||
|
||||
@@ -50,6 +50,7 @@ class QPaintEvent;
|
||||
class QPoint;
|
||||
class QShowEvent;
|
||||
class QWidget;
|
||||
class QTabWidget;
|
||||
|
||||
namespace BlackMisc { class CWorker; }
|
||||
namespace BlackGui
|
||||
@@ -708,6 +709,9 @@ namespace BlackGui
|
||||
//! Drop actions
|
||||
void setDropActions(Qt::DropActions dropActions) { Q_ASSERT(m_model); m_model->setDropActions(dropActions); }
|
||||
|
||||
//! Set a tab widget text based on row count, filter etc.
|
||||
void setTabWidgetViewText(QTabWidget *tw, int index);
|
||||
|
||||
protected:
|
||||
ModelClass *m_model = nullptr; //!< corresponding model
|
||||
|
||||
|
||||
Reference in New Issue
Block a user