Results 1 to 7 of 7

Thread: Signal and slot

  1. #1
    Join Date
    Mar 2008
    Posts
    7
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Question Signal and slot

    hi
    i am using spin box.when ever any changes in spinbox that is updatation in the spin box it should call one more funtion for validate the value what we entered.
    Qt Code:
    1. connect(m_ctrlSpinFeld1, SIGNAL(valueChanged(int)),
    2. this, SLOT(OnUpdateFeld1()));
    To copy to clipboard, switch view to plain text mode 
    i am using code like.but when i am excuting the file the slot not connected.i dont know what is the problem in that.
    Last edited by jpn; 12th March 2008 at 09:18. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Signal and slot

    How did you declare the slot? Does the class contain the Q_OBJECT macro?

  3. #3
    Join Date
    Mar 2008
    Posts
    7
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Signal and slot

    ya..i declared Q_Object .but still i am getting like
    Object::connect: No such slot Einsteig::CTANDatumeingabeDlg::OnUpdateFeld1()
    Object::connect: (sender name: 'm_ctrlSpinFeld1')
    Object::connect: (receiver name: 'Datum')
    Object::connect: No such slot Einsteig::CTANDatumeingabeDlg::OnUpdateFeld2()
    Object::connect: (sender name: 'm_ctrlSpinFeld2')
    Object::connect: (receiver name: 'Datum')
    Object::connect: No such slot Einsteig::CTANDatumeingabeDlg::OnUpdateFeld3()
    Object::connect: (sender name: 'm_ctrlSpinFeld3')
    Object::connect: (receiver name: 'Datum')
    Last edited by jpn; 12th March 2008 at 09:27. Reason: missing [quote] tags

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

    Default Re: Signal and slot

    Could you show us the declaration of Einsteig::CTANDatumeingabeDlg?
    J-P Nurmi

  5. #5
    Join Date
    Mar 2008
    Posts
    7
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Signal and slot

    Qt Code:
    1. class CTANDatumeingabeDlg : public QDialog,Ui_Datum
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. CTANDatumeingabeDlg(QWidget* pParent = NULL);
    7. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 12th March 2008 at 09:45. Reason: missing [code] tags

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

    Default Re: Signal and slot

    I don't see any slots being declared there. Where did you declared OnUpdateFeldN()?
    J-P Nurmi

  7. #7
    Join Date
    Mar 2008
    Posts
    7
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Signal and slot

    oh...
    thanks..i declared only private: not private slot:
    thanks for ur information.

Similar Threads

  1. signal and slot across threads having event loop
    By travis in forum Qt Programming
    Replies: 6
    Last Post: 5th November 2007, 23:56
  2. Replies: 2
    Last Post: 16th August 2007, 00:20
  3. signal not getting communicated to slot
    By quickNitin in forum Qt Programming
    Replies: 17
    Last Post: 2nd June 2006, 04:56
  4. Manually send signal to slot
    By donmorr in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2006, 15:03
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.