diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
commit | 8a055d66f43592c257cece2eb8cc021808062917 (patch) | |
tree | d0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples3/lineedits.py | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'examples3/lineedits.py')
-rwxr-xr-x | examples3/lineedits.py | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/examples3/lineedits.py b/examples3/lineedits.py index 7d1a37a..5ff9538 100755 --- a/examples3/lineedits.py +++ b/examples3/lineedits.py @@ -5,7 +5,7 @@ #** #** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. #** -#** This file is part of an example program for PyQt. This example +#** This file is part of an example program for PyTQt. This example #** program may be used, distributed and modified without limitation. #** #*****************************************************************************/ @@ -16,37 +16,37 @@ from qt import * TRUE = 1 FALSE = 0 -class LineEdits(QGroupBox): +class LineEdits(TQGroupBox): def __init__(self, parent = None, name = None): - QGroupBox.__init__(self, 0, Qt.Horizontal, "Line Edits", parent, name) + TQGroupBox.__init__(self, 0, TQt.Horizontal, "Line Edits", parent, name) self.setMargin(10) - box = QVBoxLayout(self.layout()) + box = TQVBoxLayout(self.layout()) - row1 = QHBoxLayout(box) + row1 = TQHBoxLayout(box) row1.setMargin(5) - label = QLabel("Echo Mode: ", self) + label = TQLabel("Echo Mode: ", self) row1.addWidget(label) - combo1 = QComboBox(FALSE, self) + combo1 = TQComboBox(FALSE, self) row1.addWidget(combo1) combo1.insertItem("Normal", -1) combo1.insertItem("Password", -1) combo1.insertItem("No Echo", -1) self.connect(combo1, SIGNAL("activated(int)"), self.slotEchoChanged) - self.lined1 = QLineEdit(self) + self.lined1 = TQLineEdit(self) box.addWidget(self.lined1) - row2 = QHBoxLayout(box) + row2 = TQHBoxLayout(box) row2.setMargin(5) - label = QLabel("Validator: ", self) + label = TQLabel("Validator: ", self) row2.addWidget(label) - combo2 = QComboBox(FALSE, self) + combo2 = TQComboBox(FALSE, self) row2.addWidget(combo2) combo2.insertItem("No Validator", -1) combo2.insertItem("Integer Validator", -1) @@ -54,49 +54,49 @@ class LineEdits(QGroupBox): self.connect(combo2, SIGNAL("activated(int)"), self.slotValidatorChanged) - self.lined2 = QLineEdit(self) + self.lined2 = TQLineEdit(self) box.addWidget(self.lined2) - row3 = QHBoxLayout(box) + row3 = TQHBoxLayout(box) row3.setMargin(5) - label = QLabel("Alignment: ", self) + label = TQLabel("Alignment: ", self) row3.addWidget(label) - combo3 = QComboBox(FALSE, self) + combo3 = TQComboBox(FALSE, self) row3.addWidget(combo3) combo3.insertItem("Left", -1) combo3.insertItem("Centered", -1) combo3.insertItem("Right", -1) self.connect(combo3, SIGNAL("activated(int)"), self.slotAlignmentChanged) - self.lined3 = QLineEdit(self) + self.lined3 = TQLineEdit(self) box.addWidget(self.lined3) - row4 = QHBox(self) + row4 = TQHBox(self) box.addWidget(row4) row4.setMargin(5) - QLabel("Read-Only: ", row4) + TQLabel("Read-Only: ", row4) - combo4 = QComboBox(FALSE, row4) + combo4 = TQComboBox(FALSE, row4) combo4.insertItem("False", -1) combo4.insertItem("True", -1) self.connect(combo4, SIGNAL("activated(int)"), self.slotReadOnlyChanged) - self.lined4 = QLineEdit(self) + self.lined4 = TQLineEdit(self) box.addWidget(self.lined4) self.lined1.setFocus() def slotEchoChanged(self, i): if i == 0: - self.lined1.setEchoMode(QLineEdit.Normal) + self.lined1.setEchoMode(TQLineEdit.Normal) elif i == 1: - self.lined1.setEchoMode(QLineEdit.Password) + self.lined1.setEchoMode(TQLineEdit.Password) elif i == 2: - self.lined1.setEchoMode(QLineEdit.NoEcho) + self.lined1.setEchoMode(TQLineEdit.NoEcho) self.lined1.setFocus() @@ -104,20 +104,20 @@ class LineEdits(QGroupBox): if i == 0: self.lined2.setValidator(None) elif i == 1: - self.lined2.setValidator(QIntValidator(self.lined2)) + self.lined2.setValidator(TQIntValidator(self.lined2)) elif i == 2: - self.lined2.setValidator(QDoubleValidator(-999.0, 999.0, 2, self.lined2)) + self.lined2.setValidator(TQDoubleValidator(-999.0, 999.0, 2, self.lined2)) self.lined2.setText("") self.lined2.setFocus() def slotAlignmentChanged(self, i): if i == 0: - self.lined3.setAlignment(QLineEdit.AlignLeft) + self.lined3.setAlignment(TQLineEdit.AlignLeft) elif i == 1: - self.lined3.setAlignment(QLineEdit.AlignCenter) + self.lined3.setAlignment(TQLineEdit.AlignCenter) elif i == 2: - self.lined3.setAlignment(QLineEdit.AlignRight) + self.lined3.setAlignment(TQLineEdit.AlignRight) self.lined3.setFocus() @@ -131,10 +131,10 @@ class LineEdits(QGroupBox): if __name__=='__main__': - app = QApplication( sys.argv ) + app = TQApplication( sys.argv ) lineedits = LineEdits() - lineedits.setCaption("Lineedits - PyQt Example") + lineedits.setCaption("Lineedits - PyTQt Example") lineedits.show() app.setMainWidget(lineedits) app.exec_loop() |