示例#1
0
    def __init__(self):
        super(YastGui, self).__init__()
        logging.info("Initializing GUI")
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.total_records = 0

        # Disable frames
        self.ui.token_frame.setEnabled(False)
        self.ui.filter_frame.setEnabled(False)
        self.ui.session_frame.setEnabled(False)

        # Set on click event for all buttons
        self.ui.B_choose_file.clicked.connect(self.choose_file)
        self.ui.file_path_textEdit.textChanged.connect(
            lambda x: self.ui.token_frame.setEnabled(True))
        self.ui.log_format_comboBox.currentIndexChanged.connect(
            lambda x: self.ui.token_frame.setEnabled(True))
        self.ui.B_Close.clicked.connect(self.close_application)
        self.ui.B_Save.clicked.connect(self.file_save)
        self.ui.B_TStart.clicked.connect(self.tokenization_handler)
        self.ui.B_CStart.clicked.connect(self.filter_handler)
        self.ui.B_SStart.clicked.connect(self.sessionization_handler)
        self.ui.actionOpen.triggered.connect(self.choose_file)
        self.ui.actionOpen.setShortcut("ctrl+O")
        self.ui.actionSave_As.triggered.connect(self.file_save)
        self.ui.actionSave_As.setShortcut("Ctrl+S")
        self.ui.actionExit.triggered.connect(self.close_application)

        logging.info("GUI initialization completed")
示例#2
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.administrador = Administrador()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.agregar_final_pushButton.clicked.connect(self.click_agregar)
        self.ui.agregar_inicio_pushButton.clicked.connect(
            self.click_agregar_inicio)
        self.ui.mostrar_pushButton.clicked.connect(self.click_mostrar)
        self.ui.actionAbrir.triggered.connect(self.action_abrir_archivo)
        self.ui.actionGuardar.triggered.connect(self.action_guardar_archivo)

        self.ui.mostrar_tabla_pushButton.clicked.connect(self.mostrar_tabla)
        self.ui.buscar_pushButton.clicked.connect(self.buscar_id)

        self.ui.dibujar.clicked.connect(self.dibujar)
        self.ui.limpiar.clicked.connect(self.limpiar)

        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)

        self.ui.actionId_ascendente.triggered.connect(self.action_ordenar_id)
        self.ui.actionDistancia_descendente.triggered.connect(
            self.action_ordenar_distancia)
        self.ui.actionVelocidad_ascendente.triggered.connect(
            self.action_ordenar_velocidad)

        self.ui.actionGrafo.triggered.connect(self.action_crear_grafo)
示例#3
0
    def __init__(self):
        super().__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.scene = QGraphicsScene()
        #self.scene.setSceneRect(0,500)
        self.ui.graphicsView.setScene(self.scene)

        self.pen = QPen()
        self.pen.setColor(QColor(0, 0, 0))
        self.pen.setWidth(1)

        self.lista = []
        self.listaMenor = []

        self.capturador = Capturador()

        self.ui.pushButton.clicked.connect(self.click)
        self.ui.pushButton_2.clicked.connect(self.mostrar)

        self.ui.actionGuardar.triggered.connect(self.guardar)
        self.ui.actionAbrir_2.triggered.connect(self.abrir)
        self.ui.actionMostar.triggered.connect(self.mostarParticulasPuntos)

        self.ui.actionPuntos_Cercanos.triggered.connect(self.puntos_cercanos)

        self.ui.pushButton_3.clicked.connect(self.ordenar_velocidad)

        self.ui.pushButton_4.clicked.connect(self.ordenar_distancia)
示例#4
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.libreria = Libreria()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.ui.agregar_pushButton.clicked.connect(
            self.click_agregar)  #agregado
        self.ui.mostrar_pushButton.clicked.connect(self.mostrar)  #agregado
        self.ui.ordenar_velocidad_pushButton.clicked.connect(
            self.ordenar_velocidad)
        self.ui.ordenar_distancia_pushButton.clicked.connect(
            self.ordenar_distancia)

        self.ui.actionguardar.triggered.connect(self.action_guardar)  #agregado
        self.ui.actionabrir.triggered.connect(self.action_abrir)  #agregado
        self.ui.actiongrafo.triggered.connect(self.mostrar_diccionario)

        self.ui.actionRecorrido_en_Profundidad_Amplitud.triggered.connect(
            self.recorrido_p_a)
        self.grafo = {}

        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)
示例#5
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # Init number buttons
        self.ui.pushButton_1.clicked.connect(lambda: self.add_to_main_field(1))
        self.ui.pushButton_2.clicked.connect(lambda: self.add_to_main_field(2))
        self.ui.pushButton_3.clicked.connect(lambda: self.add_to_main_field(3))
        self.ui.pushButton_4.clicked.connect(lambda: self.add_to_main_field(4))
        self.ui.pushButton_5.clicked.connect(lambda: self.add_to_main_field(5))
        self.ui.pushButton_6.clicked.connect(lambda: self.add_to_main_field(6))
        self.ui.pushButton_7.clicked.connect(lambda: self.add_to_main_field(7))
        self.ui.pushButton_8.clicked.connect(lambda: self.add_to_main_field(8))
        self.ui.pushButton_9.clicked.connect(lambda: self.add_to_main_field(9))

        # Init action signs
        self.ui.pushButton_minus.clicked.connect(
            lambda: self.add_to_main_field('-'))
        self.ui.pushButton_plus.clicked.connect(
            lambda: self.add_to_main_field('+'))
        self.ui.pushButton_star.clicked.connect(
            lambda: self.add_to_main_field('*'))
        self.ui.pushButton_bravely.clicked.connect(
            lambda: self.add_to_main_field('/'))

        self.ui.pushButton_equal.clicked.connect(
            lambda: self.add_counted_score())

        self.ui.radioButtonRed.toggled.connect(lambda: self.change_color())
        self.ui.radioButtonBlue.toggled.connect(lambda: self.change_color())
        self.ui.radioButtonBlack.toggled.connect(lambda: self.change_color())
    def __init__(self):
        super(MainWindow, self).__init__()

        self.particulas = Particulas()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.agregar_final_pushButton.clicked.connect(self.click_agregar)
        self.ui.agregar_inicio_pushButton.clicked.connect(
            self.click_agregar_inicio)
        self.ui.mostrar_pushButton.clicked.connect(self.click_mostrar)
        self.ui.actionAbrir.triggered.connect(self.click_abrir_archivo)
        self.ui.actionGuardar.triggered.connect(self.click_guardar_archivo)
        self.ui.mostrar_tabla_pushButton.clicked.connect(self.mostrar_tabla)
        self.ui.buscar_pushButton.clicked.connect(self.buscar_id)

        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)

        self.ui.dibujar_pushButton.clicked.connect(self.dibujar)
        self.ui.limpiar_pushButton.clicked.connect(self.limpiar)

        self.ui.ordenar_id_pushButton.clicked.connect(self.ordenar_id)
        self.ui.ordenar_distancia_pushButton.clicked.connect(
            self.ordenar_distancia)
        self.ui.ordenar_velocidad_pushButton.clicked.connect(
            self.ordenar_velocidad)

        self.ui.actionGrafo.triggered.connect(self.mostrar_grafos)

        self.ui.action_busqueda.triggered.connect(self.busqueda)
