【问题标题】:Dali::Timer TickSignal functionDali::Timer TickSignal 函数
【发布时间】:2018-01-17 12:25:18
【问题描述】:

我想在 tizen 应用程序中使用计时器,我将每 10 秒收到一次信号。我做了一些挖掘,发现有函数 Dali::Timer::TickSignal() 但我对如何使用该函数感到困惑? 谁能帮忙举个简单的例子?

【问题讨论】:

    标签: timer tizen dali


    【解决方案1】:

    这真的很简单,您只需添加控制器的回调函数即可:

    static Timer timer = Dali::Timer::New(10000);
    timer.Start();
    timer.TickSignal().Connect(this, &YourController::callbackFunction);
    
    and callback function like:
    
    bool callbackFunction(){
    
        return true;
    }
    

    【讨论】:

      【解决方案2】:

      来自the page

      TimerSignalType& Dali::Timer::TickSignal ( )

      Signal emitted after specified time interval.
      
      The return of the callback decides whether signal emission 
      stops or continues. If the callback function returns false, emission will
       stop and if true, it will continue. This return value is ignored for 
      one-shot events, which will always stop after the first execution.
      
      Returns:
      The signal to Connect() with
      Since:
      2.4, DALi version 1.0.0
      

      您也可以在 github.com 中请求获取样品:https://github.com/search?q=TickSignal+tizen&type=Code&utf8=%E2%9C%93

      【讨论】:

      • 我阅读了文档但未能实现将需要某种类型的示例代码
      猜你喜欢
      • 2018-03-18
      • 1970-01-01
      • 2023-01-18
      • 2021-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-03
      • 1970-01-01
      相关资源
      最近更新 更多