Пример #1
0
    def __init__(self, parent, client):
        super(ProcExecDialog, self).__init__(parent)

        self.setLayout(QtGui.QVBoxLayout())

        self.pep = ProcExecPanel(self, client)
        self.pep.context_updated.connect(self._on_context_update)
        self.layout().addWidget(self.pep)

        buttons_layout = QtGui.QHBoxLayout()
        self.layout().addLayout(buttons_layout)

        self.execute_button = QtGui.QPushButton('Execute', self)
        self.execute_button.clicked.connect(self.execute)
        buttons_layout.addWidget(self.execute_button)

        b = QtGui.QPushButton('Close', self)
        b.clicked.connect(self.close)
        buttons_layout.addWidget(b)
Пример #2
0
            screen = self.sweep_panel.new_screen()
            screen.setLayout(QtGui.QFormLayout())
            for i in range(10):
                self.index += 1
                screen.layout().addRow('Row #' + str(self.index),
                                       QtGui.QLineEdit(i * 'blah ', screen))

        def clear(self):
            self.sweep_panel.clear()

    import sys
    app = QtGui.QApplication(sys.argv)
    f = QtGui.QFrame(None)
    f.resize(500, 500)
    f.setLayout(QtGui.QVBoxLayout())

    bn = QtGui.QPushButton('next', f)
    f.layout().addWidget(bn)

    bc = QtGui.QPushButton('clear', f)
    f.layout().addWidget(bc)

    w = Tester(f)
    f.layout().addWidget(w)

    bn.clicked.connect(w.next)
    bc.clicked.connect(w.clear)

    f.show()
    app.exec_()