76 from eric7.Preferences import Shortcuts |
76 from eric7.Preferences import Shortcuts |
77 from eric7.Preferences.ShortcutsDialog import ShortcutsDialog |
77 from eric7.Preferences.ShortcutsDialog import ShortcutsDialog |
78 from eric7.QtHelpInterface.HelpIndexWidget import HelpIndexWidget |
78 from eric7.QtHelpInterface.HelpIndexWidget import HelpIndexWidget |
79 from eric7.QtHelpInterface.HelpSearchWidget import HelpSearchWidget |
79 from eric7.QtHelpInterface.HelpSearchWidget import HelpSearchWidget |
80 from eric7.QtHelpInterface.HelpTocWidget import HelpTocWidget |
80 from eric7.QtHelpInterface.HelpTocWidget import HelpTocWidget |
81 from eric7.SystemUtilities import FileSystemUtilities, OSUtilities, PythonUtilities |
81 from eric7.SystemUtilities import ( |
|
82 FileSystemUtilities, |
|
83 OSUtilities, |
|
84 PythonUtilities, |
|
85 QtUtilities, |
|
86 ) |
82 from eric7.UI.Info import Version |
87 from eric7.UI.Info import Version |
83 from eric7.UI.NotificationWidget import NotificationTypes |
88 from eric7.UI.NotificationWidget import NotificationTypes |
84 from eric7.WebBrowser.Tools import WebIconProvider |
89 from eric7.WebBrowser.Tools import WebIconProvider |
85 from eric7.WebBrowser.ZoomManager import ZoomManager |
90 from eric7.WebBrowser.ZoomManager import ZoomManager |
86 |
91 |
705 ) |
710 ) |
706 settings.setAttribute( |
711 settings.setAttribute( |
707 QWebEngineSettings.WebAttribute.PdfViewerEnabled, |
712 QWebEngineSettings.WebAttribute.PdfViewerEnabled, |
708 Preferences.getWebBrowser("PdfViewerEnabled"), |
713 Preferences.getWebBrowser("PdfViewerEnabled"), |
709 ) |
714 ) |
|
715 if QtUtilities.qVersionTuple() >= (6, 4, 0): |
|
716 # Qt 6.4+ |
|
717 settings.setAttribute( |
|
718 QWebEngineSettings.WebAttribute.NavigateOnDropEnabled, |
|
719 Preferences.getWebBrowser("NavigateOnDropEnabled"), |
|
720 ) |
|
721 if QtUtilities.qVersionTuple() >= (6, 6, 0): |
|
722 # Qt 6.6+ |
|
723 settings.setAttribute( |
|
724 QWebEngineSettings.WebAttribute.ReadingFromCanvasEnabled, |
|
725 Preferences.getWebBrowser("ReadingFromCanvasEnabled"), |
|
726 ) |
710 |
727 |
711 def __initActions(self): |
728 def __initActions(self): |
712 """ |
729 """ |
713 Private method to define the user interface actions. |
730 Private method to define the user interface actions. |
714 """ |
731 """ |
5320 ) |
5337 ) |
5321 ) |
5338 ) |
5322 cls._webProfile.setPersistentCookiesPolicy( |
5339 cls._webProfile.setPersistentCookiesPolicy( |
5323 QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies |
5340 QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies |
5324 ) |
5341 ) |
|
5342 with contextlib.suppress(AttributeError): |
|
5343 # Qt 6.5+ |
|
5344 cls._webProfile.setPushServiceEnabled( |
|
5345 Preferences.getWebBrowser("PushServiceEnabled") |
|
5346 ) |
5325 |
5347 |
5326 with contextlib.suppress(AttributeError): |
5348 with contextlib.suppress(AttributeError): |
5327 cls._webProfile.setSpellCheckEnabled( |
5349 cls._webProfile.setSpellCheckEnabled( |
5328 Preferences.getWebBrowser("SpellCheckEnabled") |
5350 Preferences.getWebBrowser("SpellCheckEnabled") |
5329 ) |
5351 ) |