Python PyQt5.QtCore.QTimer() Examples

The following are 30 code examples for showing how to use PyQt5.QtCore.QTimer(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtCore , or try the search function .

Example 1
def __init__(self, username):
        QWidget.__init__(self)
        uic.loadUi("UI/rawscripts.ui", self)
        self.setWindowTitle("Script Select Menu")
        self.loggedinas.setText("Logged in as: %s" % username)
        self.treeWidget.currentItemChanged.connect(self.changeSelected)
        self.startEditing.clicked.connect(self.startVideoEditor)
        self.refreshScripts.clicked.connect(self.refreshScriptsRequest)
        self.flagQuality.clicked.connect(lambda : self.flagScript("QUALITY"))
        self.addscript.clicked.connect(self.addScriptFromURL)
        self.update_table.connect(self.updateColors)
        self.add_url_response.connect(self.addedNewScript)
        self.reset_editing_status.connect(self.resetEditingStatus)
        self.timer = QtCore.QTimer(self)
        self.timer.timeout.connect(self.updateTime)
        self.timer.start(4000)
        self.currentScriptSelected = None
        self.isEditing = False 
Example 2
Project: pkmeter   Author: pkkid   File: pkmixins.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def attribute_iter(self, data, value):
        count = 0
        length = len(value) if value else 0
        for i in range(length):
            count += 1
            subwidget = self._get_subwidget(i)
            data['this'] = value[i]
            for action in subwidget.actions:
                action.apply(data)
            if self.itermax and i >= self.itermax-1:
                break
        for subwidget in self.subwidgets[count:]:
            utils.remove_widget(subwidget)
        self.subwidgets = self.subwidgets[:count]
        timer = QtCore.QTimer()
        timer.singleShot(10, self.control.resize_to_min) 
Example 3
Project: Lector   Author: BasioMeusPuga   File: dockwidgets.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent):
        self.parent = parent
        self.parentTab = self.parent.parent

        self.searchThread = BackGroundTextSearch()
        self.searchOptionsLayout = QtWidgets.QHBoxLayout()
        self.searchTabLayout = QtWidgets.QVBoxLayout()
        self.searchTimer = QtCore.QTimer(self.parent)
        self.searchLineEdit = QtWidgets.QLineEdit(self.parent)
        self.searchBookButton = QtWidgets.QToolButton(self.parent)
        self.caseSensitiveSearchButton = QtWidgets.QToolButton(self.parent)
        self.matchWholeWordButton = QtWidgets.QToolButton(self.parent)
        self.searchResultsTreeView = QtWidgets.QTreeView(self.parent)

        self._translate = QtCore.QCoreApplication.translate
        self.search_string = self._translate('SideDock', 'Search')
        self.search_book_string = self._translate('SideDock', 'Search entire book')
        self.case_sensitive_string = self._translate('SideDock', 'Match case')
        self.match_word_string = self._translate('SideDock', 'Match word')

        self.create_widgets() 
Example 4
Project: bitmask-dev   Author: leapcode   File: app.py    License: GNU General Public License v3.0 6 votes vote down vote up
def shutdown(self, *args):
        global bitmaskd
        if self.closing:
            return
        self.closing = True

        bitmaskd.join()
        terminate(pid)
        cleanup()
        print('[bitmask] shutting down gui...')

        try:
            self.stop()
            try:
                global pixbrowser
                pixbrowser.stop()
                del pixbrowser
            except:
                pass
            QtCore.QTimer.singleShot(0, qApp.deleteLater)

        except Exception as ex:
            print('exception catched: %r' % ex)
            sys.exit(1) 
Example 5
Project: JRTTView   Author: XIVN1987   File: RTTView.py    License: MIT License 6 votes vote down vote up
def __init__(self, parent=None):
        super(RTTView, self).__init__(parent)
        
        uic.loadUi('RTTView.ui', self)

        self.initSetting()

        self.initQwtPlot()

        self.rcvbuff = b''
        
        self.tmrRTT = QtCore.QTimer()
        self.tmrRTT.setInterval(10)
        self.tmrRTT.timeout.connect(self.on_tmrRTT_timeout)
        self.tmrRTT.start()

        self.tmrRTT_Cnt = 0 
