C++/Qt4 - QTextEdit - textChanged slot - Question
Hello,
In the QTextEdit the cursor is positioned at the end of the first line of the text, as its supposed to be.
However, if I then press the backspace key, the textChanged() slot gets called twice.
I don't understand why. Perhaps someone could explain.
With text and punctuation keys, the slot gets called once.
Its not a problem for me, I'd just like to know why.
Thanks in advance.
Regards
Code:
void menu::textButton() // slot
{
if (cm::subSelected == -1) {
cr::message("Select an item", "Error", 2);
return;
}
prop = new propForm(this);
}
Code:
void menu::editButton() // slot
{
prop->data->setReadOnly(false);
prop->data->activateWindow();
prop
->data
->moveCursor
(QTextCursor::EndOfBlock);
//end of first line prop->data->ensureCursorVisible();
qDebug() << thisOne;
qDebug() << thisOne->isTopLevel();
qDebug() << thisOne->isActiveWindow();
}
Code:
propForm.cpp
data->setGeometry(0, filePath->height(), this->width(), this->height() - filePath->height());
QString fileName
= (cm
::mainItem + "/" + cm
::subItem);
filePath->setText(fileName);
cr::message("Can't open file.", "Error", 2);
return;
}
while ( ! in.atEnd()) data->append(in.readLine());
file.close();
data->setReadOnly(true);
connect (data, SIGNAL(textChanged()), this, SLOT(textChanged()));
this->show();
Code:
void propForm::textChanged() // private slot
{
qDebug() << "text changed";
}
Code:
Output
menu(0x7ecc78f0)
true
true
text changed
text changed