Update references to Qt5 and PyQt5

This commit is contained in:
Veronica Berglyd Olsen
2025-01-11 21:55:26 +01:00
parent 1307fccc59
commit ff7446a2ef
16 changed files with 32 additions and 35 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ contributions are listed on the project's Members page.
The following libraries are dependencies of novelWriter: The following libraries are dependencies of novelWriter:
* **Qt5** by Qt Company * **Qt6** by Qt Company
* **PyQt5** by Riverbank Computing * **PyQt6** by Riverbank Computing
* **Enchant** by Dom Lachowicz * **Enchant** by Dom Lachowicz
* **PyEnchant** by Dimitri Merejkowsky * **PyEnchant** by Dimitri Merejkowsky
+1 -1
View File
@@ -40,7 +40,7 @@ documentation.
## Implementation ## Implementation
novelWriter is written with Python 3 (3.10+) using Qt5 and PyQt5 (5.15 only), and is released on novelWriter is written with Python 3 (3.10+) using Qt6 and PyQt6 (6.0+), and is released on
Linux, Windows and macOS. It can in principle run on any Operating System that also supports Qt, Linux, Windows and macOS. It can in principle run on any Operating System that also supports Qt,
PyQt and Python. PyQt and Python.
+3 -4
View File
@@ -36,12 +36,11 @@ Everything else is handled with standard Python libraries.
The following Python packages are needed to run all features of novelWriter: The following Python packages are needed to run all features of novelWriter:
* ``PyQt5`` needed for connecting with the Qt5 libraries. * ``PyQt6`` needed for connecting with the Qt6 libraries.
* ``PyEnchant`` needed for spell checking (optional). * ``PyEnchant`` needed for spell checking (optional).
PyQt/Qt must be at least 5.15.0. If you want spell checking, you must install the ``PyEnchant`` If you want spell checking, you must install the ``PyEnchant`` package. The spell check library
package. The spell check library must be at least 3.0 to work with Windows. On Linux, 2.0 also must be at least 3.0 to work with Windows. On Linux, 2.0 also works fine.
works fine.
If you install from PyPi, these dependencies should be installed automatically. If you install from If you install from PyPi, these dependencies should be installed automatically. If you install from
source, dependencies can still be installed from PyPi with: source, dependencies can still be installed from PyPi with:
+4 -5
View File
@@ -18,7 +18,7 @@ When contributing translations, keep the following things in mind.
* For descriptive labels and dialog boxes, make sure you do _not_ change the meaning of the text * For descriptive labels and dialog boxes, make sure you do _not_ change the meaning of the text
when you translate it from English. The user must receive the same instructions or information when you translate it from English. The user must receive the same instructions or information
regardless of language. This is improtant, otherwise the documentation will be inconsistent with regardless of language. This is important, otherwise the documentation will be inconsistent with
the user interface and it will become a lot more difficult to handle user issues and questions. the user interface and it will become a lot more difficult to handle user issues and questions.
* If you think a label or description is misleading or incomplete, please file an issue report. The * If you think a label or description is misleading or incomplete, please file an issue report. The
correct way to handle such changes is to change the text in the code first, which will then be correct way to handle such changes is to change the text in the code first, which will then be
@@ -35,7 +35,7 @@ Linguist, or updating the translations for an already existing supported languag
There are two areas relevant to localisation: There are two areas relevant to localisation:
* The Qt5 GUI translation files, which consists of `nw_XX.ts` files. This is the bulk of the * The Qt GUI translation files, which consists of `nw_XX.ts` files. This is the bulk of the
translation work. translation work.
* The `project_XX.json` files. See [Project Localisation](#project-localisation) below. * The `project_XX.json` files. See [Project Localisation](#project-localisation) below.
@@ -43,7 +43,7 @@ The `XX` in the file name corresponds to the language and country code for the t
instance `en_GB` for British English. instance `en_GB` for British English.
## Qt5 GUI Localisation ## Qt GUI Localisation
You will need the translation tool Qt 5 Linguist on your system. You will need the translation tool Qt 5 Linguist on your system.
@@ -89,8 +89,7 @@ For instance, the French translation uses the language code `fr_FR`, so its tran
be `nw_fr_FR.ts` be `nw_fr_FR.ts`
Note: The `qtlupdate` command needs the `lupdate` tool provided by PyQt6, which uses the latest Note: The `qtlupdate` command needs the `lupdate` tool provided by PyQt6, which uses the latest
TS file format. The tool in PyQt5 generates an older file format. On Debian/Ubuntu it is provided TS file format. On Debian/Ubuntu it is provided by the package `pyqt6-dev-tools`.
by the package `pyqt6-dev-tools`.
### Edit the Translation File in Qt Linguist ### Edit the Translation File in Qt Linguist
+1 -1
View File
@@ -117,7 +117,7 @@ def main(sysArgs: list | None = None) -> GuiMain | None:
" --debug Print debug output. Includes --info.\n" " --debug Print debug output. Includes --info.\n"
" --color Add ANSI colors to log output.\n" " --color Add ANSI colors to log output.\n"
" --meminfo Show memory usage information in the status bar.\n" " --meminfo Show memory usage information in the status bar.\n"
" --style= Sets Qt5 style flag. Defaults to 'Fusion'.\n" " --style= Sets Qt style flag. Defaults to 'Fusion'.\n"
" --config= Alternative config file.\n" " --config= Alternative config file.\n"
" --data= Alternative user data path.\n" " --data= Alternative user data path.\n"
) )
+2 -2
View File
@@ -54,8 +54,8 @@ more contributions are listed on the project's Members page.</p>
<p>The following libraries are dependencies of novelWriter:</p> <p>The following libraries are dependencies of novelWriter:</p>
<ul> <ul>
<li><b>Qt5</b> by Qt Company</li> <li><b>Qt6</b> by Qt Company</li>
<li><b>PyQt5</b> by Riverbank Computing</li> <li><b>PyQt6</b> by Riverbank Computing</li>
<li><b>Enchant</b> by Dom Lachowicz</li> <li><b>Enchant</b> by Dom Lachowicz</li>
<li><b>PyEnchant</b> by Dimitri Merejkowsky</li> <li><b>PyEnchant</b> by Dimitri Merejkowsky</li>
</ul> </ul>
+1 -1
View File
@@ -434,7 +434,7 @@ def describeFont(font: QFont) -> str:
def fontMatcher(font: QFont) -> QFont: def fontMatcher(font: QFont) -> QFont:
"""Make sure the font is the correct family, if possible. This """Make sure the font is the correct family, if possible. This
ensures that Qt doesn't re-use another font under the hood. The ensures that Qt doesn't re-use another font under the hood. The
default Qt5 font matching algorithm doesn't handle well changing default Qt font matching algorithm doesn't handle well changing
application fonts at runtime. application fonts at runtime.
""" """
info = QFontInfo(font) info = QFontInfo(font)
+1 -1
View File
@@ -217,7 +217,7 @@ class Config:
# System and App Information # System and App Information
# ========================== # ==========================
# Check Qt5 Versions # Check Qt Versions
self.verQtString = QT_VERSION_STR self.verQtString = QT_VERSION_STR
self.verQtValue = QT_VERSION self.verQtValue = QT_VERSION
self.verPyQtString = PYQT_VERSION_STR self.verPyQtString = PYQT_VERSION_STR
+2 -2
View File
@@ -1021,8 +1021,8 @@ class GuiMainMenu(QMenuBar):
self.aAboutNW.setMenuRole(QAction.MenuRole.AboutRole) self.aAboutNW.setMenuRole(QAction.MenuRole.AboutRole)
self.aAboutNW.triggered.connect(self.mainGui.showAboutNWDialog) self.aAboutNW.triggered.connect(self.mainGui.showAboutNWDialog)
# Help > About Qt5 # Help > About Qt
self.aAboutQt = self.helpMenu.addAction(self.tr("About Qt5")) self.aAboutQt = self.helpMenu.addAction(self.tr("About Qt"))
self.aAboutQt.setMenuRole(QAction.MenuRole.AboutQtRole) self.aAboutQt.setMenuRole(QAction.MenuRole.AboutQtRole)
self.aAboutQt.triggered.connect(self.mainGui.showAboutQtDialog) self.aAboutQt.triggered.connect(self.mainGui.showAboutQtDialog)
+2 -2
View File
@@ -92,8 +92,8 @@ class GuiMain(QMainWindow):
logger.info("OS: %s", CONFIG.osType) logger.info("OS: %s", CONFIG.osType)
logger.info("Kernel: %s", CONFIG.kernelVer) logger.info("Kernel: %s", CONFIG.kernelVer)
logger.info("Host: %s", CONFIG.hostName) logger.info("Host: %s", CONFIG.hostName)
logger.info("Qt5: %s (0x%06x)", CONFIG.verQtString, CONFIG.verQtValue) logger.info("Qt: %s (0x%06x)", CONFIG.verQtString, CONFIG.verQtValue)
logger.info("PyQt5: %s (0x%06x)", CONFIG.verPyQtString, CONFIG.verPyQtValue) logger.info("PyQt: %s (0x%06x)", CONFIG.verPyQtString, CONFIG.verPyQtValue)
logger.info("Python: %s (0x%08x)", CONFIG.verPyString, sys.hexversion) logger.info("Python: %s (0x%08x)", CONFIG.verPyString, sys.hexversion)
logger.info("GUI Language: %s", CONFIG.guiLocale) logger.info("GUI Language: %s", CONFIG.guiLocale)
+2 -2
View File
@@ -543,8 +543,8 @@ def buildTranslationAssets(args: argparse.Namespace | None = None) -> None:
try: try:
subprocess.call(["lrelease", "-verbose", *srcList]) subprocess.call(["lrelease", "-verbose", *srcList])
except Exception as exc: except Exception as exc:
print("Qt5 Linguist tools seem to be missing") print("Qt Linguist tools seem to be missing")
print("On Debian/Ubuntu, install: qttools5-dev-tools pyqt5-dev-tools") print("On Debian/Ubuntu, install: qttools5-dev-tools")
print(str(exc)) print(str(exc))
sys.exit(1) sys.exit(1)
-1
View File
@@ -3,4 +3,3 @@ flake8-pep585
flake8-pyproject flake8-pyproject
flake8-annotations flake8-annotations
isort isort
pyqt5-stubs
+1 -1
View File
@@ -1,2 +1,2 @@
pyqt5>=5.15 pyqt6>=6.0
pyenchant>=3.0.0 pyenchant>=3.0.0
+1 -1
View File
@@ -10,7 +10,7 @@ synchronisation tools. All text is saved as plain text files with a meta data he
project structure is stored in a single project XML file, and other meta data is primarily saved as project structure is stored in a single project XML file, and other meta data is primarily saved as
JSON files. JSON files.
The application is written with Python 3 (3.10+) using Qt5 and PyQt5 (5.10+). It is developed on The application is written with Python 3 (3.10+) using Qt6 and PyQt6 (5.10+). It is developed on
Linux, but should in principle work fine on other operating systems as well as long as dependencies Linux, but should in principle work fine on other operating systems as well as long as dependencies
are met. It is regularly tested on Debian and Ubuntu Linux, Windows, and MacOS. are met. It is regularly tested on Debian and Ubuntu Linux, Windows, and MacOS.
+2 -2
View File
@@ -18,12 +18,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
Dependencies Dependencies
Qt5 Qt6
Copyright: Qt Company Copyright: Qt Company
Website: <https://www.qt.io/> Website: <https://www.qt.io/>
License: LGPL v3 <https://www.gnu.org/licenses/lgpl-3.0.html> License: LGPL v3 <https://www.gnu.org/licenses/lgpl-3.0.html>
PyQt5 / PyQt5-sip PyQt6 / PyQt6-sip
Copyright: Riverbank Computing Copyright: Riverbank Computing
Website: <https://www.riverbankcomputing.com/software/pyqt/> Website: <https://www.riverbankcomputing.com/software/pyqt/>
License: GPL v3 <https://www.gnu.org/licenses/gpl-3.0.html> License: GPL v3 <https://www.gnu.org/licenses/gpl-3.0.html>
+7 -7
View File
@@ -165,13 +165,13 @@ rm -rf share/{gtk-,}doc
rm -rf lib/python3.1 rm -rf lib/python3.1
# Remove web engine # Remove web engine
rm lib/python3.*/site-packages/PyQt5/QtWebEngine* || true rm lib/python3.*/site-packages/PyQt6/QtWebEngine* || true
rm -r lib/python3.*/site-packages/PyQt5/Qt/translations/qtwebengine* || true rm -r lib/python3.*/site-packages/PyQt6/Qt/translations/qtwebengine* || true
rm lib/python3.*/site-packages/PyQt5/Qt/resources/qtwebengine* || true rm lib/python3.*/site-packages/PyQt6/Qt/resources/qtwebengine* || true
rm -r lib/python3.*/site-packages/PyQt5/Qt/qml/QtWebEngine* || true rm -r lib/python3.*/site-packages/PyQt6/Qt/qml/QtWebEngine* || true
rm -r lib/python3.*/site-packages/PyQt5/Qt/plugins/webview/libqtwebview* || true rm -r lib/python3.*/site-packages/PyQt6/Qt/plugins/webview/libqtwebview* || true
rm lib/python3.*/site-packages/PyQt5/Qt/libexec/QtWebEngineProcess* || true rm lib/python3.*/site-packages/PyQt6/Qt/libexec/QtWebEngineProcess* || true
rm lib/python3.*/site-packages/PyQt5/Qt/lib/libQt5WebEngine* || true rm lib/python3.*/site-packages/PyQt6/Qt/lib/libQt5WebEngine* || true
popd || exit 1 popd || exit 1
popd || exit 1 popd || exit 1