Example 6
Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    License: GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, parent, dialog, **kwargs):
            super(FIRSTUI.Dialog, self).__init__(parent)
            self.parent = parent
            self.data = None


            self.ui = dialog(**kwargs)
            self.ui.setupUi(self)

            self.should_show = self.ui.should_show

            self.accepted.connect(self.success_callback)
            self.rejected.connect(self.reject_callback)
            self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)

            self.hide_attempts = 0
            self.timer = QtCore.QTimer()
            self.timer.timeout.connect(self.__hide)
            self.timer.start(500) 
Example 7
Project: MusicBox   Author: HuberTRoy   File: player.py    License: MIT License 6 votes vote down vote up
def __init__(self, parent=None):
        super(DesktopLyric, self).__init__()
        self.lyric = QString('Lyric Show.')
        self.intervel = 0
        self.maskRect = QRectF(0, 0, 0, 0)
        self.maskWidth = 0
        self.widthBlock = 0
        self.t = QTimer()
        self.screen = QApplication.desktop().availableGeometry()
        self.setObjectName(_fromUtf8("Dialog"))
        self.setWindowFlags(Qt.CustomizeWindowHint | Qt.FramelessWindowHint | Qt.Dialog | Qt.WindowStaysOnTopHint | Qt.Tool)
        self.setMinimumHeight(65)
        self.setAttribute(Qt.WA_TranslucentBackground)
        self.handle = lyric_handle(self)
        self.verticalLayout = QVBoxLayout(self)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.font = QFont(_fromUtf8('微软雅黑, verdana'), 50)
        self.font.setPixelSize(50)
        # QMetaObject.connectSlotsByName(self)
        self.handle.lyricmoved.connect(self.newPos)
        self.t.timeout.connect(self.changeMask) 
Example 8
Project: Cura   Author: Ultimaker   File: PlatformPhysics.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self, controller, volume):
        super().__init__()
        self._controller = controller
        self._controller.getScene().sceneChanged.connect(self._onSceneChanged)
        self._controller.toolOperationStarted.connect(self._onToolOperationStarted)
        self._controller.toolOperationStopped.connect(self._onToolOperationStopped)
        self._build_volume = volume
        self._enabled = True

        self._change_timer = QTimer()
        self._change_timer.setInterval(100)
        self._change_timer.setSingleShot(True)
        self._change_timer.timeout.connect(self._onChangeTimerFinished)
        self._move_factor = 1.1  # By how much should we multiply overlap to calculate a new spot?
        self._max_overlap_checks = 10  # How many times should we try to find a new spot per tick?
        self._minimum_gap = 2  # It is a minimum distance (in mm) between two models, applicable for small models

        Application.getInstance().getPreferences().addPreference("physics/automatic_push_free", False)
        Application.getInstance().getPreferences().addPreference("physics/automatic_drop_down", True) 
Example 9
Project: Cura   Author: Ultimaker   File: CuraSplashScreen.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self):
        super().__init__()
        self._scale = 0.7
        self._version_y_offset = 0  # when extra visual elements are in the background image, move version text down

        if ApplicationMetadata.IsEnterpriseVersion:
            splash_image = QPixmap(Resources.getPath(Resources.Images, "cura_enterprise.png"))
            self._version_y_offset = 26
        else:
            splash_image = QPixmap(Resources.getPath(Resources.Images, "cura.png"))

        self.setPixmap(splash_image)

        self._current_message = ""

        self._loading_image_rotation_angle = 0

        self._to_stop = False
        self._change_timer = QTimer()
        self._change_timer.setInterval(50)
        self._change_timer.setSingleShot(False)
        self._change_timer.timeout.connect(self.updateLoadingImage)

        self._last_update_time = None 
Example 10
Project: Cura   Author: Ultimaker   File: GlobalStacksModel.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self, parent = None) -> None:
        super().__init__(parent)

        self._catalog = i18nCatalog("cura")

        self.addRoleName(self.NameRole, "name")
        self.addRoleName(self.IdRole, "id")
        self.addRoleName(self.HasRemoteConnectionRole, "hasRemoteConnection")
        self.addRoleName(self.MetaDataRole, "metadata")
        self.addRoleName(self.DiscoverySourceRole, "discoverySource")

        self._change_timer = QTimer()
        self._change_timer.setInterval(200)
        self._change_timer.setSingleShot(True)
        self._change_timer.timeout.connect(self._update)

        # Listen to changes
        CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged)
        CuraContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged)
        CuraContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged)
        self._updateDelayed() 
