[solved] unable to accessing signal 'textChanged' from base 'QLineEdit' class



  • I have a class like this:

    @class MathEditPoint : public QLineEdit {
    Q_OBJECT

    public:
    MathEditPoint(QWidget * parent);

     . . . . .
    

    public slots:
    void upDateSize( const QString & text );

     . . . . .  
    

    };

    MathEditPoint::MathEditPoint(QWidget * parent)
    : QLineEdit(parent) {
    connect(this, SIGNAL( textChanged( const QString & text ) ),
    this, SLOT( upDateSize( const QString & text ) ));

    . . . . .
    

    }@

    I get the following error when running:
    Object::connect: No such signal MathEditPoint::textChanged( const QString & text ) in MathEditPoint.cpp

    According the the documentation the base class QlineEdit has a single “void QLineEdit::textChanged ( const QString & text ) [signal]”. Why can I not access it?

    Thanks



  • You should write:

    @
    connect(this, SIGNAL(textChanged(QString)), this, SLOT(upDateSize(QString)));
    @



  • you don't need identifiers in the signals, just the type



  • [quote author="trollixx" date="1355960841"]You should write:

    @
    connect(this, SIGNAL(textChanged(QString)), this, SLOT(upDateSize(QString)));
    @[/quote]

    Thanks for the fast reply. The example I was looking at did not have parameters so I missed that.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.