Add some changes to the message box (to be chenged anyways later).

This commit is contained in:
Gerhard Hoffmann 2023-08-18 11:50:14 +02:00
parent 56daa84a14
commit bea8242d6f

View File

@ -209,16 +209,21 @@ void MainWindow::onReplaceLast(QString text, QString suffix) {
} }
Utils::printLineEditInfo(lines); Utils::printLineEditInfo(lines);
ui->updateStatus->setText(lines.join('\n').trimmed()); ui->updateStatus->setText(lines.join('\n').trimmed());
ui->updateStatus->setEnabled(true); scrollDownTextEdit();
} }
void MainWindow::onShowErrorMessage(QString title, QString text) { void MainWindow::onShowErrorMessage(QString title, QString text) {
text = text.leftJustified(50, ' '); text = text.leftJustified(50, ' ');
QMessageBox msgBox(QMessageBox::NoIcon, title, QMessageBox msgBox(QMessageBox::NoIcon, title,
text, QMessageBox::Ok, text, QMessageBox::Ok,
nullptr, Qt::FramelessWindowHint); this, Qt::FramelessWindowHint);
msgBox.resize(100, 50);
// msg.setStyleSheet("background-color: rgb(0, 0, 0);")
// msg.setStyleSheet("text-color: rgb(255, 255, 255);")
msgBox.setStyleSheet("QMessageBox{border: 1px solid black; background-color:white}");
msgBox.setDefaultButton(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.defaultButton()->setVisible(false); msgBox.defaultButton()->setVisible(false);
@ -227,6 +232,9 @@ void MainWindow::onShowErrorMessage(QString title, QString text) {
t->setSingleShot(true); t->setSingleShot(true);
t->start(5 * 1000); t->start(5 * 1000);
msgBox.show();
msgBox.move(0, 0);
if(msgBox.exec() == QMessageBox::Ok) { if(msgBox.exec() == QMessageBox::Ok) {
// do something // do something
} else { } else {