Beispiel #1
0
#     import PySide
#     # noinspection PyUnresolvedReferences
#     from PySide import QtCore
#     # noinspection PyUnresolvedReferences
#     from PySide.QtGui import *
#     # noinspection PyUnresolvedReferences
#     from PySide.QtCore import *
# else:
#     print("USAGE:")
#     print("  qt.py pyqt4")
#     print("  qt.py pyqt5")
#     print("  qt.py pyside")
#     sys.exit(1)

# Fix for PyCharm hints warnings when using static methods
WindowUtils = cef.WindowUtils()

# Platforms
WINDOWS = (platform.system() == "Windows")
LINUX = (platform.system() == "Linux")
MAC = (platform.system() == "Darwin")

# Configuration
WIDTH = 800
HEIGHT = 600

# OS differences
CefWidgetParent = QWidget
if LINUX and (PYQT4 or PYSIDE):
    # noinspection PyUnresolvedReferences
    CefWidgetParent = QX11EmbedContainer
Beispiel #2
0
 def focusInEvent(self, event):
     # This event seems to never get called on Linux, as CEF is
     # stealing all focus due to Issue #284.
     if self.browser:
         cef.WindowUtils().OnSetFocus(self.getHandle(), 0, 0, 0)
         self.browser.SetFocus(True)
Beispiel #3
0
    def on_size(self, event):
        if not self.browser:
            return
        cef.WindowUtils().OnSize(self.browser_panel.GetHandle(), 0, 0, 0)

        self.browser.NotifyMoveOrResizeStarted()
Beispiel #4
0
 def resizeEvent(self, event):
     size = event.size()
     if self.browser:
         if WINDOWS:
             cef.WindowUtils().OnSize(self.getHandle(), 0, 0, 0)
         self.browser.NotifyMoveOrResizeStarted()