Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Timers
Qt 6.11 is out! See what's new in the release blog

Timers

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 719 Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    @
    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv); fd = open(MODEMDEVICE,O_RDWR|O_NOCTTY);

    While(true)

    {
    Buffer.clear();
    nreturn = read(fd,&chBuf,1);
    if(nreturn > 0)
    {
    for(i=0;i<nreturn;i++)
    {
    Buffer.append(chBuf[i]);

    if(chBuf0 == 0xc9) nReadIndex = 0;

    pData[nReadIndex++] = chBuf[i];

    qDebug() << “data” << Buffer.toHex();
    }
    if(chBuf0 == 0xcf)
    {
    if(nReadIndex >= 10)

    //Display of Gui opreration //

    nReadIndex = 0;
    }
    @

    For this how can i use timers instead of while loop, where should i start timer , i tried but am geting segmentation problem.Please help me

    1 Reply Last reply
    0
    • IamSumitI Offline
      IamSumitI Offline
      IamSumit
      wrote on last edited by
      #2

      hi.

      "find here":http://qt-project.org/doc/qt-5/qtimer.html
      "Example":http://stackoverflow.com/questions/11651852/how-to-use-qtimer

      hope this helps.

      Be Cute

      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