I have this:
def __init__(self):
self.tree = TreeArea(self)
self.display = DisplayArea(self)
gridLayout.addWidget(self.tree, 0, 0)
gridLayout.addWidget(self.display, 0, 1)
class MainWidget(QWidget):
def __init__(self):
self.tree = TreeArea(self)
self.display = DisplayArea(self)
gridLayout = QGridLayout()
gridLayout.addWidget(self.tree, 0, 0)
gridLayout.addWidget(self.display, 0, 1)
To copy to clipboard, switch view to plain text mode
where TreeArea is:
def __init__(self, parent):
class TreeArea(QTreeWidget):
def __init__(self, parent):
QTreeWidget.__init__(self, parent)
To copy to clipboard, switch view to plain text mode
and DisplayArea is:
def __init__(self, parent):
class DisplayArea(QGraphicsScene):
def __init__(self, parent):
QGraphicsScene.__init__(self, parent)
To copy to clipboard, switch view to plain text mode
Qt doesn't like it when I do gridLayout.addWidget(self.display, 0, 1) since self.display does not inherit QWidget. So how do I add a QGraphicsScene to a layout?
Bookmarks