My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
displaydialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  displaydialog.cpp
3  -------------------
4  begin : Sat May 28 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 "displaydialog.h"
23 
24 #include <qlayout.h>
25 #include <qhbox.h>
26 #include <qpushbutton.h>
27 #include <qtextedit.h>
28 #include <qvgroupbox.h>
29 
30 
31 DisplayDialog::DisplayDialog(QWidget *parent, bool helper)
32  : QDialog(parent, 0, false, Qt::WDestructiveClose)
33 {
34  vLayout = new QVBoxLayout(this);
35  vLayout->setMargin(3);
36 
37  if(helper) {
38  Text = new QTextEdit(this);
39  Text->setTextFormat(Qt::PlainText);
40  Text->setReadOnly(true);
41  Text->setMinimumSize(200, 100);
42  vLayout->addWidget(Text);
43  }
44  else {
45  QVGroupBox *Analog = new QVGroupBox (tr("Analogue"), this);
46  Text = new QTextEdit(Analog);
47  Text->setTextFormat(Qt::PlainText);
48  Text->setReadOnly(true);
49  Text->setMinimumSize(200, 80);
50  vLayout->addWidget(Analog);
51 
52  QVGroupBox *VHDL = new QVGroupBox (tr("VHDL"), this);
53  VHDLText = new QTextEdit(VHDL);
54  VHDLText->setTextFormat(Qt::PlainText);
55  VHDLText->setReadOnly(true);
56  VHDLText->setMinimumSize(200, 80);
57  vLayout->addWidget(VHDL);
58 
59  QVGroupBox *Verilog = new QVGroupBox (tr("Verilog"), this);
60  VerilogText = new QTextEdit(Verilog);
61  VerilogText->setTextFormat(Qt::PlainText);
62  VerilogText->setReadOnly(true);
63  VerilogText->setMinimumSize(200, 80);
64  vLayout->addWidget(Verilog);
65  }
66 
67  QHBox *h = new QHBox(this);
68  vLayout->addWidget(h);
69 
70  h->setStretchFactor(new QWidget(h),5); // stretchable placeholder
71 
72  QPushButton *ButtonClose = new QPushButton(tr("Close"), h);
73  connect(ButtonClose, SIGNAL(clicked()), SLOT(slotClose()));
74  ButtonClose->setFocus();
75 
76  h->setStretchFactor(new QWidget(h),5); // stretchable placeholder
77 }
78 
80 {
81  delete vLayout;
82 }
83 
84 // ************************************************************
85 void DisplayDialog::slotClose()
86 {
87  accept();
88 }