示例#7
0
文件: main.py 项目: tuanken92/py_qt
    def __init__(self):
        # global mImage

        super(MainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        #init widgets
        self.initWidgets()

        #display image
        self.filename = "automation.jpg"
        self.mImage = np.array([])
        # if self.mImage:
        #     self.display_image(self.mImage)

        #Button clicked
        self.ui.btnTest.clicked.connect(self.button_event)
        self.ui.btnGet.clicked.connect(self.button_event)
        self.ui.btnLoad.clicked.connect(self.button_event)
        #Checkbox
        self.ui.cbTest.clicked.connect(self.button_event)
        #radiobox
        self.ui.rdTest.clicked.connect(self.button_event)

        #Slider
        self.ui.sldTest.valueChanged.connect(self.slider_event)

        #combobox
        self.ui.cbbTest.currentTextChanged.connect(self.cbb_event)

        #tab
        self.ui.tabWidget.currentChanged.connect(self.tabwidget_event)
示例#8
0
class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.paqueteria = Paqueteria()

        self.ui.pushButton.clicked.connect(self.click)
        self.ui.pushButton_2.clicked.connect(self.mostrar)

        self.ui.actionGuardar.triggered.connect(self.guardar)
        self.ui.actionAbrir.triggered.connect(self.abrir)

    @Slot()
    def guardar(self):
        file = QFileDialog.getSaveFileName(self, 'Guardar archivo...', '.',
                                           'JSON (*.json)')
        print(file)
        self.paqueteria.guardar(file[0])

    @Slot()
    def abrir(self):
        file = QFileDialog.getOpenFileName(self, 'Abrir archivo', '.',
                                           'JSON (*.json)')
        self.paqueteria.recuperar(file[0])

    @Slot()
    def mostrar(self):
        for paquete in self.paqueteria.lista:
            self.ui.plainTextEdit.insertPlainText(str(paquete))
        #self.paqueteria.mostrar()

    @Slot()
    def click(self):
        id = self.ui.lineEdit.text()
        origen = self.ui.lineEdit_2.text()
        destino = self.ui.lineEdit_3.text()
        distancia = self.ui.lineEdit_4.text()
        peso = self.ui.lineEdit_5.text()
        print(id, origen, destino, distancia, peso)

        paquete = Paquete()
        paquete.id = id
        paquete.origen = origen
        paquete.destino = destino
        paquete.distancia = distancia
        paquete.peso = peso

        self.paqueteria.agregar(paquete)

        msg = QMessageBox.information(
            self, 'Exito', 'Se agrego paquete con exito'
        )  #Ventana de mensaje de la libreria QMessageBox

        self.ui.lineEdit.clear()  #Limpiar campos
        self.ui.lineEdit_2.clear()
        self.ui.lineEdit_3.clear()
        self.ui.lineEdit_4.clear()
        self.ui.lineEdit_5.clear()
示例#9
0
class MainWindow(QtGui.QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.nameLabel.setProperty('class', 'mandatory QLabel')
        self.styleSheetEditor = StyleSheetEditor(self)
        self.statusBar().addWidget(QtGui.QLabel("Ready"))
        self.ui.exitAction.triggered.connect(QtGui.qApp.quit)
        self.ui.aboutQtAction.triggered.connect(QtGui.qApp.aboutQt)

    def on_editStyleAction_triggered(self):
        self.styleSheetEditor.show()
        self.styleSheetEditor.activateWindow()

    def on_aboutAction_triggered(self):
        QtGui.QMessageBox.about(
            self, "About Style sheet",
            "The <b>Style Sheet</b> example shows how widgets can be "
            "styled using "
            "<a href=\"http://qt.nokia.com/doc/4.7/stylesheet.html\">Qt "
            "Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop "
            "up the style editor, and either choose an existing style "
            "sheet or design your own.")
示例#10
0
    def __init__(self, parent=None):
        super().__init__(parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        quick_widget = self.ui.quickWidget  #type: QQuickWidget
        # quick_widget.setSource(QUrl('qrc:/welcomePage.qml'))
        quick_widget.rootContext().setContextProperty('MainWindow', self)

        # init table view dengan table model
        self.tableModel = None
        # self.ui.tableView.setModel(self.tableModel)

        # stacked widget
        self.ui.stackedWidget.setCurrentIndex(0)

        # menuQuickWidget
        self.ui.menuQuickWidget.rootContext().setContextProperty(
            'MainWindow', self)

        # columnQuickWidget
        # self.ui.columnQuickWidget.rootContext().setContextProperty('MainWindow', self)
        # self.ui.columnQuickWidget.setSource(QUrl('qrc:/qml/ColumnList.qml'))

        self.scaler = None  # pointer ke MinMaxScaler
示例#11
0
    def __init__(self):
        super(MainWindow, self).__init__() #Se llama a la ventana
        
        self.administrador = Administrador()
        self.grafo = dict()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        #Conexión del Slot
        self.ui.agregarFinal_pushButton.clicked.connect(self.click_agregar)
        self.ui.agregarInicio_pushButton.clicked.connect(self.click_agregarInicio)
        self.ui.mostrar_pushButton.clicked.connect(self.click_mostrar)
        
        self.ui.actionAbrir.triggered.connect(self.action_abrir_archivo)
        self.ui.actionGuardar.triggered.connect(self.action_guardar_archivo)
        self.ui.actionGrafo.triggered.connect(self.to_graph)
        self.ui.actionRecorrido.triggered.connect(self.action_recorrido)

        self.ui.mostrar_tabla_pushButton.clicked.connect(self.mostrar_tabla)
        self.ui.buscar_pushButton.clicked.connect(self.buscar_id)

        self.ui.dibujar.clicked.connect(self.dibujar)
        self.ui.limpiar.clicked.connect(self.limpiar)

        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)

        self.ui.ordenar_id_pushButton.clicked.connect(self.order_id)
        self.ui.ordenar_distancia_pushButton.clicked.connect(self.order_distancia)
        self.ui.ordenar_velocidad_pushButton.clicked.connect(self.order_velocidad)
示例#12
0
    def __init__(self):
        DossierActuel = QDir(QDir.currentPath())
        if not DossierActuel.cd("platform-tools"):
            url = None
            if platform.system() == "Windows":
                url = 'https://dl.google.com/android/repository/platform-tools-latest-windows.zip'
            elif platform.system() == "Darwin":  #MacOS
                url = 'https://dl.google.com/android/repository/platform-tools-latest-darwin.zip'
            elif platform.system() == "Linux":
                url = 'https://dl.google.com/android/repository/platform-tools-latest-linux.zip'
            reply = requests.get(url)
            zip_ref = zipfile.ZipFile(io.BytesIO(reply.content))
            zip_ref.extractall(DossierActuel.absolutePath())
            zip_ref.close()
        super(MainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.Manager = ManagerDevice(self)
        self.Manager.start()

        self.ui.SelectScript.clicked.connect(self.LoadScripts)
        self.ui.SelectData.clicked.connect(self.LoadData)
        self.ui.ButtonAllGo.clicked.connect(self.ButtonAllGo)

        self.ui.tableWidget.itemActivated.connect(self.ClickDevice)
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.abInicio.clicked.connect(self.click_agregar_inicio)
     self.ui.abFinal.clicked.connect(self.click_agregar_final)
     self.ui.abMostrar.clicked.connect(self.click_mostrar)
示例#14
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.adm_part = Adm_part()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.agregar_final_pushButton.clicked.connect(self.click_agregar)
        self.ui.agregar_inicio_pushButton.clicked.connect(
            self.click_agregar_inicio)
        self.ui.mostrar_pushButton.clicked.connect(self.click_mostrar)

        self.ui.actionAbrir.triggered.connect(self.action_abrir_archivo)
        self.ui.actionGuardar.triggered.connect(self.action_guardar_archivo)

        self.ui.actionOrdenar_por_ID.triggered.connect(
            self.action_Ordenar_por_ID)
        self.ui.actionOrdenar_por_distancia.triggered.connect(
            self.action_Ordenar_por_distancia)
        self.ui.actionOrdenar_por_velocidad.triggered.connect(
            self.action_Ordenar_por_velocidad)

        self.ui.actionGrafo.triggered.connect(self.action_Grafo)

        self.ui.actionBusqueda_profundidad_anchura.triggered.connect(
            self.action_busqueda)

        self.ui.mostrar_tabla_pushButton.clicked.connect(self.mostrar_tabla)
        self.ui.buscar_pushButton.clicked.connect(self.buscar_id)

        self.ui.dibujar.clicked.connect(self.dibujar)
        self.ui.limpiar.clicked.connect(self.limpiar)

        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)
示例#15
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.inputFileButton.clicked.connect(self.handle_input)
     self.ui.openButton.clicked.connect(self.handle_open)
     self.ui.startButton.clicked.connect(self.handle_start)
示例#16
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.openedFiles = []

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        logo = QPixmap('searchy_logo.png')
        self.ui.launch_logo.setPixmap(logo)

        self.workerThread = QThread()
        self.workerThread.start()

        self.worker = SearchWorker()
        self.worker.moveToThread(self.workerThread)

        self.ui.launch_search_button.clicked.connect(self.searchButtonClicked)
        self.ui.launch_search_box.returnPressed.connect(
            self.searchButtonClicked)

        self.ui.results_search_button.clicked.connect(self.searchButtonClicked)
        self.ui.results_search_box.returnPressed.connect(
            self.searchButtonClicked)

        self.start_search.connect(self.worker.startSearch)
        self.worker.match_found.connect(self.onMatchFound)
        self.worker.finished.connect(self.searchFinished)

        self.ui.results_tree_widget.itemDoubleClicked.connect(
            self.itemSelected)

        self.searching = False
示例#17
0
class MyMainWindow(QMainWindow):
    def __init__(self):
        super(MyMainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.actionopen.triggered.connect(self.onOpen)
        self.onOpen()

    @Slot()
    def onOpen(self):
        #        fname,_ = QFileDialog.getOpenFileName(self,'open file',"F:/c++space/MyEditorTools/", "Image Files (*.png *.jpg *.bmp)")
        fname = 'F:/c++space/GameTools/GameTools/testdata/s100.png'
        print('=====%s' % (fname, ))
        #        image = QtGui.QPixmap()
        #        image.load(fname)
        #        scene = QGraphicsScene()
        #        scene.addPixmap(image)
        #        self.ui.graphicsView.setScene(scene)
        #        self.ui.graphicsView.show()
        #        scrollArea = QtWidgets.QScrollArea(self)
        map = MapWidget(fname, self.ui.scrollAreaWidgetContents.rect(),
                        self.ui.scrollArea.rect())
        hbox = QtWidgets.QHBoxLayout()
        hbox.addWidget(map)
        #        self.ui.centralwidget.setLayout(hbox)
        self.ui.scrollAreaWidgetContents.setLayout(hbox)
        self.ui.statusbar.showMessage(fname)
示例#18
0
文件: main.py 项目: hensir/LANTT
 def __init__(self, parent=None):
     """初始化窗体"""
     super().__init__(parent)  # 调用父类构造函数,创建窗体
     self.ui = Ui_MainWindow()  # 创建UI对象
     self.ui.setupUi(self)  # 构造UI界面
     self.setWindowTitle("LANTT")
     self._PortDialog = None  # 特殊的处理方法 共用的两个变量
     self._ThreadDialog = None
     # -----设置默认tab界面-----
     if sys.argv[0].find('client') == -1:  # 如果当前文件名中没有client字样就 默认tabServer
         self.ui.tabWidget.setCurrentIndex(0)
     else:
         self.ui.tabWidget.setCurrentIndex(1)
     # ------tabServer的设置------
     self.ui.StE.setTextColor(QColor(0, 255, 0))
     self._filelist = []
     self._ServerFileFolder = sys.argv[0][:sys.argv[0].rfind('/') + 1]
     self._ServerFFF = QDir(self._ServerFileFolder).entryList(QDir.Files | QDir.NoDot)  # 文件夹下的文件
     self._ServerPort = 23719
     self._ServerThreadNum = 2
     self._ServerText2Send = None
     self._textDialog = None
     self.ServerStatus = False  # 做给线程轮询判断 用来断开服务
     self.initStE()
     # ------tabClient的设置------
     self.ui.CtE.setTextColor(QColor(0, 255, 0))
     self._ClientFileFolder = sys.argv[0][:sys.argv[0].rfind('/') + 1]
     self._ClientConnIP = "192.168.6.120"
     self._ClientConnPort = 23719
     self._ClientThreadNum = 6
     self._ClientText2Recv = None
     self._ClientGetIPDialog = None
     self.ClientStatus = False  # 做给线程轮询判断 用来断开服务
     self.initCtE()
示例#19
0
class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.nameLabel.setProperty("class", "mandatory QLabel")
        self.styleSheetEditor = StyleSheetEditor(self)
        self.statusBar().addWidget(QLabel("Ready"))
        self.ui.exitAction.triggered.connect(QApplication.instance().quit)
        self.ui.aboutQtAction.triggered.connect(QApplication.instance().aboutQt)

    def on_editStyleAction_triggered(self):
        self.styleSheetEditor.show()
        self.styleSheetEditor.activateWindow()

    def on_aboutAction_triggered(self):
        QMessageBox.about(
            self,
            "About Style sheet",
            "The <b>Style Sheet</b> example shows how widgets can be "
            "styled using "
            '<a href="http://doc.qt.digia.com/4.5/stylesheet.html">Qt '
            "Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop "
            "up the style editor, and either choose an existing style "
            "sheet or design your own.",
        )
示例#20
0
文件: init.py 项目: Za012/MMA-Posture
    def __init__(self):
        app = QApplication([])
        print("init")
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        #   INSTANTIATE GUI BACKEND
        # KeyPoint Generator
        key_gen = KeyPointGenerator(self.ui)
        key_gen.attach()

        # File labeler
        labeler = FileLabeler(self.ui)
        labeler.attach()

        # Teacher
        teach = Teach(self.ui)
        teach.attach()

        # Teacher
        frame_predictor = FramePredictor(self.ui)
        frame_predictor.attach()

        QMainWindow.show(self)
        sys.exit(app.exec_())
示例#21
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.AlmacenP = AlmacenDeParticulas()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.AgregarFinal.clicked.connect(self.click_agregar)
        self.ui.AgregarInicio.clicked.connect(self.click_agregarInicio)
        self.ui.Mostrar.clicked.connect(self.click_mostrar)

        self.ui.actionAbrir.triggered.connect(self.action_abrir_archivo)
        self.ui.actionGuardar.triggered.connect(self.action_guardar_archivo)

        self.ui.Mostrar_Tabla_Boton.clicked.connect(self.mostrar_tabla)
        self.ui.Buscar_Boton.clicked.connect(self.buscar_id)

        self.ui.Dibujar.clicked.connect(self.dibujar)
        self.ui.Limpiar.clicked.connect(self.limpiar)

        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)

        self.ui.OrdId.clicked.connect(self.ordId)
        self.ui.OrdDistancia.clicked.connect(self.ordDistancia)
        self.ui.OrdVelocidad.clicked.connect(self.ordVelocidad)

        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)
        self.Scene = QGraphicsScene()
        self.ui.GrafoF_graphicsView.setScene(self.Scene)
        self.ui.Mostrar_pushButton.clicked.connect(self.MostrarGrafo)
        self.ui.Limpiar_pushButton.clicked.connect(self.limpiarGrafo)

        self.ui.Recorrer.clicked.connect(self.Profundidad_Amplitud)
示例#22
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.particulas = Particula_libreria()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.agregar_inicio_pushButton.clicked.connect(
            self.click_agregar_inicio)
        self.ui.agregar_final_pushButton.clicked.connect(
            self.click_agregar_final)
        self.ui.mostrar_pushButton.clicked.connect(self.click_mostrar)

        self.ui.actionAbrir.triggered.connect(self.action_abrir_archivo)
        self.ui.actionGuardar.triggered.connect(self.action_guardar_archivo)

        self.ui.mostar_tabla_pushButton_2.clicked.connect(self.mostrar_tabla)
        self.ui.buscar_pushButton.clicked.connect(self.buscar_particula)

        self.ui.dibujar.clicked.connect(self.dibujar)
        self.ui.limpiar.clicked.connect(self.limpiar)
        self.scene = QGraphicsScene()
        self.ui.graphicsView.setScene(self.scene)

        self.ui.actionPor_id.triggered.connect(self.ordenar_id)
        self.ui.actionPor_distancia.triggered.connect(self.ordenar_distancia)
        self.ui.actionPor_velocidad.triggered.connect(self.ordenar_velocidad)

        self.ui.actionMostrar_diccionario.triggered.connect(
            self.mostrar_diccionario)
        self.ui.actionBusqueda_de_Profundidad.triggered.connect(self.recorrido)
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # Variable de control (llamada iniciada o no)

        self.llamada_en_curso = False

        # ID del frame de video local y del video remoto
        self.id_frame_local = self.ui.frame_video_local.winId()
        self.id_frame_remoto = self.ui.frame_video_remoto.winId()

        # Listeners para cada elemento del menu
        self.ui.dial_bitrate_video.valueChanged.connect(self.modificar_br_video)
        self.ui.caja_bitrate_audio.currentTextChanged.connect(self.modificar_br_audio)
        self.ui.caja_fps.currentTextChanged.connect(self.avisar_fps)
        self.ui.caja_resolucion.currentTextChanged.connect(self.avisar_resolucion)
        self.ui.caja_muestras.currentTextChanged.connect(self.avisar_muestras)
        self.ui.dial_volumen.valueChanged.connect(self.modificar_volumen)
        self.ui.check_mute.stateChanged.connect(self.mute_unmute_audio)
        self.ui.boton_iniciar.clicked.connect(self.iniciar_llamada)
        self.ui.boton_finalizar.clicked.connect(self.finalizar_llamada)
        self.ui.slider_drop_video.sliderMoved.connect(self.cambiar_drop_video)
        self.ui.slider_drop_audio.sliderMoved.connect(self.cambiar_drop_audio)
 def __init__(self):
     super(MainWindow, self).__init__()
     
     self.particulas = AdminParticula() #instancia en la clase MainWindow
     
     self.ui = Ui_MainWindow() #crear un objeto de una vista del designer
     self.ui.setupUi(self) #Las configuraciones que se hacen se incrustan en el objeto
     self.ui.agregar_inicio_pushButton.clicked.connect(self.click_agregar_inicio) #Decirle que cuando le de click se conecte a la función
     self.ui.agregar_final_pushButton.clicked.connect(self.click_agregar_final)
     self.ui.mostrar_pushButton.clicked.connect(self.mostrar) #Conectar el evento del boton a la función
     
     #Conectar eventos al presionar respectivos botones abrir y guardar 
     #Triggered -> Disparó
     self.ui.actionAbrir.triggered.connect(self.action_abrir_archivo)
     self.ui.actionGuardar.triggered.connect(self.action_guardar_archivo)
     
     #Conexión a botones tabla
     self.ui.mostrar_tabla_pushButton.clicked.connect(self.action_mostrar_tabla)
     self.ui.buscar_pushButton.clicked.connect(self.action_buscar_id)
     
     #Conexión a botones dibujar
     self.ui.draw_pushButton.clicked.connect(self.action_dibujar)
     self.ui.clear_pushButton.clicked.connect(self.action_limpiar)
     
     #Crear Escena
     self.scene = QGraphicsScene() #Crear escena
     self.ui.graphicsView.setScene(self.scene) #Insertar scene
     
     #Button sort Plane and Edit
     self.ui.sort_plane_pushButton.clicked.connect(self.action_sort_plane)
     
     #Button Busquedas en profundidad y en anchura
     self.ui.busqueda_grafo_pushButton.clicked.connect(self.action_busqueda_grafo)
示例#25
0
class MainWindow(QtWidgets.QMainWindow):
    def __init__(self, parent = None): #, ui_file, parent = None):
        super(MainWindow, self).__init__(parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.pushButton.clicked.connect(self.btn_handler)
    def btn_handler(self):
       self.close()
       self.camview = CameraView()
       self.camview.show()

    def makeOptionButton(self):
       self.menu = QMenu()
       self.testAction = QAction("Options", self)
       self.menu.addAction(self.testAction)
       self.toolButton.setMenu(self.menu)
       self.toolButton.setPopupMode(QToolButton.InstantPopup)

    @QtCore.Slot()
    def setFrame(self,frame):
        frame = np.array(frame[...,::-1])
        Qframe = QtGui.QImage(frame.data,frame.shape[1],frame.shape[0],QtGui.QImage.Format_RGB888)
        pixmap = QtGui.QPixmap.fromImage(Qframe)
        self.label.setPixmap(pixmap)

    def set_frame_as_label_pixmap(self,frame,label):
        Qframe = QtGui.QImage(frame.data,frame.shape[1],frame.shape[0],QtGui.QImage.Format_RGB888)
        pixmap = QtGui.QPixmap.fromImage(Qframe)
        label.setPixmap(pixmap)
示例#26
0
    def __init__(self, parent=None, flags=Qt.WindowFlags()):
        super(MainWindow, self).__init__(parent, flags)

        self.dayWidth = 70
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.initModel()
        self.initActions()
        self.initItemDelegate()
        self.initGrid()

        leftView = self.ui.ganttView.leftView()
        leftView.setColumnHidden(1, True)
        leftView.setColumnHidden(2, True)
        leftView.setColumnHidden(3, True)
        leftView.setColumnHidden(4, True)
        leftView.setColumnHidden(5, True)
        leftView.header().setStretchLastSection(True)

        self.ui.ganttView.leftView().customContextMenuRequested.connect(
            self.showContextMenu)
        self.ui.ganttView.selectionModel().selectionChanged.connect(
            self.enableActions)
        self.ui.ganttView.graphicsView().clicked.connect(self.slotClicked)
        self.ui.ganttView.graphicsView().qrealClicked.connect(
            self.slotDoubleClicked)
示例#27
0
class MainWindow(AbstractMainWindow):
    def __init__(self, image_acq, image_rec, posenet, posture_quality_net):
        super(MainWindow, self).__init__(image_acq, image_rec, posenet, posture_quality_net)

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

    def setup_prediciton(self):
        self.posture_quality_net.load_model()
        self.posenet.image_skeleton_signal.connect(self.posture_quality_net.predict_on_skeleton_image)
        self.posture_quality_net.predicition_signal.connect(self.on_prediciton)

    @Slot(int)
    def on_prediciton(self, prediciton):
        if prediciton == 0:
            self.ui.label.setText(
                '<html><head/><body><p><span style=" font-size:18pt; color:#1538e8;">No Posture</span></p></body></html>')
        if prediciton == 1:
            self.ui.label.setText(
                '<html><head/><body><p><span style=" font-size:18pt; color:#e81515;">Very Bad Posture</span></p></body></html>')
        if prediciton == 2:
            self.ui.label.setText(
                '<html><head/><body><p><span style=" font-size:18pt; color:#e87b15;">Bad Posture</span></p></body></html>')
        if prediciton == 3:
            self.ui.label.setText(
                '<html><head/><body><p><span style=" font-size:18pt; color:#e8d615;">Average Posture</span></p></body></html>')
        if prediciton == 4:
            self.ui.label.setText(
                '<html><head/><body><p><span style=" font-size:18pt; color:#a2e815;">Good Posture</span></p></body></html>')
        if prediciton == 5:
            self.ui.label.setText(
                '<html><head/><body><p><span style=" font-size:18pt; color:#15e827;">Very Good Posture</span></p></body></html>')
示例#28
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.MPD = setup_platform()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.timer = QTimer(self)
        self.volume_slider = volume_slider.VolumeWidget()
        self.ui.gridLayout_3.addWidget(self.volume_slider, 0, 6)

        self.update()
        self.ui.playlist_widget.addItems(self.MPD.source_list)

        self.ui.playlist_widget.currentItemChanged.connect(
            self.select_playlist)
        self.ui.songs_widget.currentItemChanged.connect(self.select_song)
        self.volume_slider.valueChanged.connect(self.volume_changed)
        self.ui.play_pause_btn.pressed.connect(self.play_pause)

        self.ui.previous_btn.pressed.connect(
            lambda: self.MPD.media_previous_track())
        self.ui.next_btn.pressed.connect(lambda: self.MPD.media_next_track())
        self.ui.mute_button.pressed.connect(self.toggle_mute)

        self.timer.timeout.connect(self.update)
        self.timer.start(10000)
示例#29
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        print(self.ui.pushButton.text())  # access widget
        self.ui.pushButton.setText("HOHO")  # change displayed text
class MainWindow(QtGui.QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        # Load the ui.
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # Assign the actions.
        self.ui.ui_exec_btn.setDefaultAction(self.ui.ui_exec_act)
        self.ui.ui_show_btn.setDefaultAction(self.ui.ui_show_act)
        self.ui.ui_count_btn.setDefaultAction(self.ui.ui_count_act)

        # Create the connections.
        self.ui.ui_exec_act.triggered.connect(self.execDialog)
        self.ui.ui_show_act.triggered.connect(self.showDialog)
        self.ui.ui_count_act.triggered.connect(self.showCount)

    def execDialog(self):
        dlg = SampleDialog(self)
        dlg.exec_()

    def showDialog(self):
        dlg = SampleDialog(self)
        dlg.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        dlg.show()

    def showCount(self):
        count = len(self.findChildren(QtGui.QDialog))
        QtGui.QMessageBox.information(self, "Dialog Count", str(count))
示例#31
0
    def __init__(self, application):
        super().__init__()

        self.application = application
        self.tabulator_dialog = None
        self.sound = QSound('laser.wav')

        self.window = Ui_MainWindow()
        self.window.setupUi(self)

        self.setWindowIcon(QIcon('aswan-icon.png'))

        # Data binding
        self.proxy_model = QSortFilterProxyModel()
        self.proxy_model.setSourceModel(self.application.REPORT)
        self.window.treeView.setModel(self.proxy_model)

        # Command binding
        self.window.actionQuit.triggered.connect(qApp.quit)

        self.window.actionColumns.triggered.connect(self.cmd_view_columns)
        self.window.actionClear.triggered.connect(self.cmd_view_clear)
        self.window.actionFit_Columns_To_Contents.triggered.connect(
            self.cmd_view_fit_columns_to_contents)

        self.window.actionDocumentation.triggered.connect(
            self.cmd_help_documentation)

        # Start the report updates
        self.update()
示例#32
0
class MainWindow(QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()

        # Set up the user interface from Designer.
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.Calc = CalcThtead()

        # Connect the buttons.
        self.ui.pushButton_1.clicked.connect(self.Calc.start)
        self.ui.pushButton_2.clicked.connect(self.stopCalc)
        self.ui.pushButton_3.clicked.connect(self.stopProg)
        self.Calc.GetNewCoordinatesStr.connect(self.ui.textEdit.append)
        self.Calc.GetNewCoordinatesInt.connect(self.ui.widget.setCoordinates)

    def stopCalc(self):
        if self.Calc.runIndicator == 1:
            self.Calc.stopC = 1

    def stopProg(self):
        if self.Calc.runIndicator == 1:
            self.Calc.db.commit()
            self.Calc.db.disconnect()
            self.Calc.tracker1.stop()
            self.Calc.tracker2.stop()
        sys.exit()
示例#33
0
def main():
    app = QApplication(sys.argv)
    window = QDialog()
    mainmenu = QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(mainmenu)
    
    mainmenu.show()
    sys.exit(app.exec_())
示例#34
0
 def setupUi(self, MainWindowBase):
     """setup the window.
     
     First, the method of the base class is called, and then all the
     functionality is installed (signal/slot connections mainly).
     """
     Ui_MainWindow.setupUi(self, MainWindowBase)
     self.widget = MainWindowBase
     QObject.connect(self.actionAbout, SIGNAL("triggered()"), self.openAbout)
     QObject.connect(self.actionFileOpen, SIGNAL("triggered()"), self.openFile)
     self.statusBar().showMessage(self.tr("Ready"))
示例#35
0
文件: qtutil.py 项目: mwicat/batchui
def setupUi(window):
    pkg_path = os.path.dirname(__file__)
    mainwindow_file = os.path.join(pkg_path, 'mainwindow.ui')
    if os.path.exists(mainwindow_file):
        from PyQt4 import uic
        ui = uic.loadUi(mainwindow_file, window)
    else:
        from ui_mainwindow import Ui_MainWindow
        ui = Ui_MainWindow()
        ui.setupUi(window)
    return ui
示例#36
0
class MainWindow(QMainWindow):
	def __init__(self, parent=None):
		super(MainWindow, self).__init__(parent)
		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)
		self.gl_widget = GLWidget()
		self.ui.gl_layout.addWidget(self.gl_widget)
		#singal slot connect
		# self.connect(self.ui.apk1_open, SIGNAL('clicked()'),self.apk1_open_onclicked)
	# @pyqtSlot()
	# def apk1_open_onclicked(self):
	# 	self.emit(SIGNAL('open_apk1'))
示例#37
0
class MainWindow(QtWidgets.QMainWindow):
    def __init__(self, parent=None):
        super().__init__(parent)

        # UI initialize
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.initModels()
        self.initProgress()

        self.connectProgress(self.jsonModel)

    def initModels(self):
        self.jsonModel = JsonTreeModel(self)
        self.ui.treeView.setModel(self.jsonModel)

    def initProgress(self):
        self.progress = QtWidgets.QProgressBar(self.ui.statusbar)
        self.progress.setVisible(False)

    def connectProgress(self, obj):
        obj.startProgress.connect(self.progress.setRange)
        obj.startProgress.connect(self.startProgress)
        obj.updateProgress.connect(self.progress.setValue)
        obj.finishProgress.connect(self.finishProgress)

    @QtCore.pyqtSlot()
    def startProgress(self):
        self.progress.setValue(0)
        self.progress.setVisible(True)

    @QtCore.pyqtSlot()
    def finishProgress(self):
        self.progress.setVisible(False)

    @QtCore.pyqtSlot()
    def on_actionOpen_triggered(self):
        filepath, ext_filter = QtWidgets.QFileDialog.getOpenFileName(self,
            '',
            '.',
            self.tr('Json (*.json)')
        )
        if not filepath:
            return
        with BusyCursor(self):
            data = json.load(open(str(filepath)))
            self.jsonModel.setJsonDocument(data)
示例#38
0
文件: lang.py 项目: AlexDoul/PyQt4
 def __init__(self, parent = None, flags = 0):
     super(MainWindow, self).__init__(parent, QtCore.Qt.WindowFlags(flags))
     self.languages = QtGui.QMenu()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.fillLanguages()
     self.retranslate()
示例#39
0
    def __init__(self, parent=None):
        super(MainWidget, self).__init__(parent)
        #uic.loadUi(os.path.dirname(os.path.realpath(__file__))+'/mainwindow.ui', self)
        # Set up the user interface from Designer.
        self.ui = Ui_MainWindow()
        self.ui.pageUsers = pageUsers(self)
        self.ui.setupUi(self)
        self.ui.stackedWidget.setCurrentIndex(0)

        # connect signals to slots
        self.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked(bool)"), self.switchToMain)
        # main
        self.connect(self.ui.buttonDrinks, QtCore.SIGNAL("clicked(bool)"), self.switchToUsers)
        # radio
        # users
        #self.connect(self.ui.buttonUser1, QtCore.SIGNAL("clicked(bool)"), self.handleUser1)
        # drinks
        self.connect(self.ui.buttonPay, QtCore.SIGNAL("clicked(bool)"), self.switchToPayment)
        # payment
        self.connect(self.ui.buttonNum0, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad0)
        self.connect(self.ui.buttonNum1, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad1)
        self.connect(self.ui.buttonNum2, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad2)
        self.connect(self.ui.buttonNum3, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad3)
        self.connect(self.ui.buttonNum4, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad4)
        self.connect(self.ui.buttonNum5, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad5)
        self.connect(self.ui.buttonNum6, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad6)
        self.connect(self.ui.buttonNum7, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad7)
        self.connect(self.ui.buttonNum8, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad8)
        self.connect(self.ui.buttonNum9, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad9)
        self.connect(self.ui.buttonNumDel, QtCore.SIGNAL("clicked(bool)"), self.paymentNumDel)
示例#40
0
 def __init__(self, db):
   QtGui.QMainWindow.__init__(self)
   self.ui = Ui_MainWindow()
   self.ind_product = []
   self.ui.setupUi(self)
   self.db = db
   self.cur = db.cursor()
   self.r = []
   self.indice = int()
   self.vittoria = ()
   self.comparsa = ()
   self.mossa = ()
   self.queryPalio()
   self.graphicScene = QtGui.QGraphicsScene()
   self.graphicsView = QtGui.QGraphicsView(self.graphicScene, self.ui.tabPalio)
   self.graphicsView.setGeometry(QtCore.QRect(710, 10, 120, 380))
   self.graphicsView.setObjectName("graphicsView")    
   self.graphicsView.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
   self.graphicsView.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
   #QtCore.QObject.connect(self.ui.actionModifica, QtCore.SIGNAL('triggered()'), self.sceltaPalio)
   QtCore.QObject.connect(self.ui.tableWidget, QtCore.SIGNAL('cellChanged(int, int)'), self.newTableLine)
   #QtCore.QObject.connect(self.ui.lineEdit_12, QtCore.SIGNAL('editingFinished()'), self.queryPalio)
   QtCore.QObject.connect(self.ui.comboBox_5, QtCore.SIGNAL('currentIndexChanged(int)'), self.sceltaPalio)
   QtCore.QObject.connect(self.ui.buttonAggiorna, QtCore.SIGNAL('pressed()'), self.aggiorna)
   QtCore.QObject.connect(self.ui.buttonNuovo, QtCore.SIGNAL('pressed()'), self.nuovoPalio)
   QtCore.QObject.connect(self.ui.aggiungiMonturato, QtCore.SIGNAL('pressed()'), self.nuovoMonturato)
   QtCore.QObject.connect(self.ui.eliminaMonturato, QtCore.SIGNAL('pressed()'), self.togliMonturato)
示例#41
0
    def __init__(self, exchangeName):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.setWindowTitle("PyArbitrageTrader - " + exchangeName)

        self.maxProfit = Decimal("-1")

        self.model = QtGui.QStandardItemModel()
        self.model.setHorizontalHeaderLabels(
            [
                "Time",
                "TradeDirection",
                "Ask1",
                "Ask1 amount",
                "Bid1",
                "Bid1 amount",
                "Ask2",
                "Ask2 amount",
                "Bid2",
                "Bid2 amount",
                "Ask3",
                "Ask3 amount",
                "Bid3",
                "Bid3 amount",
                "ProfitPercent",
                "USD profit",
            ]
        )
        self.ui.tableView_history.setModel(self.model)
示例#42
0
    def __init__(self, parent=None):
        """ init UI """
        QMainWindow.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.ui.actionSaveSession.setEnabled(False)

        self.distributedObjects = DistributedObjects()

        self.act = self.distributedObjects.actions
        self.debugController = self.distributedObjects.debugController
        self.settings = self.debugController.settings
        self.signalproxy = self.distributedObjects.signalProxy
        self.pluginloader = PluginLoader(self.distributedObjects)
        self.editorController = self.distributedObjects.editorController

        self.act = self.distributedObjects.actions
        # init RecentFileHandler
        self.recentFileHandler = RecentFileHandler(self, self.ui.menuRecentlyUsedFiles, self.distributedObjects)
        self.debugController.executableOpened.connect(self.recentFileHandler.addToRecentFiles)
        self.debugController.executableOpened.connect(self.__observeWorkingBinary)
        self.debugController.executableOpened.connect(self.showExecutableName)
        self.debugController.executableOpened.connect(self.disableButtons)
        # signal proxy
        self.signalproxy.inferiorIsRunning.connect(self.targetStartedRunning, Qt.QueuedConnection)
        self.signalproxy.inferiorStoppedNormally.connect(self.targetStopped, Qt.QueuedConnection)
        self.signalproxy.inferiorReceivedSignal.connect(self.targetStopped, Qt.QueuedConnection)
        self.signalproxy.inferiorHasExited.connect(self.targetExited, Qt.QueuedConnection)

        self.signalproxy.addDockWidget.connect(self.addPluginDockWidget)
        self.signalproxy.removeDockWidget.connect(self.removeDockWidget)

        # Plugin Loader
        self.pluginloader.insertPluginAction.connect(self.addPluginAction)

        self.ui.actionSavePlugins.triggered.connect(self.showSavePluginsDialog)
        self.ui.actionLoadPlugins.triggered.connect(self.showLoadPluginsDialog)

        # Add editor to main window.
        self.ui.gridLayout.addWidget(self.distributedObjects.editorController.editor_view, 0, 0, 1, 1)

        self.pluginloader.addAvailablePlugins()

        # Tell everyone to insert their dock widgets into the main window
        self.signalproxy.emitInsertDockWidgets()

        # get filelist dockwidget
        self.filelist_dockwidget = self.findChild(QDockWidget, "FileListView")

        self.setWindowFilePath("<none>")
        self.setupUi()
        self.createInitialWindowPlacement()
        self.readSettings()

        self.quickwatch = QuickWatch(self, self.distributedObjects)

        self.binaryName = None
        self.fileWatcher = QFileSystemWatcher()
        self.fileWatcher.fileChanged.connect(self.__binaryChanged)
示例#43
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.dataDir = os.path.dirname(__file__)

        self.setupQueryList()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.centralWidget().layout().setMargin(0)
        self.setupQueryListWidget()
        self.setupFilter()
        self.setupActions()

        self.setupJinjaEnv()
        self.setupFilterWidgets()

        for obj, signal in [
                (self.ui.fromDateEdit, "dateChanged(QDate)"),
                (self.ui.toDateEdit, "dateChanged(QDate)"),
                (self.filterLineEdit, "textEdited(QString)"),
            ]:
            QObject.connect(obj, SIGNAL(signal), self.updateQuery)

        QObject.connect(self.ui.queryListWidget, SIGNAL("itemSelectionChanged()"), self.onCurrentQueryChanged)

        QObject.connect(self.ui.webView, SIGNAL("linkClicked(const QUrl&)"), self.openUrl)

        self.updateFilterWidgets()
        self.updateQuery()
示例#44
0
    def __init__(self,parent=None):
        super(MainWindow,self).__init__(parent)

        self.ui = Ui_MainWindow(self)
        self.ui.setupUi(self)

        self.boundsbox = BoundsBox(self)
        self.boundsbox.hide()

        self.data = {} #data
        self.fn = None #filename
        self.xdata = None #temperature
        self.ydata = None #strainrate
        self.zdata = None #strain
        self.kdata = None #stress
        self.model = None #model
        self.fc = None #flowcurve
        self.params = None #parameters
        self.ue = None #uniform elongation

        self.yl = None #yieldloci
        self.criterion = None #yieldcriterion
        
        self.ui.actionOpen.triggered.connect(self.openfile)
        self.ui.action.triggered.connect(self.about)
        self.connect(self.ui.actionExit,QtCore.SIGNAL('triggered()'),
                     QtCore.SLOT('close()'))

        self.ui.pushButton_FC.clicked.connect(self.on_pushButton_FC_clicked_)
        self.ui.pushButton_YL.clicked.connect(self.on_pushButton_YL_clicked_)
示例#45
0
    def __init__(self, parent=None,customPath=None,styles=None):
        super(UVCDATMainWindow, self).__init__(parent)
        self.root=self
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.setDocumentMode(True)
        #init user options
        self.initCustomize(customPath,styles)
        self.root = self
        #self.tool_bar = mainToolbarWidget.QMainToolBarContainer(self)
        self.canvas=[]
        
        self.canvas.append(vcs.init())
        self.colormapEditor =QColormapEditor(self) 
        # Create the command recorder widget
        self.recorder = commandsRecorderWidget.QCommandsRecorderWidget(self)
        #Adds a shortcut to the record function
        self.record = self.recorder.record
        self.preferences = preferencesWidget.QPreferencesDialog(self)
        self.preferences.hide()
        self.cdmsCacheWidget = CdmsCacheWidget(self)
#        self.regridding = regriddingWidget.QRegriddingDialog(self)
#        self.regridding.hide()
        ###########################################################
        # Init Menu Widget
        ###########################################################
        self.mainMenu = mainMenuWidget.QMenuWidget(self)
        self.createDockWindows()
        self.createActions()
        self.updateMenuActions()
        self.embedSpreadsheet()
        self.connectSignals()
        self.resize(1150,800)
示例#46
0
 def __init__(self, testing=False):
     # Initialize object using ui_mainwindow
     super(MainWindow, self).__init__()
     self.window = QMainWindow()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self.window)
     self.connectSlots()
     self.testing = testing
     self.scheduler = Scheduler()
示例#47
0
文件: MainWindow.py 项目: cpsmv/ecu
    def __init__(self):
        super(MainWindow, self).__init__()

        # Set up the user interface from Designer.
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.actionVolumetric_Efficiency.triggered.connect(self.openVE)
        self.ui.actionSpark_Advance.triggered.connect(self.openSA)

        self.currentport = ""

        layout = QGridLayout(self.ui.centralwidget)
        self.ui.centralwidget.setLayout(layout)

        try:
            self.vetable = pickle.load(open("tuningve.smv", "rb"))
        except FileNotFoundError:
            print("No existing tuning found!")
            self.vetable = ModelVE()

        try:
            self.satable = pickle.load(open("tuningsa.smv", "rb"))
        except FileNotFoundError:
            print("No existing tuning found!")
            self.satable = ModelSA()

        self.vemodel = TableModel(self.vetable)
        self.vewindow = TableWindow("Volumetric Efficiency Table")
        self.vewindow.setModel(self.vemodel)

        self.samodel = TableModel(self.satable)
        self.sawindow = TableWindow("Spark Advance Table")
        self.sawindow.setModel(self.samodel)

        self.value = 0
        self.meters = []
        for i in range(0,3):
            for k in range(0,2):
                spd = Speedometer("testlol", "units", 0, 100)
                self.meters.append(spd)
                layout.addWidget(spd, k, i)

        ports = self.serial_ports()
        if len(ports):
            self.ui.menuSerial_Port.clear()
            self.actiongroup = QActionGroup(self.ui.menuSerial_Port)
            for port in ports:
                action = QAction(port, self.ui.menuSerial_Port)
                action.setCheckable(True)
                self.actiongroup.addAction(action)
            self.actiongroup.actions()[0].setChecked(True)
            self.setSerialPort()
            self.ui.menuSerial_Port.addActions(self.actiongroup.actions())
            self.actiongroup.triggered.connect(self.setSerialPort)

        QTimer.singleShot(20, self.increment)
示例#48
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.nameLabel.setProperty('class', 'mandatory QLabel')
        self.styleSheetEditor = StyleSheetEditor(self)
        self.statusBar().addWidget(QLabel("Ready"))
        self.ui.exitAction.triggered.connect(QApplication.instance().quit)
        self.ui.aboutQtAction.triggered.connect(QApplication.instance().aboutQt)
示例#49
0
class MainWindow(QWidget):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.resize(1024, 768)
        
        self.mostWatchedItems = MostWatchedItems()
        self.ui.tabWidget.addTab(self.mostWatchedItems, 'Most Watched Items')
        
        self.topSellingProducts = TopSellingProducts()
        self.ui.tabWidget.addTab(self.topSellingProducts, 'Top Selling Products')
        
        self.popularItems = PopularItems()
        self.ui.tabWidget.addTab(self.popularItems, 'Popular Items')
        
        self.popularSearches = PopularSearches()
        self.ui.tabWidget.addTab(self.popularSearches, 'Popular Searches')
示例#50
0
	def __init__(self):
		QMainWindow.__init__(self)

		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)
		self.initBoard()
		self.ui.actionJUEGO_NUEVO.triggered.connect(self.onActionJuegoNuevoTriggered)
		self.ui.actionSALIR.triggered.connect(self.onActionSalirTriggered)
		self.ui.actionATRAS.triggered.connect(self.onActionAtrasTriggered)

		self.loadGamesWindow = LoadGames(self)
示例#51
0
    def __init__(self, parent=None):
        super().__init__(parent)

        # UI initialize
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.initModels()
        self.initProgress()

        self.connectProgress(self.jsonModel)
示例#52
0
文件: poscope.py 项目: garslo/poscope
    def __init__(self):
        QtGui.QMainWindow.__init__(self)

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.rerun_btn.clicked.connect(self.rerun)

        self.source = NI6009()
        self.timer = QtCore.QTimer()
        self.redraw_interval = 50 # (ms)
        self.timer.timeout.connect(self.replot)
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        defaultFile1 = "proj_test.txt";
        defaultFile2 = "merNativne_test.txt";


        self.set1 = set()
        self.set2 = set()
        self.vstup1 = list()
        self.vstup2 = list()
        self.row2ID = list()
        self.presnost = 20

        self.currentDir = str(os.path.dirname(os.path.abspath(__file__))+"\\")

        self.allowedFiles = (".txt",".py", ".TXT")
        i=0
        self.allowedRegExpFiles = ""
        self.allowedOpenFiles = ""
        for fileType in self.allowedFiles:
            if i > 0:
                self.allowedRegExpFiles = self.allowedRegExpFiles+"|"
                self.allowedOpenFiles = self.allowedOpenFiles+" "
            self.allowedRegExpFiles = self.allowedRegExpFiles+"\\"+fileType
            self.allowedOpenFiles = self.allowedOpenFiles+"*"+fileType
            i=i+1
        
        
        self.ui = Ui_MainWindow()
	
        self.ui.setupUi(self)
        
        # comes in future release
        icoWindow = QPixmap("icon.png")
        icoCount = QPixmap("count.png")
        self.setWindowIcon(QIcon(icoWindow))
        self.ui.pushButtonPrepocitat.setIcon(QIcon(icoCount))
        self.ui.pushButtonUkazka.setVisible(False)
        self.ui.labelPresnost.setVisible(False)
        self.ui.spinBoxPresnost.setVisible(False)
        self.initTable()

        self.openAndReadPredloha(self.currentDir+defaultFile1)
        self.openAndReadMeranie(self.currentDir+defaultFile2)
        self.ui.lineEditSubor1.setText(self.currentDir+defaultFile1)
        self.ui.lineEditSubor2.setText(self.currentDir+defaultFile2)
        #self.on_pushButtonSubor1_released()
        #self.on_pushButtonSubor2_released()

        self.bod1 = False
        self.bod2 = False
        self.bod3 = False
示例#54
0
    def __init__(self, parent):
        QObject.__init__(self, parent)

        self.window = KMainWindow()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self.window)

        self.createActions()
        self.createDragMeWidget()
        self.createScene()
        self.createToolBox()
        self.window.resize(700, 500)
