All Classes Namespaces Functions Variables Enumerations Properties Pages
errordialog.cpp
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2012-2020 Matthew Chiawen Chang
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; version 2 of the License.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 */
16 
17 #include "errordialog.h"
18 #include "ui_errordialog.h"
19 
20 ErrorDialog::ErrorDialog( QString title, QString description, QString details, QWidget *parent ) :
21  QDialog( parent ),
22  ui(new Ui::ErrorDialog)
23 {
24  ui->setupUi( this );
25 
26  setWindowTitle( title );
27  ui->title->setText( QString( "<h3>%1</h3>" ).arg( title ) );
28  ui->description->setText( description );
29  if ( details.isEmpty() )
30  {
31  ui->details->setVisible( false );
32  }
33  else
34  {
35  ui->details->setText( QString( "<pre>%1</pre>" ).arg( details ) );
36  }
37 }
38 
39 ErrorDialog::~ErrorDialog()
40 {
41  delete ui;
42 }
void setupUi(QWidget *widget)
bool isEmpty() const const
void setWindowTitle(const QString &)