Results 1 to 4 of 4

Thread: Signal and "already defined" error

  1. #1
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Signal and "already defined" error

    I have a strange problem: there is a method "onprogress" in the class below. During link I am getting an error of it being already defined. When I remove "signals:" keyword it compiles OK. What might be the offence? (Windows, vs2008)

    Qt Code:
    1. class btprogress : public QDialog
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. btprogress (nbt& nt, boost::gregorian::date mindate, boost::gregorian::date maxdate,
    7. QWidget*parent = 0);
    8. ~btprogress();
    9.  
    10. signals:
    11. void onprogress(QString date);
    12.  
    13. private slots:
    14. void onbtcanceled();
    15. void oncancel();
    16. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signal and "already defined" error

    Check your code for onprogress texts,, may be you are defining it elsewhere too.
    BTW, in you code does the class have semi colon at end ?

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal and "already defined" error

    try to rename the signal.

  4. #4
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Signal and "already defined" error

    Thank you guys, for the help.

    Yes, there is a semicolon at the end. No, there is no "onprogress" method/free function/etc anywhere in the project. I will rename signal and see what happens.

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.