创建TimeLine组件框架

This commit is contained in:
duanshengchao 2024-11-27 16:39:25 +08:00
parent 60e3e4035f
commit ba2400bbd7
11 changed files with 37 additions and 3 deletions

View File

@ -89,6 +89,12 @@ set(UI_FILES
set(UTIL_FILES
util/TimeLine/timeLineWidget.h
util/TimeLine/timeLineWidget.cpp
util/TimeLine/timeLineItem.h
util/TimeLine/timeLineItem.cpp
util/TimeLine/timeStampItem.h
util/TimeLine/timeStampItem.cpp
util/TimeLine/eventItem.h
util/TimeLine/eventItem.cpp
)
#

View File

@ -151,8 +151,8 @@ void CustomTab::setText(const QString& strTitle)
QFontMetrics metrics(m_pTitle->font());
QRect rect = metrics.boundingRect(m_pTitle->text());
m_pTitle->setMinimumSize(rect.width() + 10, 0);
m_pTitle->setMaximumSize(rect.width() + 10, 1660);
m_pTitle->setMinimumSize(rect.width() + 12, 0);
m_pTitle->setMaximumSize(rect.width() + 12, 1660);
setObjectName("dashboardTab_" + strTitle);
}

View File

@ -141,7 +141,7 @@ void Dashboard::addPanel(const QString& strType)
QString strDefaultName = "dataPanel-" + QString::number(m_nPanenlNameNumber);
m_nPanenlNameNumber++;
panel->setName(strDefaultName);
int nPanelWidth = m_pDisplayArea->width() * 0.25;
int nPanelWidth = m_pDisplayArea->width() * 0.3;
int nPanelHeight = nPanelWidth * 0.56; //16:9宽高比
panel->setInitialSize(QSize(nPanelWidth, nPanelHeight));
int nCount = m_dataPanels.count();

View File

View File

View File

View File

View File

@ -28,6 +28,27 @@ TimeLineWidget::~TimeLineWidget()
delete d_ptr;
}
void TimeLineWidget::resizeEvent(QResizeEvent* e)
{
}
void TimeLineWidget::mousePressEvent(QMouseEvent* e)
{
}
void TimeLineWidget::mouseMoveEvent(QMouseEvent* e)
{
}
void TimeLineWidget::mouseReleaseEvent(QMouseEvent* e)
{
}
void TimeLineWidget::wheelEvent(QWheelEvent* e)
{
}
void TimeLineWidget::setBackground(QColor color)
{
d_ptr->m_background_color = color;

View File

@ -18,6 +18,13 @@ public:
void setBackground(QColor);
void setTimelineColor(QColor);
protected:
virtual void resizeEvent(QResizeEvent*) override;
virtual void mousePressEvent(QMouseEvent*) override;
virtual void mouseMoveEvent(QMouseEvent*) override;
virtual void mouseReleaseEvent(QMouseEvent*) override;
virtual void wheelEvent(QWheelEvent*) override;
private:
TimeLineWidgetPrivate* d_ptr;
}; // class TimeLineWidget

View File

View File