🛰️航天仿真算法库 SpaceAST
0.3.1
载入中...
搜索中...
未找到
UiTimelineView.hpp
浏览该文件的文档.
1
22
23
#pragma once
24
25
#include "AstGlobal.h"
26
#include "AstCore/TimePoint.hpp"
27
#include "AstCore/TimeInterval.hpp"
28
#include <QWidget>
29
#include <QColor>
30
#include <QString>
31
#include <vector>
32
33
AST_NAMESPACE_BEGIN
34
41
class
AST_UICORE_API
UiTimelineView
:
public
QWidget
42
{
43
Q_OBJECT
44
45
public
:
47
struct
Bar
48
{
49
TimePoint
start
;
50
TimePoint
stop
;
51
QString
label
;
52
QColor
color
;
53
};
54
55
public
:
56
explicit
UiTimelineView
(QWidget* parent =
nullptr
);
57
~UiTimelineView
()
override
;
58
59
UiTimelineView
(
const
UiTimelineView
&) =
delete
;
60
UiTimelineView
& operator=(
const
UiTimelineView
&) =
delete
;
61
63
void
setTimeSpan(
const
TimeInterval
& span);
64
66
void
setCurrentTime(
const
TimePoint
& current);
67
69
void
setBars(
const
std::vector<Bar>& bars);
70
71
protected
:
72
void
paintEvent(QPaintEvent* event)
override
;
73
74
private
:
76
qreal xFor(
const
TimePoint
& t)
const
;
77
78
TimePoint
start_{TimePoint::Epoch()};
79
TimePoint
stop_{TimePoint::Epoch()};
80
TimePoint current_{TimePoint::Epoch()};
81
std::vector<Bar> bars_{};
82
};
83
84
AST_NAMESPACE_END
ast::TimeInterval
时间区间
定义
TimeInterval.hpp:64
ast::TimePoint
绝对时间点
定义
TimePoint.hpp:108
ast::UiTimelineView
时间轴视图控件
定义
UiTimelineView.hpp:42
ast::UiTimelineView::Bar
时间轴区间条
定义
UiTimelineView.hpp:48
ast::UiTimelineView::Bar::stop
TimePoint stop
区间结束时间
定义
UiTimelineView.hpp:50
ast::UiTimelineView::Bar::color
QColor color
区间填充颜色
定义
UiTimelineView.hpp:52
ast::UiTimelineView::Bar::start
TimePoint start
区间开始时间
定义
UiTimelineView.hpp:49
ast::UiTimelineView::Bar::label
QString label
区间名称
定义
UiTimelineView.hpp:51
src
AstUiCore
Foundation
UiTimelineView.hpp
制作者
1.12.0