예제 #1
0
    def __init__(self, dialog):
        #super(MyFirstGuiProgram, self).__init__(None)
        QMainWindow.__init__(self)
        PyQt_Gui.Ui_MainWindow.__init__(self)
        self.setupUi(dialog)
        self.app = None

        qApp.installEventFilter(self)

        self.open_games = []
        self.timer_queue_exec_interval = 200

        self.init_events()
        self.init_view()

        self.client = Network.GameClient(self)
        self.client.signal_status_message.connect(self.set_status_message)
        self.client.signalCommand.connect(self.eval_command_from_server)
        self.client.color = Qt.QColor("#ff0000")
        self.update_color()
        self.client.connect_client()

        #self.widget_open_game.hide()
        self.widget_join_game.hide()

        self.widget_game_options = None
예제 #2
0
 def __init__(self, parent=None):
     super(Mosaic, self).__init__(parent=parent)
     self.setupUi(self)
     self.squares = [[None for _ in range(4)] for _ in range(4)]
     # self.pushButton.isEnabled()
     for i in range(4):
         for j in range(4):
             button_num = 4 * i + j + 1
             button_name = 'pushButton' + ('_' + str(button_num)
                                           if button_num > 1 else '')
             qt_button = getattr(self, button_name)
             qt_button.__class__ = Square
             qt_button.set_cords(i, j)
             qt_button.clicked.connect(self.square_click)
             self.squares[i][j] = qt_button
     self.pushButton_17.clicked.connect(self.new_game)
     self.space_cords = [3, 3]
     self.squares[3][3].setVisible(False)
     self.start_time = None
     self.end_time = None
     self.timer = None
     self.time_cnt = 0
     self.pushButton_19.clicked.connect(self.scoreboard)
     self.pushButton_18.clicked.connect(self.reset_game)
     qApp.installEventFilter(self)
예제 #3
0
파일: game.py 프로젝트: syurskyi/QT
    def __init__(self, players):
        """Domyślne ustawienia klasy

            Args:
                players (int): Ilość wszystkich graczy

        """
        super(Game, self).__init__()
        qApp.installEventFilter(self)
        self.released = True
        self.players = players

        self.board = board.Board(players)
        self.timers = []
        self.timer = QTimer()
        self.timer.setInterval(const.GAME_SPEED)
        self.timer.timeout.connect(self.repaint)
        self.timer.start()

        self.nr_frame = 0
        if self.players != 0:
            self.frames = []
            self.frame = np.ones((const.BOARD_WIDTH, const.BOARD_HEIGHT),
                                 dtype=int)
            self.doc = xml.Document()
            self.root = self.doc.createElement('save')
        else:
            doc = xml.parse("autosave.xml")
            self.frames = doc.getElementsByTagName("frame")
예제 #4
0
    def __init__(self, parent=None):

        super(HostPrepProgress, self).__init__(parent)
        qApp.installEventFilter(self)
        self.setupUi(self)
        self.continue_btn.clicked.connect(self.continue_btn_clicked)

        #self.host_Label.setText(host)
        self.show()
예제 #5
0
파일: iwidget.py 프로젝트: yuanjq/idoui
 def __init(self):
     qApp.installEventFilter(self)
     self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowMinMaxButtonsHint)
     self.setAttribute(Qt.WA_TranslucentBackground)
     self.setFocusPolicy(Qt.ClickFocus)
     self.setMouseTracking(True)
     QDialog.setContentsMargins(self, self.shadowMargin, self.shadowMargin, 
                                self.shadowMargin, self.shadowMargin)
     self.setFocus(Qt.MouseFocusReason)
