Sélectionner une révision Git
TimingAxis.hh 855 o
#ifndef VIVY_TIMING_AXIS_H
#define VIVY_TIMING_AXIS_H
#ifndef __cplusplus
#error "This is a C++ header"
#endif
#include <QGraphicsWidget>
#include <QPainter>
#include <cmath>
namespace Vivy
{
class TimingAxis final : public QGraphicsItem {
public:
explicit TimingAxis(qreal soundLength, int x0, int x1, int y) noexcept;
~TimingAxis() noexcept override = default;
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
private:
static inline constexpr QColor axisColour = QColor(0, 0, 127);
QVector<qreal> availableTicks = { 0.01, 0.1, 1, 10, 60, 3600, 86400 };
qreal minBetweenMinor{ 5 };
qreal penWidth{ 1 };
qreal soundLength{ 0 };
int x0{ 0 };
int x1{ 0 };
int y{ 0 };
protected:
};
}
#endif // VIVY_TIMING_AXIS_H