[SOLVED] showing a window while a user is editing a QLineEdit field
-
Is there a way that I could popup a window while a user is editing a QLineEdit field without interrupting the edit process?
-
Maybe "QToolTip":http://developer.qt.nokia.com/doc/qt-4.7/qtooltip.html will be enough for you?
-
Well the tooltip seems to work only with mouse over, perhaps I can generate an event to get it to show up instead. I have not tried the popup but I supposed it would of done the same thing. Will give it a try. As for fluca1978's solution, I want to make sure there are no simpler implementations before going that route but thanks for the idea.
Here is what I want to do: When the user is filling in data that is invalid, I want to show a non obtrusive message to this regard, ie it will not interrupt the process of editing the field. Now I have all the code written to validate the data and I am currently implementing this message with a QMessageBox but this ends the editing process and the user needs to close the box and reenable editing.
-
[quote author="Volker" date="1320789006"]This basically works for me:
@
void MainWindow::displayToolTip()
{
QPoint pos = mapToGlobal(ui->textEdit->pos());
QToolTip::showText(pos, QString("The text edit has %1 chars").arg(ui->textEdit->toPlainText().count()));
}
@[/quote]
I did this originally but the tooltip wasn't alway showing, probably due to me making the changes too fast. thanks.