示例#55
0
 def setupUi(self):
     """ Инициализируем всё, что относится к интерфейсу """
     self._ui = Ui_MainWindow()
     self._ui.setupUi(self)
     self._ui.twEntries.setContextMenuPolicy(Qt.CustomContextMenu)
     self._ui.twEntries.customContextMenuRequested.connect(self.showEntryListContextMenu)
     self._initToolBar()
     self._createEntryContextMenu()
     self._ui.wvEntryContent.settings().setAttribute(QWebSettings.PluginsEnabled, True)
     self._ui.wvEntryContent.setTextSizeMultiplier(settings.entryTextSizeMultiplier())
     self._itemDelegate = EntryItemDelegate(self._ui.twEntries)
     self._ui.twEntries.setItemDelegate(self._itemDelegate)
示例#56
0
    def __init__(self):
        QMainWindow.__init__(self)
        """Inicializador de la clase MainWindow."""
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        """Inicializacion del tablero.""" 
        self.initBoard()
        """Coneccion de senales.""" 
        self.ui.actionJUEGO_NUEVO.triggered.connect(self.onActionJuegoNuevoTriggered)
        self.ui.actionSALIR.triggered.connect(self.onActionSalirTriggered)
        self.ui.actionATRAS.triggered.connect(self.onActionAtrasTriggered)

        self.loadGamesWindow = LoadGames(self)
