示例#1
0
class CentralWidget(QtWidgets.QWidget):

    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)
        self.control = parent.control
        self.setWindowTitle('pyMolDyn 2')
        self.widget_titles = (
                "3D View",
                "Pair Distribution Functions",
                "Cavity Histograms")
        self.init_gui()

    def init_gui(self):
        self.gl_stack = GLStack(self, self.parent())
        self.gl_widget = self.gl_stack.gl_widget
        self.combo = QtWidgets.QComboBox()
        for title in self.widget_titles:
            self.combo.addItem(title)
        self.combo.activated[str].connect(self.on_combo)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.gl_stack)
        layout.addWidget(self.combo)

        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setLayout(layout)

    def on_combo(self, string):
        index = self.widget_titles.index(string)
        self.gl_stack.activate(index)
示例#2
0
class CentralWidget(QtWidgets.QWidget):
    def __init__(self, parent):
        QtWidgets.QWidget.__init__(self, parent)
        self.control = parent.control
        self.setWindowTitle('pyMolDyn 2')
        self.widget_titles = ("3D View", "Pair Distribution Functions",
                              "Cavity Histograms")
        self.init_gui()

    def init_gui(self):
        self.gl_stack = GLStack(self, self.parent())
        self.gl_widget = self.gl_stack.gl_widget
        self.combo = QtWidgets.QComboBox()
        for title in self.widget_titles:
            self.combo.addItem(title)
        self.combo.activated[str].connect(self.on_combo)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.gl_stack)
        layout.addWidget(self.combo)

        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setLayout(layout)

    def on_combo(self, string):
        index = self.widget_titles.index(string)
        self.gl_stack.activate(index)
示例#3
0
    def init_gui(self):
        self.gl_stack = GLStack(self, self.parent())
        self.gl_widget = self.gl_stack.gl_widget
        self.combo = QtWidgets.QComboBox()
        for title in self.widget_titles:
            self.combo.addItem(title)
        self.combo.activated[str].connect(self.on_combo)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.gl_stack)
        layout.addWidget(self.combo)

        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setLayout(layout)
示例#4
0
    def init_gui(self):
        self.gl_stack = GLStack(self, self.parent())
        self.gl_widget = self.gl_stack.gl_widget
        self.combo = QtWidgets.QComboBox()
        for title in self.widget_titles:
            self.combo.addItem(title)
        self.combo.activated[str].connect(self.on_combo)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.gl_stack)
        layout.addWidget(self.combo)

        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setLayout(layout)