summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-03-17 20:30:13 +0100
committerFlorian Bruhin <me@the-compiler.org>2023-03-17 20:30:13 +0100
commit4793070db3e5afec32470c440a63c6add0450880 (patch)
treed69cba543c311f3e131c76b5cbb9e6006f6fc32c /doc
parent3d56f57e502ffaad40936f19f44083a2b63f0690 (diff)
parent30125a2e2e302b79a168db36cb5b3f18ff50f5bd (diff)
downloadqutebrowser-4793070db3e5afec32470c440a63c6add0450880.tar.gz
qutebrowser-4793070db3e5afec32470c440a63c6add0450880.zip
Merge branch 'qt6-v2' into master-qt6
Diffstat (limited to 'doc')
-rw-r--r--doc/changelog.asciidoc5
-rw-r--r--doc/contributing.asciidoc69
-rw-r--r--doc/help/commands.asciidoc13
-rw-r--r--doc/help/settings.asciidoc70
-rw-r--r--doc/qutebrowser.1.asciidoc2
5 files changed, 106 insertions, 53 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index e3825de20..209042184 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -57,9 +57,12 @@ Removed
- Support for Python 3.6 is dropped, as it's been
https://discuss.python.org/t/python-3-6-rides-into-the-sunset/12964[end-of-life upstream]
since December 2021. Python 3.7.0 or newer is now required.
+- Support for Qt/PyQt before 5.15.0 and QtWebEngine before 5.15.2 are now
+ dropped, as older Qt versions are
+ https://endoflife.date/qt[end-of-life upstream] since mid/late 2020
+ (5.13/5.14) and late 2021 (5.12 LTS).
- It's planned to drop support for various legacy platforms and libraries which
are unsupported upstream, such as:
- * Qt before 5.15 LTS (plus adding support for Qt 6.2+)
* The QtWebKit backend
* macOS 10.14 (via Homebrew)
* 32-bit Windows (via Qt)
diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc
index 70447d8c5..d99dc41ef 100644
--- a/doc/contributing.asciidoc
+++ b/doc/contributing.asciidoc
@@ -128,6 +128,9 @@ Currently, the following tox environments are available:
- untracked git files
- VCS conflict markers
- common spelling mistakes
+* http://mypy-lang.org/[mypy] for static type checking:
+ - `mypy-pyqt5` run mypy with PyQt5 installed
+ - `mypy-pyqt6` run mypy with PyQt6 installed
The default test suite is run with `tox`; the list of default
environments is obtained with `tox -l`.
@@ -153,7 +156,7 @@ smallest scope which makes sense. Most of the time, this will be line scope.
false-positives, let me know! I'm still tweaking the parameters.
-Running Specific Tests
+Running specific tests
~~~~~~~~~~~~~~~~~~~~~~
While you are developing you often don't want to run the full test
@@ -180,6 +183,15 @@ tox -e py37 -- tests/end2end/features/test_tabs_bdd.py -k undo
tox -e py37-cov -- tests/unit/browser/test_webelem.py
----
+Specifying the backend for tests
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Tests automatically pick the backend based on what they manage to import. If
+you have both backends available and you would like the tests to be run with a
+specific one you can set either of a) the environment variable QUTE_TESTS_BACKEND
+, or b) the command line argument --qute-backend, to the desired backend
+(webkit/webengine).
+
Profiling
~~~~~~~~~
@@ -219,7 +231,8 @@ Useful websites
Some resources which might be handy:
-* https://doc.qt.io/qt-5/classes.html[The Qt5 reference]
+* https://doc.qt.io/qt-6/classes.html[The Qt 6 reference]
+* https://doc.qt.io/qt-5/classes.html[The Qt 5 reference]
* https://docs.python.org/3/library/index.html[The Python reference]
* https://httpbin.org/[httpbin, a test service for HTTP requests/responses]
* https://requestbin.com/[RequestBin, a service to inspect HTTP requests]
@@ -274,7 +287,7 @@ Other
Languages] (https://www.rfc-editor.org/errata_search.php?rfc=5646[Errata])
* https://www.w3.org/TR/CSS2/[Cascading Style Sheets Level 2 Revision 1 (CSS
2.1) Specification]
-* https://doc.qt.io/qt-5/stylesheet-reference.html[Qt Style Sheets Reference]
+* https://doc.qt.io/qt-6/stylesheet-reference.html[Qt Style Sheets Reference]
* https://mimesniff.spec.whatwg.org/[MIME Sniffing Standard]
* https://spec.whatwg.org/[WHATWG specifications]
* https://www.w3.org/html/wg/drafts/html/master/Overview.html[HTML 5.1 Nightly]
@@ -353,7 +366,7 @@ All objects can be printed by starting with the `--debug` flag and using the
The registry is mainly used for <<commands,command handlers>>, but it can
also be useful in places where using Qt's
-https://doc.qt.io/qt-5/signalsandslots.html[signals and slots] mechanism would
+https://doc.qt.io/qt-6/signalsandslots.html[signals and slots] mechanism would
be difficult.
Logging
@@ -600,11 +613,14 @@ This is mostly useful for qutebrowser maintainers to work around issues in Qt -
The hierarchy of widgets when QtWebEngine is involved looks like this:
- qutebrowser has a `WebEngineTab` object, which is its abstraction over QtWebKit/QtWebEngine.
-- The `WebEngineTab` has a `_widget` attribute, which is the https://doc.qt.io/qt-5/qwebengineview.html[QWebEngineView]
-- That view has a https://doc.qt.io/qt-5/qwebenginepage.html[QWebEnginePage] for everything which doesn't require rendering.
-- The view also has a layout with exactly one element (which also is its `focusProxy()`)
-- That element is the https://code.qt.io/cgit/qt/qtwebengine.git/tree/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp[RenderWidgetHostViewQtDelegateWidget] (it inherits https://doc.qt.io/qt-5/qquickwidget.html[QQuickWidget]) - also often referred to as RWHV or RWHVQDW. It can be obtained via `sip.cast(tab._widget.focusProxy(), QQuickWidget)`.
-- Calling `rootObject()` on that gives us the https://doc.qt.io/qt-5/qquickitem.html[QQuickItem] where Chromium renders into (?). With it, we can do things like `.setRotation(20)`.
+- The `WebEngineTab` has a `_widget` attribute, which is the https://doc.qt.io/qt-6/qwebengineview.html[QWebEngineView]
+- That view has a https://doc.qt.io/qt-6/qwebenginepage.html[QWebEnginePage] for everything which doesn't require rendering.
+- The view also has a layout with exactly one element (which also is its `focusProxy()`).
+ - Qt 5: That element is the https://code.qt.io/cgit/qt/qtwebengine.git/tree/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp?h=5.15[RenderWidgetHostViewQtDelegateWidget] (it inherits https://doc.qt.io/qt-6/qquickwidget.html[QQuickWidget]) - also often referred to as RWHV or RWHVQDW.
+ It can be obtained via `sip.cast(tab._widget.focusProxy(), QQuickWidget)`.
+ - Qt 6: That element is the https://code.qt.io/cgit/qt/qtwebengine.git/tree/src/webenginewidgets/api/qwebengineview.cpp[WebEngineQuickWidget] (it inherits https://doc.qt.io/qt-6/qquickwidget.html[QQuickWidget]).
+ It can be obtained via `tab._widget.focusProxy()`.
+- Calling `rootObject()` on that gives us the https://doc.qt.io/qt-6/qquickitem.html[QQuickItem] where Chromium renders into (?). With it, we can do things like `.setRotation(20)`.
Style conventions
-----------------
@@ -676,6 +692,41 @@ Return:
- `__magic__` methods
- other methods
- overrides of Qt methods
+* Type hinting: the qutebrowser codebase uses type hints liberally to enable
+ static type checking and autocompletion in editors.
+ - We use http://mypy-lang.org/[mypy] in CI jobs to perform static type
+ checking.
+ - Not all of the codebase is covered by type hints currently. We encourage
+ including type hints on all new code and even adding type hints to
+ existing code if you find yourself working on some that isn't already
+ covered. There are some module specific rules in the mypy config file,
+ `.mypy.ini`, to make type hints strictly required in some areas.
+ - More often than not mypy is correct when it raises issues. But don't be
+ afraid to add `# type: ignore[...]` statements or casts if you need to.
+ As an optional part of the language not all type information from third
+ parties is always correct. Mypy will raise a new issue if it spots an
+ "ignore" statement which is no longer needed because the underlying
+ issue has been resolved.
+ - One area where we have to take particular care is in code that deals
+ with differences between PyQt5 and PyQt6. We try to write most code in a
+ way that will work with either backend but when you need to deal with
+ differences you should use a pattern like:
++
+[source,python]
+----
+if machinery.IS_QT5:
+ ... # do PyQt5 specific implementation
+else:
+ # PyQt6
+ ... # do PyQt6 specific implementation
+----
++
+then you have to https://mypy.readthedocs.io/en/latest/command_line.html#cmdoption-mypy-always-true[tell]
+ mypy to treat `machinery.IS_QT5` as a constant value then run mypy twice to
+ cover both branches. There are a handful of variables in
+ `qutebrowser/qt/machinery.py` that mypy needs to know about. There are tox
+ jobs (`mypy-pyqt5` and `mypy-pyqt6`) that take care of telling mypy to use
+ them as constants.
Checklists
----------
diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc
index 0ba7b15a2..7f0abc71d 100644
--- a/doc/help/commands.asciidoc
+++ b/doc/help/commands.asciidoc
@@ -337,8 +337,13 @@ Remove a key from a dict.
[[config-diff]]
=== config-diff
+Syntax: +:config-diff [*--include-hidden*]+
+
Show all customized options.
+==== optional arguments
+* +*-i*+, +*--include-hidden*+: Also include internal qutebrowser settings.
+
[[config-edit]]
=== config-edit
Syntax: +:config-edit [*--no-source*]+
@@ -821,7 +826,7 @@ Show an error message in the statusbar.
* +'text'+: The text to show.
==== optional arguments
-* +*-r*+, +*--rich*+: Render the given text as https://doc.qt.io/qt-5/richtext-html-subset.html[Qt Rich Text].
+* +*-r*+, +*--rich*+: Render the given text as https://doc.qt.io/qt-6/richtext-html-subset.html[Qt Rich Text].
[[message-info]]
@@ -834,7 +839,7 @@ Show an info message in the statusbar.
* +'text'+: The text to show.
==== optional arguments
-* +*-r*+, +*--rich*+: Render the given text as https://doc.qt.io/qt-5/richtext-html-subset.html[Qt Rich Text].
+* +*-r*+, +*--rich*+: Render the given text as https://doc.qt.io/qt-6/richtext-html-subset.html[Qt Rich Text].
==== count
@@ -850,7 +855,7 @@ Show a warning message in the statusbar.
* +'text'+: The text to show.
==== optional arguments
-* +*-r*+, +*--rich*+: Render the given text as https://doc.qt.io/qt-5/richtext-html-subset.html[Qt Rich Text].
+* +*-r*+, +*--rich*+: Render the given text as https://doc.qt.io/qt-6/richtext-html-subset.html[Qt Rich Text].
[[messages]]
@@ -2176,7 +2181,7 @@ Syntax: +:debug-webaction 'action'+
Execute a webaction.
-Available actions: https://doc.qt.io/archives/qt-5.5/qwebpage.html#WebAction-enum (WebKit) https://doc.qt.io/qt-5/qwebenginepage.html#WebAction-enum (WebEngine)
+Available actions: https://doc.qt.io/archives/qt-5.5/qwebpage.html#WebAction-enum (WebKit) https://doc.qt.io/qt-6/qwebenginepage.html#WebAction-enum (WebEngine)
==== positional arguments
* +'action'+: The action to execute, e.g. MoveToNextChar.
diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc
index 8327ec048..29cde3b0f 100644
--- a/doc/help/settings.asciidoc
+++ b/doc/help/settings.asciidoc
@@ -118,6 +118,7 @@
|<<colors.webpage.darkmode.enabled,colors.webpage.darkmode.enabled>>|Render all web contents using a dark theme.
|<<colors.webpage.darkmode.grayscale.all,colors.webpage.darkmode.grayscale.all>>|Render all colors as grayscale.
|<<colors.webpage.darkmode.grayscale.images,colors.webpage.darkmode.grayscale.images>>|Desaturation factor for images in dark mode.
+|<<colors.webpage.darkmode.increase_text_contrast,colors.webpage.darkmode.increase_text_contrast>>|Increase text contrast by drawing an outline of the uninverted color.
|<<colors.webpage.darkmode.policy.images,colors.webpage.darkmode.policy.images>>|Which images to apply dark mode to.
|<<colors.webpage.darkmode.policy.page,colors.webpage.darkmode.policy.page>>|Which pages to apply dark mode to.
|<<colors.webpage.darkmode.threshold.background,colors.webpage.darkmode.threshold.background>>|Threshold for inverting background elements with dark mode.
@@ -1671,6 +1672,9 @@ Example configurations from Chromium's `chrome://flags`:
- "With selective inversion of everything": Combines the two variants
above.
+- "With increased text contrast": Set
+ `colors.webpage.darkmode.increase_text_contrast` (QtWebEngine 6.3+)
+
This setting requires a restart.
This setting is only available with the QtWebEngine backend.
@@ -1699,14 +1703,26 @@ If set to 0, images are left as-is. If set to 1, images are completely grayscale
This setting requires a restart.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,Float>>
Default: +pass:[0.0]+
+[[colors.webpage.darkmode.increase_text_contrast]]
+=== colors.webpage.darkmode.increase_text_contrast
+Increase text contrast by drawing an outline of the uninverted color.
+
+This setting requires a restart.
+
+On QtWebEngine, this setting requires Qt 6.3 or newer.
+
+On QtWebKit, this setting is unavailable.
+
+Type: <<types,Bool>>
+
+Default: +pass:[false]+
+
[[colors.webpage.darkmode.policy.images]]
=== colors.webpage.darkmode.policy.images
Which images to apply dark mode to.
@@ -1733,9 +1749,7 @@ The underlying Chromium setting has been removed in QtWebEngine 5.15.3, thus thi
This setting requires a restart.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,String>>
@@ -1754,9 +1768,7 @@ Note: This behavior is the opposite of `colors.webpage.darkmode.threshold.text`!
This setting requires a restart.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,Int>>
@@ -1769,9 +1781,7 @@ Text colors with brightness below this threshold will be inverted, and above it
This setting requires a restart.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,Int>>
@@ -1785,9 +1795,7 @@ The "auto" value is broken on QtWebEngine 5.15.2 due to a Qt bug. There, it will
This setting requires a restart.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,String>>
@@ -2274,7 +2282,7 @@ Type: <<types,String>>
Valid values:
- * +always+: Always send the Referer.
+ * +always+: Always send the Referer. With QtWebEngine 6.2+, this value is unavailable and will act like `same-domain`.
* +never+: Never send the Referer. This is not recommended, as some sites may break.
* +same-domain+: Only send the Referer for the same domain. This will still protect your privacy, but shouldn't break any sites. With QtWebEngine, the referer will still be sent for other domains, but with stripped path information.
@@ -2579,8 +2587,6 @@ Allow websites to show notifications.
This setting supports link:configuring{outfilesuffix}#patterns[URL patterns].
-On QtWebEngine, this setting requires Qt 5.13 or newer.
-
Type: <<types,BoolAsk>>
Valid values:
@@ -2595,8 +2601,6 @@ Default: +pass:[ask]+
=== content.notifications.presenter
What notification presenter to use for web notifications.
Note that not all implementations support all features of notifications:
-- With PyQt 5.14, any setting other than `qt` does not support the `click` and
- `close` events, as well as the `tag` option to replace existing notifications.
- The `qt` and `systray` options only support showing one notification at the time
and ignore the `tag` option to replace existing notifications.
- The `herbe` option only supports showing one notification at the time and doesn't
@@ -2604,16 +2608,14 @@ Note that not all implementations support all features of notifications:
- The `messages` option doesn't show icons and doesn't support the `click` and
`close` events.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,String>>
Valid values:
* +auto+: Tries `libnotify`, `systray` and `messages`, uses the first one available without showing error messages.
- * +qt+: Use Qt's native notification presenter, based on a system tray icon. Switching from or to this value requires a restart of qutebrowser. Recommended over `systray` on PyQt 5.14.
+ * +qt+: Use Qt's native notification presenter, based on a system tray icon. Switching from or to this value requires a restart of qutebrowser.
* +libnotify+: Shows messages via DBus in a libnotify-compatible way. If DBus isn't available, falls back to `systray` or `messages`, but shows an error message.
* +systray+: Use a notification presenter based on a systray icon. Falls back to `libnotify` or `messages` if not systray is available. This is a reimplementation of the `qt` setting value, but with the possibility to switch to it at runtime.
* +messages+: Show notifications as qutebrowser messages. Most notification features aren't available.
@@ -2629,9 +2631,7 @@ Note that with the `qt` presenter, origins are never shown.
This setting supports link:configuring{outfilesuffix}#patterns[URL patterns].
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,Bool>>
@@ -2684,9 +2684,7 @@ On Windows, if this setting is set to False, the system-wide animation setting i
This setting requires a restart.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,Bool>>
@@ -3635,9 +3633,7 @@ On Linux, disabling this also disables Chromium's MPRIS integration.
This setting requires a restart.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
-On QtWebKit, this setting is unavailable.
+This setting is only available with the QtWebEngine backend.
Type: <<types,Bool>>
@@ -3853,7 +3849,7 @@ Alternative process models use less resources, but decrease security and robustn
See the following pages for more details:
- https://www.chromium.org/developers/design-documents/process-models
- - https://doc.qt.io/qt-5/qtwebengine-features.html#process-models
+ - https://doc.qt.io/qt-6/qtwebengine-features.html#process-models
This setting requires a restart.
@@ -3950,7 +3946,7 @@ Default: +pass:[none]+
[[qt.highdpi]]
=== qt.highdpi
Turn on Qt HighDPI scaling.
-This is equivalent to setting QT_AUTO_SCREEN_SCALE_FACTOR=1 or QT_ENABLE_HIGHDPI_SCALING=1 (Qt >= 5.14) in the environment.
+This is equivalent to setting QT_ENABLE_HIGHDPI_SCALING=1 (Qt >= 5.14) in the environment.
It's off by default as it can cause issues with some bitmap fonts. As an alternative to this, it's possible to set font sizes and the `zoom.default` setting.
This setting requires a restart.
@@ -4033,8 +4029,6 @@ Default: +pass:[true]+
=== search.wrap
Wrap around at the top and bottom of the page when advancing through text matches using `:search-next` and `:search-prev`.
-On QtWebEngine, this setting requires Qt 5.14 or newer.
-
Type: <<types,Bool>>
Default: +pass:[true]+
@@ -4809,7 +4803,7 @@ When setting from a string, pass a json-like list, e.g. `["one", "two"]`.
|Proxy|A proxy URL, or `system`/`none`.
|QssColor|A color value supporting gradients.
-A value can be in one of the following formats: * `#RGB`/`#RRGGBB`/`#AARRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` * An SVG color name as specified in https://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. * transparent (no color) * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or percentages) * `hsv(h, s, v)` / `hsva(h, s, v, a)` (values 0-255, hue 0-359) * A gradient as explained in https://doc.qt.io/qt-5/stylesheet-reference.html#list-of-property-types[the Qt documentation] under ``Gradient''
+A value can be in one of the following formats: * `#RGB`/`#RRGGBB`/`#AARRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` * An SVG color name as specified in https://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. * transparent (no color) * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or percentages) * `hsv(h, s, v)` / `hsva(h, s, v, a)` (values 0-255, hue 0-359) * A gradient as explained in https://doc.qt.io/qt-6/stylesheet-reference.html#list-of-property-types[the Qt documentation] under ``Gradient''
|QtColor|A color value.
A value can be in one of the following formats: * `#RGB`/`#RRGGBB`/`#AARRGGBB`/`#RRRGGGBBB`/`#RRRRGGGGBBBB` * An SVG color name as specified in https://www.w3.org/TR/SVG/types.html#ColorKeywords[the W3C specification]. * transparent (no color) * `rgb(r, g, b)` / `rgba(r, g, b, a)` (values 0-255 or percentages) * `hsv(h, s, v)` / `hsva(h, s, v, a)` (values 0-255, hue 0-359)
diff --git a/doc/qutebrowser.1.asciidoc b/doc/qutebrowser.1.asciidoc
index 0f8a55680..9dc921acd 100644
--- a/doc/qutebrowser.1.asciidoc
+++ b/doc/qutebrowser.1.asciidoc
@@ -63,7 +63,7 @@ show it.
Which backend to use.
*--desktop-file-name* 'DESKTOP_FILE_NAME'::
- Set the base name of the desktop entry for this application. Used to set the app_id under Wayland. See https://doc.qt.io/qt-5/qguiapplication.html#desktopFileName-prop
+ Set the base name of the desktop entry for this application. Used to set the app_id under Wayland. See https://doc.qt.io/qt-6/qguiapplication.html#desktopFileName-prop
*--untrusted-args*::
Mark all following arguments as untrusted, which enforces that they are URLs/search terms (and not flags or commands)