summaryrefslogtreecommitdiffstats
path: root/examples2/table.py
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-11-29 01:11:08 -0600
committerTimothy Pearson <[email protected]>2011-11-29 01:11:08 -0600
commit8a055d66f43592c257cece2eb8cc021808062917 (patch)
treed0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples2/table.py
parentb388516ca2691303a076a0764fd40bf7116fe43d (diff)
downloadpytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz
pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip
Initial TQt conversion
Diffstat (limited to 'examples2/table.py')
-rwxr-xr-xexamples2/table.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples2/table.py b/examples2/table.py
index 58fd04b..f9502b7 100755
--- a/examples2/table.py
+++ b/examples2/table.py
@@ -3,12 +3,12 @@
import sys
from qt import *
-class Table(QTableView):
+class Table(TQTableView):
def __init__(self, numRows, numCols, parent=None, name=''):
- QTableView.__init__(self, parent, name)
+ TQTableView.__init__(self, parent, name)
self.curRow = self.curCol = 0
- self.setFocusPolicy(QWidget.StrongFocus)
- self.setBackgroundMode(QWidget.PaletteBase)
+ self.setFocusPolicy(TQWidget.StrongFocus)
+ self.setBackgroundMode(TQWidget.PaletteBase)
self.setNumCols(numCols)
self.setNumRows(numRows)
self.setCellWidth(100)
@@ -39,11 +39,11 @@ class Table(QTableView):
if self.hasFocus():
p.drawRect(0, 0, x2, y2)
else:
- p.setPen(Qt.DotLine)
+ p.setPen(TQt.DotLine)
p.drawRect(0, 0, x2, y2)
- p.setPen(Qt.SolidLine)
+ p.setPen(TQt.SolidLine)
- p.drawText(0,0,w,h,Qt.AlignCenter,self.contents[self.indexOf(row,col)])
+ p.drawText(0,0,w,h,TQt.AlignCenter,self.contents[self.indexOf(row,col)])
def mousePressEvent(self, me):
oldRow = self.curRow
@@ -105,7 +105,7 @@ class Table(QTableView):
numRows = 20
numCols = 20
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
v = Table(numRows, numCols)
for i in range(numRows):
for j in range(numCols):