示例#57
0
    def __init__(self, parent=None):
        """ init UI """
        QMainWindow.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.ui.actionSaveSession.setEnabled(False)

        self.distributedObjects = DistributedObjects()

        self.debugController = self.distributedObjects.debugController
        self.settings = self.debugController.settings
        self.signalproxy = self.distributedObjects.signalProxy
        self.pluginloader = PluginLoader(self.distributedObjects)

        #init RecentFileHandler
        nrRecentFiles = 5
        self.initRecentFileHandler(nrRecentFiles)

        QObject.connect(self.debugController, SIGNAL('executableOpened'), self.showExecutableName)

        # signal proxy
        QObject.connect(self.signalproxy, SIGNAL('inferiorIsRunning(PyQt_PyObject)'), self.targetStartedRunning, Qt.QueuedConnection)
        QObject.connect(self.signalproxy, SIGNAL('inferiorStoppedNormally(PyQt_PyObject)'), self.targetStopped, Qt.QueuedConnection)
        QObject.connect(self.signalproxy, SIGNAL('inferiorReceivedSignal(PyQt_PyObject)'), self.targetStopped, Qt.QueuedConnection)
        QObject.connect(self.signalproxy, SIGNAL('inferiorHasExited(PyQt_PyObject)'), self.targetExited, Qt.QueuedConnection)

        QObject.connect(self.signalproxy, SIGNAL('addDockWidget(PyQt_PyObject, QDockWidget, PyQt_PyObject)'), self.addPluginDockWidget)
        QObject.connect(self.signalproxy, SIGNAL('removeDockWidget(QDockWidget)'), self.removeDockWidget)
        QObject.connect(self.pluginloader, SIGNAL('insertPluginAction(PyQt_PyObject)'), self.addPluginAction)
        QObject.connect(self.ui.actionSavePlugins, SIGNAL('activated()'), self.showSavePluginsDialog)
        QObject.connect(self.ui.actionLoadPlugins, SIGNAL('activated()'), self.showLoadPluginsDialog)

        # Add editor to main window.
        self.ui.gridLayout.addWidget(self.distributedObjects.editorController.editor_view, 0, 0, 1, 1)

        self.pluginloader.addAvailablePlugins()

        # Tell everyone to insert their dock widgets into the main window
        self.distributedObjects.signalProxy.insertDockWidgets()

        # get filelist dockwidget
        self.filelist_dockwidget = self.findChild(QDockWidget, "FileListView")

        self.setWindowFilePath("<none>")
        self.setupUi()
        self.createInitialWindowPlacement()
        self.readSettings()

        self.quickwatch = QuickWatch(self, self.distributedObjects)