Example 11
Project: Cura   Author: Ultimaker   File: SettingInheritanceManager.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self, parent = None) -> None:
        super().__init__(parent)

        self._global_container_stack = None  # type: Optional[ContainerStack]
        self._settings_with_inheritance_warning = []  # type: List[str]
        self._active_container_stack = None  # type: Optional[ExtruderStack]

        self._update_timer = QTimer()
        self._update_timer.setInterval(500)
        self._update_timer.setSingleShot(True)
        self._update_timer.timeout.connect(self._update)

        Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
        ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
        self._onGlobalContainerChanged()
        self._onActiveExtruderChanged() 
Example 12
Project: Cura   Author: Ultimaker   File: ModelChecker.py    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self):
        super().__init__()

        self._button_view = None

        self._caution_message = Message("", #Message text gets set when the message gets shown, to display the models in question.
            lifetime = 0,
            title = catalog.i18nc("@info:title", "3D Model Assistant"))

        self._change_timer = QTimer()
        self._change_timer.setInterval(200)
        self._change_timer.setSingleShot(True)
        self._change_timer.timeout.connect(self.onChanged)

        Application.getInstance().initializationFinished.connect(self._pluginsInitialized)
        Application.getInstance().getController().getScene().sceneChanged.connect(self._onChanged)
        Application.getInstance().globalContainerStackChanged.connect(self._onChanged) 
Example 13
Project: kite   Author: pyrocko   File: spool.py    License: GNU General Public License v3.0 6 votes vote down vote up
def progressStarted(self, args):
        if self.progress.isVisible():
            return

        nargs = len(args)

        text = args[0]
        maximum = 0 if nargs < 2 else args[1]
        progress_func = None if nargs < 3 else args[2]

        self.progress.setWindowTitle('Processing...')
        self.progress.setLabelText(text)
        self.progress.setMaximum(maximum)
        self.progress.setValue(0)

        @QtCore.pyqtSlot()
        def updateProgress():
            if progress_func:
                self.progress.setValue(progress_func())

        self.progress_timer = QtCore.QTimer()
        self.progress_timer.timeout.connect(updateProgress)
        self.progress_timer.start(250)

        self.progress.show() 
Example 14
Project: kawaii-player   Author: kanishka-linux   File: optionwidgets.py    License: GNU General Public License v3.0 6 votes vote down vote up
def info_preview(self, command, picn, length, change_aspect, tsec, counter, x, y, use_existing=None, lock=None):
        if self.preview_process.processId() != 0:
            self.preview_process.kill()
        if self.preview_process.processId() == 0 and lock is False and not use_existing:
            ui.logger.debug('\npreview_generating - {} - {}\n'.format(length, tsec))
            self.preview_process = QtCore.QProcess()
            self.preview_process.finished.connect(partial(self.preview_generated, picn, length, change_aspect, tsec, counter, x, y))
            QtCore.QTimer.singleShot(1, partial(self.preview_process.start, command))
        elif use_existing:
            newpicn = os.path.join(self.preview_dir, "{}.jpg".format(int(tsec)))
            if ui.live_preview == 'fast':
                self.apply_pic(newpicn, x, y, length)
                ui.logger.debug('\n use existing preview image \n')
            else:
                self.preview_process = QtCore.QProcess()
                command = 'echo "hello"'
                self.preview_process.finished.connect(partial(self.preview_generated, picn, length, change_aspect, tsec, counter, x, y))
                QtCore.QTimer.singleShot(1, partial(self.preview_process.start, command)) 
Example 15
Project: kawaii-player   Author: kanishka-linux   File: player_functions.py    License: GNU General Public License v3.0 6 votes vote down vote up
def qmsg_message(txt):
    print(txt)
    #root = tkinter.Tk()
    #width = root.winfo_screenwidth()
    #height = root.winfo_screenheight()
    #print(width, height, '--screen--tk--')
    msg = QtWidgets.QMessageBox()
    msg.setGeometry(0, 0, 50, 20)
    #msg.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint)
    msg.setWindowModality(QtCore.Qt.NonModal)
    msg.setWindowTitle("Kawaii-Player MessageBox")
    
    msg.setIcon(QtWidgets.QMessageBox.Information)
    msg.setText(txt+'\n\n(Message Will Autohide in 5 seconds)')
    msg.show()
    
    frame_timer = QtCore.QTimer()
    frame_timer.timeout.connect(lambda x=0: frame_options(msg))
    frame_timer.setSingleShot(True)
    frame_timer.start(5000)
    msg.exec_() 
