Switched from QDialog to QMainWindow
authorDmitriy Morozov <dmitriy@mrzv.org>
Sat, 05 Mar 2011 15:09:50 -0800
changeset 2 56a5778c903c
parent 1 da08d9c69f4b
child 3 6f1239040a06
Switched from QDialog to QMainWindow
VEFViewer.py
points.py
viewerInterface.ui
--- a/VEFViewer.py	Sat Mar 05 14:59:46 2011 -0800
+++ b/VEFViewer.py	Sat Mar 05 15:09:50 2011 -0800
@@ -3,11 +3,11 @@
 import  ui_PyVEFViewer  as ui
 from    opster          import command, dispatch
 
-class VEFViewerWindow(ui.QtGui.QDialog):
+class VEFViewerWindow(ui.QtGui.QWidget):
     def __init__(self, parent = None):
         super(VEFViewerWindow, self).__init__(parent)
 
-        self.ui = ui.Ui_Dialog()
+        self.ui = ui.Ui_MainWindow()
         self.ui.setupUi(self)
 
 @command(usage = '%name [options]')
--- a/points.py	Sat Mar 05 14:59:46 2011 -0800
+++ b/points.py	Sat Mar 05 15:09:50 2011 -0800
@@ -3,6 +3,7 @@
                            glEnable, glDisable, GL_LIGHTING
 from    PyQt4       import QtGui, QtCore
 from    ViewerItem  import ViewerItem
+from    os.path     import basename
 
 class Point(object):
     __slots__ = ('x','y','z')
@@ -36,7 +37,7 @@
 
 class Points(ViewerItem):
     def __init__(self, filename, parent = None):
-        super(Points, self).__init__(filename, parent)
+        super(Points, self).__init__(basename(filename), parent)
 
         self.points = []
         with open(filename) as f:
--- a/viewerInterface.ui	Sat Mar 05 14:59:46 2011 -0800
+++ b/viewerInterface.ui	Sat Mar 05 15:09:50 2011 -0800
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
- <class>Dialog</class>
- <widget class="QDialog" name="Dialog">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
   <property name="geometry">
    <rect>
     <x>0</x>
@@ -17,6 +17,9 @@
    <property name="spacing">
     <number>6</number>
    </property>
+   <property name="sizeConstraint">
+    <enum>QLayout::SetNoConstraint</enum>
+   </property>
    <property name="margin">
     <number>9</number>
    </property>