-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gui: Qt5 fixes for MessageBox #967
Conversation
QTextEdit in QMessageBox workaround only works in Qt4. Instead use the Natron MessageBox (after some fixes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ small suggestion
Gui/MessageBox.cpp
Outdated
_imp->infoEdit = new QTextEdit; | ||
_imp->infoEdit->setFocusPolicy(Qt::NoFocus); | ||
_imp->infoEdit->setReadOnly(true); | ||
_imp->infoEdit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); | ||
_imp->infoEdit->append(message); | ||
_imp->infoEdit->setWordWrapMode(QTextOption::WordWrap); | ||
_imp->infoEdit->setHtml(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks the label path above will auto detect rich text or not. I wonder if this code should be something like the following to mimic that behavior.
if (Qt::mightBeRichText(message)) {
_imp->infoEdit->setHtml(message);
} else {
_imp->infoEdit->setPlainText(message);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply, I will add check for rich text sometime tomorrow after work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any update @rodlie ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh, forgot about this one, sorry. Will add fix as soon as I'm in front of my dev machine (~1h).
LGTM |
QTextEdit in QMessageBox workaround only works in Qt4. Instead use the Natron MessageBox (after some fixes).
Tested on Windows 10 with Qt 5.15.13.