Results 1 to 4 of 4

Thread: textChanged signal issue

  1. #1
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default textChanged signal issue

    Hi i have the following code and it does not even display the message box, what am I missing?

    DialogNuevoPeriodo.h
    Qt Code:
    1. class DialogNuevoPeriodo : public QDialog{
    2.  
    3. public:
    4. ...
    5. private slots:
    6. ...
    7. void setCalendarYear(const QString &);
    8. ...
    9. private:
    10. QLabel *lAnio;
    11. ...
    12. };
    To copy to clipboard, switch view to plain text mode 
    DialogNuevoPeriodo.cpp
    Qt Code:
    1. #include "DialogNuevoPeriodo.h"
    2. DialogNuevoPeriodo::DialogNuevoPeriodo(QWidget *parent)
    3. : QDialog(parent){
    4. ...
    5. leAnio = new QLineEdit;
    6. leAnio->setValidator(new QIntValidator(1800, QDate::currentDate().year(), this));
    7. ...
    8. connect(leAnio, SIGNAL(textChanged(const QString &)),
    9. this, SLOT(setCalendarYear(const QString &)));
    10. ...
    11. }
    12. ...
    13. void DialogNuevoPeriodo::setCalendarYear(const QString &text){
    14. QMessageBox::warning(this, tr("something"),
    15. "something"
    16. );
    17. }
    18. ...
    To copy to clipboard, switch view to plain text mode 
    it just does nothing in the slot why is that? thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: textChanged signal issue

    Quote Originally Posted by chaosgeorge View Post
    what am I missing?
    Add Q_OBJECT macro to your class definition and rerun qmake.

  3. The following user says thank you to jacek for this useful post:

    chaosgeorge (9th November 2006)

  4. #3
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: textChanged signal issue

    uhm ok i made that but now i get an error of something like ... undefined reference to 'vtable for <myClass>'"

  5. #4
    Join Date
    Nov 2006
    Posts
    41
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: textChanged signal issue

    hohoooo newbie pops-up again i forgot qmake

Similar Threads

  1. Replies: 2
    Last Post: 17th May 2006, 21:01
  2. QSortFilterProxyModel signal and selection confusion
    By pascal123 in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2006, 16:25
  3. no such signal QListBox::currentChanged()
    By jopie bakker in forum Newbie
    Replies: 2
    Last Post: 2nd March 2006, 15:17
  4. send signal from QCombobox
    By raphaelf in forum Qt Programming
    Replies: 22
    Last Post: 28th February 2006, 14:18
  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.