Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions plugins/dde-dock/datetime/datetimeplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ void DatetimePlugin::loadPlugin()
m_refershTimer = new QTimer(this);
m_dateTipsLabel->setObjectName("datetime");

m_refershTimer->setInterval(1000);
m_refershTimer->start();
// 整秒启动定时器,并增加更新频率,避免秒显示与控制中心显示不一致(控制中心500ms更新一次)
m_refershTimer->setInterval(500);
QTimer::singleShot(1000 - QTime::currentTime().msec(), [this]() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个singleShot本身也不是一个精确的时间,这样能保证时间是要一致的么,

updateCurrentTimeString();
m_refershTimer->start();
});

m_centralWidget.reset(new DatetimeWidget(m_RegionFormatModel));

Expand Down