【发布时间】:2014-01-02 08:39:22
【问题描述】:
我需要以编程方式将 QLineEdit 中的 valueChanged 信号连接到自定义插槽。我知道如何使用 Qt Designer 进行连接并使用图形界面进行连接,但我想以编程方式进行连接,以便了解有关信号和插槽的更多信息。
这就是我所拥有的不起作用。
.cpp 文件
// constructor
connect(myLineEdit, SIGNAL(valueChanged(static QString)), this, SLOT(customSlot()));
void MainWindow::customSlot()
{
qDebug()<< "Calling Slot";
}
.h 文件
private slots:
void customSlot();
我在这里错过了什么?
谢谢
【问题讨论】:
标签: c++ qt signals-slots qlineedit