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. [SOLVED]How to handle our own signals and slot.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]How to handle our own signals and slot.

Scheduled Pinned Locked Moved General and Desktop
7 Posts 5 Posters 4.9k 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.
  • S Offline
    S Offline
    shoyeb
    wrote on last edited by
    #1

    Hi,

    I want to implement my own signals and slot in my application. But i am confused regarding the emission of signals, i want my signal to be emiited at a specific time. But i dont know how to do this.
    Please help me with this.
    I am a newbie in Qt.

    There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Did you see already "this example?":http://developer.qt.nokia.com/doc/qt-4.8/widgets-digitalclock.html It is a good starter.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KA51O
        wrote on last edited by
        #3

        "This wiki page":http://doc.qt.nokia.com/4.7/signalsandslots.html about signals and slots is a good start.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          shoyeb
          wrote on last edited by
          #4

          @koahnig thnx 4 dat example, i will try dat.
          @KA51O i have read dat.

          There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

          1 Reply Last reply
          0
          • X Offline
            X Offline
            xfreax
            wrote on last edited by
            #5

            shoyeb, why dont you create one timer, and when its timeOut() occurs, emit your signal.

            Remember that you need to connect the timer's timeOut() to its event handler where you can emit that signal.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kinjalp
              wrote on last edited by
              #6

              @
              class Sleeper : public QThread
              {
              public:
              static void usleep(unsigned long usecs){QThread::usleep(usecs);}
              static void msleep(unsigned long msecs){QThread::msleep(msecs);}
              static void sleep(unsigned long secs){QThread::sleep(secs);}
              };

              class SleeperThread : public QThread
              {
              public:
              static void msleep(unsigned long msecs)
              {
              QThread::msleep(msecs);
              }
              };
              @

              use before connect function or signal emit Sleeper::sleep(10);

              May this will help for giving specific delay for emiting signal... :)

              [Edit: Be sure and wrap code in @ tags. Thanks! -mlong]

              1 Reply Last reply
              0
              • S Offline
                S Offline
                shoyeb
                wrote on last edited by
                #7

                kinjalp and xfreax thanx 4 ur reply, i will surely try this and let u know..

                There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

                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