예제 #6
0
    def __init__(self, parent=None):
        super(DroneGUI, self).__init__(parent)

        # creates the terminal
        self.create_terminal()

        # create tabs
        self.create_tabs()

        # set the size policy
        self.set_size_policy()

        # palette background setting, style
        self.create_palette()

        # adds the arm, kill, unarm buttons
        # self.create_arm_kill_buttons()

        # adds the PID insert text boxes
        self.create_PID_insert()

        # adds the log
        self.create_log()

        # stream for the command line output to fill the log
        sys.stdout = Stream(newText=self.onUpdateText)

        # adds the data monitor
        self.create_data_monitor()

        # installs the event filter for 'space bar' and 'a'
        qApp.installEventFilter(self)

        # creates a button to deliver a live motor output plot graph
        self.motor_output_plot_graph_is_open = False
        self.create_motor_output_plot_button()

        # create the flight motion labels
        self.create_flight_motion_labels()

        # shows the current information of the drone
        self.drone_information()

        # add logo
        self.set_logo()

        # set up about tab
        self.show_about_info()

        # commands currently allowed in the terminal
        self.accepted_commands = {"connect", "arm", "kill", "forward",
                                  "altitude", "vehicle status", "pi status", "square"}

        # accepted IPs for the Raspberry Pi
        self.accepted_ips = {"192.168.1.1"}

        self.ssh_client = None
예제 #7
0
    def __init__(self,
                 parent=None,
                 repeat_times=config.thuMouse_repeatTimes_default):
        """
        :param parent: The previous parent

        - The interaction window has both 1. a Lacate Pane and 2. a Follow Pane.
        - It shows only one Pane at a time.

        """
        super(Interaction_window, self).__init__(parent)
        screen_size = get_screen_size()

        self.parent = parent
        self.resize(config.interaction_window_size[0],
                    config.interaction_window_size[1])
        self.main_widget = QWidget()
        self.main_widget.setFixedSize(*screen_size)
        self.setCentralWidget(self.main_widget)
        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Expanding)
        self.main_widget.setSizePolicy(size_policy)
        self.layout().addWidget(self.main_widget)

        self.locate_layout = QGridLayout()
        self.locate_layout.setGeometry(self.main_widget.geometry())
        self.locate_pane = LocatePane(parent=self.locate_layout)

        self.follow_layout = QHBoxLayout()
        self.follow_layout.setGeometry(self.main_widget.geometry())
        self.follow_pane = FollowPane(parent=self.follow_layout)

        # --------------- LOGIC RELATED --------------------
        # state handler
        self.state = ['idle']  # resting when initialized

        # Keys allowed in the locate pane
        # 1. for pause/restart
        self.function_keys = [Qt.Key_Enter, Qt.Key_Return, Qt.Key_Space]
        # 2. arrow keys
        self.arrow_keys = {Qt.Key_Left, Qt.Key_Up, Qt.Key_Right, Qt.Key_Down}

        # register for event filter
        qApp.installEventFilter(self)

        self.repeat_times = repeat_times
        self.remaining_repeat_times = self.repeat_times

        # --------------- cursor control --------------------
        self.cursor_home_pos = [int(x / 2) for x in screen_size]
        """
        # A list of points the cursor went through
        """
        self.trace = []
예제 #8
0
    def showTrackingTooltip(self, tooltip, cursorOffset=QPoint(25, 25)):
        if self.instance and self.instance != tooltip:
            QTrackingTooltip.hideTooltip()

        if tooltip:
            self.instance = tooltip
            self.instance.show()

            self.instance.setPosCursorOffset(cursorOffset)
            self.instance.isTracking = True

            qApp.installEventFilter(self.instance.data())
예제 #9
0
    def __init__(self, parent=None):

        super(PrepCheck, self).__init__(parent)
        qApp.installEventFilter(self)
        self.setupUi(self)
        self.configure_btn.clicked.connect(self.configure_btn_clicked)
        self.cancel_btn.clicked.connect(self.cancel_btn_clicked)
        cfg = settings.get_working_config()
        cfgList = cfg.split(':')
        host = cfgList[0].strip()
        self.host_Label.setText(host)
        self.show()
예제 #10
0
    def init_ui(self):
        self.ui = uic.loadUi(Constants.UI_FILE, self)
        self.setWindowTitle(Constants.WINDOW_TITLE)
        #self.showFullScreen()  # Disabled because UI does not scale properly on large screens

        # Set an eventFilter on the entire application to catch key inputs
        qApp.installEventFilter(self)

        # The "Back" button needs to be disabled for each page separately
        self.currentIdChanged.connect(self.disable_back)

        self.init_ui_page_one()
        self.show()
