[PyQt] Getting a couple errors when I try and start a QMainWindow from a QMainWindow

dizou di_zou at yahoo.com
Mon Jan 4 16:53:08 GMT 2010


I am trying to create another QMainWindow when I click an action in my
QMainWindow. I get these errors when I click the action:

X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 3 (X_GetWindowAttributes)
  Resource id:  0x1800165
X Error: BadValue (integer parameter out of range for operation) 2
  Extension:    144 (Uknown extension)
  Minor opcode: 7 (Unknown request)
  Resource id:  0x1800165
X Error: BadValue (integer parameter out of range for operation) 2
  Extension:    144 (Uknown extension)
  Minor opcode: 7 (Unknown request)
  Resource id:  0x1800165

Here is my code:

class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.main = MainWidget()        
        self.setCentralWidget(self.main)
    def ViewNodeMovement3D(self):
        self.main.ViewNodeMovement3D()

class MainWidget(QWidget):
    def __init__(self):
        QWidget.__init__(self)
    def ViewNodeMovement3D(self):
        vtkWindow = DisplayView3D(self)
        vtkWindow.show()

class DisplayView3D(QMainWindow):
    def __init__(self, parent):
        QMainWindow.__init__(self, parent)

        self.vtkWidget = QVTKRenderWindowInteractor()
     
        self.ren = vtk.vtkRenderer()
        self.vtkWidget.GetRenderWindow().AddRenderer(self.ren)
        
        self.setCentralWidget(self.vtkWidget)
-- 
View this message in context: http://old.nabble.com/Getting-a-couple-errors-when-I-try-and-start-a-QMainWindow-from-a-QMainWindow-tp27015712p27015712.html
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list