Hi i'm reading the book "C++ GUI Programiming with Qt4",and i found this code on chapter 2,my question is what the "emit" keyword does in the code,what is it for?
void FindDialog::findClicked()
{
Qt::CaseSensitivity cs = caseCheckBox->isChecked() ? Qt::CaseSensitive
: Qt::CaseInsensitive;
if (backwardCheckBox->isChecked())
{
emit findPrevious(text, cs);
} else {
emit findNext(text, cs);
}
}
void FindDialog
::enableFindButton(const QString &text
) {
findButton->setEnabled(!text.isEmpty());
}
void FindDialog::findClicked()
{
QString text = lineEdit->text();
Qt::CaseSensitivity cs = caseCheckBox->isChecked() ? Qt::CaseSensitive
: Qt::CaseInsensitive;
if (backwardCheckBox->isChecked())
{
emit findPrevious(text, cs);
} else {
emit findNext(text, cs);
}
}
void FindDialog::enableFindButton(const QString &text)
{
findButton->setEnabled(!text.isEmpty());
}
To copy to clipboard, switch view to plain text mode
Bookmarks