Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. QT长时间运行后定时器中更新时间日期无法生效,点击鼠标以后UI恢复更新
Forum Updated to NodeBB v4.3 + New Features

QT长时间运行后定时器中更新时间日期无法生效,点击鼠标以后UI恢复更新

Scheduled Pinned Locked Moved Unsolved Chinese
1 Posts 1 Posters 200 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vanessa23
    wrote last edited by
    #1

    项目中使用了QTimer定时器,连接槽函数如下void QMammo::on_timerDate_timeout()
    {
    static E_DateFormat dateFormat = SysConfig::getInstance()->GeneralSettings.DateFormat;
    static E_TimeFormat timeFormat = SysConfig::getInstance()->GeneralSettings.TimeFormat;

    QString strDate, strTime;
    Utility::utcDateTime2QString(QDateTime::currentDateTimeUtc(), dateFormat, timeFormat, &strDate, &strTime);
    ui.labelDateInfo->setText(strDate);
    ui.labelTimeInfo->setText(strTime);
    

    } 但发现程序放在那长时间运行没有去响应任何行为的情况下,过了8个小时左右UI刷新不了,后点击界面中任意按钮恢复更新,这是为什么?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved