|
From: <hba...@us...> - 2009-06-21 19:35:10
|
Revision: 10057
http://plplot.svn.sourceforge.net/plplot/?rev=10057&view=rev
Author: hbabcock
Date: 2009-06-21 19:35:06 +0000 (Sun, 21 Jun 2009)
Log Message:
-----------
Remove plplot_pyqt directory since at least in the near future we'll likely only have a single example. Rename the example from pyqt_test.py to pyqt4_test.py to emphasize its dependence on pyqt4.
Added Paths:
-----------
trunk/examples/python/pyqt4_test.py
Removed Paths:
-------------
trunk/examples/python/plplot_pyqt/
Copied: trunk/examples/python/pyqt4_test.py (from rev 10051, trunk/examples/python/plplot_pyqt/pyqt_test.py)
===================================================================
--- trunk/examples/python/pyqt4_test.py (rev 0)
+++ trunk/examples/python/pyqt4_test.py 2009-06-21 19:35:06 UTC (rev 10057)
@@ -0,0 +1,60 @@
+#!/usr/bin/python
+#
+# A simple PLplot/PyQt example
+#
+# Copyright (C) 2009 Hazen Babcock
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Library Public License as published
+# by the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+
+import sys
+from PyQt4 import QtCore, QtGui
+import plplot
+import plplot_pyqt
+
+class QPlot(QtGui.QMainWindow):
+ def __init__(self):
+ print "init"
+ QtGui.QMainWindow.__init__(self, None)
+
+ self.plot = plplot_pyqt.QtExtWidget(800, 800, self)
+ self.setCentralWidget(self.plot)
+
+ plplot_pyqt.plsetqtdev(self.plot)
+ plplot.plsdev("extqt")
+ plplot.plinit()
+
+ self.resize(400,400)
+
+ def cleanup(self):
+ plplot.plend()
+ plplot_pyqt.plfreeqtdev()
+
+ def paintEvent(self, event):
+ plplot.pladv(0)
+ plplot.plenv(0, 10, 0, 10, 0, 0)
+ plplot.pllab("X", "Y", "X vs Y")
+ self.plot.show()
+
+
+app = QtGui.QApplication(sys.argv)
+plot = QPlot()
+plot.show()
+app.exec_()
+plot.cleanup()
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|