Example 16
Project: imperialism-remake   Author: Trilarion   File: server_monitor.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.layout = QtWidgets.QVBoxLayout(self)

        self.status = QtWidgets.QLabel('No information yet.')
        self.layout.addWidget(self.status)
        self.layout.addStretch()

        local_network_client.connect_to_channel(constants.C.SYSTEM, self.update_monitor)

        # one initial update
        self.request_monitor_update()

        # set timer for following updates
        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.request_monitor_update)
        self.timer.setInterval(10000)
        self.timer.start() 
Example 17
Project: imperialism-remake   Author: Trilarion   File: qt.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        """
        We initialize the timer and set the update interval (one minute) and start it and update the clock at least
        once.
        """
        super().__init__(*args, **kwargs)

        # customize format if desired (https://docs.python.org/3.5/library/datetime.html#strftime-strptime-behavior)
        self.time_format = '%H:%M'

        # initial update
        self.update_clock()

        # create and start timer for all following updates
        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.update_clock)
        self.timer.setInterval(60000)
        self.timer.start() 
Example 18
Project: PyPipboyApp   Author: matzman666   File: autodocwidget.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, startEnabled, startSetting, startLimit, formID):
        self.Enabled = startEnabled
        self.Setting = startSetting
        self.Limit = startLimit
        self.FormID = formID
        
        self.Num = 0
        self.Active = False
        
        self.UseFlag = False
        self.UseTimer = QtCore.QTimer()
        self.UseTimer.setSingleShot(True)
        self.UseTimer.timeout.connect(self.UseTimerTimeout)
        self.UseTimerDelay = 2000
        
        self.FreezeUseFlag = False 
Example 19
Project: qutebrowser   Author: qutebrowser   File: completer.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *, cmd, win_id, parent=None):
        super().__init__(parent)
        self._cmd = cmd
        self._win_id = win_id
        self._timer = QTimer()
        self._timer.setSingleShot(True)
        self._timer.setInterval(0)
        self._timer.timeout.connect(self._update_completion)
        self._last_cursor_pos = -1
        self._last_text = None
        self._last_before_cursor = None
        self._cmd.update_completion.connect(self.schedule_completion_update) 
Example 20
Project: qutebrowser   Author: qutebrowser   File: httpclient.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self._nam = QNetworkAccessManager(self)
        self._timers = {}  # type: typing.MutableMapping[QNetworkReply, QTimer] 
Example 21
Project: qutebrowser   Author: qutebrowser   File: httpclient.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _handle_reply(self, reply):
        """Handle a new QNetworkReply."""
        if reply.isFinished():
            self.on_reply_finished(reply)
        else:
            timer = QTimer(self)
            timer.setInterval(10000)
            timer.timeout.connect(reply.abort)
            timer.start()
            self._timers[reply] = timer
            reply.finished.connect(functools.partial(
                self.on_reply_finished, reply)) 
Example 22
Project: qutebrowser   Author: qutebrowser   File: messageview.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self._messages = []  # type: typing.MutableSequence[Message]
        self._vbox = QVBoxLayout(self)
        self._vbox.setContentsMargins(0, 0, 0, 0)
        self._vbox.setSpacing(0)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        self._clear_timer = QTimer()
        self._clear_timer.timeout.connect(self.clear_messages)
        config.instance.changed.connect(self._set_clear_timer_interval)

        self._last_text = None 
Example 23
Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: rest_notification.py    License: GNU General Public License v3.0 5 votes vote down vote up
def start_shown_timer(self):
        self.shown_qtimer = QtCore.QTimer(self)  # -please remember to send "self" to the timer
        self.shown_qtimer.setSingleShot(True)
        self.shown_qtimer.timeout.connect(self.shown_timer_timeout)
        self.shown_qtimer.start(SHOWN_TIMER_TIME_INT) 
Example 24
Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: main_win.py    License: GNU General Public License v3.0 5 votes vote down vote up
def start_suspend_timer(self, i_minutes: int):
        if i_minutes == 0:
            logging.debug("Resuming application (after suspending)")
            self.stop_suspend_timer()
        logging.debug("Suspending the application for " + str(i_minutes) + " minutes")

        self.stop_rest_timer()
        self.stop_breathing_timer()

        self.suspend_qtimer = QtCore.QTimer(self)  # -please remember to send "self" to the timer
        self.suspend_qtimer.setSingleShot(True)  # <-------
        self.suspend_qtimer.timeout.connect(self.suspend_timer_timeout)
        self.suspend_qtimer.start(i_minutes * 60 * 1000)
        self.update_gui() 
