×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    254

    Can we have the userdefined signals in QT

    hi all,
    i have a question please help me out.
    Can we have userdefined signals in QT...
    please give me an example ...

    regards
    Arun Gupta

  2. #2
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    254

    Re: Can we have the userdefined signals in QT

    Using Qt with 3rd Party Signals and Slots

    It is possible to use Qt with a 3rd party signal/slot mechanism. You can even use both mechanisms in the same project. Just add the following line to your qmake project (.pro) file.

    CONFIG += no_keywords
    It tells Qt not to define the moc keywords signals, slots, and emit, because these names will be used by a 3rd party library, e.g. Boost. Then to continue using Qt signals and slots with the no_keywords flag, simply replace all uses of the Qt moc keywords in your sources with the corresponding Qt macros Q_SIGNALS (or Q_SIGNAL), Q_SLOTS (or Q_SLOT), and Q_EMIT.


    I got these from the tutorials but there is no refrence what so ever on creating userdefined signals...


    regards
    Arun Gupta

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2009
    Posts
    430

    Re: Can we have the userdefined signals in QT

    Does this answer your question? http://qt.nokia.com/doc/4.5/signalsandslots.html

  4. #4
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    254

    Re: Can we have the userdefined signals in QT

    i think i got my answer please correct me if i am wrong

    when we create the useddefined class we can define ours.so we need to inherit the inbuilt class and define our own signal and slots


    regards
    Arun Gupta

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2009
    Posts
    430

    Re: Can we have the userdefined signals in QT

    Yes, you have to inherit from QObject or any other object that inherits QObject. Then you can create signals and slots as you wish.

Similar Threads

  1. Qt for Symbian development resources
    By liuxg in forum [Archived] Qt General ( Qt技术)
    Replies: 55
    Last Post: 2011-01-26, 04:06
  2. Senior QT Client Developer (Dublin, Ireland)
    By marynyc in forum News and Announcements
    Replies: 0
    Last Post: 2009-06-02, 18:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •