Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] unable to accessing signal 'textChanged' from base 'QLineEdit' class
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 7.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hans977
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • T Offline
      T Offline
      trollixx
      wrote on last edited by
      #2

      You should write:

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

      Oleg

      1 Reply Last reply
      0
      • U Offline
        U Offline
        utcenter
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hans977
          wrote on last edited by
          #4

          [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.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved