Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+135
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* MVC view (QTreeView) - shows items (rows), events, date-time lines and more
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Mike Wille, SLSE, 2014-10-01
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AbstractTimelineModel.h"
|
||||
#include "TimelineIndicator.h"
|
||||
#include "TimelineHeaderView.h"
|
||||
#include "LineMap.h"
|
||||
#include "Range.h"
|
||||
|
||||
#include <QTreeView>
|
||||
|
||||
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
/**
|
||||
* @brief MVC view (QTreeView) - shows items (rows), events, date-time lines and more
|
||||
*/
|
||||
class TimelineView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief creates a specialized QTreeView
|
||||
* @param parent parent of this widget
|
||||
*/
|
||||
explicit TimelineView(QWidget *parent);
|
||||
|
||||
EventGraphic *getEventOnPosition(QPoint position);
|
||||
|
||||
/**
|
||||
* @brief sets the (Timeline-)Model by calling setModel of base class QTreeView with additional options
|
||||
* @param model new TimelineModel
|
||||
*/
|
||||
void setTimelineModel(AbstractTimelineModel *model);
|
||||
|
||||
/**
|
||||
* @brief returns the timeline model
|
||||
* @return timeline model
|
||||
*/
|
||||
AbstractTimelineModel *timelineModel();
|
||||
|
||||
/**
|
||||
* @brief refreshes the view data, which triggers all views to refresh also
|
||||
*/
|
||||
void refreshData();
|
||||
|
||||
/**
|
||||
* @brief setHeader overloaded, does more than the original
|
||||
* @param header header to set
|
||||
*/
|
||||
void setHeader(QHeaderView *header);
|
||||
|
||||
|
||||
void setKnownRanges(const QVector<Range> &newRanges)
|
||||
{
|
||||
m_knownRanges = newRanges;
|
||||
}
|
||||
|
||||
void setDrawCache(bool show)
|
||||
{
|
||||
m_drawCache = show;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
qint64 m_posMarkTime;
|
||||
AbstractTimelineModel *m_model;
|
||||
LineMap m_lineMap;
|
||||
QVector<Range> m_knownRanges;
|
||||
bool m_drawCache;
|
||||
|
||||
|
||||
protected:
|
||||
bool event(QEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *) override;
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
|
||||
|
||||
/**
|
||||
* @brief checks whether it is possible to start an acecon on the clicked position
|
||||
* @param event event
|
||||
*/
|
||||
//void mouseMoveEvent(QMouseEvent* event);
|
||||
|
||||
/**
|
||||
* @brief draws lines to show where next date texts are
|
||||
* @param event event
|
||||
*/
|
||||
virtual void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief deletes line list (date text line lists)
|
||||
*/
|
||||
void slotResetLineList();
|
||||
|
||||
/**
|
||||
* @brief add date text line pixel position which should be added to a list,
|
||||
* so that the view can draw them on itself
|
||||
* @param posX pixel position of date text line
|
||||
*/
|
||||
void slotAddLine(int posX, qint64 time);
|
||||
|
||||
/**
|
||||
* @brief sets new position mark pixel position to the view (used by mouse click event)
|
||||
* @param posMarkPos pixel position of new position mark
|
||||
*/
|
||||
//void slotSetPosMarkPos(int posMarkPos);
|
||||
|
||||
/**
|
||||
* @brief sets new position mark time position to the view
|
||||
* @param posmarTime time position of new position mark
|
||||
*/
|
||||
void slotSetPosMarkTime(qint64 posMarkTime);
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
void signalEventAction(EventGraphic *eg, int); // int => action type
|
||||
void signalZoom();
|
||||
void signalUnzoom();
|
||||
|
||||
};
|
||||
|
||||
} // namespace LtsTimelineClassic
|
||||
Reference in new issue
Block a user