簡體   English   中英

Qt中的連接分段錯誤

[英]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 時,它將從記事本-> 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)));

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM