Files
qt5-legatus-legacy/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_proxy_model.h
T
2026-08-13 18:33:10 +02:00

42 lines
905 B
C++
Executable File

#pragma once
/**
* @RDE_HEADER@
* Proxy Model for hiding empty tracks and sorting tracks by name plus having the "Markers" track always at the top
* $Id: $
* $HeadURL: $
* $Author: $
*
* Created by Mike Lennart Wille, SLTE, 2022-06-22
*/
#include <QSortFilterProxyModel>
class QModelIndex;
namespace Timeline
{
class TimelineModel;
class TimelineProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
TimelineProxyModel();
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
//virtual bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const;
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
void toggleShowAllRows();
private:
mutable TimelineModel *m_modelCachedPointer { nullptr };
bool m_forceShowAllRows { false };
};
} // namespace Timeline