Search code examples
c++qtqt5qt-creatorsignals-slots

QLineWidget returnPressed signal not working


I have a QLineWidget inside of QWidget that is a tab (QTabWidget 'page'), I'm trying to use the returnPressed signal, but it isn't working, it was working before but i completely changed the code structure and it's not anymore.

The application outputs QMetaObject::connectSlotsByName: No matching signal for on_urlEntry_returnPressed()

Widget class header: http://pastebin.com/GbMNmjUD
Widget class source: http://pastebin.com/chdkhBRy


Solution

  • First, you should have provided a minimal working example, not that bunch of code.

    Second, if you simply used a debugger, you would notice that the warning comes after the second call to QMetaObject::connectSlotsByName. And that would mean that the BrowserTab object does not have a child named urlEntry with a signal named returnPressed. This happens because all control widgets you create become children of the Browser object passed in BrowserTab::setupUi and not the BrowserTab.