示例#58
0
文件: poscope.py 项目: garslo/poscope
class MainWindow(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.rerun_btn.clicked.connect(self.rerun)

        self.source = NI6009()
        self.timer = QtCore.QTimer()
        self.redraw_interval = 50 # (ms)
        self.timer.timeout.connect(self.replot)

    def replot(self):
        self.ui.plotter.replotWith(xs=np.arange(0,1000),
                                   ys=self.source.data())
        self.timer.start()

    def rerun(self):
        self.timer.stop()
        self.source.reads_per_run = int(self.ui.num_reads.text())
        self.source.sample_rate = int(self.ui.num_samples.text())
        self.timer.start()
示例#59
0
class MainWindow(QtGui.QMainWindow):
    def __init__(self):
        super(MainWindow, self).__init__()

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.nameLabel.setProperty('class', 'mandatory QLabel')
        self.styleSheetEditor = StyleSheetEditor(self)
        self.statusBar().addWidget(QtGui.QLabel("Ready"))
        self.ui.exitAction.triggered.connect(QtGui.qApp.quit)
        self.ui.aboutQtAction.triggered.connect(QtGui.qApp.aboutQt)

    def on_editStyleAction_triggered(self):
        self.styleSheetEditor.show()
        self.styleSheetEditor.activateWindow()

    def on_aboutAction_triggered(self):
        QtGui.QMessageBox.about(self, "About Style sheet",
                "The <b>Style Sheet</b> example shows how widgets can be "
                "styled using "
                "<a href=\"http://qt.nokia.com/doc/4.7/stylesheet.html\">Qt "
                "Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop "
                "up the style editor, and either choose an existing style "
                "sheet or design your own.")
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        # Load the ui.
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # Assign the actions.
        self.ui.ui_exec_btn.setDefaultAction(self.ui.ui_exec_act)
        self.ui.ui_show_btn.setDefaultAction(self.ui.ui_show_act)
        self.ui.ui_count_btn.setDefaultAction(self.ui.ui_count_act)

        # Create the connections.
        self.ui.ui_exec_act.triggered.connect(self.execDialog)
        self.ui.ui_show_act.triggered.connect(self.showDialog)
        self.ui.ui_count_act.triggered.connect(self.showCount)