#include #include #include #include "error_dialog.h" namespace display { ErrorDialog::ErrorDialog(std::vector errors) : GenericDialog("Greške", "") { auto contentLayout = new QVBoxLayout(); content->setLayout(contentLayout); for (auto &err: errors) { contentLayout->addWidget(new QLabel(QString::fromStdString(err.message), this)); } } ErrorDialog::ErrorDialog(std::ostringstream& errorStream) : GenericDialog("Greške", "") { auto contentLayout = new QVBoxLayout(); content->setLayout(contentLayout); setMinimumWidth(1000); auto log = new QPlainTextEdit(); log->setFont(QFont("Courier")); log->appendPlainText(QString::fromStdString(errorStream.str())); log->setReadOnly(true); contentLayout->addWidget(log); } } // display