Qt中的Connect Segmentation Fault

Connect Segmentation Fault in Qt

我在连接分段错误和程序崩溃时遇到错误。 SIGSEGV

//notepad.cpp
connect(Properties->UI->okWordPushButton, SIGNAL(clicked()), this, SLOT(wordcount(int)));

void notepad::wordcount(int wcount)
{

        wcount = ui->textEdit->toPlainText().split(QRegExp("(\s|\n|\r)+"), QString::SkipEmptyParts).count();
        Properties->UI->wordcountlabel->setText(QString::number(wcount))

}

我想要完成的是,当我在 Properties 中按下 okWordPushButton 时,它将从 notepad->textEdit 读取并发送一个 int 到 Properties->wordcountlabel

//notepad.h
public slots:
    void wordcount(int);

我已经包含了属性的所有文件,但我收到了那个错误。 请帮忙

我不得不使用不同的方法。

 connect(Properties, SIGNAL(wordComboChanged(int, QString)), this,SLOT(calculateWordCount(int, QString)));
connect(this, SIGNAL(wordCountUpdated(int)), Properties, SLOT(updateWordCount(int)));