Python PyQt5.QtGui.QShowEvent() Examples

The following are 10 code examples for showing how to use PyQt5.QtGui.QShowEvent(). 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.QtGui , or try the search function .

Example 1
Project: track   Author: frans-fuerst   File: mainwindow.py    License: Apache License 2.0 7 votes vote down vote up
def event(self, e):
        if not isinstance(e, (
                QtCore.QEvent,
                QtCore.QChildEvent,
                QtCore.QDynamicPropertyChangeEvent,
                QtGui.QPaintEvent,
                QtGui.QHoverEvent,
                QtGui.QMoveEvent,
                QtGui.QEnterEvent,
                QtGui.QResizeEvent,
                QtGui.QShowEvent,
                QtGui.QPlatformSurfaceEvent,
                QtGui.QWindowStateChangeEvent,
                QtGui.QKeyEvent,
                QtGui.QWheelEvent,
                QtGui.QMouseEvent,
                QtGui.QFocusEvent,
                QtGui.QHelpEvent,
                QtGui.QHideEvent,
                QtGui.QCloseEvent,
                QtGui.QInputMethodQueryEvent,
                QtGui.QContextMenuEvent,
                )):
            log().warning("unknown event: %r %r", e.type(), e)
        return super().event(e) 
Example 2
Project: IDASkins   Author: zyantific   File: clrapplier.py    License: MIT License 6 votes vote down vote up
def eventFilter(self, obj, event):
        def is_colors_dialog():
            return isinstance(
                obj, QDialog) and 'IDA Colors' in obj.windowTitle()

        if isinstance(event, QShowEvent) and is_colors_dialog():
            qApp.removeEventFilter(self)

            # Hide window and find &Import button
            obj.windowHandle().setOpacity(0)
            buttons = [widget for widget in obj.children() if isinstance(
                widget, QDialogButtonBox)][0]
            button = [widget for widget in buttons.buttons() if widget.text()
                      == '&Import'][0]

            with NativeHook(ask_file=self.ask_file_handler):
                button.click()

            QTimer.singleShot(0, lambda: obj.accept())
            return 1
        return 0 
Example 3
Project: vidcutter   Author: ozmartian   File: mediainfo.py    License: GNU General Public License v3.0 5 votes vote down vote up
def showEvent(self, event: QShowEvent) -> None:
        if self.content.verticalScrollBar().isVisible() \
                and (self.parent.parent.parent.stylename == 'fusion' or sys.platform in {'win32', 'darwin'}):
            self.content.setStyleSheet('''
                QTextBrowser {{
                    border-left: none;
                    border-right: 1px solid {0};
                    border-top: 1px solid {0};
                    border-bottom: 1px solid {0};
                    background-color: transparent;
                }}'''.format('#4D5355' if self.parent.parent.theme == 'dark' else '#C0C2C3'))
        super(KeyframesDialog, self).showEvent(event) 
Example 4
Project: vidcutter   Author: ozmartian   File: settings.py    License: GNU General Public License v3.0 5 votes vote down vote up
def showEvent(self, event: QShowEvent) -> None:
        self.clearSpinners()
        super(GeneralPage, self).showEvent(event) 
Example 5
Project: vidcutter   Author: ozmartian   File: videoconsole.py    License: GNU General Public License v3.0 5 votes vote down vote up
def showEvent(self, event: QShowEvent):
        self.parent.consoleLogger.flush()
        super(ConsoleWidget, self).showEvent(event) 
Example 6
Project: vidcutter   Author: ozmartian   File: widgets.py    License: GNU General Public License v3.0 5 votes vote down vote up
def showEvent(self, event: QShowEvent):
            self.adjustSize()
            self.parent.adjustSize() 
Example 7
Project: vidcutter   Author: ozmartian   File: videocutter.py    License: GNU General Public License v3.0 5 votes vote down vote up
def showEvent(self, event: QShowEvent) -> None:
        if hasattr(self, 'filterProgressBar') and self.filterProgressBar.isVisible():
            self.filterProgressBar.update()
        super(VideoCutter, self).showEvent(event) 
Example 8
Project: CvStudio   Author: haruiz   File: loading_dialog.py    License: MIT License 5 votes vote down vote up
def showEvent(self, e: QShowEvent):
        if self.movie.state() == QMovie.NotRunning:
            self.movie.start() 
Example 9
Project: pandasgui   Author: adamerose   File: dataframe_viewer.py    License: MIT License 5 votes vote down vote up
def showEvent(self, event: QtGui.QShowEvent):
        """
        Initialize column and row sizes on the first time the widget is shown
        """
        if not self._loaded:
            # Set column widths
            for column_index in range(self.columnHeader.model().columnCount()):
                self.auto_size_column(column_index)

            # Set row heights
            # Just sets a single uniform row height based on the first N rows for performance.
            N = 100
            default_row_height = 30
            for row_index in range(self.indexHeader.model().rowCount())[:N]:
                self.auto_size_row(row_index)
                height = self.indexHeader.rowHeight(row_index)
                default_row_height = max(default_row_height, height)

            # Set limit for default row height
            default_row_height = min(default_row_height, 100)

            self.indexHeader.verticalHeader().setDefaultSectionSize(default_row_height)
            self.dataView.verticalHeader().setDefaultSectionSize(default_row_height)

        self._loaded = True
        event.accept() 
Example 10
Project: IDArling   Author: IDArlingTeam   File: filter.py    License: GNU General Public License v3.0 4 votes vote down vote up
def eventFilter(self, obj, ev):  # noqa: N802
        # Is it a QShowEvent on a QDialog named "Dialog"?
        if (
            ev.__class__ == ev,
            QShowEvent
            and obj.__class__ == QDialog
            and obj.windowTitle() == "About",
        ):
            # Find a child QGroupBox
            for groupBox in obj.children():
                if groupBox.__class__ == QGroupBox:
                    # Find a child QLabel with an icon
                    for label in groupBox.children():
                        if isinstance(label, QLabel) and label.pixmap():
                            self._replace_icon(label)

        # Is it a QContextMenuEvent on a QWidget?
        if isinstance(obj, QWidget) and isinstance(ev, QContextMenuEvent):
            # Find a parent titled "IDA View"
            parent = obj
            while parent:
                if parent.windowTitle().startswith("IDA View"):
                    # Intercept the next context menu
                    self._intercept = True
                parent = parent.parent()

        # Is it a QShowEvent on a QMenu?
        if isinstance(obj, QMenu) and isinstance(ev, QShowEvent):
            # Should we intercept?
            if self._intercept:
                self._insert_menu(obj)
                self._intercept = False

        # Is it a ToolTip event on a QWidget with a parent?
        if (
            ev.type() == QEvent.ToolTip
            and obj.__class__ == QWidget
            and obj.parent()
        ):
            table_view = obj.parent()
            # Is it a QTableView with a parent?
            if table_view.__class__ == QTableView and table_view.parent():
                func_window = table_view.parent()
                # Is it a QWidget titled "Functions window"?
                if (
                    func_window.__class__ == QWidget
                    and func_window.windowTitle() == "Functions window"
                ):
                    self._set_tooltip(obj, ev)

        return False