Salome HOME
e6ef8580f1a87c768d54cab29de0928eddf5e7ba
[modules/yacs.git] / src / pyqt / gui / logview.py
1 # Copyright (C) 2006-2021  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 import sys
21 from qt import *
22
23 log="""
24 Ligne 1
25 Ligne 1
26 Ligne 1
27 Ligne 1
28 Ligne 1
29 Ligne 1
30 Ligne 1
31 Ligne 1
32 Ligne 1
33 Ligne 1
34 Ligne 1
35 Ligne 1
36 Ligne 1
37 """
38 class LogView(QDialog):
39    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
40      QDialog.__init__(self,parent,name,modal,fl)
41      layout = QVBoxLayout(self,6,6,"AboutFormLayout")
42      self.text=QTextBrowser(self,"log")
43      self.text.setFrameShape(QTextEdit.NoFrame)
44      self.text.setTextFormat(QTextEdit.PlainText)
45      #self.text.setWordWrap(QTextEdit.FixedColumnWidth)
46      #self.text.setWrapColumnOrWidth(120)
47      self.text.setReadOnly(1)
48      #self.text.setText(log)
49      layout.addWidget(self.text)
50      self.button = QPushButton(self,"pushButton1")
51      self.button.setText("&Close")
52      layout.addWidget(self.button)
53      self.resize(QSize(532,437).expandedTo(self.minimumSizeHint()))
54      self.connect(self.button,SIGNAL("clicked()"),self.accept)
55
56
57
58 if __name__ == "__main__":
59   a = QApplication(sys.argv)
60   QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
61   w = LogView()
62   w.text.setText("un texte extremement loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong")
63   a.setMainWidget(w)
64   w.show()
65   a.exec_loop()