Example 25
Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: main_win.py    License: GNU General Public License v3.0 5 votes vote down vote up
def start_rest_timer(self):
        mc.mc_global.rest_reminder_minutes_passed_int = 0
        self.stop_rest_timer()
        self.rest_reminder_qtimer = QtCore.QTimer(self)
        self.rest_reminder_qtimer.timeout.connect(self.rest_timer_timeout)
        self.rest_reminder_qtimer.start(60 * 1000)  # -one minute 
Example 26
Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: main_win.py    License: GNU General Public License v3.0 5 votes vote down vote up
def start_breathing_timer(self):
        self.stop_breathing_timer()
        settings = mc.model.SettingsM.get()
        self.breathing_qtimer = QtCore.QTimer(self)  # -please remember to send "self" to the timer
        self.breathing_qtimer.timeout.connect(self.breathing_timer_timeout)
        # -show_breathing_notification
        self.breathing_qtimer.start(settings.breathing_reminder_interval_int * 60 * 1000) 
Example 27
Project: mindfulness-at-the-computer   Author: mindfulness-at-the-computer   File: rest_prepare.py    License: GNU General Public License v3.0 5 votes vote down vote up
def start_shown_timer(self):
        self.shown_qtimer = QtCore.QTimer(self)  # -please remember to send "self" to the timer
        self.shown_qtimer.setSingleShot(True)
        self.shown_qtimer.timeout.connect(self.shown_timer_timeout)
        self.shown_qtimer.start(SHOWN_TIMER_TIME_INT) 
Example 28
Project: qhangups   Author: xmikos   File: __main__.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, refresh_token_path, parent=None):
        super().__init__(parent)
        self.set_language()

        self.refresh_token_path = refresh_token_path
        self.hangups_running = False
        self.client = None

        self.create_actions()
        self.create_menu()
        self.create_icon()
        self.update_status()

        # These are populated by on_connect when it's called.
        self.conv_list = None  # hangups.ConversationList
        self.user_list = None  # hangups.UserList
        self.notifier = None   # hangups.notify.Notifier

        # Widgets
        self.conversations_dialog = QHangupsConversationsList(controller=self)
        self.messages_dialog = QHangupsConversations(controller=self)

        # Setup system tray icon doubleclick timer
        self.icon_doubleclick_timer = QtCore.QTimer(self)
        self.icon_doubleclick_timer.setSingleShot(True)
        self.icon_doubleclick_timer.timeout.connect(self.icon_doubleclick_timeout)

        # Handle signals on Unix
        # (add_signal_handler is not implemented on Windows)
        try:
            loop = asyncio.get_event_loop()
            for signum in (signal.SIGINT, signal.SIGTERM):
                loop.add_signal_handler(signum, lambda: self.quit(force=True))
        except NotImplementedError:
            pass

        settings = QtCore.QSettings()

        if settings.value("autoconnect", False, type=bool):
            self.hangups_start() 
Example 29
Project: Lector   Author: BasioMeusPuga   File: contentwidgets.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, main_window, parent=None):
        super(PliantQTextBrowser, self).__init__(parent)
        self._translate = QtCore.QCoreApplication.translate

        self.parent = parent
        self.main_window = main_window

        # Available modes:
        # flow - default
        # singlePage
        # doublePage
        self.text_mode = 'flow'

        # New pages will be generated following a resize
        # This is timed so as not to drive the processor nuts
        self.resizeTimer = QtCore.QTimer()
        self.resizeTimer.setSingleShot(True)
        self.resizeTimer.timeout.connect(self.create_pages)

        self.annotation_mode = False
        self.annotator = AnnotationPlacement()
        self.current_annotation = None
        self.annotation_dict = self.parent.metadata['annotations']

        self.common_functions = PliantWidgetsCommonFunctions(
            self, self.main_window)

        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(
            self.generate_textbrowser_context_menu)

        self.setMouseTracking(True)
        self.verticalScrollBar().sliderMoved.connect(
            self.record_position)
        self.mousePosition = None
        self.ignore_wheel_event = False
        self.ignore_wheel_event_number = 0

        self.at_end = False
        self.page_cursors = []
        self.page_number = 0 
Example 30
Project: bitmask-dev   Author: leapcode   File: app.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _handle_kill(*args, **kw):
    global pixbrowser
    global closing
    if closing:
        sys.exit()
    win = kw.get('win')
    if win:
        win.user_closed = True
        QtCore.QTimer.singleShot(0, win.close)
    if pixbrowser:
        QtCore.QTimer.singleShot(0, pixbrowser.close)
    closing = True