1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library 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 GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # Author : Guillaume Boulant (EDF)
23 from qtsalome import *
26 class TubeDialog_UI(QDialog):
28 This class defines the design of a Qt dialog box dedicated to the
29 salome plugin examples. It presents a UI form that contains
30 parameters for the spatial dimensions of geometrical object.
32 def __init__(self, parent=None):
33 QDialog.__init__(self, parent)
37 self.setObjectName("Dialog")
39 self.hboxlayout = QHBoxLayout(self)
40 self.hboxlayout.setContentsMargins(9,9,9,9)
41 self.hboxlayout.setSpacing(6)
42 self.hboxlayout.setObjectName("hboxlayout")
43 self.vboxlayout = QVBoxLayout()
44 self.vboxlayout.setContentsMargins(0,0,0,0)
45 self.vboxlayout.setSpacing(6)
46 self.vboxlayout.setObjectName("vboxlayout")
47 self.hboxlayout1 = QHBoxLayout()
48 self.hboxlayout1.setContentsMargins(0,0,0,0)
49 self.hboxlayout1.setSpacing(6)
50 self.hboxlayout1.setObjectName("hboxlayout1")
51 self.vboxlayout1 = QVBoxLayout()
52 self.vboxlayout1.setContentsMargins(0,0,0,0)
53 self.vboxlayout1.setSpacing(6)
54 self.vboxlayout1.setObjectName("vboxlayout1")
55 self.lblRadius = QLabel(self)
56 self.lblRadius.setObjectName("lblRadius")
57 self.vboxlayout1.addWidget(self.lblRadius)
58 self.lblLength = QLabel(self)
59 self.lblLength.setObjectName("lblLength")
60 self.vboxlayout1.addWidget(self.lblLength)
61 self.lblWidth = QLabel(self)
62 self.lblWidth.setObjectName("lblWidth")
63 self.vboxlayout1.addWidget(self.lblWidth)
64 self.hboxlayout1.addLayout(self.vboxlayout1)
65 self.vboxlayout2 = QVBoxLayout()
66 self.vboxlayout2.setContentsMargins(0,0,0,0)
67 self.vboxlayout2.setSpacing(6)
68 self.vboxlayout2.setObjectName("vboxlayout2")
69 self.txtRadius = QLineEdit(self)
70 self.txtRadius.setObjectName("txtRadius")
71 self.vboxlayout2.addWidget(self.txtRadius)
72 self.txtLength = QLineEdit(self)
73 self.txtLength.setObjectName("txtLength")
74 self.vboxlayout2.addWidget(self.txtLength)
75 self.txtWidth = QLineEdit(self)
76 self.txtWidth.setObjectName("txtWidth")
77 self.vboxlayout2.addWidget(self.txtWidth)
78 self.hboxlayout1.addLayout(self.vboxlayout2)
79 self.vboxlayout.addLayout(self.hboxlayout1)
80 spacerItem = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
81 self.vboxlayout.addItem(spacerItem)
82 self.buttonBox = QDialogButtonBox(self)
83 self.buttonBox.setOrientation(Qt.Horizontal)
84 self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.NoButton|QDialogButtonBox.Ok)
85 self.buttonBox.setObjectName("buttonBox")
86 self.vboxlayout.addWidget(self.buttonBox)
87 self.hboxlayout.addLayout(self.vboxlayout)
89 self.setWindowTitle("Tube construction")
90 self.lblRadius.setText("Rayon")
91 self.lblLength.setText("Longueur")
92 self.lblWidth.setText("Epaisseur")
95 # ======================================================================
97 # ======================================================================
100 a = QApplication(sys.argv)
101 tubedialog = TubeDialog_UI()
102 sys.exit(tubedialog.exec_())
104 if __name__=="__main__":