1/*
2 * Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#include "ojproblempropertywidget.h"
18#include "ui_ojproblempropertywidget.h"
19
20OJProblemPropertyWidget::OJProblemPropertyWidget(QWidget *parent) :
21 QDialog(parent),
22 ui(new Ui::OJProblemPropertyWidget)
23{
24 ui->setupUi(this);
25}
26
27OJProblemPropertyWidget::~OJProblemPropertyWidget()
28{
29 delete ui;
30}
31
32void OJProblemPropertyWidget::setName(const QString &name)
33{
34 QFont f = ui->lbName->font();
35 f.setPixelSize(f.pixelSize()+2);
36 f.setBold(true);
37 ui->lbName->setFont(f);
38 ui->lbName->setText(name);
39}
40
41void OJProblemPropertyWidget::setUrl(const QString &url)
42{
43 ui->txtURL->setText(url);
44}
45
46void OJProblemPropertyWidget::setDescription(const QString &description)
47{
48 ui->txtDescription->setHtml(description);
49}
50
51QString OJProblemPropertyWidget::name()
52{
53 return ui->lbName->text();
54}
55
56QString OJProblemPropertyWidget::url()
57{
58 return ui->txtURL->text();
59}
60
61QString OJProblemPropertyWidget::description()
62{
63 return ui->txtDescription->toHtml();
64}
65
66void OJProblemPropertyWidget::on_btnOk_clicked()
67{
68 this->accept();
69}
70
71
72void OJProblemPropertyWidget::on_btnCancel_clicked()
73{
74 this->reject();
75}
76
77