예제 #11
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        self.setAttribute(Qt.WA_QuitOnClose)
        self.setAttribute(Qt.WA_DeleteOnClose)

        self._isUserIsResizing = False

        # create instance variables
        # ui
        self.ui = uic.loadUi("mainwindow.ui", self)

        # report manager
        # self._reportManager = ReportManager(parent=self)

        # report engines
        # self._xlsxEngine = XlsxEngine(parent=self)
        # self._reportManager.setEngine(self._xlsxEngine)
        # self._printEngine = PrintEngine(parent=self)
        # self._reportManager.setEngine(self._printEngine)

        # persistence engine
        self._persistenceEngine = MysqlEngine(parent=self,
                                              dbItemClass=TaskItem)

        # persistence facade
        self._persistenceFacade = PersistenceFacade(
            parent=self, persistenceEngine=self._persistenceEngine)

        # domain model
        self._modelDomain = DomainModel(
            parent=self, persistenceFacade=self._persistenceFacade)

        # connect ui facade to models
        # self._uiFacade = UiFacade(parent=self, reportManager=self._reportManager)
        self._uiFacade = UiFacade(parent=self, domainModel=self._modelDomain)

        # main window models
        self._modelTaskTable = TaskModel(parent=self,
                                         domainModel=self._modelDomain)
        self._modelSearchProxy = TaskSearchProxyModel(parent=self)
        self._modelSearchProxy.setSourceModel(self._modelTaskTable)

        # actions
        self.actRefresh = QAction("Обновить", self)
        self.actTaskAdd = QAction("Добавить поставку", self)
        self.actTaskEdit = QAction("Изменить поставку", self)
        self.actTaskDelete = QAction("Удалить поставку", self)

        # try:
        qApp.installEventFilter(self)
예제 #12
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        qApp.installEventFilter(self)
        self.setupUi(self)

        # Liens a faire ici
        self.pushButton_selection_photos.clicked.connect(
            self.fct_selection_images)
        self.pushButton_selection_dossier_export.clicked.connect(
            self.fct_selection_dossier_export)
        self.pushButton_lancement_conversion.clicked.connect(
            self.lancement_conversion)
        self.actionQuitter.triggered.connect(qApp.quit)

        self.show()
예제 #13
0
파일: main.py 프로젝트: AQORN/opensphere
    def __init__(self, parent=None):

        super(Login, self).__init__(parent)
        qApp.installEventFilter(self)
        self.setupUi(self)
        self.close_btn.clicked.connect(self.close_btn_clicked)
        self.login_btn.clicked.connect(self.login_btn_clicked)

        #set combobox with previous hostnames
        hostnames = settings.get_hosts()
        if hostnames is not None:
            hostnames = hostnames.strip().split(',')
            for host in hostnames:
                self.hostname_comboBox.addItem(host)
        self.hostname_comboBox.setFocus()
        self.show()
예제 #14
0
    def __init__(self, window, dictionaryManager):
        QMainWindow.__init__(self)
        Ui_GameWindow.__init__(self)
        self.setupUi(window)
        qApp.installEventFilter(self)
        self.dManager = dictionaryManager
        self.word = ""
        self.keyPressed = False
        self.gameRunning = False

        # Find all .csv files in the directory
        self.fileList = []
        for file in os.listdir(os.getcwd() + "/lists"):
            if file.endswith(".csv"):
                self.fileList.append(file)
        for filename in self.fileList:
            self.wordFileList.addItem(formatFilename(filename))

        self.playButton.clicked.connect(self.startGame)
        self.translateButton.clicked.connect(self.processWord)
예제 #15
0
 def __init__(self, *args, **kwargs):
     QtWidgets.QMainWindow.__init__(self, *args, **kwargs)
     # super(MyMainWindow, self).__init__(parent=parent)
     qApp.installEventFilter(self)
     self.setupUi(self)
예제 #16
0
 def __init__(self, parent):
     super(FormWidget, self).__init__(parent)
     qApp.installEventFilter(self)
     self.UI()
예제 #17
0
 def __init__(self, parent=None):
     super(Info, self).__init__(parent)
     qApp.installEventFilter(self)
     self.initUI()
예제 #18
0
def load_clr_file(filepath):
    event_filter = TemporaryFilter(filepath)
    qApp.installEventFilter(event_filter)

    return idaapi.process_ui_action('SetColors')
예제 #19
0
def load_clr_file(filepath):
    event_filter = TemporaryFilter(filepath)
    qApp.installEventFilter(event_filter)

    return idaapi.process_ui_action('SetColors')