Debian Codegraph @

src/aide.cpp

raw symbols SCIP
1 /* dialogue.cpp
2 *
3 * This file is part of PRAELECTOR
4 *
5 * PRAELECTOR is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * PRAELECTOR 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 * You should have received a copy of the GNU General Public License
16 * along with PRAELECTOR; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21 #include <QFile>
22 #include <QFont>
23 #include <QtCore/QCoreApplication>
24
25 #include <aide.h>
26
27 #include <QDebug>
28
29 Aide::Aide (QString nf)
30 {
31 resize(800, 600);
32 QFont font;
33 font.setPointSize(14);
34 setFont(font);
35 verticalLayout = new QVBoxLayout(this);
36 verticalLayout->setSpacing(6);
37 verticalLayout->setContentsMargins(11, 11, 11, 11);
38
39 textBrowser = new QTextBrowser(this);
40 textBrowser->setTabChangesFocus(true);
41 textBrowser->installEventFilter (this);
42 verticalLayout->addWidget(textBrowser);
43
44 buttonBox = new QDialogButtonBox(this);
45 buttonBox->setStandardButtons(QDialogButtonBox::Ok);
46 verticalLayout->addWidget(buttonBox);
47
48 QFile f(nf);
49 f.open(QFile::ReadOnly);
50 QTextStream flux(&f);
51 flux.setCodec("UTF-8");
52 textBrowser->setHtml(flux.readAll());
53 f.close();
54
55 setModal (false);
56 connect (buttonBox,SIGNAL(accepted()),this,SLOT(accept()));
57 }