我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用PyQt5.QtCore.Qt.WindowActive()。
def bring_to_front(self): """ Brings the terminal window to the front and places the cursor in the textbox """ self._textbox.setFocus() self.setWindowState(self.windowState() & ~Qt.WindowMinimized | Qt.WindowActive) self.raise_() self.activateWindow() # Handlers that update the labels at the bottom
def show(self): self.setWindowState(self.windowState() & Qt.WindowMinimized | Qt.WindowActive) self.activateWindow() super(QMainWindow, self).show() self.raise_()
def cb_boundary_slider_released(self): # destroy cursors on spectru mwindow self._app.windows['spectrumWindow'].get_current_widget().destroy_cursors() # bring window to front self.show() self.setWindowState(self.windowState() & ~Qt.WindowMinimized | Qt.WindowActive) self.activateWindow()
def cb_area_slider_released(self): # remove area map from the map canvas self._app.windows['mapWindow'].ui.tab_widget.currentWidget().destroy_area_map() # bring this window to front again self.setWindowState(self.windowState() & ~Qt.WindowMinimized | Qt.WindowActive) self.activateWindow()
def cb_limit_slider_released(self): # remove cursor from the spectrum canvas self._app.windows['spectrumWindow'].get_current_widget().destroy_cursors() # bring window to front self.show() self.setWindowState(self.windowState() & ~Qt.WindowMinimized | Qt.WindowActive) self.activateWindow()
def cb_threshold_slider_released(self): # destroy threshold map from the map canvas self._app.windows['mapWindow'].ui.tab_widget.currentWidget().destroy_threshold_map() # bring window to front self.setWindowState(self.windowState() & ~Qt.WindowMinimized | Qt.WindowActive) self.activateWindow()
def create_cursors(self, x1, x2): # check whether the spectrum window was visible self._visible_flag = self.parent().isVisible() # create cursor self._spectrum_canvas.create_cursors(x1, x2) # bring window to front self.parent().show() self.parent().setWindowState(self.windowState() & ~Qt.WindowMinimized | Qt.WindowActive) self.parent().activateWindow()
def create_threshold_map(self, threshold_data, threshold): # create threshold map on the map canvas self._map_canvas.create_threshold_map(threshold_data, threshold) # bring window to front self.setWindowState(self.windowState() & ~Qt.WindowMinimized | Qt.WindowActive) self.activateWindow()
def make_visible(self): """ Make sure that the main window is visible """ self.setWindowState((self.windowState() & ~Qt.WindowMinimized) | Qt.WindowActive) self.activateWindow() self.raise_() self.show()