My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
helpdialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  helpdialog.cpp
3  ------------------
4  begin : Fri Mar 04 2005
5  copyright : (C) 2005 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifdef HAVE_CONFIG_H
19 # include <config.h>
20 #endif
21 
22 #include "helpdialog.h"
23 
24 #include <qlayout.h>
25 #include <qhbox.h>
26 #include <qpushbutton.h>
27 #include <qtextedit.h>
28 
29 
30 HelpDialog::HelpDialog(QWidget *parent)
31  : QDialog(parent, 0, false, Qt::WDestructiveClose)
32 {
33  setCaption("Qucs Filter Help");
34 
35 
36  // -------- set help text into dialog ------------
37  QString s(tr("QucsFilter is a filter synthesis program. "
38  "To create a filter, simply enter all "
39  "parameters and press the big button at the "
40  "bottom of the main window. Immediatly, the "
41  "schematic of the filter is calculated and "
42  "put into the clipboard. Now go to Qucs, "
43  "open an empty schematic and press "
44  "CTRL-V (paste from clipboard). The filter "
45  "schematic can now be inserted and "
46  " simulated. Have lots of fun!"));
47 
48 
49  // -------- create dialog widgets ------------
50  resize(250, 230);
51 
52  vLayout = new QVBoxLayout(this);
53 
54  Text = new QTextEdit(s, QString::null, this);
55  Text->setTextFormat(Qt::PlainText);
56  Text->setReadOnly(true);
57 // Text->setWordWrap(QTextEdit::NoWrap);
58  Text->setMinimumSize(200,200);
59  vLayout->addWidget(Text);
60 
61  QHBox *h = new QHBox(this);
62  vLayout->addWidget(h);
63 
64  h->setStretchFactor(new QWidget(h),5); // stretchable placeholder
65 
66  QPushButton *ButtonClose = new QPushButton(tr("Close"), h);
67  connect(ButtonClose, SIGNAL(clicked()), SLOT(slotClose()));
68  ButtonClose->setFocus();
69 
70  h->setStretchFactor(new QWidget(h),5); // stretchable placeholder
71 }
72 
74 {
75  delete vLayout;
76 }
77 
78 // ************************************************************
79 void HelpDialog::slotClose()
80 {
81  accept();
82 }