No Such Slot Qt
自定义槽 No such slot
头文件:mainwindow.h
源文件:mainwindow.cpp
main.cpp文件
运行能出现界面,但是提示如下信息:
D:ifnpftpGuiftpGui-build-desktopdebugftpGui.exe 启动中...
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_0')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_1')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_2')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_3')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_4')
请诸位老师,错在哪里?
必然出错!!!
你没有理解好this
connect(edit,SIGNAL(editingFinished()),this,SLOT(this->inputFinish(edit->text(),i)));
而且我没有看错的话,你写的是centralWidget(),是个函数啊这个函数我在MainWindow 里面也没有找到,这么写有点莫名其妙,接受者不可以是函数
- Qt No Such Slot In Derived Class
- No Such Slot Qt 8
- Qt No Such Slot Qobject
- No Such Slot Qt 100
- No Such Slot Qt 12
- No Such Slot Qt Saucepan
The slots machine, often known as the “one armed bandit”, became an icon of modern online gaming. At Slotomania, you can start playing your favorite slot games with crazy graphics, Qt No Such Slot In Derived Class top of the line sound effects, and hundreds of variations to choose from. 400% Deposit Bonus. The 400% Signals Slots Qt Example deposit bonus will look very tempting at first glance but beware of the terms & conditions. You have to ask Signals Slots Qt Example yourself Signals Slots Qt Example the question why an online casino Signals Slots Qt Example would give out such a huge percentage.
诸位好。最近在做qt,自定义槽的时候,出现如下错误。先把代码贴出了,请各位老师,过目。头文件:mainwindow.h
- C/C++ code
源文件:mainwindow.cpp
- C/C++ code
main.cpp文件
- C/C++ code
运行能出现界面,但是提示如下信息:
D:ifnpftpGuiftpGui-build-desktopdebugftpGui.exe 启动中...
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_0')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_1')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_2')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_3')
Object::connect: (receiver name: 'centralWidget')
Object::connect: No such slot QWidget::this->inputFinish(edit->text(),i) in ..ftpGuimainwindow.cpp:23
Object::connect: (sender name: 'lineEdit_4')
Qt No Such Slot In Derived Class
请诸位老师,错在哪里?
No Such Slot Qt 8
------解决方案--------------------必然出错!!!
你没有理解好this
connect(edit,SIGNAL(editingFinished()),this,SLOT(this->inputFinish(edit->text(),i)));
Qt No Such Slot Qobject
你的槽函数是定义在MainWindow 这个类中,所以接受者应该是thisNo Such Slot Qt 100
而且我没有看错的话,你写的是centralWidget(),是个函数啊这个函数我在MainWindow 里面也没有找到,这么写有点莫名其妙,接受者不可以是函数