Results 1 to 13 of 13

Thread: possible to connect defined signals(available in Qt designer) to custom slots...?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: possible to connect defined signals(available in Qt designer) to custom slots...?

    speaking of signals and slots.... can i connect my custom signals of a different class to the custom slots of a different class...??

  2. #2
    Join Date
    Jun 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: possible to connect defined signals(available in Qt designer) to custom slots...?

    Quote Originally Posted by rick_st3 View Post
    speaking of signals and slots.... can i connect my custom signals of a different class to the custom slots of a different class...??
    Yes, if these 2 classes are derived from QObject (or from something, which is based on QObject).

    QObject::connect(<ptr to signaling class>, SIGNAL( someSignal() ), <ptr to slot class>, SLOT( someSlot() ) );

  3. #3
    Join Date
    Jun 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: possible to connect defined signals(available in Qt designer) to custom slots...?

    actually i tried connecting two classes through custom signals and custom slots, one class was inheriting QWidget and the other was inheriting QGLWidget... but the connection was not working... now,is such a connection possible...??? if no please suggest some other alternative... thanks...

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: possible to connect defined signals(available in Qt designer) to custom slots...?

    Quote Originally Posted by rick_st3 View Post
    actually i tried connecting two classes through custom signals and custom slots, one class was inheriting QWidget and the other was inheriting QGLWidget... but the connection was not working... now,is such a connection possible...??? if no please suggest some other alternative... thanks...
    Yes, it is possible. Just make sure that both class declarations contain required Q_OBJECT macro and that you declare signals and slots properly. Take a look at the debug output. QObject::connect() outputs a detailed warning when it fails to establish signal-slot connection.
    J-P Nurmi

  5. #5
    Join Date
    Jun 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: possible to connect defined signals(available in Qt designer) to custom slots...?

    got it... thanx mate...

Similar Threads

  1. Replies: 2
    Last Post: 12th July 2007, 09:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.